1. 17 3月, 2015 2 次提交
  2. 05 3月, 2015 2 次提交
    • D
      x86/asm/entry/64: Fix comments · e90e147c
      Denys Vlasenko 提交于
       - Misleading and slightly incorrect comments in "struct pt_regs" are
         fixed (four instances).
      
       - Fix incorrect comment atop EMPTY_FRAME macro.
      
       - Explain in more detail what we do with stack layout during hw interrupt.
      
       - Correct comments about "partial stack frame" which are no longer
         true.
      Signed-off-by: NDenys Vlasenko <dvlasenk@redhat.com>
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Will Drewry <wad@chromium.org>
      Link: http://lkml.kernel.org/r/1423778052-21038-3-git-send-email-dvlasenk@redhat.com
      Link: http://lkml.kernel.org/r/e1f4429c491fe6ceeddb879dea2786e0f8920f9c.1424989793.git.luto@amacapital.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      e90e147c
    • D
      x86/asm/entry/64: Always allocate a complete "struct pt_regs" on the kernel stack · 76f5df43
      Denys Vlasenko 提交于
      The 64-bit entry code was using six stack slots less by not
      saving/restoring registers which are callee-preserved according
      to the C ABI, and was not allocating space for them.
      
      Only when syscalls needed a complete "struct pt_regs" was
      the complete area allocated and filled in.
      
      As an additional twist, on interrupt entry a "slightly less
      truncated pt_regs" trick is used, to make nested interrupt
      stacks easier to unwind.
      
      This proved to be a source of significant obfuscation and subtle
      bugs. For example, 'stub_fork' had to pop the return address,
      extend the struct, save registers, and push return address back.
      Ugly. 'ia32_ptregs_common' pops return address and "returns" via
      jmp insn, throwing a wrench into CPU return stack cache.
      
      This patch changes the code to always allocate a complete
      "struct pt_regs" on the kernel stack. The saving of registers
      is still done lazily.
      
      "Partial pt_regs" trick on interrupt stack is retained.
      
      Macros which manipulate "struct pt_regs" on stack are reworked:
      
       - ALLOC_PT_GPREGS_ON_STACK allocates the structure.
      
       - SAVE_C_REGS saves to it those registers which are clobbered
         by C code.
      
       - SAVE_EXTRA_REGS saves to it all other registers.
      
       - Corresponding RESTORE_* and REMOVE_PT_GPREGS_FROM_STACK macros
         reverse it.
      
      'ia32_ptregs_common', 'stub_fork' and friends lost their ugly dance
      with the return pointer.
      
      LOAD_ARGS32 in ia32entry.S now uses symbolic stack offsets
      instead of magic numbers.
      
      'error_entry' and 'save_paranoid' now use SAVE_C_REGS +
      SAVE_EXTRA_REGS instead of having it open-coded yet again.
      
      Patch was run-tested: 64-bit executables, 32-bit executables,
      strace works.
      
      Timing tests did not show measurable difference in 32-bit
      and 64-bit syscalls.
      Signed-off-by: NDenys Vlasenko <dvlasenk@redhat.com>
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Will Drewry <wad@chromium.org>
      Link: http://lkml.kernel.org/r/1423778052-21038-2-git-send-email-dvlasenk@redhat.com
      Link: http://lkml.kernel.org/r/b89763d354aa23e670b9bdf3a40ae320320a7c2e.1424989793.git.luto@amacapital.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      76f5df43
  3. 19 2月, 2015 1 次提交
    • J
      x86/mm/ASLR: Propagate base load address calculation · f47233c2
      Jiri Kosina 提交于
      Commit:
      
        e2b32e67 ("x86, kaslr: randomize module base load address")
      
      makes the base address for module to be unconditionally randomized in
      case when CONFIG_RANDOMIZE_BASE is defined and "nokaslr" option isn't
      present on the commandline.
      
      This is not consistent with how choose_kernel_location() decides whether
      it will randomize kernel load base.
      
      Namely, CONFIG_HIBERNATION disables kASLR (unless "kaslr" option is
      explicitly specified on kernel commandline), which makes the state space
      larger than what module loader is looking at. IOW CONFIG_HIBERNATION &&
      CONFIG_RANDOMIZE_BASE is a valid config option, kASLR wouldn't be applied
      by default in that case, but module loader is not aware of that.
      
      Instead of fixing the logic in module.c, this patch takes more generic
      aproach. It introduces a new bootparam setup data_type SETUP_KASLR and
      uses that to pass the information whether kaslr has been applied during
      kernel decompression, and sets a global 'kaslr_enabled' variable
      accordingly, so that any kernel code (module loading, livepatching, ...)
      can make decisions based on its value.
      
      x86 module loader is converted to make use of this flag.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NKees Cook <keescook@chromium.org>
      Cc: "H. Peter Anvin" <hpa@linux.intel.com>
      Link: https://lkml.kernel.org/r/alpine.LNX.2.00.1502101411280.10719@pobox.suse.cz
      [ Always dump correct kaslr status when panicking ]
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      f47233c2
  4. 10 2月, 2015 1 次提交
    • L
      tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS · 3a9a941d
      Len Brown 提交于
      The Processor generation code-named Haswell
      added MSR_{CORE | GFX | RING}_PERF_LIMIT_REASONS
      to explain when and how the processor limits frequency.
      
      turbostat -v
      will now decode these bits.
      
      Each MSR has an "Active" set of bits which describe
      current conditions, and a "Logged" set of bits,
      which describe what has happened since last cleared.
      
      Turbostat currently doesn't clear the log bits.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3a9a941d
  5. 30 1月, 2015 1 次提交
  6. 26 1月, 2015 1 次提交
  7. 09 1月, 2015 2 次提交
  8. 21 12月, 2014 1 次提交
  9. 18 12月, 2014 1 次提交
  10. 05 12月, 2014 1 次提交
  11. 03 12月, 2014 1 次提交
  12. 12 11月, 2014 2 次提交
  13. 24 10月, 2014 1 次提交
  14. 21 8月, 2014 1 次提交
  15. 16 8月, 2014 1 次提交
  16. 21 7月, 2014 1 次提交
  17. 17 7月, 2014 1 次提交
  18. 19 6月, 2014 1 次提交
  19. 30 5月, 2014 1 次提交
    • F
      x86/xsaves: Detect xsaves/xrstors feature · 6229ad27
      Fenghua Yu 提交于
      Detect the xsaveopt, xsavec, xgetbv, and xsaves features in processor extended
      state enumberation sub-leaf (eax=0x0d, ecx=1):
      Bit 00: XSAVEOPT is available
      Bit 01: Supports XSAVEC and the compacted form of XRSTOR if set
      Bit 02: Supports XGETBV with ECX = 1 if set
      Bit 03: Supports XSAVES/XRSTORS and IA32_XSS if set
      
      The above features are defined in the new word 10 in cpu features.
      
      The IA32_XSS MSR (index DA0H) contains a state-component bitmap that specifies
      the state components that software has enabled xsaves and xrstors to manage.
      If the bit corresponding to a state component is clear in XCR0 | IA32_XSS,
      xsaves and xrstors will not operate on that state component, regardless of
      the value of the instruction mask.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Link: http://lkml.kernel.org/r/1401387164-43416-3-git-send-email-fenghua.yu@intel.comSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      6229ad27
  20. 09 5月, 2014 1 次提交
  21. 06 5月, 2014 1 次提交
  22. 14 3月, 2014 2 次提交
  23. 24 2月, 2014 1 次提交
  24. 21 1月, 2014 1 次提交
  25. 17 1月, 2014 2 次提交
    • J
      KVM: nVMX: Clean up handling of VMX-related MSRs · cae50139
      Jan Kiszka 提交于
      This simplifies the code and also stops issuing warning about writing to
      unhandled MSRs when VMX is disabled or the Feature Control MSR is
      locked - we do handle them all according to the spec.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      cae50139
    • V
      add support for Hyper-V reference time counter · e984097b
      Vadim Rozenfeld 提交于
      Signed-off: Peter Lieven <pl@kamp.de>
      Signed-off: Gleb Natapov
      Signed-off: Vadim Rozenfeld <vrozenfe@redhat.com>
      
      After some consideration I decided to submit only Hyper-V reference
      counters support this time. I will submit iTSC support as a separate
      patch as soon as it is ready.
      
      v1 -> v2
      1. mark TSC page dirty as suggested by
          Eric Northup <digitaleric@google.com> and Gleb
      2. disable local irq when calling get_kernel_ns,
          as it was done by Peter Lieven <pl@amp.de>
      3. move check for TSC page enable from second patch
          to this one.
      
      v3 -> v4
          Get rid of ref counter offset.
      
      v4 -> v5
          replace __copy_to_user with kvm_write_guest
          when updateing iTSC page.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e984097b
  26. 15 1月, 2014 1 次提交
  27. 29 12月, 2013 2 次提交
    • D
      x86: Add xloadflags bit for EFI runtime support on kexec · 456a29dd
      Dave Young 提交于
      Old kexec-tools can not load new kernels. The reason is kexec-tools does
      not fill efi_info in x86 setup header previously, thus EFI failed to
      initialize.  In new kexec-tools it will by default to fill efi_info and
      pass other EFI required infomation to 2nd kernel so kexec kernel EFI
      initialization can succeed finally.
      
      To prevent from breaking userspace, add a new xloadflags bit so
      kexec-tools can check the flag and switch to old logic.
      Signed-off-by: NDave Young <dyoung@redhat.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      456a29dd
    • D
      x86/efi: Pass necessary EFI data for kexec via setup_data · 1fec0533
      Dave Young 提交于
      Add a new setup_data type SETUP_EFI for kexec use.  Passing the saved
      fw_vendor, runtime, config tables and EFI runtime mappings.
      
      When entering virtual mode, directly mapping the EFI runtime regions
      which we passed in previously. And skip the step to call
      SetVirtualAddressMap().
      
      Specially for HP z420 workstation we need save the smbios physical
      address.  The kernel boot sequence proceeds in the following order.
      Step 2 requires efi.smbios to be the physical address.  However, I found
      that on HP z420 EFI system table has a virtual address of SMBIOS in step
      1.  Hence, we need set it back to the physical address with the smbios
      in efi_setup_data.  (When it is still the physical address, it simply
      sets the same value.)
      
      1. efi_init() - Set efi.smbios from EFI system table
      2. dmi_scan_machine() - Temporary map efi.smbios to access SMBIOS table
      3. efi_enter_virtual_mode() - Map EFI ranges
      
      Tested on ovmf+qemu, lenovo thinkpad, a dell laptop and an
      HP z420 workstation.
      Signed-off-by: NDave Young <dyoung@redhat.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      1fec0533
  28. 21 12月, 2013 1 次提交
  29. 13 11月, 2013 1 次提交
    • L
      tools / power turbostat: Support Silvermont · 144b44b1
      Len Brown 提交于
      Support the next generation Intel Atom processor
      mirco-architecture, formerly called Silvermont.
      
      The server version, formerly called "Avoton",
      is named the "Intel(R) Atom(TM) Processor C2000 Product Family".
      
      The client version, formerly called "Bay Trail",
      is named the "Intel Atom Processor Z3000 Series",
      as well as various "Intel Pentium Processor"
      and "Intel Celeron Processor" brands, depending
      on form-factor.
      
      Silvermont has a set of MSRs not far off from NHM,
      but the RAPL register set is a sub-set of those previously supported.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      144b44b1
  30. 31 10月, 2013 1 次提交
    • B
      kvm: Add KVM_GET_EMULATED_CPUID · 9c15bb1d
      Borislav Petkov 提交于
      Add a kvm ioctl which states which system functionality kvm emulates.
      The format used is that of CPUID and we return the corresponding CPUID
      bits set for which we do emulate functionality.
      
      Make sure ->padding is being passed on clean from userspace so that we
      can use it for something in the future, after the ioctl gets cast in
      stone.
      
      s/kvm_dev_ioctl_get_supported_cpuid/kvm_dev_ioctl_get_cpuid/ while at
      it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9c15bb1d
  31. 18 10月, 2013 1 次提交
  32. 11 10月, 2013 2 次提交