public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, brgerst@gmail.com,
	torvalds@linux-foundation.org, luto@amacapital.net,
	dvlasenk@redhat.com, peterz@infradead.org, hpa@zytor.com,
	mingo@kernel.org, bp@alien8.de, tglx@linutronix.de, bp@suse.de,
	luto@kernel.org
Subject: [tip:x86/cpu] x86/MSR: Chop off lower 32-bit value
Date: Tue, 24 Nov 2015 01:33:52 -0800	[thread overview]
Message-ID: <tip-679bcea857d72868e3431dde3a0e158bf0ed9119@git.kernel.org> (raw)
In-Reply-To: <1448273546-2567-7-git-send-email-bp@alien8.de>

Commit-ID:  679bcea857d72868e3431dde3a0e158bf0ed9119
Gitweb:     http://git.kernel.org/tip/679bcea857d72868e3431dde3a0e158bf0ed9119
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Mon, 23 Nov 2015 11:12:26 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 24 Nov 2015 09:15:55 +0100

x86/MSR: Chop off lower 32-bit value

sparse complains that the cast truncates the high bits. But here
we really do know what we're doing and we need the lower 32 bits
only as the @low argument. So make that explicit.

Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1448273546-2567-7-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/msr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 77d8b28..8613382 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -190,7 +190,7 @@ static inline void wrmsr(unsigned msr, unsigned low, unsigned high)
 
 static inline void wrmsrl(unsigned msr, u64 val)
 {
-	native_write_msr(msr, (u32)val, (u32)(val >> 32));
+	native_write_msr(msr, (u32)(val & 0xffffffffULL), (u32)(val >> 32));
 }
 
 /* wrmsr with exception handling */

      reply	other threads:[~2015-11-24  9:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 10:12 [PATCH 0/6] tip-queue 2015-11-23 Borislav Petkov
2015-11-23 10:12 ` [PATCH 1/6] x86/cpu: Unify CPU family, model, stepping calculation Borislav Petkov
2015-11-24  9:32   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 2/6] kvm: Add accessors for guest CPU's family, model, stepping Borislav Petkov
2015-11-24  9:32   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 3/6] x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR Borislav Petkov
2015-11-24  9:33   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH tip-urgent 4/6] x86/microcode: Initialize the driver late when facilities are up Borislav Petkov
2015-11-23 10:12 ` [PATCH 5/6] x86/cpu: Fix MSR value truncation issue Borislav Petkov
2015-11-24  9:33   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 6/6] x86/MSR: Chop off lower 32-bit value Borislav Petkov
2015-11-24  9:33   ` tip-bot for Borislav 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 \
    --in-reply-to=tip-679bcea857d72868e3431dde3a0e158bf0ed9119@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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