linux-2.6
17 years ago[PATCH] KVM: Don't set guest cr3 from vmx_vcpu_setup()
Avi Kivity [Sat, 6 Jan 2007 00:36:58 +0000 (16:36 -0800)] 
[PATCH] KVM: Don't set guest cr3 from vmx_vcpu_setup()

It overwrites the right cr3 set from mmu setup.  Happens only with the test
harness.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Add missing 'break'
Avi Kivity [Sat, 6 Jan 2007 00:36:58 +0000 (16:36 -0800)] 
[PATCH] KVM: Add missing 'break'

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Avoid oom on cr3 switch
Ingo Molnar [Sat, 6 Jan 2007 00:36:57 +0000 (16:36 -0800)] 
[PATCH] KVM: Avoid oom on cr3 switch

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Initialize vcpu->kvm a little earlier
Avi Kivity [Sat, 6 Jan 2007 00:36:57 +0000 (16:36 -0800)] 
[PATCH] KVM: Initialize vcpu->kvm a little earlier

Fixes oops on early close of /dev/kvm.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Improve reporting of vmwrite errors
Avi Kivity [Sat, 6 Jan 2007 00:36:56 +0000 (16:36 -0800)] 
[PATCH] KVM: Improve reporting of vmwrite errors

This will allow us to see the root cause when a vmwrite error happens.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: add audit code to check mappings, etc are correct
Avi Kivity [Sat, 6 Jan 2007 00:36:56 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: add audit code to check mappings, etc are correct

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Destroy mmu while we still have a vcpu left
Avi Kivity [Sat, 6 Jan 2007 00:36:55 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Destroy mmu while we still have a vcpu left

mmu_destroy flushes the guest tlb (indirectly), which needs a valid vcpu.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Flush guest tlb when reducing permissions on a pte
Avi Kivity [Sat, 6 Jan 2007 00:36:55 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Flush guest tlb when reducing permissions on a pte

If we reduce permissions on a pte, we must flush the cached copy of the pte
from the guest's tlb.

This is implemented at the moment by flushing the entire guest tlb, and can be
improved by flushing just the relevant virtual address, if it is known.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Detect oom conditions and propagate error to userspace
Avi Kivity [Sat, 6 Jan 2007 00:36:54 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Detect oom conditions and propagate error to userspace

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Replace atomic allocations by preallocated objects
Avi Kivity [Sat, 6 Jan 2007 00:36:53 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Replace atomic allocations by preallocated objects

The mmu sometimes needs memory for reverse mapping and parent pte chains.
however, we can't allocate from within the mmu because of the atomic context.

So, move the allocations to a central place that can be executed before the
main mmu machinery, where we can bail out on failure before any damage is
done.

(error handling is deffered for now, but the basic structure is there)

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Free pages on kvm destruction
Avi Kivity [Sat, 6 Jan 2007 00:36:52 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Free pages on kvm destruction

Because mmu pages have attached rmap and parent pte chain structures, we need
to zap them before freeing so the attached structures are freed.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Treat user-mode faults as a hint that a page is no longer a page...
Avi Kivity [Sat, 6 Jan 2007 00:36:52 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Treat user-mode faults as a hint that a page is no longer a page table

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Fix cmpxchg8b emulation
Avi Kivity [Sat, 6 Jan 2007 00:36:51 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Fix cmpxchg8b emulation

cmpxchg8b uses edx:eax as the compare operand, not edi:eax.

cmpxchg8b is used by 32-bit pae guests to set page table entries atomically,
and this is emulated touching shadowed guest page tables.

Also, implement it for 32-bit hosts.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Never free a shadow page actively serving as a root
Avi Kivity [Sat, 6 Jan 2007 00:36:51 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Never free a shadow page actively serving as a root

We always need cr3 to point to something valid, so if we detect that we're
freeing a root page, simply push it back to the top of the active list.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Page table write flood protection
Avi Kivity [Sat, 6 Jan 2007 00:36:50 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Page table write flood protection

In fork() (or when we protect a page that is no longer a page table), we can
experience floods of writes to a page, which have to be emulated.  This is
expensive.

So, if we detect such a flood, zap the page so subsequent writes can proceed
natively.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: If an empty shadow page is not empty, report more info
Avi Kivity [Sat, 6 Jan 2007 00:36:50 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: If an empty shadow page is not empty, report more info

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Ensure freed shadow pages are clean
Avi Kivity [Sat, 6 Jan 2007 00:36:49 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Ensure freed shadow pages are clean

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: <ove is_empty_shadow_page() above kvm_mmu_free_page()
Avi Kivity [Sat, 6 Jan 2007 00:36:49 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: <ove is_empty_shadow_page() above kvm_mmu_free_page()

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Handle misaligned accesses to write protected guest page tables
Avi Kivity [Sat, 6 Jan 2007 00:36:48 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Handle misaligned accesses to write protected guest page tables

A misaligned access affects two shadow ptes instead of just one.

Since a misaligned access is unlikely to occur on a real page table, just zap
the page out of existence, avoiding further trouble.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Remove release_pt_page_64()
Avi Kivity [Sat, 6 Jan 2007 00:36:48 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Remove release_pt_page_64()

Unused.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Remove invlpg interception
Avi Kivity [Sat, 6 Jan 2007 00:36:47 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Remove invlpg interception

Since we write protect shadowed guest page tables, there is no need to trap
page invalidations (the guest will always change the mapping before issuing
the invlpg instruction).

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: oom handling
Avi Kivity [Sat, 6 Jan 2007 00:36:47 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: oom handling

When beginning to process a page fault, make sure we have enough shadow pages
available to service the fault.  If not, free some pages.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: kvm_mmu_put_page() only removes one link to the page
Avi Kivity [Sat, 6 Jan 2007 00:36:47 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: kvm_mmu_put_page() only removes one link to the page

...  and so must not free it unconditionally.

Move the freeing to kvm_mmu_zap_page().

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Implement child shadow unlinking
Avi Kivity [Sat, 6 Jan 2007 00:36:46 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Implement child shadow unlinking

When removing a page table, we must maintain the parent_pte field all child
shadow page tables.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: If emulating an instruction fails, try unprotecting the page
Avi Kivity [Sat, 6 Jan 2007 00:36:45 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: If emulating an instruction fails, try unprotecting the page

A page table may have been recycled into a regular page, and so any
instruction can be executed on it.  Unprotect the page and let the cpu do its
thing.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Zap shadow page table entries on writes to guest page tables
Avi Kivity [Sat, 6 Jan 2007 00:36:45 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Zap shadow page table entries on writes to guest page tables

Iterate over all shadow pages which correspond to a the given guest page table
and remove the mappings.

A subsequent page fault will reestablish the new mapping.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Support emulated writes into RAM
Avi Kivity [Sat, 6 Jan 2007 00:36:44 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Support emulated writes into RAM

As the mmu write protects guest page table, we emulate those writes.  Since
they are not mmio, there is no need to go to userspace to perform them.

So, perform the writes in the kernel if possible, and notify the mmu about
them so it can take the approriate action.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Let the walker extract the target page gfn from the pte
Avi Kivity [Sat, 6 Jan 2007 00:36:44 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Let the walker extract the target page gfn from the pte

This fixes a problem where set_pte_common() looked for shadowed pages based on
the page directory gfn (a huge page) instead of the actual gfn being mapped.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Write protect guest pages when a shadow is created for them
Avi Kivity [Sat, 6 Jan 2007 00:36:43 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Write protect guest pages when a shadow is created for them

When we cache a guest page table into a shadow page table, we need to prevent
further access to that page by the guest, as that would render the cache
incoherent.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Shadow page table caching
Avi Kivity [Sat, 6 Jan 2007 00:36:43 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Shadow page table caching

Define a hashtable for caching shadow page tables. Look up the cache on
context switch (cr3 change) or during page faults.

The key to the cache is a combination of
- the guest page table frame number
- the number of paging levels in the guest
   * we can cache real mode, 32-bit mode, pae, and long mode page
     tables simultaneously.  this is useful for smp bootup.
- the guest page table table
   * some kernels use a page as both a page table and a page directory.  this
     allows multiple shadow pages to exist for that page, one per level
- the "quadrant"
   * 32-bit mode page tables span 4MB, whereas a shadow page table spans
     2MB.  similarly, a 32-bit page directory spans 4GB, while a shadow
     page directory spans 1GB.  the quadrant allows caching up to 4 shadow page
     tables for one guest page in one level.
- a "metaphysical" bit
   * for real mode, and for pse pages, there is no guest page table, so set
     the bit to avoid write protecting the page.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Make kvm_mmu_alloc_page() return a kvm_mmu_page pointer
Avi Kivity [Sat, 6 Jan 2007 00:36:42 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Make kvm_mmu_alloc_page() return a kvm_mmu_page pointer

This allows further manipulation on the shadow page table.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Make the shadow page tables also special-case pae
Avi Kivity [Sat, 6 Jan 2007 00:36:41 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Make the shadow page tables also special-case pae

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Use the guest pdptrs instead of mapping cr3 in pae mode
Avi Kivity [Sat, 6 Jan 2007 00:36:41 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Use the guest pdptrs instead of mapping cr3 in pae mode

This lets us not write protect a partial page, and is anyway what a real
processor does.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MU: Special treatment for shadow pae root pages
Avi Kivity [Sat, 6 Jan 2007 00:36:40 +0000 (16:36 -0800)] 
[PATCH] KVM: MU: Special treatment for shadow pae root pages

Since we're not going to cache the pae-mode shadow root pages, allocate a
single pae shadow that will hold the four lower-level pages, which will act as
roots.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Fold fetch_guest() into init_walker()
Avi Kivity [Sat, 6 Jan 2007 00:36:40 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Fold fetch_guest() into init_walker()

It is never necessary to fetch a guest entry from an intermediate page table
level (except for large pages), so avoid some confusion by always descending
into the lowest possible level.

Rename init_walker() to walk_addr() as it is no longer restricted to
initialization.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Load the pae pdptrs on cr3 change like the processor does
Avi Kivity [Sat, 6 Jan 2007 00:36:39 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Load the pae pdptrs on cr3 change like the processor does

In pae mode, a load of cr3 loads the four third-level page table entries in
addition to cr3 itself.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Teach the page table walker to track guest page table gfns
Avi Kivity [Sat, 6 Jan 2007 00:36:39 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Teach the page table walker to track guest page table gfns

Saving the table gfns removes the need to walk the guest and host page tables
in lockstep.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: MMU: Implement simple reverse mapping
Avi Kivity [Sat, 6 Jan 2007 00:36:38 +0000 (16:36 -0800)] 
[PATCH] KVM: MMU: Implement simple reverse mapping

Keep in each host page frame's page->private a pointer to the shadow pte which
maps it.  If there are multiple shadow ptes mapping the page, set bit 0 of
page->private, and use the rest as a pointer to a linked list of all such
mappings.

Reverse mappings are needed because we when we cache shadow page tables, we
must protect the guest page tables from being modified by the guest, as that
would invalidate the cached ptes.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Prevent stale bits in cr0 and cr4
Avi Kivity [Sat, 6 Jan 2007 00:36:38 +0000 (16:36 -0800)] 
[PATCH] KVM: Prevent stale bits in cr0 and cr4

Hardware virtualization implementations allow the guests to freely change some
of the bits in cr0 and cr4, but trap when changing the other bits.  This is
useful to avoid excessive exits due to changing, for example, the ts flag.

It also means the kvm's copy of cr0 and cr4 may be stale with respect to these
bits.  most of the time this doesn't matter as these bits are not very
interesting.  Other times, however (for example when returning cr0 to
userspace), they are, so get the fresh contents of these bits from the guest
by means of a new arch operation.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Update the rtc-rs5c372 driver
David Brownell [Sat, 6 Jan 2007 00:36:37 +0000 (16:36 -0800)] 
[PATCH] Update the rtc-rs5c372 driver

 Bugfixes:
  - Handle RTCs which are configured to use 12-hour mode.
  - Never report bogus/un-initialized times.
  - Displaying "raw trim" requires not masking it first!
  - Fix the sysfs and procfs display of crystal and trim data.

 Features:
  - Handle other RTCs in this family, notably rv5c386/rv5c387.
  - Declare the other registers.
  - Provide alarm get/set functionality.
  - Handle AIE and UIE; but no IRQ handling yet.

 Cleanup:
  - Shrink object by not including needless sysfs or procfs support
  - We don't need no steenkin' forward declarations.  (Except one.)

Until the I2C framework merges "new style" driver support, matching
the driver model better, using rv5c chips or alarm IRQs requires a
separate board-specific patch.  (And an IRQ handler, handing off labor
through a work_struct...)

This uses the "method 3" register reads, but notes that it's done
to work around an evident i2c adapter driver bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fix BUG_ON(!PageSlab) from fallback_alloc
Hugh Dickins [Sat, 6 Jan 2007 00:36:36 +0000 (16:36 -0800)] 
[PATCH] fix BUG_ON(!PageSlab) from fallback_alloc

pdflush hit the BUG_ON(!PageSlab(page)) in kmem_freepages called from
fallback_alloc: cache_grow already freed those pages when alloc_slabmgmt
failed.  But it wouldn't have freed them if __GFP_NO_GROW, so make sure
fallback_alloc doesn't waste its time on that case.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Pekka J Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
Eric Sandeen [Sat, 6 Jan 2007 00:36:36 +0000 (16:36 -0800)] 
[PATCH] fix memory corruption from misinterpreted bad_inode_ops return values

CVE-2006-5753 is for a case where an inode can be marked bad, switching
the ops to bad_inode_ops, which are all connected as:

static int return_EIO(void)
{
        return -EIO;
}

#define EIO_ERROR ((void *) (return_EIO))

static struct inode_operations bad_inode_ops =
{
        .create         = bad_inode_create
...etc...

The problem here is that the void cast causes return types to not be
promoted, and for ops such as listxattr which expect more than 32 bits of
return value, the 32-bit -EIO is interpreted as a large positive 64-bit
number, i.e. 0x00000000fffffffa instead of 0xfffffffa.

This goes particularly badly when the return value is taken as a number of
bytes to copy into, say, a user's buffer for example...

I originally had coded up the fix by creating a return_EIO_<TYPE> macro
for each return type, like this:

static int return_EIO_int(void)
{
return -EIO;
}
#define EIO_ERROR_INT ((void *) (return_EIO_int))

static struct inode_operations bad_inode_ops =
{
.create = EIO_ERROR_INT,
...etc...

but Al felt that it was probably better to create an EIO-returner for each
actual op signature.  Since so few ops share a signature, I just went ahead
& created an EIO function for each individual file & inode op that returns
a value.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] ip2 warning fix
Andrew Morton [Sat, 6 Jan 2007 00:36:35 +0000 (16:36 -0800)] 
[PATCH] ip2 warning fix

Make this:

drivers/char/ip2/ip2main.c: In function 'ip2_loadmain':
drivers/char/ip2/ip2main.c:654: warning: control may reach end of non-void function 'iiSetAddress' being inlined
drivers/char/ip2/ip2main.c:808: warning: control may reach end of non-void function 'iiInitialize' being inlined

go away.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] i386: modpost smpboot code warning fix
Vivek Goyal [Sat, 6 Jan 2007 00:36:34 +0000 (16:36 -0800)] 
[PATCH] i386: modpost smpboot code warning fix

o Currently synchronize_tsc_ap() is of type __init. It is called by
  smp_callin() which is of type __cpuinit. So synchronize_tsc_ap()
  should be of type __cpuinit.

o Modpost generates warnings for i386 if CONFIG_RELOCATABLE=y and
  CONFIG_HOTPLUG_CPU=y

WARNING: vmlinux - Section mismatch: reference to .init.data: from .text between 'start_secondary' (at offset 0xc01164dc) and 'initialize_secondary'
WARNING: vmlinux - Section mismatch: reference to .init.data: from .text between 'start_secondary' (at offset 0xc01164e8) and 'initialize_secondary'

o tsc is of type __initdata. It should be of type __cpuinitdata.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] i386: fix another modpost warning
Vivek Goyal [Sat, 6 Jan 2007 00:36:34 +0000 (16:36 -0800)] 
[PATCH] i386: fix another modpost warning

o MODPOST generates warning for i386 if kernel is compiled with
  CONFIG_RELOCATABLE=y

WARNING: vmlinux - Section mismatch: reference to .init.data: from .data between 'this_cpu' (at offset 0xc05194d0) and 'cpuinfo_op'

o this_cpu pointer should be of type __cpuinitdata.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] i386: fix modpost warning in SMP trampoline code
Vivek Goyal [Sat, 6 Jan 2007 00:36:33 +0000 (16:36 -0800)] 
[PATCH] i386: fix modpost warning in SMP trampoline code

o MODPOST generates warning for i386 if kernel is compiled with
  CONFIG_RELOCATABLE=y

WARNING: vmlinux - Section mismatch: reference to .init.text:startup_32_smp
from .data between 'trampoline_data' (at offset 0xc0519cf8) and 'boot_gdt'

o trampoline code/data can go into init section is CPU hotplug is not
  enabled.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Sanely size hash tables when using large base pages
Paul Mundt [Sat, 6 Jan 2007 00:36:30 +0000 (16:36 -0800)] 
[PATCH] Sanely size hash tables when using large base pages

At the moment the inode/dentry cache hash tables (common by way of
alloc_large_system_hash()) are incorrectly sized by their respective
detection logic when we attempt to use large base pages on systems with
little memory.

This results in odd behaviour when using a 64kB PAGE_SIZE, such as:

Dentry cache hash table entries: 8192 (order: -1, 32768 bytes)
Inode-cache hash table entries: 4096 (order: -2, 16384 bytes)

The mount cache hash table is seemingly the only one that gets this right
by directly taking PAGE_SIZE in to account.

The following patch attempts to catch the bogus values and round it up to
at least 0-order.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] i386: Restore CONFIG_PHYSICAL_START option
Vivek Goyal [Sat, 6 Jan 2007 00:36:30 +0000 (16:36 -0800)] 
[PATCH] i386: Restore CONFIG_PHYSICAL_START option

o Relocatable bzImage support had got rid of CONFIG_PHYSICAL_START option
  thinking that now this option is not required as people can build a
  second kernel as relocatable and load it anywhere. So need of compiling
  the kernel for a custom address was gone. But Magnus uses vmlinux images
  for second kernel in Xen environment and he wants to continue to use
  it.

o Restoring the CONFIG_PHYSICAL_START option for the time being. I think
  down the line we can get rid of it.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] profiling: fix sched profiling typo
Ingo Molnar [Sat, 6 Jan 2007 00:36:29 +0000 (16:36 -0800)] 
[PATCH] profiling: fix sched profiling typo

Fix sched profiling typo, introduced by the sleep profiling patch.  This
bug caused profile=sched to not work.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] swsusp: Do not fail if resume device is not set
Rafael J. Wysocki [Sat, 6 Jan 2007 00:36:28 +0000 (16:36 -0800)] 
[PATCH] swsusp: Do not fail if resume device is not set

In the kernels later than 2.6.19 there is a regression that makes swsusp
fail if the resume device is not explicitly specified.

It can be fixed by adding an additional parameter to
mm/swapfile.c:swap_type_of() allowing us to pass the (struct block_device
*) corresponding to the first available swap back to the caller.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] adfs: fix filename handling
James Bursa [Sat, 6 Jan 2007 00:36:28 +0000 (16:36 -0800)] 
[PATCH] adfs: fix filename handling

Fix filenames on adfs discs being terminated at the first character greater
than 128 (adfs filenames are Latin 1).  I saw this problem when using a
loopback adfs image on a 2.6.17-rc5 x86_64 machine, and the patch fixed it
there.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] atiixp: Old drivers/ide layer driver for the ATIIXP hang fix
Alan [Sat, 6 Jan 2007 00:36:27 +0000 (16:36 -0800)] 
[PATCH] atiixp: Old drivers/ide layer driver for the ATIIXP hang fix

When the old IDE layer calls into methods in the driver during error
handling it is essentially random whether ide_lock is already held.  This
causes a deadlock in the atiixp driver which also uses ide_lock internally
for locking.

Switch to a private lock instead.

[akpm@osl.org: cleanup]
Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix BUG at drivers/scsi/scsi_lib.c:1118 caused by "pktsetup dvd /dev/sr0"
Christoph Hellwig [Sat, 6 Jan 2007 00:36:26 +0000 (16:36 -0800)] 
[PATCH] Fix BUG at drivers/scsi/scsi_lib.c:1118 caused by "pktsetup dvd /dev/sr0"

Fix http://bugzilla.kernel.org/show_bug.cgi?id=7667

This is because the packet driver tries to send down read/write BLOCK_PC
commands that don't use a bio and do not use sg lists.

The right fix is to replace all the packet_command stuff in the packet
driver by scsi_execute() which needs to be lifted from scsi code to
the block code for that.

Fix the bug for now.  It's not the full way to a generic execute block pc
infrastcuture but fixes the bug for the time being.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] rtc-at91rm9200 build fix
David Brownell [Sat, 6 Jan 2007 00:36:25 +0000 (16:36 -0800)] 
[PATCH] rtc-at91rm9200 build fix

The at91rm9200 RTC driver needs some assistance to build, because of recent
header file rearrangement.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Improve interrupt response
Dor Laor [Sat, 6 Jan 2007 00:36:24 +0000 (16:36 -0800)] 
[PATCH] KVM: Improve interrupt response

The current interrupt injection mechanism might delay an interrupt under
the following circumstances:

 - if injection fails because the guest is not interruptible (rflags.IF clear,
   or after a 'mov ss' or 'sti' instruction).  Userspace can check rflags,
   but the other cases or not testable under the current API.
 - if injection fails because of a fault during delivery.  This probably
   never happens under normal guests.
 - if injection fails due to a physical interrupt causing a vmexit so that
   it can be handled by the host.

In all cases the guest proceeds without processing the interrupt, reducing
the interactive feel and interrupt throughput of the guest.

This patch fixes the situation by allowing userspace to request an exit
when the 'interrupt window' opens, so that it can re-inject the interrupt
at the right time.  Guest interactivity is very visibly improved.

Signed-off-by: Dor Laor <dor.laor@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Recover after an arch module load failure
Yoshimi Ichiyanagi [Sat, 6 Jan 2007 00:36:24 +0000 (16:36 -0800)] 
[PATCH] KVM: Recover after an arch module load failure

If we load the wrong arch module, it leaves behind kvm_arch_ops set, which
prevents loading of the correct arch module later.

Fix be not setting kvm_arch_ops until we're sure it's good.

Signed-off-by: Yoshimi Ichiyanagi <ichiyanagi.yoshimi@lab.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Use raw_smp_processor_id() instead of smp_processor_id() where applicable
Ingo Molnar [Sat, 6 Jan 2007 00:36:23 +0000 (16:36 -0800)] 
[PATCH] KVM: Use raw_smp_processor_id() instead of smp_processor_id() where applicable

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] KVM: Fix GFP_KERNEL alloc in atomic section bug
Ingo Molnar [Sat, 6 Jan 2007 00:36:23 +0000 (16:36 -0800)] 
[PATCH] KVM: Fix GFP_KERNEL alloc in atomic section bug

KVM does kmalloc() in an atomic section while having preemption disabled via
vcpu_load().  Fix this by moving the ->*_msr setup from the vcpu_setup method
to the vcpu_create method.

(This is also a small speedup for setting up a vcpu, which can in theory be
more frequent than the vcpu_create method).

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] via82cxxx: fix cable detection
Bartlomiej Zolnierkiewicz [Sat, 6 Jan 2007 00:36:21 +0000 (16:36 -0800)] 
[PATCH] via82cxxx: fix cable detection

This patch fixes 2.6.15 regression, is straightforward and tested.

Cable detection got broken probably while converting the driver to support
multiple controllers.  Cable detection is done by examining how BIOS
configured the attached devices.  The current code is broken in that it
examines the status *after* modifying Clk66 configuration ending up
detecting 40c cables as 80c.  This patch fixes it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] PCI: prevent down_read when pci_devices is empty
Ard van Breemen [Sat, 6 Jan 2007 00:36:21 +0000 (16:36 -0800)] 
[PATCH] PCI: prevent down_read when pci_devices is empty

The pci_find_subsys gets called very early by obsolete ide setup parameters.
This is a bogus call since pci is not initialized yet, so the list is empty.
But in the mean time, interrupts get enabled by down_read.  This can result in
a kernel panic when the irq controller gets initialized.

This patch checks if the device list is empty before taking the semaphore, and
hence will not enable irq's.  Furthermore it will inform that it is called
while pci_devices is empty as a reminder that the ide code needs to be fixed.

The pci_get_subsys can get called in the same manner, and as such is patched
in the same manner.

[akpm@osdl.org: cleanups]
Signed-off-by: Ard van Breemen <ard@telegraafnet.nl>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] kernelparams: detect if and which parameter parsing enabled irq's
Ard van Breemen [Sat, 6 Jan 2007 00:36:20 +0000 (16:36 -0800)] 
[PATCH] kernelparams: detect if and which parameter parsing enabled irq's

The parsing of some kernel parameters seem to enable irq's at a stage that
irq's are not supposed to be enabled (Particularly the ide kernel parameters).

Having irq's enabled before the irq controller is initialized might lead to a
kernel panic.  This patch only detects this behaviour and warns about wich
parameter caused it.

[akpm@osdl.org: cleanups]
Signed-off-by: Ard van Breemen <ard@telegraafnet.nl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] start_kernel: test if irq's got enabled early, barf, and disable them again
Ard van Breemen [Sat, 6 Jan 2007 00:36:19 +0000 (16:36 -0800)] 
[PATCH] start_kernel: test if irq's got enabled early, barf, and disable them again

The calls made by parse_parms to other initialization code might enable
interrupts again way too early.

Having interrupts on this early can make systems PANIC when they initialize
the IRQ controllers (which happens later in the code).  This patch detects
that irq's are enabled again, barfs about it and disables them again as a
safety net.

[akpm@osdl.org: cleanups]
Signed-off-by: Ard van Breemen <ard@telegraafnet.nl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix leds-s3c24xx hardware.h reference
Richard Purdie [Sat, 6 Jan 2007 00:36:18 +0000 (16:36 -0800)] 
[PATCH] Fix leds-s3c24xx hardware.h reference

Russell King recently reminded us that one shouldn't use
asm/arch/hardware.h but one should use asm/hardware.h
(http://lkml.org/lkml/2006/12/23/26).  Unfortunately, the leds-s3c24xx
driver is using the wrong header.  This patch is fixing that.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix implicit declarations in via-pmu
Dave Jones [Sat, 6 Jan 2007 00:36:18 +0000 (16:36 -0800)] 
[PATCH] Fix implicit declarations in via-pmu

drivers/macintosh/via-pmu.c: In function 'pmac_suspend_devices':
drivers/macintosh/via-pmu.c:2014: error: implicit declaration of function 'pm_prepare_console'
drivers/macintosh/via-pmu.c: In function 'pmac_wakeup_devices':
drivers/macintosh/via-pmu.c:2139: error: implicit declaration of function 'pm_restore_console'

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Add AFS_SUPER_MAGIC to magic.h
Adam Megacz [Sat, 6 Jan 2007 00:36:17 +0000 (16:36 -0800)] 
[PATCH] Add AFS_SUPER_MAGIC to magic.h

Jeffrey Altman, one of the gatekeepers of OpenAFS (the open source project
which inherited the Transarc/IBM AFS codebase) has requested that the magic
number 0x5346414F (little endian 'OAFS') be allocated for the f_type field
of the fsinfo structure on Linux:

  https://lists.openafs.org/pipermail/openafs-info/2006-December/024829.html

Add it to include/linux/magic.h, mostly as a way of publishing this number
and ensuring that no other filesystem accidentally uses it.

Cc: Jeffrey Altman <jaltman@secure-endpoints.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Thu, 4 Jan 2007 20:55:56 +0000 (12:55 -0800)] 
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SOUND] Sparc CS4231: Use 64 for period_bytes_min
  [SOUND] Sparc CS4231: Fix IRQ return value and initialization.

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 4 Jan 2007 20:55:26 +0000 (12:55 -0800)] 
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IPV4/IPV6]: Fix inet{,6} device initialization order.
  [TCP]: Use old definition of before
  [NETFILTER]: ebtables: don't compute gap before checking struct type
  [NETFILTER]: nf_nat: fix MASQUERADE crash on device down
  [NETFILTER]: New connection tracking is not EXPERIMENTAL anymore
  [NETFILTER]: Fix routing of REJECT target generated packets in output chain
  [NETFILTER]: compat offsets size change
  [SUNGEM]: PHY updates & pause fixes (#2)
  [X25]: proper prototype for x25_init_timers()
  [AF_NETLINK]: module_put cleanup
  [XFRM_USER]: avoid pointless void ** casts
  [NETFILTER] xt_hashlimit.c: fix typo
  [NET] drivers/net/loopback.c: convert to module_init()
  [PKTGEN]: Convert to kthread API.
  [NET]: ifb double-counts packets

17 years ago[IPV4/IPV6]: Fix inet{,6} device initialization order.
David L Stevens [Thu, 4 Jan 2007 20:31:14 +0000 (12:31 -0800)] 
[IPV4/IPV6]: Fix inet{,6} device initialization order.

It is important that we only assign dev->ip{,6}_ptr
only after all portions of the inet{,6} are setup.

Otherwise we can receive packets before the multicast
spinlocks et al. are initialized.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Use old definition of before
Gerrit Renker [Thu, 4 Jan 2007 20:25:16 +0000 (12:25 -0800)] 
[TCP]: Use old definition of before

This reverts the new (unambiguous) definition of the TCP `before'
relation. As pointed out in an example by Herbert Xu, there is
existing code which implicitly requires the old definition in order
to work correctly.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: ebtables: don't compute gap before checking struct type
Chuck Ebbert [Thu, 4 Jan 2007 20:17:44 +0000 (12:17 -0800)] 
[NETFILTER]: ebtables: don't compute gap before checking struct type

We cannot compute the gap until we know we have a 'struct ebt_entry' and
not 'struct ebt_entries'.  Failure to check can cause crash.

Tested-by: Santiago Garcia Mantinan <manty@manty.net>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: nf_nat: fix MASQUERADE crash on device down
Martin Josefsson [Thu, 4 Jan 2007 20:16:54 +0000 (12:16 -0800)] 
[NETFILTER]: nf_nat: fix MASQUERADE crash on device down

Check the return value of nfct_nat() in device_cmp(), we might very well
have non NAT conntrack entries as well (Netfilter bugzilla #528).

Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: New connection tracking is not EXPERIMENTAL anymore
Patrick McHardy [Thu, 4 Jan 2007 20:16:06 +0000 (12:16 -0800)] 
[NETFILTER]: New connection tracking is not EXPERIMENTAL anymore

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: Fix routing of REJECT target generated packets in output chain
Patrick McHardy [Thu, 4 Jan 2007 20:15:34 +0000 (12:15 -0800)] 
[NETFILTER]: Fix routing of REJECT target generated packets in output chain

Packets generated by the REJECT target in the output chain have a local
destination address and a foreign source address. Make sure not to use
the foreign source address for the output route lookup.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: compat offsets size change
Dmitry Mishin [Thu, 4 Jan 2007 20:14:41 +0000 (12:14 -0800)] 
[NETFILTER]: compat offsets size change

Used by compat code offsets of entries should be 'unsigned int' as entries
array size has this dimension.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Thu, 4 Jan 2007 16:55:57 +0000 (08:55 -0800)] 
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: asus_acpi: new MAINTAINER
  ACPI: fix section mis-match build warning
  ACPI: increase ACPI_MAX_REFERENCE_COUNT for larger systems
  ACPI: EC: move verbose printk to debug build only
  backlight: fix backlight_device_register compile failures

17 years agoHID: fix help texts in Kconfig
Jiri Kosina [Wed, 3 Jan 2007 22:03:14 +0000 (23:03 +0100)] 
HID: fix help texts in Kconfig

The help text for CONFIG_HID might imply for someone that
it's necessary to enable it for any keyboard or mouse
attached to the system. This is obviously not correct, so
fix it to avoid confusing the users.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
17 years agoFix some ARM builds due to HID brokenness
Russell King [Fri, 22 Dec 2006 17:09:16 +0000 (17:09 +0000)] 
Fix some ARM builds due to HID brokenness

HID it defaults to 'y'.  When you have input deselected, this
causes the kernel to fail to link.
Fix it by making it depend on INPUT.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
17 years ago[SUNGEM]: PHY updates & pause fixes (#2)
Benjamin Herrenschmidt [Thu, 4 Jan 2007 02:54:43 +0000 (18:54 -0800)] 
[SUNGEM]: PHY updates & pause fixes (#2)

This patch adds support for a few more PHYs used by Apple and fixes
advertising and detecting of Pause (we were missing setting the bit in
MII_ADVERTISE and weren't testing in LPA for all PHYs).

Note that I currently only advertise pause, not asymetric pause. I
don't know for sure the details there, I suppose I should read a bit
more 802.3 references, and I don't now what sungem is capable of, but
I noticed the PCS code (originated from you) does the same.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SOUND] Sparc CS4231: Use 64 for period_bytes_min
David S. Miller [Thu, 4 Jan 2007 02:51:54 +0000 (18:51 -0800)] 
[SOUND] Sparc CS4231: Use 64 for period_bytes_min

This matches what the ISA cs4231 driver uses.

Tested by Georg Chini.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[X25]: proper prototype for x25_init_timers()
Adrian Bunk [Thu, 4 Jan 2007 02:48:13 +0000 (18:48 -0800)] 
[X25]: proper prototype for x25_init_timers()

This patch adds a proper prototype for x25_init_timers() in
include/net/x25.h

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AF_NETLINK]: module_put cleanup
Mariusz Kozlowski [Tue, 2 Jan 2007 23:24:30 +0000 (15:24 -0800)] 
[AF_NETLINK]: module_put cleanup

This patch removes redundant argument check for module_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[XFRM_USER]: avoid pointless void ** casts
Christoph Hellwig [Tue, 2 Jan 2007 23:22:30 +0000 (15:22 -0800)] 
[XFRM_USER]: avoid pointless void ** casts

All ->doit handlers want a struct rtattr **, so pass down the right
type.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER] xt_hashlimit.c: fix typo
Alexey Dobriyan [Tue, 2 Jan 2007 08:42:00 +0000 (00:42 -0800)] 
[NETFILTER] xt_hashlimit.c: fix typo

Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET] drivers/net/loopback.c: convert to module_init()
Adrian Bunk [Tue, 2 Jan 2007 08:35:48 +0000 (00:35 -0800)] 
[NET] drivers/net/loopback.c: convert to module_init()

This patch converts drivers/net/loopback.c to using module_init().

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[PKTGEN]: Convert to kthread API.
David S. Miller [Tue, 2 Jan 2007 04:51:53 +0000 (20:51 -0800)] 
[PKTGEN]: Convert to kthread API.

Based upon a suggestion from Christoph Hellwig.

This fixes various races in module load/unload handling
too.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: ifb double-counts packets
dean gaudet [Tue, 2 Jan 2007 03:39:09 +0000 (19:39 -0800)] 
[NET]: ifb double-counts packets

Signed-off-by: dean gaudet <dean@arctic.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SOUND] Sparc CS4231: Fix IRQ return value and initialization.
Georg Chini [Wed, 3 Jan 2007 05:28:17 +0000 (21:28 -0800)] 
[SOUND] Sparc CS4231: Fix IRQ return value and initialization.

SBUS: Change IRQ-handler return value from 0 to IRQ_HANDLED and
fix some initialisation problems.

Change period_bytes_min from 4096 to 256 to allow driver to work with
low latency (VOIP) applications. Hope this does not break EBUS.

Signed-off-by: Georg Chini <georg.chini@triaton-webhosting.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
Linus Torvalds [Thu, 4 Jan 2007 01:34:54 +0000 (17:34 -0800)] 
Merge /pub/scm/linux/kernel/git/davej/agpgart

* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
  [AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value
  [AGPGART] Fix PCI-posting flush typo.
  [AGPGART] fix detection of aperture size versus GTT size on G965
  [AGPGART] Remove unnecessary flushes when inserting and removing pages.
  [AGPGART] K8M890 support for amd-k8.

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Thu, 4 Jan 2007 01:34:12 +0000 (17:34 -0800)] 
Merge /pub/scm/linux/kernel/git/davej/cpufreq

* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] longhaul: Kill off warnings introduced by recent changes.
  [CPUFREQ] Uninitialized use of cmd.val in arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:acpi_cpufreq_target()
  [CPUFREQ] Longhaul - Always guess FSB
  [CPUFREQ] Longhaul - Fix up powersaver assumptions.
  [CPUFREQ] longhaul: Fix up unreachable code.
  [CPUFREQ] speedstep-centrino: missing space and bracket
  [CPUFREQ] Bug fix for acpi-cpufreq and cpufreq_stats oops on frequency change notification
  [CPUFREQ] select consistently

17 years ago[PATCH] ide-cd maintainer
Jens Axboe [Wed, 3 Jan 2007 17:15:20 +0000 (18:15 +0100)] 
[PATCH] ide-cd maintainer

Alan agreed to take over casual maintenance of the ide-cd atapi cdrom
driver, so I'm happy to sign it over to him. Alan, I hope the address is
the one you want to use. I also changed the list to linux-ide as that
seems more appropriate.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] cdrom: set default timeout to 7 seconds
Jens Axboe [Wed, 3 Jan 2007 07:10:35 +0000 (08:10 +0100)] 
[PATCH] cdrom: set default timeout to 7 seconds

It's a known fact that Windows times out commands after 7 seconds, so
drives generally try and respond if they can before that happens.  We
default to 5 seconds, which sometimes is a bit too short.

Jeremy Higdon reported here:

http://lkml.org/lkml/2007/1/1/145

that his drive takes longer than 5 seconds for a "read track
information" command, later confirming that it is about 6.7 seconds.

So just do the sane thing and change the default command timeout to 7
seconds to avoid other surprises.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] x86_64: Fix dump_trace()
OGAWA Hirofumi [Wed, 3 Jan 2007 16:21:28 +0000 (01:21 +0900)] 
[PATCH] x86_64: Fix dump_trace()

If caller passed the tsk, we should use it to validate a stack ptr.
Otherwise, sysrq-t and other debugging stuff doesn't work.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[CPUFREQ] longhaul: Kill off warnings introduced by recent changes.
Dave Jones [Wed, 3 Jan 2007 04:42:16 +0000 (23:42 -0500)] 
[CPUFREQ] longhaul: Kill off warnings introduced by recent changes.

Bunch of unused vars + one case where gcc isn't smart enough.

Signed-off-by: Dave Jones <davej@redhat.com>
17 years ago[CPUFREQ] Uninitialized use of cmd.val in arch/i386/kernel/cpu/cpufreq/acpi-cpufreq...
Guillaume Chazarain [Tue, 2 Jan 2007 18:58:13 +0000 (19:58 +0100)] 
[CPUFREQ] Uninitialized use of cmd.val in arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:acpi_cpufreq_target()

cmd.val was used uninitialized on the line below.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
17 years ago[CPUFREQ] Longhaul - Always guess FSB
Rafa³ Bilski [Mon, 1 Jan 2007 22:49:34 +0000 (23:49 +0100)] 
[CPUFREQ] Longhaul - Always guess FSB

This is patch that solves Ebox mini PC issue and make
FSB code more specification compilant. At start guess_fsb
function is guessing 200MHz FSB too. It is better to
make it in this way because, thanks to this function, driver
will fail for bogus FSB values caused by bogus multiplier
value. For PowerSaver processors we can't depend on Max /
MinMHzFSB because these values are only used for
PowerSaver 2.0 and 3.0. Most processors on which Longhaul
is used are PowerSaver 1.0 only. I'm changing code for older
CPU's too, but not so much as previously, and this code was
already used for Ezra. Using MinMHzBR for Ezra-T is outside
spec. It is for voltage scaling purpose and don't have to
be equal to minmult (but it is). Same for Nehemiah (it
isn't for sure). Added mult - current multiplier value.

Signed-off-by: Rafa³ Bilski <rafalbilski@interia.pl>
Signed-off-by: Dave Jones <davej@redhat.com>
17 years ago[AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value
akpm@osdl.org [Tue, 2 Jan 2007 22:44:31 +0000 (14:44 -0800)] 
[AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value

drivers/char/agp/sgi-agp.c: check kmalloc() return value

Signed-off-by: Amit Choudhary <amit2030@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
17 years agoMerge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Wed, 3 Jan 2007 02:50:57 +0000 (18:50 -0800)] 
Merge branch 'for-linus' of /home/rmk/linux-2.6-arm

* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 4081/1: Add definition for TI Sync Serial Protocol
  [ARM] 4080/1: Fix for the SSCR0_SlotsPerFrm macro
  [ARM] Fix VFP initialisation issue for SMP systems
  [ARM] 4078/1: Fix ARM copypage cache coherency problems
  [ARM] 4077/1: iop13xx: fix __io() macro
  [ARM] 4074/1: Flat loader stack alignment
  [ARM] 4073/1: Prevent s3c24xx drivers from including asm/arch/hardware.h and asm/arch/irqs.h
  [ARM] 4071/1: S3C24XX: Documentation update
  [ARM] 4066/1: correct a comment about PXA's sched_clock range
  [ARM] 4065/1: S3C24XX: dma printk fixes
  [ARM] 4064/1: make pxa_get_cycles() static
  [ARM] 4063/1: ep93xx: fix IRQ_EP93XX_GPIO?MUX numbering

17 years ago[ARM] 4081/1: Add definition for TI Sync Serial Protocol
Philipp Zabel [Tue, 2 Jan 2007 20:06:57 +0000 (21:06 +0100)] 
[ARM] 4081/1: Add definition for TI Sync Serial Protocol

Of the possible SSP frame formats (FRF bits in SSCR0), only SSCR0_PSP is defined. Other possible formats are Motorola SPI (0<<4), TI SSP (1<<4) and Microwire (2<<4). Attached patch adds a definition SSCR0_TISSP.
This mode is used for the sound codec attached to the PXA272 SSP1 of some HTC PDA phones.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4080/1: Fix for the SSCR0_SlotsPerFrm macro
Philipp Zabel [Tue, 2 Jan 2007 19:59:38 +0000 (20:59 +0100)] 
[ARM] 4080/1: Fix for the SSCR0_SlotsPerFrm macro

The SSCR0_SlotsPerFrm macro writes a 3-bit value to bits [2:0], while the correct location of FRDC in SSCR0 is at bits [26:24]. This patch adds the missing "<< 24".

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] Fix VFP initialisation issue for SMP systems
Russell King [Tue, 2 Jan 2007 23:40:30 +0000 (23:40 +0000)] 
[ARM] Fix VFP initialisation issue for SMP systems

When we install the handlers for context switching, we must enable
VFP on all CPU cores, otherwise undefined (and random) effects
occur.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>