From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754444AbbKWKOF (ORCPT ); Mon, 23 Nov 2015 05:14:05 -0500 Received: from mail.skyhub.de ([78.46.96.112]:41981 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbbKWKMg (ORCPT ); Mon, 23 Nov 2015 05:12:36 -0500 From: Borislav Petkov To: Ingo Molnar Cc: LKML Subject: [PATCH 6/6] x86/MSR: Chop off lower 32-bit value Date: Mon, 23 Nov 2015 11:12:26 +0100 Message-Id: <1448273546-2567-7-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1448273546-2567-1-git-send-email-bp@alien8.de> References: <1448273546-2567-1-git-send-email-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov 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. Signed-off-by: Borislav Petkov Suggested-by: Andy Lutomirski Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner --- 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 77d8b284e4a7..86133827c75c 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 */ -- 2.3.5