lkml.org 
[lkml]   [2015]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH] x86/cpu: Fix MSR value truncation issue
On Fri, Oct 30, 2015 at 10:28 AM, Borislav Petkov <bp@alien8.de> wrote:
> From: Borislav Petkov <bp@suse.de>
>
> So sparse rightfully complains that the u64 MSR value we're writing into
> the STAR MSR, i.e. 0xc0000081, is being truncated:
>
> ./arch/x86/include/asm/msr.h:193:36: warning: cast truncates bits from constant value (23001000000000 becomes 0)

Is this with or without:

commit 47edb65178cb7056c2eea0b6c41a7d8c84547192
Author: Andy Lutomirski <luto@kernel.org>
Date: Thu Jul 23 12:14:40 2015 -0700

x86/asm/msr: Make wrmsrl() a function

If that patch is applied, then I think that gcc is just being dumb and
that we should consider tweaking wrmsrl to avoid generating the
warning. Maybe change (u32)val to (u32)(val & 0xffffffffull)?

I don't see why we should uglify the caller when the problem is some
combination of gcc and the wrmsrl implementation.

--Andy


\
 
 \ /
  Last update: 2015-10-30 20:21    [W:0.087 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site