All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>, Borislav Petkov <bp@alien8.de>
Cc: Jamie Heilman <jamie@audible.transient.net>,
	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, Sean Christopherson <seanjc@google.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH -v1.2] kvm/emulate: Fix SETcc emulation function offsets with SLS
Date: Sat, 19 Mar 2022 14:24:06 +0100	[thread overview]
Message-ID: <94df38ce-6bd7-a993-7d9f-0a1418a1c8df@redhat.com> (raw)
In-Reply-To: <YjMVpfe/9ldmWX8W@hirez.programming.kicks-ass.net>

On 3/17/22 12:04, Peter Zijlstra wrote:
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> 
> Depending on what Paolo wants, it might make sense to merge this into
> tip/x86/urgent such that we can then resolve the merge conflict vs
> tip/x86/core with something like the below:

Sorry for responding late, I was sick the past few days.  Go ahead and 
apply it to tip/x86/core with the rest of the SLS and IBT patches.  If 
you place it in front of the actual insertion of the INT3 it will even 
be bisectable, but I'm not sure if your commit hashes are already frozen.

Just one thing:

> -#define SETCC_ALIGN	(4 * (1 + IS_ENABLED(CONFIG_SLS)))
> +/*
> + * Depending on .config the SETcc functions look like:
> + *
> + * setcc:
> + * +0	ENDBR		[CONFIG_X86_KERNEL_IBT]
> + * +4	SETcc	%al
> + * +7	RET
> + * +8	INT3		[CONFIG_SLS]
> + *
> + * Which gives possible sizes: 4, 5, 8, 9 which when rounded up to the
> + * next power-of-two alignment become: 4, 8, 16.
> + */
> +#define SETCC_ALIGN	(4 * (1 + IS_ENABLED(CONFIG_SLS)) * (1 + HAS_KERNEL_IBT))

This might be slightly nicer as (4 << IS_ENABLED(CONFIG_SLS) << 
HAS_KERNEL_IBT.  Or maybe not, depends on your taste.

It might also be worth doing:

#define SETCC_LENGTH (4 + IS_ENABLED(CONFIG_SLS) + 4 * HAS_KERNEL_IBT)
#define SETCC_ALIGN  (4 << IS_ENABLED(CONFIG_SLS) << HAS_KERNEL_IBT)
BUILD_BUG_ON(SETCC_LENGTH <= SETCC_ALIGN);

Thanks,

Paolo


  reply	other threads:[~2022-03-19 13:24 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
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 [this message]
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=94df38ce-6bd7-a993-7d9f-0a1418a1c8df@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=jamie@audible.transient.net \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --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.