summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drivers/atm/ambassador: kill uninit'd var warning, and fix bugJeff Garzik2007-07-171-1/+3
| | | | | | | | | An uninitialized variable warning illuminated an area where indeed the variable was being used without initialization. Unfortunately, after verifying all such paths were fixed, the warning still appears. So we follow the initialization practice of other variables in this function. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] sata_mv: use pci_try_set_mwi()Jeff Garzik2007-07-171-1/+1
| | | | | | Because sometimes in life, it's ok to fail. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/infiniband/hw/mthca/mthca_qp: kill uninit'd var warningJeff Garzik2007-07-171-2/+2
| | | | | | | | | | | | | | | | | | | drivers/infiniband/hw/mthca/mthca_qp.c: In function ‘mthca_tavor_post_send’: drivers/infiniband/hw/mthca/mthca_qp.c:1594: warning: ‘f0’ may be used uninitialized in this function drivers/infiniband/hw/mthca/mthca_qp.c: In function ‘mthca_arbel_post_send’: drivers/infiniband/hw/mthca/mthca_qp.c:1949: warning: ‘f0’ may be used uninitialized in this function Initializing 'f0' is not strictly necessary in either case, AFAICS. I was considering use of uninitialized_var(), but looking at the complex flow of control in each function, I feel it is wiser and safer to simply zero the var and be certain of ourselves. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/net/wan/sbni: kill uninit'd var warningJeff Garzik2007-07-171-4/+3
| | | | | | | It's actually convenient in the code to initialize this and a sister variable to zero. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/mtd/ubi/eba: minor cleanup: tighten scope of a local varJeff Garzik2007-07-171-2/+2
| | | | Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/telephony/ixj: cleanup and fix gcc warningJeff Garzik2007-07-171-1/+6
| | | | | | | | | | 1) Fix gcc uninit'd var warnings by adding 'default' switch stmt labels in two cases. It was lightning-strikes unlikely that a problem would ever arise, but not impossible. 2) Tighten the scope of 'blankword' in two cases. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/net/wan/pc300_drv: fix bug caught by gcc warningJeff Garzik2007-07-171-0/+2
| | | | | | | | | | | | The warning drivers/net/wan/pc300_drv.c: In function ‘cpc_open’: drivers/net/wan/pc300_drv.c:2942: warning: ‘br’ may be used uninitialized in this function was valid. Ensure 'br' is initialized in all cases. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/usb/misc/auerswald: fix status check, remove redundant checkJeff Garzik2007-07-171-1/+1
| | | | | | | | | | 1) We should only set 'actual_length' output variable if usb length is known to be good. 2) No need to check actual_length for NULL. The only caller always passes non-NULL value. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [netdrvr] eepro100, ne2k-pci: abort resume if pci_enable_device() failsJeff Garzik2007-07-172-2/+12
| | | | Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [netdrvr] natsemi: Fix device removal bugJeff Garzik2007-07-171-1/+1
| | | | | | | | | | | | | | | | | This episode illustrates how an overused warning can train people to ignore that warning, which winds up hiding bugs. The warning drivers/net/natsemi.c: In function ‘natsemi_remove1’: drivers/net/natsemi.c:3222: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result is oft-ignored, even though at close inspection one notices this occurs in the /remove/ function, not normally where creation occurs. A quick s/create/remove/ and we are fixed, with the warning gone. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* kernel/auditfilter: kill bogus uninit'd-var compiler warningJeff Garzik2007-07-171-8/+4
| | | | | | | | | | | | | | | | | Kill this warning... kernel/auditfilter.c: In function ‘audit_receive_filter’: kernel/auditfilter.c:1213: warning: ‘ndw’ may be used uninitialized in this function kernel/auditfilter.c:1213: warning: ‘ndp’ may be used uninitialized in this function ...with a simplification of the code. audit_put_nd() can accept NULL arguments, just like kfree(). It is cleaner to init two existing vars to NULL, remove the redundant test variable 'putnd_needed' branches, and call audit_put_nd() directly. As a desired side effect, the warning goes away. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2007-07-1718-763/+1198
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (80 commits) KVM: Use CPU_DYING for disabling virtualization KVM: Tune hotplug/suspend IPIs KVM: Keep track of which cpus have virtualization enabled SMP: Allow smp_call_function_single() to current cpu i386: Allow smp_call_function_single() to current cpu x86_64: Allow smp_call_function_single() to current cpu HOTPLUG: Adapt thermal throttle to CPU_DYING HOTPLUG: Adapt cpuset hotplug callback to CPU_DYING HOTPLUG: Add CPU_DYING notifier KVM: Clean up #includes KVM: Remove kvmfs in favor of the anonymous inodes source KVM: SVM: Reliably detect if SVM was disabled by BIOS KVM: VMX: Remove unnecessary code in vmx_tlb_flush() KVM: MMU: Fix Wrong tlb flush order KVM: VMX: Reinitialize the real-mode tss when entering real mode KVM: Avoid useless memory write when possible KVM: Fix x86 emulator writeback KVM: Add support for in-kernel pio handlers KVM: VMX: Fix interrupt checking on lightweight exit KVM: Adds support for in-kernel mmio handlers ...
| * KVM: Use CPU_DYING for disabling virtualizationAvi Kivity2007-07-161-2/+2
| | | | | | | | | | | | | | | | Only at the CPU_DYING stage can we be sure that no user process will be scheduled onto the cpu and oops when trying to use virtualization extensions. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Tune hotplug/suspend IPIsAvi Kivity2007-07-161-2/+2
| | | | | | | | | | | | | | | | | | The hotplug IPIs can be called from the cpu on which we are currently running on, so use on_cpu(). Similarly, drop on_each_cpu() for the suspend/resume callbacks, as we're in atomic context here and only one cpu is up anyway. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Keep track of which cpus have virtualization enabledAvi Kivity2007-07-161-12/+33
| | | | | | | | | | | | | | | | By keeping track of which cpus have virtualization enabled, we prevent double-enable or double-disable during hotplug, which is a very fatal oops. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * SMP: Allow smp_call_function_single() to current cpuAvi Kivity2007-07-161-1/+6
| | | | | | | | | | | | | | | | This removes the requirement for callers to get_cpu() to check in simple cases. This patch is for !CONFIG_SMP. Cc: Andi Kleen <ak@suse.de> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * i386: Allow smp_call_function_single() to current cpuAvi Kivity2007-07-161-3/+5
| | | | | | | | | | | | | | | | This removes the requirement for callers to get_cpu() to check in simple cases. Cc: Andi Kleen <ak@suse.de> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * x86_64: Allow smp_call_function_single() to current cpuAvi Kivity2007-07-161-4/+8
| | | | | | | | | | | | | | | | This removes the requirement for callers to get_cpu() to check in simple cases. Cc: Andi Kleen <ak@suse.de> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * HOTPLUG: Adapt thermal throttle to CPU_DYINGAvi Kivity2007-07-161-2/+4
| | | | | | | | | | | | CPU_DYING is notified in atomic context, so no taking mutexes here. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * HOTPLUG: Adapt cpuset hotplug callback to CPU_DYINGAvi Kivity2007-07-161-0/+3
| | | | | | | | | | | | CPU_DYING is called in atomic context, so don't try to take any locks. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * HOTPLUG: Add CPU_DYING notifierAvi Kivity2007-07-162-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | KVM wants a notification when a cpu is about to die, so it can disable hardware extensions, but at a time when user processes cannot be scheduled on the cpu, so it doesn't try to use virtualization extensions after they have been disabled. This adds a CPU_DYING notification. The notification is called in atomic context on the doomed cpu. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Clean up #includesAvi Kivity2007-07-164-20/+20
| | | | | | | | | | | | Remove unnecessary ones, and rearange the remaining in the standard order. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Remove kvmfs in favor of the anonymous inodes sourceAvi Kivity2007-07-163-133/+12
| | | | | | | | | | | | | | | | kvm uses a pseudo filesystem, kvmfs, to generate inodes, a job that the new anonymous inodes source does much better. Cc: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: SVM: Reliably detect if SVM was disabled by BIOSJoerg Roedel2007-07-162-0/+9
| | | | | | | | | | | | | | | | | | | | This patch adds an implementation to the svm is_disabled function to detect reliably if the BIOS disabled the SVM feature in the CPU. This fixes the issues with kernel panics when loading the kvm-amd module on machines where SVM is available but disabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: VMX: Remove unnecessary code in vmx_tlb_flush()Avi Kivity2007-07-161-1/+0
| | | | | | | | | | | | | | | | A vmexit implicitly flushes the tlb; the code is bogus. Noted by Shaohua Li. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Fix Wrong tlb flush orderShaohua Li2007-07-161-1/+1
| | | | | | | | | | | | | | Need to flush the tlb after updating a pte, not before. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: VMX: Reinitialize the real-mode tss when entering real modeAvi Kivity2007-07-161-0/+4
| | | | | | | | | | | | | | Protected mode code may have corrupted the real-mode tss, so re-initialize it when switching to real mode. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Avoid useless memory write when possibleLuca Tettamanti2007-07-161-2/+4
| | | | | | | | | | | | | | | | When writing to normal memory and the memory area is unchanged the write can be safely skipped, avoiding the costly kvm_mmu_pte_write. Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Fix x86 emulator writebackLuca Tettamanti2007-07-161-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the old value and new one are the same the emulator skips the write; this is undesirable when the destination is a MMIO area and the write shall be performed regardless of the previous value. This optimization breaks e.g. a Linux guest APIC compiled without X86_GOOD_APIC. Remove the check and perform the writeback stage in the emulation unless it's explicitly disabled (currently push and some 2 bytes instructions may disable the writeback). Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Add support for in-kernel pio handlersEddie Dong2007-07-162-1/+37
| | | | | | | | | | | | | | Useful for the PIC and PIT. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: VMX: Fix interrupt checking on lightweight exitGregory Haskins2007-07-161-3/+3
| | | | | | | | | | | | | | | | With kernel-injected interrupts, we need to check for interrupts on lightweight exits too. Signed-off-by: Gregory Haskins <ghaskins@novell.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Adds support for in-kernel mmio handlersGregory Haskins2007-07-162-12/+142
| | | | | | | | | | Signed-off-by: Gregory Haskins <ghaskins@novell.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Implement emulation of instruction "ret" (opcode 0xc3)Nitin A Kamble2007-07-161-4/+8
| | | | | | | | | | Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Implement emulation of "pop reg" instruction (opcode 0x58-0x5f)Nitin A Kamble2007-07-161-2/+15
| | | | | | | | | | | | | | For use in real mode. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: VMX: Ensure vcpu time stamp counter is monotonousAvi Kivity2007-07-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | If the time stamp counter goes backwards, a guest delay loop can become infinite. This can happen if a vcpu is migrated to another cpu, where the counter has a lower value than the first cpu. Since we're doing an IPI to the first cpu anyway, we can use that to pick up the old tsc, and use that to calculate the adjustment we need to make to the tsc offset. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Initialize the BSP bit in the APIC_BASE msr correctlyAvi Kivity2007-07-162-6/+6
| | | | | | | | | | | | Needs to be set on vcpu 0 only. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: VMX: Replace memset(<addr>, 0, PAGESIZE) with clear_page(<addr>)Shani Moideen2007-07-161-3/+3
| | | | | | | | | | Signed-off-by: Shani Moideen <shani.moideen@wipro.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: SVM: Replace memset(<addr>, 0, PAGESIZE) with clear_page(<addr>)Shani Moideen2007-07-161-2/+2
| | | | | | | | | | Signed-off-by: Shani Moideen <shani.moideen@wipro.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Flush remote tlbs when reducing shadow pte permissionsAvi Kivity2007-07-165-15/+84
| | | | | | | | | | | | | | | | | | | | | | When a vcpu causes a shadow tlb entry to have reduced permissions, it must also clear the tlb on remote vcpus. We do that by: - setting a bit on the vcpu that requests a tlb flush before the next entry - if the vcpu is currently executing, we send an ipi to make sure it exits before we continue Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Keep an upper bound of initialized vcpusAvi Kivity2007-07-162-0/+6
| | | | | | | | | | | | | | That way, we don't need to loop for KVM_MAX_VCPUS for a single vcpu vm. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Emulate hlt on real mode for IntelAvi Kivity2007-07-163-2/+12
| | | | | | | | | | | | | | This has two use cases: the bios can't boot from disk, and guest smp bootstrap. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Move duplicate halt handling code into kvm_main.cAvi Kivity2007-07-164-12/+14
| | | | | | | | | | | | Will soon have a thid user. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Enable guest smpAvi Kivity2007-07-161-1/+1
| | | | | | | | | | | | | | As we don't support guest tlb shootdown yet, this is only reliable for real-mode guests. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Fix adding an smp virtual machine to the vm listAvi Kivity2007-07-161-3/+3
| | | | | | | | | | | | | | If we add the vm once per vcpu, we corrupt the list if the guest has multiple vcpus. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Fix vcpu freeing for guest smpAvi Kivity2007-07-162-2/+17
| | | | | | | | | | | | | | | | A vcpu can pin up to four mmu shadow pages, which means the freeing loop will never terminate. Fix by first unpinning shadow pages on all vcpus, then freeing shadow pages. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Remove unnecessary initialization and checks in mark_page_dirty()Nguyen Anh Quynh2007-07-161-2/+2
| | | | | | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Replace C code with call to ARRAY_SIZE() macro.Robert P. J. Day2007-07-161-1/+1
| | | | | | | | | | Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Lazy guest cr3 switchingAvi Kivity2007-07-164-21/+40
| | | | | | | | | | | | | | | | | | Switch guest paging context may require us to allocate memory, which might fail. Instead of wiring up error paths everywhere, make context switching lazy and actually do the switch before the next guest entry, where we can return an error if allocation fails. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Remove unused large page markerAvi Kivity2007-07-162-3/+0
| | | | | | | | | | | | | | This has not been used for some time, as the same information is available in the page header. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Don't cache guest access bits in the shadow page tableAvi Kivity2007-07-162-9/+0
| | | | | | | | | | | | | | | | | | This was once used to avoid accessing the guest pte when upgrading the shadow pte from read-only to read-write. But usually we need to set the guest pte dirty or accessed bits anyway, so this wasn't really exploited. Signed-off-by: Avi Kivity <avi@qumranet.com>