1. 28 3月, 2006 6 次提交
  2. 27 3月, 2006 16 次提交
    • A
      [PATCH] bitops: i386: use generic bitops · 1cc2b994
      Akinobu Mita 提交于
      - remove generic_fls64()
      - remove sched_find_first_bit()
      - remove generic_hweight{32,16,8}()
      - remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()
      - remove minix_{test,set,test_and_clear,test,find_first_zero}_bit()
      Signed-off-by: NAkinobu Mita <mita@miraclelinux.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1cc2b994
    • P
      [PATCH] kprobes: fix broken fault handling for i386 · b4026513
      Prasanna S Panchamukhi 提交于
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      Signed-off-by: NPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b4026513
    • B
      [PATCH] kprobe handler: discard user space trap · 2326c770
      bibo,mao 提交于
      Currently kprobe handler traps only happen in kernel space, so function
      kprobe_exceptions_notify should skip traps which happen in user space.
      This patch modifies this, and it is based on 2.6.16-rc4.
      Signed-off-by: Nbibo mao <bibo.mao@intel.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
      Cc: <hiramatu@sdl.hitachi.co.jp>
      Signed-off-by: NPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2326c770
    • B
      [PATCH] kretprobe instance recycled by parent process · c6fd91f0
      bibo mao 提交于
      When kretprobe probes the schedule() function, if the probed process exits
      then schedule() will never return, so some kretprobe instances will never
      be recycled.
      
      In this patch the parent process will recycle retprobe instances of the
      probed function and there will be no memory leak of kretprobe instances.
      Signed-off-by: Nbibo mao <bibo.mao@intel.com>
      Cc: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c6fd91f0
    • M
      [PATCH] kretprobe: kretprobe-booster · c9becf58
      Masami Hiramatsu 提交于
      In normal operation, kretprobe makes a target function return to trampoline
      code.  A kprobe (called trampoline_probe) has been inserted in the trampoline
      code.  When the kernel hits this kprobe, it calls kretprobe's handler and it
      returns to the original return address.
      
      Kretprobe-booster removes the trampoline_probe.  It allows the trampoline code
      to call kretprobe's handler directly instead of invoking kprobe.  The
      trampoline code returns to the original return address.
      
      (changelog from Chuck Ebbert <76306.1226@compuserve.com> - thanks ;))
      Signed-off-by: NMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Chuck Ebbert <76306.1226@compuserve.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c9becf58
    • M
      [PATCH] x86: kprobes-booster · 311ac88f
      Masami Hiramatsu 提交于
      Current kprobe copies the original instruction at the probe point and replaces
      it with a breakpoint instruction (int3).  When the kernel hits the probe
      point, kprobe handler is invoked.  And the copied instruction is single-step
      executed on the copied buffer (not on the original address) by kprobe.  After
      that, the kprobe checks registers and modify it (if need) as if the
      instructions was executed on the original address.
      
      My proposal is based on the fact there are many instructions which do NOT
      require the register modification after the single-step execution.  When the
      copied instruction is a kind of them, kprobe just jumps back to the next
      instruction after single-step execution.  If so, why don't we execute those
      instructions directly?
      
      With kprobe-booster patch, kprobes will execute a copied instruction directly
      and (if need) jump back to original code.  This direct execution is executed
      when the kprobe don't have both post_handler and break_handler, and the copied
      instruction can be executed directly.
      
      I sorted instructions which can be executed directly or not;
      
      - Call instructions are NG(can not be executed directly).
        We should correct the return address pushed into top of stack.
      - Indirect instructions except for absolute indirect-jumps
        are NG. Those instructions changes EIP randomly. We should
        check EIP and correct it.
      - Instructions that change EIP beyond the range of the
        instruction buffer are NG.
      - Instructions that change EIP to tail 5 bytes of the
        instruction buffer (it is the size of a jump instruction).
        We must write a jump instruction which backs to original
        kernel code in the instruction buffer.
      - Break point instruction is NG. We should not touch EIP and
        pass to other handlers.
      - Absolute direct/indirect jumps are OK.- Conditional Jumps are NG.
      - Halt and software-interruptions are NG. Because it will stay on
        the instruction buffer of kprobes.
      - Prefixes are NG.
      - Unknown/reserved opcode is NG.
      - Other 1 byte instructions are OK. But those instructions need a
        jump back code.
      - 2 bytes instructions are mapped sparsely. So, in this release,
        this patch don't boost those instructions.
      
      >From Intel's IA-32 opcode map described in IA-32 Intel Architecture Software
      Developer's Manual Vol.2 B, I determined that following opcodes are not
      boostable.
      
      - 0FH (2byte escape)
      - 70H - 7FH (Jump on condition)
      - 9AH (Call) and 9CH (Pushf)
      - C0H-C1H (Grp 2: includes reserved opcode)
      - C6H-C7H (Grp11: includes reserved opcode)
      - CCH-CEH (Software-interrupt)
      - D0H-D3H (Grp2: includes reserved opcode)
      - D6H (Reserved)
      - D8H-DFH (Coprocessor)
      - E0H-E3H (loop/conditional jump)
      - E8H (Call)
      - F0H-F3H (Prefixes and reserved)
      - F4H (Halt)
      - F6H-F7H (Grp3: includes reserved opcode)
      - FEH-FFH(Grp4,5: includes reserved opcode)
      
      Kprobe-booster checks whether target instruction can be boosted (can be
      executed directly) at arch_copy_kprobe() function.  If the target instruction
      can be boosted, it clears "boostable" flag.  If not, it sets "boostable" flag
      -1.  This is disabled status.  In resume_execution() function, If "boostable"
      flag is cleared, kprobe-booster measures the size of the target instruction
      and sets "boostable" flag 1.
      
      In kprobe_handler(), kprobe checks the "boostable" flag.  If the flag is 1, it
      resets current kprobe and executes instruction buffer directly instead of
      single stepping.
      
      When unregistering a boosted kprobe, it calls synchronize_sched()
      after "int3" is removed. So we can ensure followings after
      the synchronize_sched() called.
      - interrupt handlers are finished on all CPUs.
      - instruction buffer is not executed on all CPUs.
      And we can release the boosted kprobe safely.
      
      And also, on preemptible kernel, the booster is not enabled where the kernel
      preemption is enabled.  So, there are no preempted threads on the instruction
      buffer.
      
      The description of kretprobe-booster:
      ====================================
      
      In the normal operation, kretprobe make a target function return to trampoline
      code.  And a kprobe (called trampoline_probe) have been inserted at the
      trampoline code.  When the kernel hits this kprobe, it calls kretprobe's
      handler and it returns to original return address.
      
      Kretprobe-booster patch removes the trampoline_probe.  It allows the
      trampoline code to call kretprobe's handler directly instead of invoking
      kprobe.  And tranpoline code returns to original return address.
      
      This new trampoline code stores and restores registers, so the kretprobe
      handler is still able to access those registers.
      
      Current kprobe has about 1.3 usec/probe(*) overhead, and kprobe-booster patch
      reduces it to 0.6 usec/probe(*).  Also current kretprobe has about 2.0
      usec/probe(*) overhead.  Kprobe-booster patch reduces it to 1.3 usec/probe(*),
      and the combination of both kprobe-booster patch and kretprobe-booster patch
      reduces it to 0.9 usec/probe(*).
      
      I expect the combination of both patches can reduce half of a probing
      overhead.
      
      Performance numbers strongly depend on the processor model.
      
      Andrew Morton wrote:
      > These preempt tricks look rather nasty.  Can you please describe what the
      > problem is, precisely?  And how this code avoids it?  Perhaps we can find
      > something cleaner.
      
      The problem is how to remove the copied instructions of the
      kprobe *safely* on the preemptable kernel (CONFIG_PREEMPT=y).
      
      Kprobes basically executes the following actions;
      
      (1)int3
      (2)preempt_disable()
      (3)kprobe_prehandler()
      (4)copied instructioin(single step)
      (5)kprobe_posthandler()
      (6)preempt_enable()
      (7)return to the original code
      
      During the execution of copied instruction, preemption is
      disabled (from step (2) to (6)).
      When unregistering the probes, Kprobe waits for RCU
      quiescent state by using synchronize_sched() after removing
      int3 instruction.
      Thus we can ensure the copied instruction is not executed.
      
      On the other hand, kprobe-booster executes the following actions;
      
      (1)int3
      (2)preempt_disable()
      (3)kprobe_prehandler()
      (4)preempt_enable()             <-- this one is added by my patch
      (5)copied instruction(direct execution)
      (6)jmp back to the original code
      
      The problem is that we have no way to prevent preemption on
      step (5) or (6). We cannot call preempt_disable() after step (6),
      because there are no rooms to do that. Thus, some other
      processes may be preempted at step(5) or (6) on preemptable kernel.
      And I couldn't find the easy way to ensure that other processes'
      stack do *not* have the address of them. (I thought some way
      to do that, but those are very costly.)
      
      So currently, I simply boost the kprobe only when the probe
      point is already preemption disabled.
      
      > Also, the patch adds a preempt_enable() but I don't see a corresponding
      > preempt_disable().  Am I missing something?
      
      It is corresponding to the preempt_disable() in the top of
      kprobe_handler().
      I copied the code of kprobe_handler() here:
      
      static int __kprobes kprobe_handler(struct pt_regs *regs)
      {
              struct kprobe *p;
              int ret = 0;
              kprobe_opcode_t *addr = NULL;
              unsigned long *lp;
              struct kprobe_ctlblk *kcb;
      
              /*
               * We don't want to be preempted for the entire
               * duration of kprobe processing
               */
              preempt_disable();             <-- HERE
              kcb = get_kprobe_ctlblk();
      Signed-off-by: NMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      311ac88f
    • M
      [PATCH] kprobes: clean up resume_execute() · b50ea74c
      Masami Hiramatsu 提交于
      Clean up kprobe's resume_execute() for i386 arch.
      Signed-off-by: NMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b50ea74c
    • D
      [PATCH] fix array overrun in efi.c · d6d21dfd
      Darren Jenkins 提交于
      Coverity found an over-run @ line 364 of efi.c
      
      This is due to the loop checking the size correctly, then adding a '\0'
      after possibly hitting the end of the array.
      
      Ensure the loop exits with one space left in the array.
      Signed-off-by: NDarren Jenkins <darrenrjenkins@gmail.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d6d21dfd
    • I
      [PATCH] sem2mutex: misc static one-file mutexes · 14cc3e2b
      Ingo Molnar 提交于
      Semaphore to mutex conversion.
      
      The conversion was generated via scripts, and the result was validated
      automatically via a script as well.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Acked-by: NAlasdair G Kergon <agk@redhat.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Adam Belay <ambx1@neo.rr.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      14cc3e2b
    • T
      [PATCH] EFI fixes · 23dd842c
      Tolentino, Matthew E 提交于
      Here's a patch that fixes EFI boot for x86 on 2.6.16-rc5-mm3.  The
      off-by-one is admittedly my fault, but the other two fix up the rest.
      
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Matt Domsch <Matt_Domsch@dell.com>
      Cc: "Tolentino, Matthew E" <matthew.e.tolentino@intel.com>
      Cc: "Brown, Len" <len.brown@intel.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      23dd842c
    • B
      [PATCH] EFI: keep physical table addresses in efi structure · b2c99e3c
      Bjorn Helgaas 提交于
      Almost all users of the table addresses from the EFI system table want
      physical addresses.  So rather than doing the pa->va->pa conversion, just keep
      physical addresses in struct efi.
      
      This fixes a DMI bug: the efi structure contained the physical SMBIOS address
      on x86 but the virtual address on ia64, so dmi_scan_machine() used ioremap()
      on a virtual address on ia64.
      
      This is essentially the same as an earlier patch by Matt Tolentino:
      	http://marc.theaimsgroup.com/?l=linux-kernel&m=112130292316281&w=2
      except that this changes all table addresses, not just ACPI addresses.
      
      Matt's original patch was backed out because it caused MCAs on HP sx1000
      systems.  That problem is resolved by the ioremap() attribute checking added
      for ia64.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Matt Domsch <Matt_Domsch@dell.com>
      Cc: "Tolentino, Matthew E" <matthew.e.tolentino@intel.com>
      Cc: "Brown, Len" <len.brown@intel.com>
      Cc: Andi Kleen <ak@muc.de>
      Acked-by: N"Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b2c99e3c
    • B
      [PATCH] DMI: only ioremap stuff we actually need · 27d8e3d1
      Bjorn Helgaas 提交于
      dmi_scan_machine() tries to ioremap 0x10000 (64K) bytes, even though it only
      looks at the first 32 bytes or so.  If the SMBIOS table is near the end of a
      memory region, the ioremap() may fail when it shouldn't.
      
      This is in the efi_enabled path, so it really only affects ia64 at the moment.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Matt Domsch <Matt_Domsch@dell.com>
      Cc: "Tolentino, Matthew E" <matthew.e.tolentino@intel.com>
      Cc: "Brown, Len" <len.brown@intel.com>
      Cc: Andi Kleen <ak@muc.de>
      Acked-by: N"Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      27d8e3d1
    • M
      [PATCH] ia64: use i386 dmi_scan.c · 3ed3bce8
      Matt Domsch 提交于
      Enable DMI table parsing on ia64.
      
      Andi Kleen has a patch in his x86_64 tree which enables the use of i386
      dmi_scan.c on x86_64.  dmi_scan.c functions are being used by the
      drivers/char/ipmi/ipmi_si_intf.c driver for autodetecting the ports or
      memory spaces where the IPMI controllers may be found.
      
      This patch adds equivalent changes for ia64 as to what is in the x86_64
      tree.  In addition, I reworked the DMI detection, such that on EFI-capable
      systems, it uses the efi.smbios pointer to find the table, rather than
      brute-force searching from 0xF0000.  On non-EFI systems, it continues the
      brute-force search.
      
      My test system, an Intel S870BN4 'Tiger4', aka Dell PowerEdge 7250, with
      latest BIOS, does not list the IPMI controller in the ACPI namespace, nor
      does it have an ACPI SPMI table.  Also note, currently shipping Dell x8xx
      EM64T servers don't have these either, so DMI is the only method for
      obtaining the address of the IPMI controller.
      Signed-off-by: NMatt Domsch <Matt_Domsch@dell.com>
      Acked-by: N"Luck, Tony" <tony.luck@intel.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3ed3bce8
    • V
      [PATCH] i386: export: memory more than 4G through /proc/iomem · 10dbe196
      Vivek Goyal 提交于
      Currently /proc/iomem exports physical memory also apart from io device
      memory.  But on i386, it truncates any memory more than 4GB.  This leads to
      problems for kexec/kdump.
      
      Kexec reads /proc/iomem to determine the system memory layout and prepares a
      memory map based on that and passes it to the kernel being kexeced.  Given the
      fact that memory more than 4GB has been truncated, new kernel never gets to
      see and use that memory.
      
      Kdump also reads /proc/iomem to determine the physical memory layout of the
      system and encodes this informaiton in ELF headers.  After a crash new kernel
      parses these ELF headers being used by previous kernel and vmcore is prepared
      accordingly.  As memory more than 4GB has been truncated, kdump never sees
      that memory and never prepares ELF headers for it.  Hence vmcore is truncated
      and limited to 4GB even if there is more physical memory in the system.
      
      This patch exports memory more than 4GB through /proc/iomem on i386.
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      10dbe196
    • J
      [PATCH] i386: pass proper trap numbers to die chain handlers · 20c0d2d4
      Jan Beulich 提交于
      Pass the trap number causing the call to notify_die() to the die
      notification handler chain in a number of instances.  Also, honor the
      return value from the handler chain invocation in die() as, through a
      debugger, the fault may have been fixed.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Acked-By: NAndi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      20c0d2d4
    • H
      [PATCH] x86: "make isoimage" support; FDINITRD= support; minor cleanups · 841b8a46
      H. Peter Anvin 提交于
      Add a "make isoimage" to i386 and x86-64, which allows the automatic
      creation of a bootable CD image.  It also adds an option FDINITRD= to
      include an initrd of the user's choice in generated floppy- or CD boot
      images.  Finally, some minor cleanups of the image generation code.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      841b8a46
  3. 26 3月, 2006 14 次提交
  4. 24 3月, 2006 4 次提交
    • A
      [PATCH] kill include/linux/platform.h, default_idle() cleanup · cdb04527
      Adrian Bunk 提交于
      include/linux/platform.h contained nothing that was actually used except
      the default_idle() prototype, and is therefore removed by this patch.
      
      This patch does the following with the platform specific default_idle()
      functions on different architectures:
      - remove the unused function:
        - parisc
        - sparc64
      - make the needlessly global function static:
        - arm
        - h8300
        - m68k
        - m68knommu
        - s390
        - v850
        - x86_64
      - add a prototype in asm/system.h:
        - cris
        - i386
        - ia64
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Acked-by: NPatrick Mochel <mochel@digitalimplant.org>
      Acked-by: NKyle McMartin <kyle@parisc-linux.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      cdb04527
    • A
      [PATCH] more-for_each_cpu-conversions fix · a7201156
      Andrew Morton 提交于
      I screwed up this conversion - we should be iterating across online CPUs, not
      possible ones.
      
      Spotted by Joe Perches <joe@perches.com>
      
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a7201156
    • B
      [PATCH] PCI: PCI/Cardbus cards hidden, needs pci=assign-busses to fix · 8c4b2cf9
      Bernhard Kaindl 提交于
      "In some cases, especially on modern laptops with a lot of PCI and cardbus
      bridges, we're unable to assign correct secondary/subordinate bus numbers
      to all cardbus bridges due to BIOS limitations unless we are using
      "pci=assign-busses" boot option." -- Ivan Kokshaysky (from a patch comment)
      
      Without it, Cardbus cards inserted are never seen by PCI because the parent
      PCI-PCI Bridge of the Cardbus bridge will not pass and translate Type 1 PCI
      configuration cycles correctly and the system will fail to find and
      initialise the PCI devices in the system.
      
      Reference: PCI-PCI Bridges: PCI Configuration Cycles and PCI Bus Numbering:
      http://www.science.unitn.it/~fiorella/guidelinux/tlk/node72.html
      
      The reason for this is that:
       ``All PCI busses located behind a PCI-PCI bridge must reside between the
      secondary bus number and the subordinate bus number (inclusive).''
      
      "pci=assign-busses" makes pcibios_assign_all_busses return 1 and this
      turns on PCI renumbering during PCI probing.
      
      Alan suggested to use DMI automatically set assign-busses on problem systems.
      
      The only question for me was where to put it.  I put it directly before
      scanning PCI bus into pcibios_scan_root() because it's called from legacy,
      acpi and numa and so it can be one place for all systems and configurations
      which may need it.
      
      AMD64 Laptops are also affected and fixed by assign-busses, and the code is
      also incuded from arch/x86_64/pci/ that place will also work for x86_64
      kernels, I only ifdef'-ed the x86-only Laptop in this example.
      
      Affected and known or assumed to be fixed with it are (found by googling):
      
      * ASUS Z71V and L3s
      * Samsung X20
      * Compaq R3140us and all Compaq R3000 series laptops with TI1620 Controller,
        also Compaq R4000 series (from a kernel.org bugreport)
      * HP zv5000z (AMD64 3700+, known that fixup_parent_subordinate_busnr fixes it)
      * HP zv5200z
      * IBM ThinkPad 240
      * An IBM ThinkPad (1.8 GHz Pentium M) debugged by Pavel Machek
        gives the correspondig message which detects the possible problem.
      * MSI S260 / Medion SIM 2100 MD 95600
      
      The patch also expands the "try pci=assign-busses" warning so testers will
      help us to update the DMI table.
      
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8c4b2cf9
    • L
      [PATCH] PCI: resource address mismatch · b408cbc7
      Linus Torvalds 提交于
      On Tue, 21 Feb 2006, Ivan Kokshaysky wrote:
      > There are two bogus entries in the BIOS memory map table which are
      > conflicting with a prefetchable memory range of the AGP bridge:
      >
      >  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
      >  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
      >
      > 0000:00:02.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP) (prog-if 00 [Normal decode])
      > 	Flags: bus master, fast devsel, latency 0
      > 	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
      > 	I/O behind bridge: 0000c000-0000cfff
      > 	Memory behind bridge: e7e00000-e7efffff
      > 	Prefetchable memory behind bridge: fec00000-ffcfffff
      > 					   ^^^^^^^^^^^^^^^^^
      
      Yes. However, it's pretty clear that the e820 entries are there for a
      reason. Probably they are a hack by the BIOS maintainers to keep Windows
      from stomping/moving that region, exactly because they want to keep the
      bridge where it is (or, it's actually for the BIOS itself - the BIOS
      tables are a horrid mess, and BIOS engineers are pretty hacky people:
      they'll add random entries to make their own broken algorithms do the
      "right thing").
      
      > Starting from 2.6.13, kernel tries to resolve that sort of conflicts,
      > so that prefetch window of the bridge and the framebuffer memory behind
      > it get moved to 0x10000000.
      
      I think we could (and probably should) solve this another way: consider
      the ACPI "reserved regions" from the e820 map exactly the same way that we
      do other ACPI hints - they should restrict _new_ allocations, but not
      impact stuff we figure out on our own.
      
      Basically, right now we assign _unassigned_ resources at "fs_initcall"
      time. If we were to add in the e820 "reserved region" stuff before that
      (but after we've done PCI discovery), we'd probably do the right thing.
      
      Right now we do the e820 reserved regions very early indeed: we call
      "register_memory()" from setup_arch(). We could move at least part of it
      (the part that registers the resources) down a bit.
      
      Here's a test-patch. I'm not saying we should absolutely do this, but it
      might be interesting to try...
      
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: <bjk@luxsci.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b408cbc7