aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAge
* drivers/atm/ambassador: kill uninit'd var warning, and fix bugJeff Garzik2007-07-17
| | | | | | | | | 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-17
| | | | | | 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-17
| | | | | | | | | | | | | | | | | | | 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-17
| | | | | | | 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-17
| | | | Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/telephony/ixj: cleanup and fix gcc warningJeff Garzik2007-07-17
| | | | | | | | | | 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-17
| | | | | | | | | | | | 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-17
| | | | | | | | | | 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-17
| | | | Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [netdrvr] natsemi: Fix device removal bugJeff Garzik2007-07-17
| | | | | | | | | | | | | | | | | 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>
* Merge branch 'for-linus' of ↵Linus Torvalds2007-07-17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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>
| * KVM: Clean up #includesAvi Kivity2007-07-16
| | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | 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-16
| | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | 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-16
| | | | | | | | | | 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-16
| | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | Will soon have a thid user. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Enable guest smpAvi Kivity2007-07-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | 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-16
| | | | | | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Replace C code with call to ARRAY_SIZE() macro.Robert P. J. Day2007-07-16
| | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | | | | | | | 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>
| * KVM: MMU: Simpify accessed/dirty/present/nx bit handlingAvi Kivity2007-07-16
| | | | | | | | | | | | | | | | Always set the accessed and dirty bit (since having them cleared causes a read-modify-write cycle), always set the present bit, and copy the nx bit from the guest. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Remove cr0.wp tricksAvi Kivity2007-07-16
| | | | | | | | | | | | No longer needed as we do everything in one place. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Make setting shadow ptes atomic on i386Avi Kivity2007-07-16
| | | | | | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Make shadow pte updates atomicAvi Kivity2007-07-16
| | | | | | | | | | | | | | | | | | | | | | With guest smp, a second vcpu might see partial updates when the first vcpu services a page fault. So delay all updates until we have figured out what the pte should look like. Note that on i386, this is still not completely atomic as a 64-bit write will be split into two on a 32-bit machine. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: Move shadow pte modifications from set_pte/set_pde to set_pde_common()Avi Kivity2007-07-16
| | | | | | | | | | | | We want all shadow pte modifications in one place. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Fold fix_write_pf() into set_pte_common()Avi Kivity2007-07-16
| | | | | | | | | | | | | | This prevents some work from being performed twice, and, more importantly, reduces the number of places where we modify shadow ptes. Signed-off-by: Avi Kivity <avi@qumranet.com>
| * KVM: MMU: Fold fix_read_pf() into set_pte_common()Avi Kivity2007-07-16
| | | | | | | | Signed-off-by: Avi Kivity <avi@qumranet.com>