1. 01 2月, 2008 3 次提交
    • H
      x86: c_p_a clflush_cache_range fix · d4387bd3
      Huang, Ying 提交于
      Because in i386 early boot stage, boot_cpu_data may be not available,
      which makes clflush_cach_range() into infinite loop, which is called
      by change_page_attr(). This patch fixes this by setting
      boot_cpu_data.x86_clflush_size in early_cpu_detect().
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d4387bd3
    • H
      x86: change_page_attr_clear fix · 5827040d
      Huang, Ying 提交于
      This patch replaces __change_page_attr_set_clr() with
      change_page_attr_set_clr() in change_page_attr_clear() to flush the
      TLB/cache properly.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5827040d
    • H
      x86: fix sparse warnings in intel_cacheinfo.c · c1666e66
      Harvey Harrison 提交于
      arch/x86/kernel/cpu/intel_cacheinfo.c:355:7: warning: symbol 'i' shadows an earlier one
      arch/x86/kernel/cpu/intel_cacheinfo.c:296:39: originally declared here
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:18: warning: incorrect type in argument 2 (different signedness)
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:18:    expected unsigned int *eax
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:18:    got int *
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:28: warning: incorrect type in argument 3 (different signedness)
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:28:    expected unsigned int *ebx
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:28:    got int *
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:38: warning: incorrect type in argument 4 (different signedness)
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:38:    expected unsigned int *ecx
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:38:    got int *
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:48: warning: incorrect type in argument 5 (different signedness)
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:48:    expected unsigned int *edx
      arch/x86/kernel/cpu/intel_cacheinfo.c:367:48:    got int *
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c1666e66
  2. 31 1月, 2008 24 次提交
  3. 30 1月, 2008 13 次提交
    • A
      KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM · fb56dbb3
      Avi Kivity 提交于
      Currently, make headers_check barfs due to <asm/kvm.h>, which <linux/kvm.h>
      includes, not existing.  Rather than add a zillion <asm/kvm.h>s, export kvm.h
      only if the arch actually supports it.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      fb56dbb3
    • Y
      x86: fix nodemap_size according to nodeid bits · afadcd78
      Yinghai Lu 提交于
      memnode.map is s16 array because of nodeid is 16 bit now.
      
      so need to increase the nodemap_size according to that bits.
      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>
      afadcd78
    • Y
      x86: fix overlap between pagetable with bss section · 91987157
      Yinghai Lu 提交于
      one early crash on one 8 node 256g machine:
      
      Command line: console=uart8250,io,0x3f8,115200n8 initrd=kernel.org/mydisk11_x86_64.gz rw root=/dev/ram0 debug initcall_debug apic=debug acpi.debug_level=0x0000000f pci=routeirq ip=dhcp load_ramdisk=1 ramdisk_size=131072 BOOT_IMAGE=kernel.org/bzImage_2.6.25_k8.1
      BIOS-provided physical RAM map:
       BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
       BIOS-e820: 000000000009bc00 - 00000000000a0000 (reserved)
       BIOS-e820: 00000000000e6000 - 0000000000100000 (reserved)
       BIOS-e820: 0000000000100000 - 00000000dffe0000 (usable)
       BIOS-e820: 00000000dffe0000 - 00000000dffee000 (ACPI data)
       BIOS-e820: 00000000dffee000 - 00000000dffff050 (ACPI NVS)
       BIOS-e820: 00000000dffff050 - 00000000e0000000 (reserved)
       BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
       BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
       BIOS-e820: 00000000ff700000 - 0000000100000000 (reserved)
       BIOS-e820: 0000000100000000 - 0000004020000000 (usable)
      Early serial console at I/O port 0x3f8 (options '115200n8')
      console [uart0] enabled
      end_pfn_map = 67239936
      Kernel panic - not syncing: Duplicated early reservation d40000-e42000
      
      Pid: 0, comm: swapper Not tainted 2.6.24-smp-g5a514e21-dirty #3
      
      Call Trace:
       [<ffffffff80221545>] lapic_get_maxlvt+0x0/0x10
       [<ffffffff80221657>] clear_local_APIC+0x5/0xcf
       [<ffffffff80221726>] disable_local_APIC+0x5/0x17
       [<ffffffff8021fe16>] smp_send_stop+0x46/0x4c
       [<ffffffff80235293>] panic+0x94/0x13e
       [<ffffffff80bc3b03>] sctp_eps_proc_init+0x12/0x34
       [<ffffffff80b9f1c5>] reserve_early+0x30/0x6c
       [<ffffffff80803925>] init_memory_mapping+0x2cd/0x2dc
       [<ffffffff80b9dc01>] setup_arch+0x21f/0x44e
       [<ffffffff80b978be>] start_kernel+0x6f/0x2c7
       [<ffffffff80b971cc>] _sinittext+0x1cc/0x1d3
      
      it turns out there is overlap between pgtable and bss...
      
      in System.map we have
      ffffffff80d40420 b rsi_table
      ffffffff80d40620 B krb5_seq_lock
      ffffffff80d40628 b i.20437
      ffffffff80d40630 b xprt_rdma_inline_write_padding
      ffffffff80d40638 b sunrpc_table_header
      ffffffff80d40640 b zero
      ffffffff80d40644 b min_memreg
      ffffffff80d40648 b rpcrdma_tk_lock_g
      ffffffff80d40650 B sctp_assocs_id_lock
      ffffffff80d40658 B proc_net_sctp
      ffffffff80d40660 B sctp_assocs_id
      ffffffff80d40680 B sysctl_sctp_mem
      ffffffff80d40690 B sysctl_sctp_rmem
      ffffffff80d406a0 B sysctl_sctp_wmem
      ffffffff80d406b0 b sctp_ctl_socket
      ffffffff80d406b8 b sctp_pf_inet6_specific
      ffffffff80d406c0 b sctp_pf_inet_specific
      ffffffff80d406c8 b sctp_af_v4_specific
      ffffffff80d406d0 b sctp_af_v6_specific
      ffffffff80d406d8 b sctp_rand.33270
      ffffffff80d406dc b sctp_memory_pressure
      ffffffff80d406e0 b sctp_sockets_allocated
      ffffffff80d406e4 b sctp_memory_allocated
      ffffffff80d406e8 b sctp_sysctl_header
      ffffffff80d406f0 b zero
      ffffffff80d406f4 A __bss_stop
      ffffffff80d406f4 A _end
      
      need to round up table_start to PAGE_SIZE.
      
      also make the panic more informative.
      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>
      91987157
    • J
      x86: add PCI IDs to k8topology_64.c · bb4a1d64
      Joachim Deguara 提交于
      This just adds the PCI IDs of AMD's family 10h and 11h CPU's northbridges to
      k8topology discovery.
      Signed-off-by: NJoachim Deguara <joachim.deguara@amd.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Acked-by: NYinghai Lu <yinghai.lu@sun.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      bb4a1d64
    • J
      x86: fix early_ioremap pagetable ops · f6df72e7
      Jeremy Fitzhardinge 提交于
      Put appropriate pagetable update hooks in so that paravirt knows
      what's going on in there.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f6df72e7
    • J
      x86: use the same pgd_list for PAE and 64-bit · e3ed910d
      Jeremy Fitzhardinge 提交于
      Use a standard list threaded through page->lru for maintaining the pgd
      list on PAE.  This is the same as 64-bit, and seems saner than using a
      non-standard list via page->index.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      e3ed910d
    • B
      x86: early boot debugging via FireWire (ohci1394_dma=early) · f212ec4b
      Bernhard Kaindl 提交于
      This patch adds a new configuration option, which adds support for a new
      early_param which gets checked in arch/x86/kernel/setup_{32,64}.c:setup_arch()
      to decide wether OHCI-1394 FireWire controllers should be initialized and
      enabled for physical DMA access to allow remote debugging of early problems
      like issues ACPI or other subsystems which are executed very early.
      
      If the config option is not enabled, no code is changed, and if the boot
      paramenter is not given, no new code is executed, and independent of that,
      all new code is freed after boot, so the config option can be even enabled
      in standard, non-debug kernels.
      
      With specialized tools, it is then possible to get debugging information
      from machines which have no serial ports (notebooks) such as the printk
      buffer contents, or any data which can be referenced from global pointers,
      if it is stored below the 4GB limit and even memory dumps of of the physical
      RAM region below the 4GB limit can be taken without any cooperation from the
      CPU of the host, so the machine can be crashed early, it does not matter.
      
      In the extreme, even kernel debuggers can be accessed in this way. I wrote
      a small kgdb module and an accompanying gdb stub for FireWire which allows
      to gdb to talk to kgdb using remote remory reads and writes over FireWire.
      
      An version of the gdb stub fore FireWire is able to read all global data
      from a system which is running a a normal kernel without any kernel debugger,
      without any interruption or support of the system's CPU. That way, e.g. the
      task struct and so on can be read and even manipulated when the physical DMA
      access is granted.
      
      A HOWTO is included in this patch, in Documentation/debugging-via-ohci1394.txt
      and I've put a copy online at
      ftp://ftp.suse.de/private/bk/firewire/docs/debugging-via-ohci1394.txt
      
      It also has links to all the tools which are available to make use of it
      another copy of it is online at:
      ftp://ftp.suse.de/private/bk/firewire/kernel/ohci1394_dma_early-v2.diffSigned-Off-By: NBernhard Kaindl <bk@suse.de>
      Tested-By: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f212ec4b
    • J
      x86: don't special-case pmd allocations as much · 6194ba6f
      Jeremy Fitzhardinge 提交于
      In x86 PAE mode, stop treating pmds as a special case.  Previously
      they were always allocated and freed with the pgd.  The modifies the
      code to be the same as 64-bit mode, where they are allocated on
      demand.
      
      This is a step on the way to unifying 32/64-bit pagetable allocation
      as much as possible.
      
      There is a complicating wart, however.  When you install a new
      reference to a pmd in the pgd, the processor isn't guaranteed to see
      it unless you reload cr3.  Since reloading cr3 also has the
      side-effect of flushing the tlb, this is an expense that we want to
      avoid whereever possible.
      
      This patch simply avoids reloading cr3 unless the update is to the
      current pagetable.  Later patches will optimise this further.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: William Irwin <wli@holomorphy.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      6194ba6f
    • H
      x86: shrink some ifdefs in fault.c · fd40d6e3
      Harvey Harrison 提交于
      The change from current to tsk in do_page_fault is safe as
      this is set at the very beginning of the function.
      
      Removes a likely() annotation from the 64-bit version, this
      could have instead been added to 32-bit.
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      fd40d6e3
    • J
      x86: ignore spurious faults · 5b727a3b
      Jeremy Fitzhardinge 提交于
      When changing a kernel page from RO->RW, it's OK to leave stale TLB
      entries around, since doing a global flush is expensive and they pose
      no security problem.  They can, however, generate a spurious fault,
      which we should catch and simply return from (which will have the
      side-effect of reloading the TLB to the current PTE).
      
      This can occur when running under Xen, because it frequently changes
      kernel pages from RW->RO->RW to implement Xen's pagetable semantics.
      It could also occur when using CONFIG_DEBUG_PAGEALLOC, since it avoids
      doing a global TLB flush after changing page permissions.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Harvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      5b727a3b
    • H
      x86: remove nx_enabled from fault.c · b406ac61
      Harvey Harrison 提交于
      On !PAE 32-bit, _PAGE_NX will be 0, making is_prefetch always
      return early.  The test is sufficient on PAE as __supported_pte_mask
      is updated in the same places as nx_enabled in init_32.c which also
      takes disable_nx into account.
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b406ac61
    • H
      x86: unify fault_32|64.c · c61e211d
      Harvey Harrison 提交于
      Unify includes in moved fault.c.
      
      Modify Makefiles to pick up unified file.
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      c61e211d
    • H
      x86: unify fault_32|64.c with ifdefs · f8c2ee22
      Harvey Harrison 提交于
      Elimination of these ifdefs can be done in a unified file.
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f8c2ee22