All of lore.kernel.org
 help / color / mirror / Atom feed
From: konrad.wilk@oracle.com
To: speck@linutronix.de
Subject: [MODERATED] [PATCH v15.3 1/1] [PATCH v15.3] SSB fixup patch #1
Date: Sun, 13 May 2018 17:33:57 -0400	[thread overview]
Message-ID: <20180513213403.512079062@localhost.localdomain> (raw)

Cast val and (val >> 32) to uintptr_t, so that they fit in a
general-purpose register in both 32-bit and 64-bit code.

Fixes: c65732e4f721 ("x86/cpu: Restore CPUID_8000_0008_EBX reload")
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/asm/nospec-branch.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 328ea3cb769f..979aa050d311 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature)
 {
 	asm volatile(ALTERNATIVE("", "wrmsr", %c[feature])
 		: : "c" (msr),
-		    "a" (val),
-		    "d" (val >> 32),
+		    "a" ((uintptr_t)val),
+		    "d" ((uintptr_t)(val >> 32)),
 		    [feature] "i" (feature)
 		: "memory");
 }
-- 
2.14.3

             reply	other threads:[~2018-05-13 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-13 21:33 konrad.wilk [this message]
2018-05-13 22:07 ` [MODERATED] Re: [PATCH v15.3 1/1] [PATCH v15.3] SSB fixup patch #1 Borislav Petkov
2018-05-13 23:14   ` Linus Torvalds
2018-05-14 12:47     ` Thomas Gleixner
2018-05-13 23:08 ` [MODERATED] " Linus Torvalds

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=20180513213403.512079062@localhost.localdomain \
    --to=konrad.wilk@oracle.com \
    --cc=speck@linutronix.de \
    /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.