1. 07 1月, 2012 1 次提交
  2. 11 5月, 2011 1 次提交
  3. 18 11月, 2010 1 次提交
    • M
      x86: Add NX protection for kernel data · 5bd5a452
      Matthieu Castet 提交于
      This patch expands functionality of CONFIG_DEBUG_RODATA to set main
      (static) kernel data area as NX.
      
      The following steps are taken to achieve this:
      
       1. Linker script is adjusted so .text always starts and ends on a page bound
       2. Linker script is adjusted so .rodata always start and end on a page boundary
       3. NX is set for all pages from _etext through _end in mark_rodata_ro.
       4. free_init_pages() sets released memory NX in arch/x86/mm/init.c
       5. bios rom is set to x when pcibios is used.
      
      The results of patch application may be observed in the diff of kernel page
      table dumps:
      
      pcibios:
      
       -- data_nx_pt_before.txt       2009-10-13 07:48:59.000000000 -0400
       ++ data_nx_pt_after.txt        2009-10-13 07:26:46.000000000 -0400
        0x00000000-0xc0000000           3G                           pmd
        ---[ Kernel Mapping ]---
       -0xc0000000-0xc0100000           1M     RW             GLB x  pte
       +0xc0000000-0xc00a0000         640K     RW             GLB NX pte
       +0xc00a0000-0xc0100000         384K     RW             GLB x  pte
       -0xc0100000-0xc03d7000        2908K     ro             GLB x  pte
       +0xc0100000-0xc0318000        2144K     ro             GLB x  pte
       +0xc0318000-0xc03d7000         764K     ro             GLB NX pte
       -0xc03d7000-0xc0600000        2212K     RW             GLB x  pte
       +0xc03d7000-0xc0600000        2212K     RW             GLB NX pte
        0xc0600000-0xf7a00000         884M     RW         PSE GLB NX pmd
        0xf7a00000-0xf7bfe000        2040K     RW             GLB NX pte
        0xf7bfe000-0xf7c00000           8K                           pte
      
      No pcibios:
      
       -- data_nx_pt_before.txt       2009-10-13 07:48:59.000000000 -0400
       ++ data_nx_pt_after.txt        2009-10-13 07:26:46.000000000 -0400
        0x00000000-0xc0000000           3G                           pmd
        ---[ Kernel Mapping ]---
       -0xc0000000-0xc0100000           1M     RW             GLB x  pte
       +0xc0000000-0xc0100000           1M     RW             GLB NX pte
       -0xc0100000-0xc03d7000        2908K     ro             GLB x  pte
       +0xc0100000-0xc0318000        2144K     ro             GLB x  pte
       +0xc0318000-0xc03d7000         764K     ro             GLB NX pte
       -0xc03d7000-0xc0600000        2212K     RW             GLB x  pte
       +0xc03d7000-0xc0600000        2212K     RW             GLB NX pte
        0xc0600000-0xf7a00000         884M     RW         PSE GLB NX pmd
        0xf7a00000-0xf7bfe000        2040K     RW             GLB NX pte
        0xf7bfe000-0xf7c00000           8K                           pte
      
      The patch has been originally developed for Linux 2.6.34-rc2 x86 by
      Siarhei Liakh <sliakh.lkml@gmail.com> and Xuxian Jiang <jiang@cs.ncsu.edu>.
      
       -v1:  initial patch for 2.6.30
       -v2:  patch for 2.6.31-rc7
       -v3:  moved all code into arch/x86, adjusted credits
       -v4:  fixed ifdef, removed credits from CREDITS
       -v5:  fixed an address calculation bug in mark_nxdata_nx()
       -v6:  added acked-by and PT dump diff to commit log
       -v7:  minor adjustments for -tip
       -v8:  rework with the merge of "Set first MB as RW+NX"
      Signed-off-by: NSiarhei Liakh <sliakh.lkml@gmail.com>
      Signed-off-by: NXuxian Jiang <jiang@cs.ncsu.edu>
      Signed-off-by: NMatthieu CASTET <castet.matthieu@free.fr>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: James Morris <jmorris@namei.org>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Kees Cook <kees.cook@canonical.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <4CE2F82E.60601@free.fr>
      [ minor cleanliness edits ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5bd5a452
  4. 18 10月, 2010 1 次提交
  5. 18 8月, 2010 1 次提交
  6. 13 3月, 2010 2 次提交
  7. 20 2月, 2010 1 次提交
    • T
      x86: Move pci init function to x86_init · b72d0db9
      Thomas Gleixner 提交于
      The PCI initialization in pci_subsys_init() is a mess. pci_numaq_init,
      pci_acpi_init, pci_visws_init and pci_legacy_init are called and each
      implementation checks and eventually modifies the global variable
      pcibios_scanned.
      
      x86_init functions allow us to do this more elegant. The pci.init
      function pointer is preset to pci_legacy_init. numaq, acpi and visws
      can modify the pointer in their early setup functions. The functions
      return 0 when they did the full initialization including bus scan. A
      non zero return value indicates that pci_legacy_init needs to be
      called either because the selected function failed or wants the
      generic bus scan in pci_legacy_init to happen (e.g. visws).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <43F901BD926A4E43B106BF17856F07559FB80CFE@orsmsx508.amr.corp.intel.com>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NJacob Pan <jacob.jun.pan@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      b72d0db9
  8. 11 2月, 2010 1 次提交
  9. 18 9月, 2009 1 次提交
  10. 10 9月, 2009 1 次提交
  11. 02 7月, 2009 1 次提交
  12. 12 6月, 2009 1 次提交
  13. 03 4月, 2009 1 次提交
    • J
      x86/dma: unify definition of pci_unmap_addr* and pci_unmap_len macros · 67796bf7
      Joerg Roedel 提交于
      Impact: unification of pci-dma macros and pci_32.h removal
      
      This patch unifies the definition of the pci_unmap_addr*, pci_unmap_len*
      and DECLARE_PCI_UNMAP* macros. This makes sense because the pci_unmap
      functions are no longer no-ops anymore when the kernel runs with
      CONFIG_DMA_API_DEBUG. Without an iommu or DMA_API_DEBUG it is a no-op on 32 bit
      because the dma mapping path returns a physical address and therefore the
      dma-api implementation has no internal state which needs to be destroyed with
      an unmap call.
      This unification also simplifies the port of x86_64 iommu drivers to 32 bit x86
      and let us get rid of pci_32.h.
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Acked-by: NStephen Hemminger <shemminger@vyatta.com>
      67796bf7
  14. 20 3月, 2009 1 次提交
    • M
      PCI/MSI: Use #ifdefs instead of weak functions · 11df1f05
      Michael Ellerman 提交于
      Weak functions aren't all they're cracked up to be. They lead to
      incorrect binaries with some toolchains, they require us to have empty
      functions we otherwise wouldn't, and the unused code is not elided
      (as of gcc 4.3.2 anyway).
      
      So replace the weak MSI arch hooks with the #define foo foo idiom. We no
      longer need empty versions of arch_setup/teardown_msi_irq().
      
      This is less source (by 1 line!), and results in smaller binaries too:
      
         text	   data	    bss	    dec	    hex	filename
      9354300	1693916	 678424	11726640 b2ef30	build/powerpc/vmlinux-before
      9354052	1693852	 678424	11726328 b2edf8	build/powerpc/vmlinux-after
      
      Also smaller on x86_64 and arm (iop13xx).
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      11df1f05
  15. 13 3月, 2009 1 次提交
  16. 26 12月, 2008 1 次提交
  17. 18 12月, 2008 1 次提交
  18. 23 10月, 2008 2 次提交
  19. 23 7月, 2008 1 次提交
    • V
      x86: consolidate header guards · 77ef50a5
      Vegard Nossum 提交于
      This patch is the result of an automatic script that consolidates the
      format of all the headers in include/asm-x86/.
      
      The format:
      
      1. No leading underscore. Names with leading underscores are reserved.
      2. Pathname components are separated by two underscores. So we can
         distinguish between mm_types.h and mm/types.h.
      3. Everything except letters and numbers are turned into single
         underscores.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      77ef50a5
  20. 19 7月, 2008 1 次提交
    • S
      x86, pci: introduce config option for pci reroute quirks (was: [PATCH 0/3]... · 41b9eb26
      Stefan Assmann 提交于
      x86, pci: introduce config option for pci reroute quirks (was: [PATCH 0/3] Boot IRQ quirks for Broadcom and AMD/ATI)
      
      This is against linux-2.6-tip, branch pci-ioapic-boot-irq-quirks.
      
      From: Stefan Assmann <sassmann@suse.de>
      Subject: Introduce config option for pci reroute quirks
      
      The config option X86_REROUTE_FOR_BROKEN_BOOT_IRQS is introduced to
      enable (or disable) the redirection of the interrupt handler to the boot
      interrupt line by default. Depending on the existence of interrupt
      masking / threaded interrupt handling in the kernel (vanilla, rt, ...)
      and the maturity of the rerouting patch, users can enable or disable the
      redirection by default.
      
      This means that the reroute quirk can be applied to any kernel without
      changing it.
      
      Interrupt sharing could be increased if this option is enabled. However this
      option is vital for threaded interrupt handling, as done by the RT kernel.
      It should simplify the consolidation with the RT kernel.
      
      The option can be overridden by either pci=ioapicreroute or
      pci=noioapicreroute.
      Signed-off-by: NStefan Assmann <sassmann@suse.de>
      Signed-off-by: NOlaf Dabrunz <od@suse.de>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Ihno Krumreich <ihno@suse.de>
      Cc: Sven Dietrich <sdietrich@suse.de>
      Cc: Daniel Gollub <dgollub@suse.de>
      Cc: Felix Foerster <ffoerster@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      41b9eb26
  21. 08 7月, 2008 3 次提交
  22. 27 4月, 2008 1 次提交
    • Y
      x86: get mp_bus_to_node early · 871d5f8d
      Yinghai Lu 提交于
      Currently, on an amd k8 system with multi ht chains, the numa_node of
      pci devices under /sys/devices/pci0000:80/* is always 0, even if that
      chain is on node 1 or 2 or 3.
      
      Workaround: pcibus_to_node(bus) is used when we want to get the node that
      pci_device is on.
      
      In struct device, we already have numa_node member, and we could use
      dev_to_node()/set_dev_node() to get and set numa_node in the device.
      set_dev_node is called in pci_device_add() with pcibus_to_node(bus),
      and pcibus_to_node uses bus->sysdata for nodeid.
      
      The problem is when pci_add_device is called, bus->sysdata is not assigned
      correct nodeid yet. The result is that numa_node will always be 0.
      
      pcibios_scan_root and pci_scan_root could take sysdata. So we need to get
      mp_bus_to_node mapping before these two are called, and thus
      get_mp_bus_to_node could get correct node for sysdata in root bus.
      
      In scanning of the root bus, all child busses will take parent bus sysdata.
      So all pci_device->dev.numa_node will be assigned correctly and automatically.
      
      Later we could use dev_to_node(&pci_dev->dev) to get numa_node, and we
      could also could make other bus specific device get the correct numa_node
      too.
      
      This is an updated version of pci_sysdata and Jeff's pci_domain patch.
      
      [ mingo@elte.hu: build fix ]
      Signed-off-by: NYinghai Lu <yinghai.lu@sun.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      871d5f8d
  23. 17 4月, 2008 1 次提交
  24. 30 1月, 2008 2 次提交
  25. 13 10月, 2007 1 次提交
  26. 11 10月, 2007 1 次提交