From: Jamie Heilman <jamie@audible.transient.net>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, Peter Zijlstra <peterz@infradead.org>
Subject: Re: system locks up with CONFIG_SLS=Y; 5.17.0-rc
Date: Wed, 16 Mar 2022 20:15:43 +0000 [thread overview]
Message-ID: <YjJFb02Fc0jeoIW4@audible.transient.net> (raw)
In-Reply-To: <YjI69aUseN/IuzTj@zn.tnic>
Borislav Petkov wrote:
> On Wed, Mar 16, 2022 at 06:45:25PM +0000, Jamie Heilman wrote:
> > Yep that worked, here's output, you can see the network get set up and
> > then boom:
>
> Thx, that was very useful. Does this below fix it, per chance:
It does indeed!
> ---
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index f667bd8df533..e88ce4171c4a 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -430,8 +430,11 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
> FOP_END
>
> /* Special case for SETcc - 1 instruction per cc */
> +
> +#define SETCC_ALIGN 8
> +
> #define FOP_SETCC(op) \
> - ".align 4 \n\t" \
> + ".align " __stringify(SETCC_ALIGN) " \n\t" \
> ".type " #op ", @function \n\t" \
> #op ": \n\t" \
> ASM_ENDBR \
> @@ -1049,7 +1052,7 @@ static int em_bsr_c(struct x86_emulate_ctxt *ctxt)
> static __always_inline u8 test_cc(unsigned int condition, unsigned long flags)
> {
> u8 rc;
> - void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
> + void (*fop)(void) = (void *)em_setcc + SETCC_ALIGN * (condition & 0xf);
>
> flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
> asm("push %[flags]; popf; " CALL_NOSPEC
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
--
Jamie Heilman http://audible.transient.net/~jamie/
next prev parent reply other threads:[~2022-03-16 20:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 9:51 system locks up with CONFIG_SLS=Y; 5.17.0-rc Jamie Heilman
2022-03-16 12:31 ` Borislav Petkov
2022-03-16 18:45 ` Jamie Heilman
2022-03-16 19:02 ` Dave Hansen
2022-03-16 19:21 ` Borislav Petkov
2022-03-16 19:31 ` Borislav Petkov
2022-03-16 20:15 ` Jamie Heilman [this message]
2022-03-16 21:23 ` Borislav Petkov
2022-03-16 21:37 ` Jamie Heilman
2022-03-16 22:02 ` Peter Zijlstra
2022-03-17 9:37 ` [PATCH -v1.1] kvm/emulate: Fix SETcc emulation function offsets with SLS Borislav Petkov
2022-03-17 10:52 ` [PATCH -v1.2] " Borislav Petkov
2022-03-17 11:04 ` Peter Zijlstra
2022-03-19 13:24 ` Paolo Bonzini
2022-03-19 13:36 ` Borislav Petkov
2022-03-19 13:41 ` Paolo Bonzini
2022-03-19 13:50 ` Borislav Petkov
2022-03-20 14:04 ` Paolo Bonzini
2022-03-20 14:17 ` Boris Petkov
2022-03-17 17:45 ` Jamie Heilman
2022-03-16 15:34 ` system locks up with CONFIG_SLS=Y; 5.17.0-rc Dave Hansen
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=YjJFb02Fc0jeoIW4@audible.transient.net \
--to=jamie@audible.transient.net \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox