]> Git Repo - linux.git/commitdiff
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <[email protected]>
Tue, 12 Jan 2016 01:45:32 +0000 (17:45 -0800)
committerLinus Torvalds <[email protected]>
Tue, 12 Jan 2016 01:45:32 +0000 (17:45 -0800)
Pull x86 platform updates from Ingo Molnar:
 "Two changes:

   - one to quirk-save/restore certain system MSRs across
     suspend/resume, to make certain Intel systems work better
     (Chen Yu)

   - and also to constify a read only structure (Julia Lawall)"

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/platform/calgary: Constify cal_chipset_ops structures
  x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume

1  2 
arch/x86/include/asm/msr.h

index 1e87bff093d135a1ab8a6c22477a2c04ca933ec6,24feb3c1dc41713c06ba64b9520247e27d080009..93fb7c1cffda7a03e8e0248f634e86eb78e3ff3d
@@@ -32,6 -32,16 +32,16 @@@ struct msr_regs_info 
        int err;
  };
  
+ struct saved_msr {
+       bool valid;
+       struct msr_info info;
+ };
+ struct saved_msrs {
+       unsigned int num;
+       struct saved_msr *array;
+ };
  static inline unsigned long long native_read_tscp(unsigned int *aux)
  {
        unsigned long low, high;
  #define EAX_EDX_RET(val, low, high)   "=A" (val)
  #endif
  
 +#ifdef CONFIG_TRACEPOINTS
 +/*
 + * Be very careful with includes. This header is prone to include loops.
 + */
 +#include <asm/atomic.h>
 +#include <linux/tracepoint-defs.h>
 +
 +extern struct tracepoint __tracepoint_read_msr;
 +extern struct tracepoint __tracepoint_write_msr;
 +extern struct tracepoint __tracepoint_rdpmc;
 +#define msr_tracepoint_active(t) static_key_false(&(t).key)
 +extern void do_trace_write_msr(unsigned msr, u64 val, int failed);
 +extern void do_trace_read_msr(unsigned msr, u64 val, int failed);
 +extern void do_trace_rdpmc(unsigned msr, u64 val, int failed);
 +#else
 +#define msr_tracepoint_active(t) false
 +static inline void do_trace_write_msr(unsigned msr, u64 val, int failed) {}
 +static inline void do_trace_read_msr(unsigned msr, u64 val, int failed) {}
 +static inline void do_trace_rdpmc(unsigned msr, u64 val, int failed) {}
 +#endif
 +
  static inline unsigned long long native_read_msr(unsigned int msr)
  {
        DECLARE_ARGS(val, low, high);
  
        asm volatile("rdmsr" : EAX_EDX_RET(val, low, high) : "c" (msr));
 +      if (msr_tracepoint_active(__tracepoint_read_msr))
 +              do_trace_read_msr(msr, EAX_EDX_VAL(val, low, high), 0);
        return EAX_EDX_VAL(val, low, high);
  }
  
@@@ -101,8 -88,6 +111,8 @@@ static inline unsigned long long native
                     _ASM_EXTABLE(2b, 3b)
                     : [err] "=r" (*err), EAX_EDX_RET(val, low, high)
                     : "c" (msr), [fault] "i" (-EIO));
 +      if (msr_tracepoint_active(__tracepoint_read_msr))
 +              do_trace_read_msr(msr, EAX_EDX_VAL(val, low, high), *err);
        return EAX_EDX_VAL(val, low, high);
  }
  
@@@ -110,8 -95,6 +120,8 @@@ static inline void native_write_msr(uns
                                    unsigned low, unsigned high)
  {
        asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high) : "memory");
 +      if (msr_tracepoint_active(__tracepoint_read_msr))
 +              do_trace_write_msr(msr, ((u64)high << 32 | low), 0);
  }
  
  /* Can be uninlined because referenced by paravirt */
@@@ -129,8 -112,6 +139,8 @@@ notrace static inline int native_write_
                     : "c" (msr), "0" (low), "d" (high),
                       [fault] "i" (-EIO)
                     : "memory");
 +      if (msr_tracepoint_active(__tracepoint_read_msr))
 +              do_trace_write_msr(msr, ((u64)high << 32 | low), err);
        return err;
  }
  
@@@ -189,8 -170,6 +199,8 @@@ static inline unsigned long long native
        DECLARE_ARGS(val, low, high);
  
        asm volatile("rdpmc" : EAX_EDX_RET(val, low, high) : "c" (counter));
 +      if (msr_tracepoint_active(__tracepoint_rdpmc))
 +              do_trace_rdpmc(counter, EAX_EDX_VAL(val, low, high), 0);
        return EAX_EDX_VAL(val, low, high);
  }
  
@@@ -221,7 -200,7 +231,7 @@@ static inline void wrmsr(unsigned msr, 
  
  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 */
This page took 0.068613 seconds and 4 git commands to generate.