Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1746668rdb; Thu, 25 Jan 2024 05:09:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcjtM2qVknd9eIZgI2LBk4ZOTDn48Qn4vf9AiRB3D5phB97dB8RxWe+kRmp65NwPjcM+cO X-Received: by 2002:a05:6214:c64:b0:681:9a4b:8a9d with SMTP id t4-20020a0562140c6400b006819a4b8a9dmr1202466qvj.120.1706188173580; Thu, 25 Jan 2024 05:09:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706188173; cv=pass; d=google.com; s=arc-20160816; b=ZlXU096CaVSKE7cmhWnN6TgzqPXHIkj9DeuxJlj3H9ph9WlFkqcop1wCwtP9yw2kLA eQfYEqUPtKZwWG90j1Fk6loeuT+X0qTEVtiharD7W9yWkvJF2NZrxQL2eqHg4PQbeZg8 mB8CUE8F0MjJK77ObUm7My9cGWtZx5rXKwMopUMj/oz7/YtqlasDFuBdHbF+RFxoHLKS srp7SOhzryjiE7jVE8W1hXIWUklB74VASwY9t0H/I4zP+4KaOab6bLCPdpMvfAvEMXae yD+HuB7Q5hXPu38M09zXeHU6byqooqNhU8hiJ/KVcerU5950FHq6M+GOI2Km5Kkkok+a sNlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=aI9WJx+jYvQnEIH6Q4cNpzmMxlGwehYlGZIFWqI/BWw=; fh=iuBIVGBFYBG6N1G76L1NX+F2XOgGr0LqnLG0Q3dTodE=; b=aiZgI17w34KgZPn+oR6+XcmUKAJ7sAQztCLPUljS7A8uumZDCYt4RDUmcCKg7Y4lfo 2X1Bh3bunFgIE09gFVuwmEzmr0sI5oYoMvTNOssy9DuHqcGdCS4USUZ2s6WpPC6Ast2W K+DkPLJtjSdT0uNwqQSFd/gQvC8GYKYdTsq9oSRk6GKyj+kbRWsu+GXCtnsb4oPqIntW 8fUXjqd+5JhgdgZ2snJLud1W9YyEZ+9MwveQlJpAZRSuwxtT0K5x+YHuhgKfkenRG1hC qyoLbz5QHfFJFHZUUq3kiq2MtECvIE7hMzLqPEMHTLEvITmaUC35JBqC9bruLFWzf/Lt ihGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024011201 header.b=Rfedy4bS; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-38622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s2-20020a0ce302000000b006819a5f4319si12528599qvl.313.2024.01.25.05.09.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:09:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024011201 header.b=Rfedy4bS; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-38622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 560D11C23F46 for ; Thu, 25 Jan 2024 13:09:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87BC951000; Thu, 25 Jan 2024 13:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="Rfedy4bS" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7293050A95 for ; Thu, 25 Jan 2024 13:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706188116; cv=none; b=rQzabYUPFmxwrQSRSi1XDipomshzB2MPb5G1GKGnqHtS+pqsOEEvezWKwoEPLl9TY1gI9uyd8CU7L64NsTFN/oAP8wRjIXKP35zVFLMBU4xB5BHR3I4QZfAENb6rdOc5n8/IyWUGT52nbZN4FwX8fMYtr4L5i7YSM/FNQiJssTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706188116; c=relaxed/simple; bh=DQw6SkbRWKUw+mEBZpF+BrHQJGhjrIcRv8sDzH/zTLY=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=O8vdwBX2jnV9nk/3y/zRKBc4kFuGMlV2raHvGHYu7YTa567dpv/cwa3p7TUnztQ0Ef3xIhdjOjydRa8VFNhr5RBUh5DAenpD5UqbMMYiNRxpT/mXjTPNwuxdEbGuV+MqoNPf4zSyVQdwSyRdzVzIb4EfyOd94vqu5tW/vSi5jzY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=Rfedy4bS; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 40PD7ohH017921 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 25 Jan 2024 05:07:51 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 40PD7ohH017921 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024011201; t=1706188071; bh=aI9WJx+jYvQnEIH6Q4cNpzmMxlGwehYlGZIFWqI/BWw=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Rfedy4bS6fJrYJhVwO0eqYNK7BQP/zUgo78ry7Yr0XwJ/z0GYR+jw0elS1t+7qCWH 8jYPWWx353vfXtxz0fwzh6DmXxtGax3lWkP6ubcNm7/3hSjbdwSg+IIq4u52f/6Xqm LQk/AGVLDC0LpVfmwfoPPnLEdFQKRRce8Csw+vAu5q9Q6IZ0DT05i7lpvtEAKxGFRi BBFCAY/BSVeceaGljlVQAXzLTlxiENwcU1R69l62KrL3V8tzF4v1xonvmRFz1gMejh q2Egm2lH+Mp1L9GWFfPTTjMrLJOxNyktGMpWiJTNNZyfZF+Ock1ycy2/XIwtHNAMcz Pt4KCLg3iqLHw== Date: Thu, 25 Jan 2024 05:07:47 -0800 From: "H. Peter Anvin" To: Andi Kleen , "Kirill A. Shutemov" CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, Kai Huang , Sean Christopherson Subject: =?US-ASCII?Q?Re=3A_=5BPATCHv3=2C_RESEND=5D_x86/trampoline=3A_Bypass_co?= =?US-ASCII?Q?mpat_mode_in_trampoline=5Fstart64=28=29_if_not_needed?= User-Agent: K-9 Mail for Android In-Reply-To: References: <20240124131510.496803-1-kirill.shutemov@linux.intel.com> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On January 25, 2024 1:57:18 AM PST, Andi Kleen wro= te: >> + /* Paging mode is correct proceed in 64-bit mode */ >> + >> + LOCK_AND_LOAD_REALMODE_ESP lock_rip=3D1 >> + >> + movw $__KERNEL_DS, %dx >> + movl %edx, %ss >> + addl $pa_real_mode_base, %esp >> + movl %edx, %ds >> + movl %edx, %es >> + movl %edx, %fs >> + movl %edx, %gs >> + >> + movl $pa_trampoline_pgd, %eax >> + movq %rax, %cr3 >> + >> + jmpq *tr_start(%rip) > >Still think we should add a far jump here so that we run on a defined >code segment=2E It probably doesn't matter since there are likely no >IRETs before reloading anyways, but it seems cleaner=2E > >-Andi > Agreed=2E