02 Sep, 2015

2 commits

  • Pull x86 mm updates from Ingo Molnar:
    "The dominant change in this cycle was the continued work to isolate
    kernel drivers from MTRR legacies: this tree gets rid of all kernel
    internal driver interfaces to MTRRs (mostly by rewriting it to proper
    PAT interfaces), the only access left is the /proc/mtrr ABI.

    This work was done by Luis R Rodriguez.

    There's also some related PCI interface additions for which I've
    Cc:-ed Bjorn"

    * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
    x86/mm/mtrr: Remove kernel internal MTRR interfaces: unexport mtrr_add() and mtrr_del()
    s390/io: Add pci_iomap_wc() and pci_iomap_wc_range()
    drivers/dma/iop-adma: Use dma_alloc_writecombine() kernel-style
    drivers/video/fbdev/vt8623fb: Use arch_phys_wc_add() and pci_iomap_wc()
    drivers/video/fbdev/s3fb: Use arch_phys_wc_add() and pci_iomap_wc()
    drivers/video/fbdev/arkfb.c: Use arch_phys_wc_add() and pci_iomap_wc()
    PCI: Add pci_iomap_wc() variants
    drivers/video/fbdev/gxt4500: Use pci_ioremap_wc_bar() to map framebuffer
    drivers/video/fbdev/kyrofb: Use arch_phys_wc_add() and pci_ioremap_wc_bar()
    drivers/video/fbdev/i740fb: Use arch_phys_wc_add() and pci_ioremap_wc_bar()
    PCI: Add pci_ioremap_wc_bar()
    x86/mm: Make kernel/check.c explicitly non-modular
    x86/mm/pat: Make mm/pageattr[-test].c explicitly non-modular
    x86/mm/pat: Add comments to cachemode translation tables
    arch/*/io.h: Add ioremap_uc() to all architectures
    drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc()
    drivers/video/fbdev/atyfb: Replace MTRR UC hole with strong UC
    drivers/video/fbdev/atyfb: Clarify ioremap() base and length used
    drivers/video/fbdev/atyfb: Carve out framebuffer length fudging into a helper
    x86/mm, asm-generic: Add IOMMU ioremap_uc() variant default
    ...

    Linus Torvalds
     
  • Pull x86 boot updates from Ingo Molnar:
    "The main x86 bootup related changes in this cycle were:

    - more boot time optimizations. (Len Brown)

    - implement hex output to allow the debugging of early bootup
    parameters. (Kees Cook)

    - remove obsolete MCA leftovers. (Paolo Pisati)"

    * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted
    x86/smpboot: Remove SIPI delays from cpu_up()
    x86/smpboot: Remove udelay(100) when polling cpu_callin_map
    x86/smpboot: Remove udelay(100) when polling cpu_initialized_map
    x86/boot: Obsolete the MCA sys_desc_table
    x86/boot: Add hex output for debugging

    Linus Torvalds
     

28 Aug, 2015

1 commit

  • The effort to replace mtrr_add() with architecture agnostic
    arch_phys_wc_add() is complete, this will ensure write-combining
    implementations (PAT on x86) is taken advantage instead of using
    MTRR. With the effort done now, hide direct MTRR access for
    drivers.

    The legacy user-space /proc/mtrr ABI is not affected.

    Update x86 documentation on MTRR to reflect the completion of
    the phasing out of direct access to MTRR, also add a note on
    platform firmware code use of MTRRs based on the obituary
    discussion of MTRRs on Linux [0].

    [0] http://lkml.kernel.org/r/1438991330.3109.196.camel@hp.com

    Signed-off-by: Luis R. Rodriguez
    Cc:
    Cc: Andy Lutomirski
    Cc: Andy Walls
    Cc: Antonino Daplas
    Cc: Borislav Petkov
    Cc: Daniel Vetter
    Cc: Dave Airlie
    Cc: Dave Hansen
    Cc: Davidlohr Bueso
    Cc: Doug Ledford
    Cc: H. Peter Anvin
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Mel Gorman
    Cc: Peter Zijlstra
    Cc: Suresh Siddha
    Cc: Thomas Gleixner
    Cc: Tomi Valkeinen
    Cc: Toshi Kani
    Cc: Ville Syrjälä
    Cc: Vlastimil Babka
    Cc: airlied@linux.ie
    Cc: benh@kernel.crashing.org
    Cc: bhelgaas@google.com
    Cc: dan.j.williams@intel.com
    Cc: konrad.wilk@oracle.com
    Cc: linux-fbdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-media@vger.kernel.org
    Cc: mst@redhat.com
    Cc: netdev@vger.kernel.org
    Cc: vinod.koul@intel.com
    Cc: xen-devel@lists.xensource.com
    Link: http://lkml.kernel.org/r/1440443613-13696-12-git-send-email-mcgrof@do-not-panic.com
    Signed-off-by: Ingo Molnar

    Luis R. Rodriguez
     

25 Aug, 2015

1 commit


21 Jul, 2015

1 commit

  • The kernel does not support the MCA bus anymroe, so mark sys_desc_table
    as obsolete: remove any reference from the code together with the remaining
    of MCA logic.

    bloat-o-meter output:

    add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-55 (-55)
    function old new delta
    i386_start_kernel 128 119 -9
    setup_arch 1421 1375 -46

    Signed-off-by: Paolo Pisati
    Cc: Josh Triplett
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1437409430-8491-1-git-send-email-p.pisati@gmail.com
    Signed-off-by: Ingo Molnar

    Paolo Pisati
     

02 Jul, 2015

1 commit

  • The paths mentioned in this file weren't updated through some file
    rename commits. Fix them to refer to the correct path.

    Signed-off-by: James C Boyd
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: corbet@lwn.net
    Cc: trivial@kernel.org
    Link: http://lkml.kernel.org/r/1435781606-3037-1-git-send-email-jcboyd.dev@gmail.com
    Signed-off-by: Ingo Molnar

    James C Boyd
     

30 Jun, 2015

1 commit


23 Jun, 2015

2 commits

  • Pull x86 core updates from Ingo Molnar:
    "There were so many changes in the x86/asm, x86/apic and x86/mm topics
    in this cycle that the topical separation of -tip broke down somewhat -
    so the result is a more traditional architecture pull request,
    collected into the 'x86/core' topic.

    The topics were still maintained separately as far as possible, so
    bisectability and conceptual separation should still be pretty good -
    but there were a handful of merge points to avoid excessive
    dependencies (and conflicts) that would have been poorly tested in the
    end.

    The next cycle will hopefully be much more quiet (or at least will
    have fewer dependencies).

    The main changes in this cycle were:

    * x86/apic changes, with related IRQ core changes: (Jiang Liu, Thomas
    Gleixner)

    - This is the second and most intrusive part of changes to the x86
    interrupt handling - full conversion to hierarchical interrupt
    domains:

    [IOAPIC domain] -----
    |
    [MSI domain] --------[Remapping domain] ----- [ Vector domain ]
    | (optional) |
    [HPET MSI domain] ----- |
    |
    [DMAR domain] -----------------------------
    |
    [Legacy domain] -----------------------------

    This now reflects the actual hardware and allowed us to distangle
    the domain specific code from the underlying parent domain, which
    can be optional in the case of interrupt remapping. It's a clear
    separation of functionality and removes quite some duct tape
    constructs which plugged the remap code between ioapic/msi/hpet
    and the vector management.

    - Intel IOMMU IRQ remapping enhancements, to allow direct interrupt
    injection into guests (Feng Wu)

    * x86/asm changes:

    - Tons of cleanups and small speedups, micro-optimizations. This
    is in preparation to move a good chunk of the low level entry
    code from assembly to C code (Denys Vlasenko, Andy Lutomirski,
    Brian Gerst)

    - Moved all system entry related code to a new home under
    arch/x86/entry/ (Ingo Molnar)

    - Removal of the fragile and ugly CFI dwarf debuginfo annotations.
    Conversion to C will reintroduce many of them - but meanwhile
    they are only getting in the way, and the upstream kernel does
    not rely on them (Ingo Molnar)

    - NOP handling refinements. (Borislav Petkov)

    * x86/mm changes:

    - Big PAT and MTRR rework: making the code more robust and
    preparing to phase out exposing direct MTRR interfaces to drivers -
    in favor of using PAT driven interfaces (Toshi Kani, Luis R
    Rodriguez, Borislav Petkov)

    - New ioremap_wt()/set_memory_wt() interfaces to support
    Write-Through cached memory mappings. This is especially
    important for good performance on NVDIMM hardware (Toshi Kani)

    * x86/ras changes:

    - Add support for deferred errors on AMD (Aravind Gopalakrishnan)

    This is an important RAS feature which adds hardware support for
    poisoned data. That means roughly that the hardware marks data
    which it has detected as corrupted but wasn't able to correct, as
    poisoned data and raises an APIC interrupt to signal that in the
    form of a deferred error. It is the OS's responsibility then to
    take proper recovery action and thus prolonge system lifetime as
    far as possible.

    - Add support for Intel "Local MCE"s: upcoming CPUs will support
    CPU-local MCE interrupts, as opposed to the traditional system-
    wide broadcasted MCE interrupts (Ashok Raj)

    - Misc cleanups (Borislav Petkov)

    * x86/platform changes:

    - Intel Atom SoC updates

    ... and lots of other cleanups, fixlets and other changes - see the
    shortlog and the Git log for details"

    * 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (222 commits)
    x86/hpet: Use proper hpet device number for MSI allocation
    x86/hpet: Check for irq==0 when allocating hpet MSI interrupts
    x86/mm/pat, drivers/infiniband/ipath: Use arch_phys_wc_add() and require PAT disabled
    x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT disabled
    x86/platform/intel/baytrail: Add comments about why we disabled HPET on Baytrail
    genirq: Prevent crash in irq_move_irq()
    genirq: Enhance irq_data_to_desc() to support hierarchy irqdomain
    iommu, x86: Properly handle posted interrupts for IOMMU hotplug
    iommu, x86: Provide irq_remapping_cap() interface
    iommu, x86: Setup Posted-Interrupts capability for Intel iommu
    iommu, x86: Add cap_pi_support() to detect VT-d PI capability
    iommu, x86: Avoid migrating VT-d posted interrupts
    iommu, x86: Save the mode (posted or remapped) of an IRTE
    iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip
    iommu: dmar: Provide helper to copy shared irte fields
    iommu: dmar: Extend struct irte for VT-d Posted-Interrupts
    iommu: Add new member capability to struct irq_remap_ops
    x86/asm/entry/64: Disentangle error_entry/exit gsbase/ebx/usermode code
    x86/asm/entry/32: Shorten __audit_syscall_entry() args preparation
    x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry()
    ...

    Linus Torvalds
     
  • Pull x86 EFI updates from Ingo Molnar:
    "EFI changes:

    - Use idiomatic negative error values in efivar_create_sysfs_entry()
    instead of returning '1' to indicate error (Dan Carpenter)

    - Implement new support to expose the EFI System Resource Tables in
    sysfs, which provides information for performing firmware updates
    (Peter Jones)

    - Documentation cleanup in the EFI handover protocol section which
    falsely claimed that 'cmdline_size' needed to be filled out by the
    boot loader (Alex Smith)

    - Align the order of SMBIOS tables in /sys/firmware/efi/systab to
    match the way that we do things for ACPI and add documentation to
    Documentation/ABI (Jean Delvare)"

    * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    efi: Work around ia64 build problem with ESRT driver
    efi: Add 'systab' information to Documentation/ABI
    efi: dmi: List SMBIOS3 table before SMBIOS table
    efi/esrt: Fix some compiler warnings
    x86, doc: Remove cmdline_size from list of fields to be filled in for EFI handover
    efi: Add esrt support
    efi: efivar_create_sysfs_entry() should return negative error codes

    Linus Torvalds
     

22 Jun, 2015

1 commit


09 Jun, 2015

1 commit


08 Jun, 2015

1 commit

  • Rename the following system call entry points:

    ia32_cstar_target -> entry_SYSCALL_compat
    ia32_syscall -> entry_INT80_compat

    The generic naming scheme for x86 system call entry points is:

    entry_MNEMONIC_qualifier

    where 'qualifier' is one of _32, _64 or _compat.

    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

07 Jun, 2015

4 commits

  • Conflicts:
    arch/x86/include/asm/irq_vectors.h

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Initialize and prepare for handling LMCEs. Add a boot-time
    option to disable LMCEs.

    Signed-off-by: Ashok Raj
    [ Simplify stuff, align statements for better readability, reflow comments; kill
    unused lmce_clear(); save us an MSR write if LMCE is already enabled. ]
    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: linux-edac
    Link: http://lkml.kernel.org/r/1433436928-31903-16-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Ashok Raj
     
  • Now that reserve_ram_pages_type() accepts the WT type, add
    set_memory_wt(), set_memory_array_wt() and set_pages_array_wt()
    in order to be able to set memory to Write-Through page cache
    mode.

    Also, extend ioremap_change_attr() to accept the WT type.

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Elliott@hp.com
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: arnd@arndb.de
    Cc: hch@lst.de
    Cc: hmh@hmh.eng.br
    Cc: jgross@suse.com
    Cc: konrad.wilk@oracle.com
    Cc: linux-mm
    Cc: linux-nvdimm@lists.01.org
    Cc: stefan.bader@canonical.com
    Cc: yigal@plexistor.com
    Link: http://lkml.kernel.org/r/1433436928-31903-13-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     
  • Add ioremap_wt() for creating Write-Through mappings on x86. It
    follows the same model as ioremap_wc() for multi-arch support.
    Define ARCH_HAS_IOREMAP_WT in the x86 version of io.h to
    indicate that ioremap_wt() is implemented on x86.

    Also update the PAT documentation file to cover ioremap_wt().

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Elliott@hp.com
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: arnd@arndb.de
    Cc: hch@lst.de
    Cc: hmh@hmh.eng.br
    Cc: jgross@suse.com
    Cc: konrad.wilk@oracle.com
    Cc: linux-mm
    Cc: linux-nvdimm@lists.01.org
    Cc: stefan.bader@canonical.com
    Cc: yigal@plexistor.com
    Link: http://lkml.kernel.org/r/1433436928-31903-8-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     

27 May, 2015

4 commits

  • As part of the effort to phase out MTRR use document
    write-combining MTRR effects on pages with different non-PAT
    page attributes flags and different PAT entry values. Extend
    arch_phys_wc_add() documentation to clarify power of two sizes /
    boundary requirements as we phase out mtrr_add() use.

    Lastly hint towards ioremap_uc() for corner cases on device
    drivers working with devices with mixed regions where MTRR size
    requirements would otherwise not enable write-combining
    effective memory types.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Antonino Daplas
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Daniel Vetter
    Cc: Dave Airlie
    Cc: Dave Hansen
    Cc: Davidlohr Bueso
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Jonathan Corbet
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Mel Gorman
    Cc: Peter Zijlstra
    Cc: Suresh Siddha
    Cc: Thomas Gleixner
    Cc: Tomi Valkeinen
    Cc: Ville Syrjälä
    Cc: Vlastimil Babka
    Cc: linux-fbdev@vger.kernel.org
    Link: http://lkml.kernel.org/r/1430343851-967-3-git-send-email-mcgrof@do-not-panic.com
    Link: http://lkml.kernel.org/r/1432628901-18044-10-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Luis R. Rodriguez
     
  • Hold it down for future reference, as the question about the
    question mark in stack traces keeps popping up.

    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Michal Marek
    Cc: Peter Zijlstra
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: live-patching@vger.kernel.org
    Link: http://lkml.kernel.org/r/1432628901-18044-18-git-send-email-bp@alien8.de
    Link: http://lkml.kernel.org/r/20150521101614.GA10889@gmail.com
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     
  • Update the documentation after

    6f442be2fb22 ("x86_64, traps: Stop using IST for #SS").

    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Michal Marek
    Cc: Peter Zijlstra
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: live-patching@vger.kernel.org
    Link: http://lkml.kernel.org/r/1432628901-18044-17-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     
  • ... to Documentation/x86/ as it is going to collect more and not
    only 64-bit specific info.

    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Michal Marek
    Cc: Peter Zijlstra
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: live-patching@vger.kernel.org
    Link: http://lkml.kernel.org/r/1432628901-18044-16-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     

11 May, 2015

1 commit

  • Documentation/x86/boot.txt labels the bit in
    boot_params.hdr.loadflags as ALSR_FLAG while it should be
    KASLR_FLAG.

    Signed-off-by: Miroslav Benes
    Signed-off-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jiri Kosina
    Cc: Jonathan Corbet
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1429011324-7170-1-git-send-email-mbenes@suse.cz
    Link: http://lkml.kernel.org/r/1431332153-18566-4-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Miroslav Benes
     

01 May, 2015

1 commit


03 Apr, 2015

1 commit

  • Commit:

    e2b32e678513 ("x86, kaslr: randomize module base load address")

    made module base address randomization unconditional and didn't regard
    disabled KKASLR due to CONFIG_HIBERNATION and command line option
    "nokaslr". For more info see (now reverted) commit:

    f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")

    In order to propagate KASLR status to kernel proper, we need a single bit
    in boot_params.hdr.loadflags and we've chosen bit 1 thus leaving the
    top-down allocated bits for bits supposed to be used by the bootloader.

    Originally-From: Jiri Kosina
    Suggested-by: H. Peter Anvin
    Signed-off-by: Borislav Petkov
    Cc: Kees Cook
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     

22 Feb, 2015

1 commit

  • Pull misc x86 fixes from Ingo Molnar:
    "This contains:

    - EFI fixes
    - a boot printout fix
    - ASLR/kASLR fixes
    - intel microcode driver fixes
    - other misc fixes

    Most of the linecount comes from an EFI revert"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/mm/ASLR: Avoid PAGE_SIZE redefinition for UML subarch
    x86/microcode/intel: Handle truncated microcode images more robustly
    x86/microcode/intel: Guard against stack overflow in the loader
    x86, mm/ASLR: Fix stack randomization on 64-bit systems
    x86/mm/init: Fix incorrect page size in init_memory_mapping() printks
    x86/mm/ASLR: Propagate base load address calculation
    Documentation/x86: Fix path in zero-page.txt
    x86/apic: Fix the devicetree build in certain configs
    Revert "efi/libstub: Call get_memory_map() to obtain map and desc sizes"
    x86/efi: Avoid triple faults during EFI mixed mode calls

    Linus Torvalds
     

19 Feb, 2015

1 commit


14 Feb, 2015

1 commit

  • This patch adds arch specific code for kernel address sanitizer.

    16TB of virtual addressed used for shadow memory. It's located in range
    [ffffec0000000000 - fffffc0000000000] between vmemmap and %esp fixup
    stacks.

    At early stage we map whole shadow region with zero page. Latter, after
    pages mapped to direct mapping address range we unmap zero pages from
    corresponding shadow (see kasan_map_shadow()) and allocate and map a real
    shadow memory reusing vmemmap_populate() function.

    Also replace __pa with __pa_nodebug before shadow initialized. __pa with
    CONFIG_DEBUG_VIRTUAL=y make external function call (__phys_addr)
    __phys_addr is instrumented, so __asan_load could be called before shadow
    area initialized.

    Signed-off-by: Andrey Ryabinin
    Cc: Dmitry Vyukov
    Cc: Konstantin Serebryany
    Cc: Dmitry Chernenkov
    Signed-off-by: Andrey Konovalov
    Cc: Yuri Gribov
    Cc: Konstantin Khlebnikov
    Cc: Sasha Levin
    Cc: Christoph Lameter
    Cc: Joonsoo Kim
    Cc: Dave Hansen
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Jim Davis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     

03 Jan, 2015

1 commit

  • This causes all non-NMI, non-double-fault kernel entries from
    userspace to run on the normal kernel stack. Double-fault is
    exempt to minimize confusion if we double-fault directly from
    userspace due to a bad kernel stack.

    This is, suprisingly, simpler and shorter than the current code. It
    removes the IMO rather frightening paranoid_userspace path, and it
    make sync_regs much simpler.

    There is no risk of stack overflow due to this change -- the kernel
    stack that we switch to is empty.

    This will also enable us to create non-atomic sections within
    machine checks from userspace, which will simplify memory failure
    handling. It will also allow the upcoming fsgsbase code to be
    simplified, because it doesn't need to worry about usergs when
    scheduling in paranoid_exit, as that code no longer exists.

    Cc: Oleg Nesterov
    Cc: Andi Kleen
    Cc: Tony Luck
    Acked-by: Borislav Petkov
    Signed-off-by: Andy Lutomirski

    Andy Lutomirski
     

20 Dec, 2014

1 commit


15 Dec, 2014

3 commits

  • Give MPX a real config option. The CPUs that support it (referenced
    here):

    https://software.intel.com/en-us/forums/topic/402393

    are not available publicly yet. Right now only the software emulator
    provides MPX for the general public.

    [ tglx: Make it default off. There is no point in having it on right
    now as no hardware and no proper tooling support are available ]

    Signed-off-by: Dave Hansen
    Cc: Dave Hansen
    Link: http://lkml.kernel.org/r/20141212183836.2569D58D@viggo.jf.intel.com
    Signed-off-by: Thomas Gleixner

    Dave Hansen
     
  • I was writing some MPX test programs and realized that the
    current design makes it tricky. I did something like:

    bndcfgu |= bnd_dir | BNDCFGU_ENABLE;
    xrstor();
    printf("xrstor done");
    // #BR bounds exception here
    prctl(MPX_ENABLE_MANAGEMENT);

    and then compiled the app with "-fcheck-pointer-bounds -mmpx"
    to enable MPX instrumentation.

    The problem is that there is MPX instrumentation inserted in
    to the area of the printf(). The kernel gets a bounds exception
    and since management isn't yet enabled, it SIGSEGV's.

    Add a bit to the documentation to explain a way around this and
    where apps need to be careful.

    Signed-off-by: Dave Hansen
    Cc: Dave Hansen
    Link: http://lkml.kernel.org/r/20141212183835.8C581B3E@viggo.jf.intel.com
    Signed-off-by: Thomas Gleixner

    Dave Hansen
     
  • Pull x86 fixes from Ingo Molnar:
    "Misc fixes (mainly Andy's TLS fixes), plus a cleanup"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/tls: Disallow unusual TLS segments
    x86/tls: Validate TLS entries to protect espfix
    MAINTAINERS: Add me as x86 VDSO submaintainer
    x86/asm: Unify segment selector defines
    x86/asm: Guard against building the 32/64-bit versions of the asm-offsets*.c file directly
    x86_64, switch_to(): Load TLS descriptors before switching DS and ES
    x86/mm: Use min() instead of min_t() in the e820 printout code
    x86/mm: Fix zone ranges boot printout
    x86/doc: Update documentation after file shuffling

    Linus Torvalds
     

11 Dec, 2014

1 commit


18 Nov, 2014

1 commit

  • This patch adds the Documentation/x86/intel_mpx.txt file with some
    information about Intel MPX.

    Signed-off-by: Qiaowei Ren
    Signed-off-by: Dave Hansen
    Cc: linux-mm@kvack.org
    Cc: linux-mips@linux-mips.org
    Cc: Dave Hansen
    Link: http://lkml.kernel.org/r/20141114151832.7FDB1720@viggo.jf.intel.com
    Signed-off-by: Thomas Gleixner

    Qiaowei Ren
     

19 Sep, 2014

1 commit

  • Peter Anvin says:

    > 0xffff880000000000 is the lowest usable address because we have
    > agreed to leave 0xffff800000000000-0xffff880000000000 for the
    > hypervisor or other non-OS uses.

    Let's call this out in the documentation.

    This came up during the kernel address sanitizer discussions
    where it was proposed to use this area for other kernel things.

    Signed-off-by: Dave Hansen
    Cc: Andrey Ryabinin
    Cc: Dmitry Vyukov
    Link: http://lkml.kernel.org/r/20140918195606.841389D2@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Dave Hansen
     

10 Aug, 2014

1 commit


31 Jul, 2014

1 commit

  • Most of the logic here is in the documentation file. Please take
    a look at it.

    I know we've come full-circle here back to a tunable, but this
    new one is *WAY* simpler. I challenge anyone to describe in one
    sentence how the old one worked. Here's the way the new one
    works:

    If we are flushing more pages than the ceiling, we use
    the full flush, otherwise we use per-page flushes.

    Signed-off-by: Dave Hansen
    Link: http://lkml.kernel.org/r/20140731154101.12B52CAF@viggo.jf.intel.com
    Acked-by: Rik van Riel
    Acked-by: Mel Gorman
    Signed-off-by: H. Peter Anvin

    Dave Hansen
     

05 Jun, 2014

1 commit

  • Pull x86-64 espfix changes from Peter Anvin:
    "This is the espfix64 code, which fixes the IRET information leak as
    well as the associated functionality problem. With this code applied,
    16-bit stack segments finally work as intended even on a 64-bit
    kernel.

    Consequently, this patchset also removes the runtime option that we
    added as an interim measure.

    To help the people working on Linux kernels for very small systems,
    this patchset also makes these compile-time configurable features"

    * 'x86/espfix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option"
    x86, espfix: Make it possible to disable 16-bit support
    x86, espfix: Make espfix64 a Kconfig option, fix UML
    x86, espfix: Fix broken header guard
    x86, espfix: Move espfix definitions into a separate header file
    x86-32, espfix: Remove filter for espfix32 due to race
    x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack

    Linus Torvalds
     

05 May, 2014

1 commit


01 May, 2014

1 commit

  • The IRET instruction, when returning to a 16-bit segment, only
    restores the bottom 16 bits of the user space stack pointer. This
    causes some 16-bit software to break, but it also leaks kernel state
    to user space. We have a software workaround for that ("espfix") for
    the 32-bit kernel, but it relies on a nonzero stack segment base which
    is not available in 64-bit mode.

    In checkin:

    b3b42ac2cbae x86-64, modify_ldt: Ban 16-bit segments on 64-bit kernels

    we "solved" this by forbidding 16-bit segments on 64-bit kernels, with
    the logic that 16-bit support is crippled on 64-bit kernels anyway (no
    V86 support), but it turns out that people are doing stuff like
    running old Win16 binaries under Wine and expect it to work.

    This works around this by creating percpu "ministacks", each of which
    is mapped 2^16 times 64K apart. When we detect that the return SS is
    on the LDT, we copy the IRET frame to the ministack and use the
    relevant alias to return to userspace. The ministacks are mapped
    readonly, so if IRET faults we promote #GP to #DF which is an IST
    vector and thus has its own stack; we then do the fixup in the #DF
    handler.

    (Making #GP an IST exception would make the msr_safe functions unsafe
    in NMI/MC context, and quite possibly have other effects.)

    Special thanks to:

    - Andy Lutomirski, for the suggestion of using very small stack slots
    and copy (as opposed to map) the IRET frame there, and for the
    suggestion to mark them readonly and let the fault promote to #DF.
    - Konrad Wilk for paravirt fixup and testing.
    - Borislav Petkov for testing help and useful comments.

    Reported-by: Brian Gerst
    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/r/1398816946-3351-1-git-send-email-hpa@linux.intel.com
    Cc: Konrad Rzeszutek Wilk
    Cc: Borislav Petkov
    Cc: Andrew Lutomriski
    Cc: Linus Torvalds
    Cc: Dirk Hohndel
    Cc: Arjan van de Ven
    Cc: comex
    Cc: Alexander van Heukelum
    Cc: Boris Ostrovsky
    Cc: # consider after upstream merge

    H. Peter Anvin
     

14 Mar, 2014

1 commit