1. 01 9月, 2017 4 次提交
  2. 31 8月, 2017 6 次提交
    • J
      x86/idt: Remove superfluous ALIGNment · 04b5de3a
      Jiri Slaby 提交于
      Commit 87e81786 ("x86/idt: Move early IDT setup out of 32-bit asm")
      switched early_ignore_irq to use ENTRY. ENTRY aligns the code, so there
      is no need for one more ALIGN right before the function.
      
      And add one \n after the function to separate it from the data.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Link: http://lkml.kernel.org/r/20170831121653.28917-1-jslaby@suse.cz
      04b5de3a
    • N
      x86/boot/KASLR: Work around firmware bugs by excluding EFI_BOOT_SERVICES_* and... · 0982adc7
      Naoya Horiguchi 提交于
      x86/boot/KASLR: Work around firmware bugs by excluding EFI_BOOT_SERVICES_* and EFI_LOADER_* from KASLR's choice
      
      There's a potential bug in how we select the KASLR kernel address n
      the early boot code.
      
      The KASLR boot code currently chooses the kernel image's physical memory
      location from E820_TYPE_RAM regions by walking over all e820 entries.
      
      E820_TYPE_RAM includes EFI_BOOT_SERVICES_CODE and EFI_BOOT_SERVICES_DATA
      as well, so those regions can end up hosting the kernel image. According to
      the UEFI spec, all memory regions marked as EfiBootServicesCode and
      EfiBootServicesData are available as free memory after the first call
      to ExitBootServices(). I.e. so such regions should be usable for the
      kernel, per spec.
      
      In real life however, we have workarounds for broken x86 firmware,
      where we keep such regions reserved until SetVirtualAddressMap() is done.
      
      See the following code in should_map_region():
      
      	static bool should_map_region(efi_memory_desc_t *md)
      	{
      		...
      		/*
      		 * Map boot services regions as a workaround for buggy
      		 * firmware that accesses them even when they shouldn't.
      		 *
      		 * See efi_{reserve,free}_boot_services().
      		 */
      		if (md->type =3D=3D EFI_BOOT_SERVICES_CODE ||
      			md->type =3D=3D EFI_BOOT_SERVICES_DATA)
      				return false;
      
      This workaround suppressed a boot crash, but potential issues still
      remain because no one prevents the regions from overlapping with kernel
      image by KASLR.
      
      So let's make sure that EFI_BOOT_SERVICES_{CODE|DATA} regions are never
      chosen as kernel memory for the workaround to work fine.
      
      Furthermore, EFI_LOADER_{CODE|DATA} regions are also excluded because
      they can be used after ExitBootServices() as defined in EFI spec.
      
      As a result, we choose kernel address only from EFI_CONVENTIONAL_MEMORY
      which is the only memory type we know to be safely free.
      Signed-off-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Junichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: fanc.fnst@cn.fujitsu.com
      Cc: izumi.taku@jp.fujitsu.com
      Link: http://lkml.kernel.org/r/20170828074444.GC23181@hori1.linux.bs1.fc.nec.co.jp
      [ Rewrote/fixed/clarified the changelog and the in code comments. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      0982adc7
    • H
      x86/apic: Silence "FW_BUG TSC_DEADLINE disabled due to Errata" on CPUs without the feature · 594a30fb
      Hans de Goede 提交于
      When booting 4.13 on a VirtualBox VM on a Skylake host the following
      error shows up in the logs:
      
       [    0.000000] [Firmware Bug]: TSC_DEADLINE disabled due to Errata;
                      please update microcode to version: 0xb2 (or later)
      
      This is caused by apic_check_deadline_errata() only checking CPU model
      and not the X86_FEATURE_TSC_DEADLINE_TIMER flag (which VirtualBox does
      NOT export to the guest), combined with VirtualBox not exporting the
      micro-code version to the guest.
      
      This commit adds a check for X86_FEATURE_TSC_DEADLINE_TIMER to
      apic_check_deadline_errata(), silencing this error on VirtualBox VMs.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Frank Mehnert <frank.mehnert@oracle.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Thayer <michael.thayer@oracle.com>
      Cc: Michal Necasek <michal.necasek@oracle.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: bd9240a1 ("x86/apic: Add TSC_DEADLINE quirk due to errata")
      Link: http://lkml.kernel.org/r/20170830105811.27539-1-hdegoede@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      594a30fb
    • V
      x86/mm: Enable RCU based page table freeing (CONFIG_HAVE_RCU_TABLE_FREE=y) · 9e52fc2b
      Vitaly Kuznetsov 提交于
      There's a subtle bug in how some of the paravirt guest code handles
      page table freeing on x86:
      
      On x86 software page table walkers depend on the fact that remote TLB flush
      does an IPI: walk is performed lockless but with interrupts disabled and in
      case the page table is freed the freeing CPU will get blocked as remote TLB
      flush is required. On other architectures which don't require an IPI to do
      remote TLB flush we have an RCU-based mechanism (see
      include/asm-generic/tlb.h for more details).
      
      In virtualized environments we may want to override the ->flush_tlb_others
      callback in pv_mmu_ops and use a hypercall asking the hypervisor to do a
      remote TLB flush for us. This breaks the assumption about IPIs. Xen PV has
      been doing this for years and the upcoming remote TLB flush for Hyper-V will
      do it too.
      
      This is not safe, as software page table walkers may step on an already
      freed page.
      
      Fix the bug by enabling the RCU-based page table freeing mechanism,
      CONFIG_HAVE_RCU_TABLE_FREE=y.
      
      Testing with kernbench and mmap/munmap microbenchmarks, and neither showed
      any noticeable performance impact.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Acked-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrew Cooper <andrew.cooper3@citrix.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Jork Loeser <Jork.Loeser@microsoft.com>
      Cc: KY Srinivasan <kys@microsoft.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: xen-devel@lists.xenproject.org
      Link: http://lkml.kernel.org/r/20170828082251.5562-1-vkuznets@redhat.com
      [ Rewrote/fixed/clarified the changelog. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      9e52fc2b
    • J
      x86/mm: Use pr_cont() in dump_pagetable() · 39e48d9b
      Jan Beulich 提交于
      The lack of newlines in preceding format strings is a clear indication
      that these were meant to be continuations of one another, and indeed
      output ends up quite a bit more compact (and readable) that way.
      
      Switch other plain printk()-s in the function instances to pr_info(),
      as requested.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/59A7D72B0200007800175E4E@prv-mh.provo.novell.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      39e48d9b
    • T
      x86/idt: Remove the tracing IDT leftovers · 1d792a67
      Thomas Gleixner 提交于
      Stephen reported a merge conflict with the XEN tree. That also shows that the
      IDT cleanup forgot to remove the now unused trace_{trap} defines.
      
      Remove them.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      1d792a67
  3. 29 8月, 2017 30 次提交