public inbox for [email protected]
 help / color / mirror / Atom feed
From: Boris Petkov <[email protected]>
To: Paolo Bonzini <[email protected]>
Cc: Peter Zijlstra <[email protected]>,
	Jamie Heilman <[email protected]>,
	[email protected], Ingo Molnar <[email protected]>,
	Dave Hansen <[email protected]>,
	Thomas Gleixner <[email protected]>,
	Sean Christopherson <[email protected]>,
	[email protected], [email protected]
Subject: Re: [PATCH -v1.2] kvm/emulate: Fix SETcc emulation function offsets with SLS
Date: Sun, 20 Mar 2022 14:17:08 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On March 20, 2022 2:04:02 PM UTC, Paolo Bonzini <[email protected]> wrote:
>So this is what I squashed in:
>
>diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
>index f321abb9a4a8..e86d610dc6b7 100644
>--- a/arch/x86/kvm/emulate.c
>+++ b/arch/x86/kvm/emulate.c
>@@ -430,7 +430,19 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
>  
>  /* Special case for SETcc - 1 instruction per cc */
>  
>-#define SETCC_ALIGN	(4 * (1 + IS_ENABLED(CONFIG_SLS)))
>+/*
>+ * Depending on .config the SETcc functions look like:
>+ *
>+ * SETcc %al   [3 bytes]
>+ * RET         [1 byte]
>+ * INT3        [1 byte; CONFIG_SLS]
>+ *
>+ * Which gives possible sizes 4 or 5.  When rounded up to the
>+ * next power-of-two alignment they become 4 or 8.
>+ */
>+#define SETCC_LENGTH	(4 + IS_ENABLED(CONFIG_SLS))
>+#define SETCC_ALIGN	(4 << IS_ENABLED(CONFIG_SLS))
>+static_assert(SETCC_LENGTH <= SETCC_ALIGN);
>  
>  #define FOP_SETCC(op) \
>  	".align " __stringify(SETCC_ALIGN) " \n\t" \
>
>Paolo


Ack.

Thanks.

-- 
Sent from a small device: formatting sux and brevity is inevitable.


      parent reply	other threads:[~2022-03-20 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[email protected]>
     [not found] ` <[email protected]>
     [not found]   ` <[email protected]>
2022-03-16 19:02     ` system locks up with CONFIG_SLS=Y; 5.17.0-rc 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
     [not found]             ` <[email protected]>
     [not found]               ` <[email protected]>
     [not found]                 ` <YjMVpfe/[email protected]>
     [not found]                   ` <[email protected]>
     [not found]                     ` <[email protected]>
     [not found]                       ` <[email protected]>
     [not found]                         ` <[email protected]>
     [not found]                           ` <[email protected]>
2022-03-20 14:17                             ` Boris Petkov [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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