]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:03:12 +0000 (05:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:03:12 +0000 (05:03 -0700)
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, amd: Include linux/elf.h since we use stuff from asm/elf.h
  x86: cache_info: Update calculation of AMD L3 cache indices
  x86: cache_info: Kill the atomic allocation in amd_init_l3_cache()
  x86: cache_info: Kill the moronic shadow struct
  x86: cache_info: Remove bogus free of amd_l3_cache data
  x86, amd: Include elf.h explicitly, prepare the code for the module.h split
  x86-32, amd: Move va_align definition to unbreak 32-bit build
  x86, amd: Move BSP code to cpu_dev helper
  x86: Add a BSP cpu_dev helper
  x86, amd: Avoid cache aliasing penalties on AMD family 15h

1  2 
Documentation/kernel-parameters.txt
arch/x86/kernel/cpu/common.c
arch/x86/vdso/vma.c

index a8ba119a4d537c096c0d67698612ecb5b8036153,af73c036b7e673d432caa67b2adb4e5597695556..6afd091bc1f896ab5857ffd6fb661b944847b60a
@@@ -40,7 -40,6 +40,7 @@@ parameter is applicable
        ALSA    ALSA sound support is enabled.
        APIC    APIC support is enabled.
        APM     Advanced Power Management support is enabled.
 +      ARM     ARM architecture is enabled.
        AVR32   AVR32 architecture is enabled.
        AX25    Appropriate AX.25 support is enabled.
        BLACKFIN Blackfin architecture is enabled.
@@@ -49,9 -48,7 +49,9 @@@
        EDD     BIOS Enhanced Disk Drive Services (EDD) is enabled
        EFI     EFI Partitioning (GPT) is enabled
        EIDE    EIDE/ATAPI support is enabled.
 +      EVM     Extended Verification Module
        FB      The frame buffer device is enabled.
 +      FTRACE  Function tracing enabled.
        GCOV    GCOV profiling is enabled.
        HW      Appropriate hardware is enabled.
        IA-64   IA-64 architecture is enabled.
@@@ -72,7 -69,6 +72,7 @@@
                        Documentation/m68k/kernel-options.txt.
        MCA     MCA bus support is enabled.
        MDA     MDA console support is enabled.
 +      MIPS    MIPS architecture is enabled.
        MOUSE   Appropriate mouse support is enabled.
        MSI     Message Signaled Interrupts (PCI).
        MTD     MTD (Memory Technology Device) support is enabled.
        SPARC   Sparc architecture is enabled.
        SWSUSP  Software suspend (hibernation) is enabled.
        SUSPEND System suspend states are enabled.
 -      FTRACE  Function tracing enabled.
        TPM     TPM drivers are enabled.
        TS      Appropriate touchscreen support is enabled.
        UMS     USB Mass Storage support is enabled.
        X86-64  X86-64 architecture is enabled.
                        More X86-64 boot options can be found in
                        Documentation/x86/x86_64/boot-options.txt .
 -      X86     Either 32bit or 64bit x86 (same as X86-32+X86-64)
 +      X86     Either 32-bit or 64-bit x86 (same as X86-32+X86-64)
        XEN     Xen support is enabled
  
  In addition, the following text indicates that the option:
@@@ -164,12 -161,7 +164,12 @@@ bytes respectively. Such letter suffixe
                        rsdt -- prefer RSDT over (default) XSDT
                        copy_dsdt -- copy DSDT to memory
  
 -                      See also Documentation/power/pm.txt, pci=noacpi
 +                      See also Documentation/power/runtime_pm.txt, pci=noacpi
 +
 +      acpi_rsdp=      [ACPI,EFI,KEXEC]
 +                      Pass the RSDP address to the kernel, mostly used
 +                      on machines running EFI runtime service to boot the
 +                      second kernel for kdump.
  
        acpi_apic_instance=     [ACPI, IOAPIC]
                        Format: <int>
                        behaviour to be specified.  Bit 0 enables warnings,
                        bit 1 enables fixups, and bit 2 sends a segfault.
  
+       align_va_addr=  [X86-64]
+                       Align virtual addresses by clearing slice [14:12] when
+                       allocating a VMA at process creation time. This option
+                       gives you up to 3% performance improvement on AMD F15h
+                       machines (where it is enabled by default) for a
+                       CPU-intensive style benchmark, and it can vary highly in
+                       a microbenchmark depending on workload and compiler.
+                       1: only for 32-bit processes
+                       2: only for 64-bit processes
+                       on: enable for both 32- and 64-bit processes
+                       off: disable for both 32- and 64-bit processes
        amd_iommu=      [HW,X86-84]
                        Pass parameters to the AMD IOMMU driver in the system.
                        Possible values are:
        amijoy.map=     [HW,JOY] Amiga joystick support
                        Map of devices attached to JOY0DAT and JOY1DAT
                        Format: <a>,<b>
 -                      See also Documentation/kernel/input/joystick.txt
 +                      See also Documentation/input/joystick.txt
  
        analog.map=     [HW,JOY] Analog joystick and gamepad support
                        Specifies type or capabilities of an analog joystick
        atkbd.softrepeat= [HW]
                        Use software keyboard repeat
  
 -      autotest        [IA64]
 +      autotest        [IA-64]
  
        baycom_epp=     [HW,AX25]
                        Format: <io>,<mode>
        bttv.radio=     Most important insmod options are available as
                        kernel args too.
        bttv.pll=       See Documentation/video4linux/bttv/Insmod-options
 -      bttv.tuner=     and Documentation/video4linux/bttv/CARDLIST
 +      bttv.tuner=
  
        bulk_remove=off [PPC]  This parameter disables the use of the pSeries
                        firmware feature for flushing multiple hpte entries
                        /proc/<pid>/coredump_filter.
                        See also Documentation/filesystems/proc.txt.
  
 +      cpuidle.off=1   [CPU_IDLE]
 +                      disable the cpuidle sub-system
 +
        cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
                        Format:
                        <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
                uart[8250],mmio32,<addr>[,options]
                        Start an early, polled-mode console on the 8250/16550
                        UART at the specified I/O port or MMIO address.
 -                      MMIO inter-register address stride is either 8bit (mmio)
 -                        or 32bit (mmio32).
 +                      MMIO inter-register address stride is either 8-bit
 +                      (mmio) or 32-bit (mmio32).
                        The options are the same as for ttyS, above.
  
        earlyprintk=    [X86,SH,BLACKFIN]
  
        elevator=       [IOSCHED]
                        Format: {"cfq" | "deadline" | "noop"}
 -                      See Documentation/block/as-iosched.txt and
 +                      See Documentation/block/cfq-iosched.txt and
                        Documentation/block/deadline-iosched.txt for details.
  
 -      elfcorehdr=     [IA64,PPC,SH,X86]
 +      elfcorehdr=     [IA-64,PPC,SH,X86]
                        Specifies physical address of start of kernel core
                        image elf header. Generally kexec loader will
                        pass this option to capture kernel.
                        This option is obsoleted by the "netdev=" option, which
                        has equivalent usage. See its documentation for details.
  
 +      evm=            [EVM]
 +                      Format: { "fix" }
 +                      Permit 'security.evm' to be updated regardless of
 +                      current integrity status.
 +
        failslab=
        fail_page_alloc=
        fail_make_request=[KNL]
                        General fault injection mechanism.
                        Format: <interval>,<probability>,<space>,<times>
 -                      See also /Documentation/fault-injection/.
 +                      See also Documentation/fault-injection/.
  
        floppy=         [HW]
                        See Documentation/blockdev/floppy.txt.
                        tracer at boot up. function-list is a comma separated
                        list of functions. This list can be changed at run
                        time by the set_ftrace_filter file in the debugfs
 -                      tracing directory. 
 +                      tracing directory.
  
        ftrace_notrace=[function-list]
                        [FTRACE] Do not trace the functions specified in
  
        hashdist=       [KNL,NUMA] Large hashes allocated during boot
                        are distributed across NUMA nodes.  Defaults on
 -                      for 64bit NUMA, off otherwise.
 +                      for 64-bit NUMA, off otherwise.
                        Format: 0 | 1 (for off | on)
  
        hcl=            [IA-64] SGI's Hardware Graph compatibility layer
                        DMA.
                forcedac [x86_64]
                        With this option iommu will not optimize to look
 -                      for io virtual address below 32 bit forcing dual
 +                      for io virtual address below 32-bit forcing dual
                        address cycle on pci bus for cards supporting greater
 -                      than 32 bit addressing. The default is to look
 -                      for translation below 32 bit and if not available
 +                      than 32-bit addressing. The default is to look
 +                      for translation below 32-bit and if not available
                        then look in the higher range.
                strict [Default Off]
                        With this option on every unmap_single operation will
                        has the capability. With this option, super page will
                        not be supported.
        intremap=       [X86-64, Intel-IOMMU]
 -                      Format: { on (default) | off | nosid }
                        on      enable Interrupt Remapping (default)
                        off     disable Interrupt Remapping
                        nosid   disable Source ID checking
 +                      no_x2apic_optout
 +                              BIOS x2APIC opt-out request will be ignored
  
 -      inttest=        [IA64]
 +      inttest=        [IA-64]
  
        iomem=          Disable strict checking of access to MMIO memory
                strict  regions from userspace.
                nomerge
                forcesac
                soft
 -              pt      [x86, IA64]
 +              pt      [x86, IA-64]
  
        io7=            [HW] IO7 for Marvel based alpha systems
                        See comment before marvel_specify_io7 in
  
        kvm-amd.npt=    [KVM,AMD] Disable nested paging (virtualized MMU)
                        for all guests.
 -                      Default is 1 (enabled) if in 64bit or 32bit-PAE mode
 -
 -      kvm-intel.bypass_guest_pf=
 -                      [KVM,Intel] Disables bypassing of guest page faults
 -                      on Intel chips. Default is 1 (enabled)
 +                      Default is 1 (enabled) if in 64-bit or 32-bit PAE mode.
  
        kvm-intel.ept=  [KVM,Intel] Disable extended page tables
                        (virtualized MMU) support on capable Intel chips.
                        libata.dma=0      Disable all PATA and SATA DMA
                        libata.dma=1      PATA and SATA Disk DMA only
                        libata.dma=2      ATAPI (CDROM) DMA only
 -                      libata.dma=4      Compact Flash DMA only 
 +                      libata.dma=4      Compact Flash DMA only
                        Combinations also work, so libata.dma=3 enables DMA
                        for disks and CDROMs, but not CFs.
 -      
 +
        libata.ignore_hpa=      [LIBATA] Ignore HPA limit
                        libata.ignore_hpa=0       keep BIOS limits (default)
                        libata.ignore_hpa=1       ignore limits, using full disk
        ltpc=           [NET]
                        Format: <io>,<irq>,<dma>
  
 -      machvec=        [IA64] Force the use of a particular machine-vector
 +      machvec=        [IA-64] Force the use of a particular machine-vector
                        (machvec) in a generic kernel.
                        Example: machvec=hpzx1_swiotlb
  
                        it is equivalent to "nosmp", which also disables
                        the IO APIC.
  
 -      max_loop=       [LOOP] Maximum number of loopback devices that can
 -                      be mounted
 -                      Format: <1-256>
 +      max_loop=       [LOOP] The number of loop block devices that get
 +      (loop.max_loop) unconditionally pre-created at init time. The default
 +                      number is configured by BLK_DEV_LOOP_MIN_COUNT. Instead
 +                      of statically allocating a predefined number, loop
 +                      devices can be requested on-demand with the
 +                      /dev/loop-control interface.
  
        mcatest=        [IA-64]
  
  
        nointroute      [IA-64]
  
 -      nojitter        [IA64] Disables jitter checking for ITC timers.
 +      nojitter        [IA-64] Disables jitter checking for ITC timers.
  
        no-kvmclock     [X86,KVM] Disable paravirtualized KVM clock driver
  
        no-kvmapf       [X86,KVM] Disable paravirtualized asynchronous page
                        fault handling.
  
 +      no-steal-acc    [X86,KVM] Disable paravirtualized steal time accounting.
 +                      steal time is computed, but won't influence scheduler
 +                      behaviour
 +
        nolapic         [X86-32,APIC] Do not enable or use the local APIC.
  
        nolapic_timer   [X86-32,APIC] Do not use the local APIC timer.
  
        nox2apic        [X86-64,APIC] Do not enable x2APIC mode.
  
 -      nptcg=          [IA64] Override max number of concurrent global TLB
 +      nptcg=          [IA-64] Override max number of concurrent global TLB
                        purges which is reported from either PAL_VM_SUMMARY or
                        SAL PALO.
  
                        See Documentation/sound/oss/oss-parameters.txt
  
        panic=          [KNL] Kernel behaviour on panic: delay <timeout>
 -                      seconds before rebooting
 +                      timeout > 0: seconds before rebooting
 +                      timeout = 0: wait forever
 +                      timeout < 0: reboot immediately
                        Format: <timeout>
  
        parkbd.port=    [HW] Parallel port number the keyboard adapter is
                        Format: { parport<nr> | timid | 0 }
                        See also Documentation/parport.txt.
  
 -      pmtmr=          [X86] Manual setup of pmtmr I/O Port. 
 +      pmtmr=          [X86] Manual setup of pmtmr I/O Port.
                        Override pmtimer IOPort with a hex value.
                        e.g. pmtmr=0x508
  
 -      pnp.debug       [PNP]
 -                      Enable PNP debug messages.  This depends on the
 -                      CONFIG_PNP_DEBUG_MESSAGES option.
 +      pnp.debug=1     [PNP]
 +                      Enable PNP debug messages (depends on the
 +                      CONFIG_PNP_DEBUG_MESSAGES option).  Change at run-time
 +                      via /sys/module/pnp/parameters/debug.  We always show
 +                      current resource usage; turning this on also shows
 +                      possible settings and some assignment information.
  
        pnpacpi=        [ACPI]
                        { off }
                        [HW,MOUSE] Controls Logitech smartscroll autorepeat.
                        0 = disabled, 1 = enabled (default).
  
 +      pstore.backend= Specify the name of the pstore backend to use
 +
        pt.             [PARIDE]
                        See Documentation/blockdev/paride.txt.
  
                        in <PAGE_SIZE> units (needed only for swap files).
                        See  Documentation/power/swsusp-and-swap-files.txt
  
 +      resumedelay=    [HIBERNATION] Delay (in seconds) to pause before attempting to
 +                      read the resume files
 +
 +      resumewait      [HIBERNATION] Wait (indefinitely) for resume device to show up.
 +                      Useful for devices that are detected asynchronously
 +                      (e.g. USB and MMC devices).
 +
        hibernate=      [HIBERNATION]
                noresume        Don't check if there's a hibernation image
                                present during boot.
        ro              [KNL] Mount root device read-only on boot
  
        root=           [KNL] Root filesystem
 +                      See name_to_dev_t comment in init/do_mounts.c.
  
        rootdelay=      [KNL] Delay (in seconds) to pause before attempting to
                        mount the root filesystem
                        Format: <integer>
  
        sonypi.*=       [HW] Sony Programmable I/O Control Device driver
 -                      See Documentation/sonypi.txt
 +                      See Documentation/laptops/sonypi.txt
  
        specialix=      [HW,SERIAL] Specialix multi-serial port adapter
                        See Documentation/serial/specialix.txt.
                        <port#>,<js1>,<js2>,<js3>,<js4>,<js5>,<js6>,<js7>
                        See also Documentation/input/joystick-parport.txt
  
 +      udbg-immortal   [PPC] When debugging early kernel crashes that
 +                      happen after console_init() and before a proper 
 +                      console driver takes over, this boot options might
 +                      help "seeing" what's going on.
 +
        uhash_entries=  [KNL,NET]
                        Set number of hash buckets for UDP/UDP-Lite connections
  
        unknown_nmi_panic
                        [X86] Cause panic on unknown NMI.
  
 +      usbcore.authorized_default=
 +                      [USB] Default USB device authorization:
 +                      (default -1 = authorized except for wireless USB,
 +                      0 = not authorized, 1 = authorized)
 +
        usbcore.autosuspend=
                        [USB] The autosuspend time delay (in seconds) used
                        for newly-detected USB devices (default 2).  This
                                        medium is write-protected).
                        Example: quirks=0419:aaf5:rl,0421:0433:rc
  
 +      user_debug=     [KNL,ARM]
 +                      Format: <int>
 +                      See arch/arm/Kconfig.debug help text.
 +                               1 - undefined instruction events
 +                               2 - system calls
 +                               4 - invalid data aborts
 +                               8 - SIGSEGV faults
 +                              16 - SIGBUS faults
 +                      Example: user_debug=31
 +
        userpte=
                        [X86] Flags controlling user PTE allocations.
  
        vmpoff=         [KNL,S390] Perform z/VM CP command after power off.
                        Format: <command>
  
 +      vsyscall=       [X86-64]
 +                      Controls the behavior of vsyscalls (i.e. calls to
 +                      fixed addresses of 0xffffffffff600x00 from legacy
 +                      code).  Most statically-linked binaries and older
 +                      versions of glibc use these calls.  Because these
 +                      functions are at fixed addresses, they make nice
 +                      targets for exploits that can control RIP.
 +
 +                      emulate     Vsyscalls turn into traps and are emulated
 +                                  reasonably safely.
 +
 +                      native      [default] Vsyscalls are native syscall
 +                                  instructions.
 +                                  This is a little bit faster than trapping
 +                                  and makes a few dynamic recompilers work
 +                                  better than they would in emulation mode.
 +                                  It also makes exploits much easier to write.
 +
 +                      none        Vsyscalls don't work at all.  This makes
 +                                  them quite hard to use for exploits but
 +                                  might break your system.
 +
        vt.cur_default= [VT] Default cursor shape.
                        Format: 0xCCBBAA, where AA, BB, and CC are the same as
                        the parameters of the <Esc>[?A;B;Cc escape sequence;
index 62184390a60121ec74465ae5e17d01be86853f4a,8ed394a8eb6e49ba1f6f4c9a2ae28b184a955a63..ec63df54d1388618ad2deaf843d53ac72b3068e1
@@@ -21,7 -21,7 +21,7 @@@
  #include <linux/topology.h>
  #include <linux/cpumask.h>
  #include <asm/pgtable.h>
 -#include <asm/atomic.h>
 +#include <linux/atomic.h>
  #include <asm/proto.h>
  #include <asm/setup.h>
  #include <asm/apic.h>
@@@ -681,6 -681,9 +681,9 @@@ static void __init early_identify_cpu(s
        filter_cpuid_features(c, false);
  
        setup_smep(c);
+       if (this_cpu->c_bsp_init)
+               this_cpu->c_bsp_init(c);
  }
  
  void __init early_cpu_init(void)
diff --combined arch/x86/vdso/vma.c
index 316fbca3490e98afe758d7a4e535eaecd4482a8f,caa42ce17577c4763f4a3f1775cb3a4445e3cc89..153407c35b75bda37e2b5d2675d3abb6280cc9cd
  #include <asm/vgtod.h>
  #include <asm/proto.h>
  #include <asm/vdso.h>
 +#include <asm/page.h>
  
  unsigned int __read_mostly vdso_enabled = 1;
  
  extern char vdso_start[], vdso_end[];
  extern unsigned short vdso_sync_cpuid;
  
 -static struct page **vdso_pages;
 +extern struct page *vdso_pages[];
  static unsigned vdso_size;
  
 -static int __init init_vdso_vars(void)
 +static void __init patch_vdso(void *vdso, size_t len)
 +{
 +      Elf64_Ehdr *hdr = vdso;
 +      Elf64_Shdr *sechdrs, *alt_sec = 0;
 +      char *secstrings;
 +      void *alt_data;
 +      int i;
 +
 +      BUG_ON(len < sizeof(Elf64_Ehdr));
 +      BUG_ON(memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0);
 +
 +      sechdrs = (void *)hdr + hdr->e_shoff;
 +      secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
 +
 +      for (i = 1; i < hdr->e_shnum; i++) {
 +              Elf64_Shdr *shdr = &sechdrs[i];
 +              if (!strcmp(secstrings + shdr->sh_name, ".altinstructions")) {
 +                      alt_sec = shdr;
 +                      goto found;
 +              }
 +      }
 +
 +      /* If we get here, it's probably a bug. */
 +      pr_warning("patch_vdso: .altinstructions not found\n");
 +      return;  /* nothing to patch */
 +
 +found:
 +      alt_data = (void *)hdr + alt_sec->sh_offset;
 +      apply_alternatives(alt_data, alt_data + alt_sec->sh_size);
 +}
 +
 +static int __init init_vdso(void)
  {
        int npages = (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE;
        int i;
  
 +      patch_vdso(vdso_start, vdso_end - vdso_start);
 +
        vdso_size = npages << PAGE_SHIFT;
 -      vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
 -      if (!vdso_pages)
 -              goto oom;
 -      for (i = 0; i < npages; i++) {
 -              struct page *p;
 -              p = alloc_page(GFP_KERNEL);
 -              if (!p)
 -                      goto oom;
 -              vdso_pages[i] = p;
 -              copy_page(page_address(p), vdso_start + i*PAGE_SIZE);
 -      }
 +      for (i = 0; i < npages; i++)
 +              vdso_pages[i] = virt_to_page(vdso_start + i*PAGE_SIZE);
  
        return 0;
 -
 - oom:
 -      printk("Cannot allocate vdso\n");
 -      vdso_enabled = 0;
 -      return -ENOMEM;
  }
 -subsys_initcall(init_vdso_vars);
 +subsys_initcall(init_vdso);
  
  struct linux_binprm;
  
@@@ -89,6 -69,15 +89,15 @@@ static unsigned long vdso_addr(unsigne
        addr = start + (offset << PAGE_SHIFT);
        if (addr >= end)
                addr = end;
+       /*
+        * page-align it here so that get_unmapped_area doesn't
+        * align it wrongfully again to the next page. addr can come in 4K
+        * unaligned here as a result of stack start randomization.
+        */
+       addr = PAGE_ALIGN(addr);
+       addr = align_addr(addr, NULL, ALIGN_VDSO);
        return addr;
  }