All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, Kai Huang <kai.huang@intel.com>,
	Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCHv3, RESEND] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed
Date: Thu, 25 Jan 2024 06:50:07 -0800	[thread overview]
Message-ID: <ZbJ1H77MtNkko02P@tassilo> (raw)
In-Reply-To: <wo4wcvuhvqsqissocu7nz2urg5yt7mx65s5dxkjxqimgnxv3ax@qsa3lqlfsaxi>

> I think it is cleaner to switch to IRET here. Does this work for you?
> 
> diff --git a/arch/x86/realmode/rm/trampoline_64.S b/arch/x86/realmode/rm/trampoline_64.S
> index 608f108cba7d..14d9c7daf90f 100644
> --- a/arch/x86/realmode/rm/trampoline_64.S
> +++ b/arch/x86/realmode/rm/trampoline_64.S
> @@ -243,7 +243,9 @@ SYM_CODE_START(trampoline_start64)
>  	movl	$pa_trampoline_pgd, %eax
>  	movq	%rax, %cr3
>  
> -	jmpq	*tr_start(%rip)
> +	pushq	$__KERNEL_CS
> +	pushq	tr_start(%rip)
> +	lretq

Looks good. Thanks.

-Andi

  reply	other threads:[~2024-01-25 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 13:15 [PATCHv3, RESEND] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed Kirill A. Shutemov
2024-01-25  9:57 ` Andi Kleen
2024-01-25 11:44   ` Kirill A. Shutemov
2024-01-25 14:50     ` Andi Kleen [this message]
2024-01-25 13:07   ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbJ1H77MtNkko02P@tassilo \
    --to=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.