summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* KVM: MMU: Use slab caches for shadow pages and their headersAvi Kivity2007-07-163-28/+41
| | | | | | Use slab caches instead of a simple custom list. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Use symbolic constants instead of magic numbersEddie Dong2007-07-161-1/+1
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Fix includesMarkus Rechberger2007-07-161-0/+2
| | | | | | | KVM compilation fails for some .configs. This fixes it. Signed-off-by: Markus Rechberger <markus.rechberger@amd.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: x86 emulator: implement wbinvdAvi Kivity2007-07-161-1/+3
| | | | | | Vista seems to trigger it. Signed-off-by: Avi Kivity <avi@qumranet.com>
* Use menuconfig objects II - KVM/VirtJan Engelhardt2007-07-161-2/+6
| | | | | | | | | | Make a "menuconfig" out of the Kconfig objects "menu, ..., endmenu", so that the user can disable all the options in that menu at once instead of having to disable each option separately. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Avoid saving and restoring msr_efer on lightweight vmexitEddie Dong2007-07-163-21/+71
| | | | | | | | | | | | | | | | | | | MSR_EFER.LME/LMA bits are automatically save/restored by VMX hardware, KVM only needs to save NX/SCE bits at time of heavy weight VM Exit. But clearing NX bits in host envirnment may cause system hang if the host page table is using EXB bits, thus we leave NX bits as it is. If Host NX=1 and guest NX=0, we can do guest page table EXB bits check before inserting a shadow pte (though no guest is expecting to see this kind of gp fault). If host NX=0, we present guest no Execute-Disable feature to guest, thus no host NX=0, guest NX=1 combination. This patch reduces raw vmexit time by ~27%. Me: fix compile warnings on i386. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Cleanup redundant code in MSR setEddie Dong2007-07-161-2/+0Star
| | | | | Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Avoid saving and restoring msrs on lightweight vmexitEddie Dong2007-07-162-56/+76
| | | | | | | | | | | | In a lightweight exit (where we exit and reenter the guest without scheduling or exiting to userspace in between), we don't need various msrs on the host, and avoiding shuffling them around reduces raw exit time by 8%. i386 compile fix by Daniel Hecken <dh@bahntechnik.de>. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Handle #SS faults from real modeNitin A Kamble2007-07-161-1/+5
| | | | | | | | | Instructions with address size override prefix opcode 0x67 Cause the #SS fault with 0 error code in VM86 mode. Forward them to the emulator. Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Use local labels in inline assemblyAvi Kivity2007-07-161-8/+7Star
| | | | | | This makes oprofile dumps and disassebly easier to read. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Fix vmx I/O bitmap initialization on highmem systemsAvi Kivity2007-07-161-2/+2
| | | | | | | | | kunmap() expects a struct page, not a virtual address. Fixes an oops loading kvm-intel.ko on i386 with CONFIG_HIGHMEM. Thanks to Michael Ivanov <deruhu@peterstar.ru> for reporting. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Avoid corrupting tr in real modeAvi Kivity2007-07-161-14/+31
| | | | | | | | | | | | The real mode tr needs to be set to a specific tss so that I/O instructions can function. Divert the new tr values to the real mode save area from where they will be restored on transition to protected mode. This fixes some crashes on reboot when the bios accesses an I/O instruction. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Only reload guest msrs if they are already loadedAvi Kivity2007-07-161-1/+2
| | | | | | | | | | If we set an msr via an ioctl() instead of by handling a guest exit, we have the host state loaded, so reloading the msrs would clobber host state instead of guest state. This fixes a host oops (and loss of a cpu) on a guest reboot. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Store shadow page tables as kernel virtual addresses, not physicalAvi Kivity2007-07-163-19/+17Star
| | | | | | Simpifies things a bit. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Simplify kvm_mmu_free_page() a tiny bitAvi Kivity2007-07-161-6/+4Star
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Implement IA32_EBL_CR_POWERON msrMatthew Gregan2007-07-161-0/+1
| | | | | | | | | | | | | | Attempting to boot the default 'bsd' kernel of OpenBSD 4.1 i386 in a guest fails early in the kernel init inside p3_get_bus_clock while trying to read the IA32_EBL_CR_POWERON MSR. KVM logs an 'unhandled MSR' message and the guest kernel faults. This patch is sufficient to allow OpenBSD to boot, after which it seems to run fine. I'm not sure if this is the correct solution for dealing with this particular MSR, but it works for me. Signed-off-by: Matthew Gregan <kinetik@flim.org> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Set cr0.mp for guestsAvi Kivity2007-07-161-1/+3
| | | | | | | This allows fwait instructions to be trapped when the guest fpu is not loaded. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Consolidate guest fpu activation and deactivationAvi Kivity2007-07-162-20/+32
| | | | | | Easier to keep track of where the fpu is this way. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Rationalize exception bitmap usageAvi Kivity2007-07-161-21/+21
| | | | | | | | Everyone owns a piece of the exception bitmap, but they happily write to the entire thing like there's no tomorrow. Centralize handling in update_exception_bitmap() and have everyone call that. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Move some more msr mangling into vmx_save_host_state()Avi Kivity2007-07-161-7/+7
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Fix potential guest state leak into hostAvi Kivity2007-07-162-71/+94
| | | | | | | | | | | The lightweight vmexit path avoids saving and reloading certain host state. However in certain cases lightweight vmexit handling can schedule() which requires reloading the host state. So we store the host state in the vcpu structure, and reloaded it if we relinquish the vcpu. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Increase mmu shadow cache to 1024 pagesAvi Kivity2007-07-161-1/+1
| | | | | | | This improves kbuild times by about 10%, bringing it within a respectable 25% of native. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Update shadow pte on write to guest pteAvi Kivity2007-07-162-0/+30
| | | | | | | | | | | | | | | | | | | | A typical demand page/copy on write pattern is: - page fault on vaddr - kvm propagates fault to guest - guest handles fault, updates pte - kvm traps write, clears shadow pte, resumes guest - guest returns to userspace, re-faults on same vaddr - kvm installs shadow pte, resumes guest - guest continues So, three vmexits for a single guest page fault. But if instead of clearing the page table entry, we update to correspond to the value that the guest has just written, we eliminate the third vmexit. This patch does exactly that, reducing kbuild time by about 10%. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Respect nonpae pagetable quadrant when zapping ptesAvi Kivity2007-07-161-0/+4
| | | | | | | | | | | | | | | | | | | When a guest writes to a page that has an mmu shadow, we have to clear the shadow pte corresponding to the memory location touched by the guest. Now, in nonpae mode, a single guest page may have two or four shadow pages (because a nonpae page maps 4MB or 4GB, whereas the pae shadow maps 2MB or 1GB), so we when we look up the page we find up to three additional aliases for the page. Since we _clear_ the shadow pte, it doesn't matter except for a slight performance penalty, but if we want to _update_ the shadow pte instead of clearing it, it is vital that we don't modify the aliases. Fortunately, exactly which page is needed (the "quadrant") is easily computed, and is accessible in the shadow page header. All we need is to ignore shadow pages from the wrong quadrants. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Unify kvm_mmu_pre_write() and kvm_mmu_post_write()Avi Kivity2007-07-163-11/+8Star
| | | | | | | Instead of calling two functions and repeating expensive checks, call one function and provide it with before/after information. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Be more careful restoring fs on lightweight vmexitAvi Kivity2007-07-161-11/+11
| | | | | | | | i386 wants fs for accessing the pda even on a lightweight exit, so ensure we can always restore it. This fixes a regression on i386 introduced by the lightweight vmexit patch. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Reduce misfirings of the fork detectorAvi Kivity2007-07-161-0/+4
| | | | | | | | | | | | | | The kvm mmu tries to detects forks by looking for repeated writes to a page table. If it sees a fork, it unshadows the page table so the page table copying can proceed at native speed instead of being emulated. However, the detector also triggered on simple demand paging access patterns: a linear walk of memory would of course cause repeated writes to the same pagetable page, causing it to unshadow prematurely. Fix by resetting the fork detector if we detect a demand fault. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Unindent some codeAvi Kivity2007-07-161-29/+29
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Avoid saving and restoring some host CPU state on lightweight vmexitAvi Kivity2007-07-163-45/+62
| | | | | | | | | | | | Many msrs and the like will only be used by the host if we schedule() or return to userspace. Therefore, we avoid saving them if we handle the exit within the kernel, and if a reschedule is not requested. Based on a patch from Eddie Dong <eddie.dong@intel.com> with a couple of fixes by me. Signed-off-by: Yaozu(Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Assume that writes smaller than 4 bytes are to non-pagetable pagesAvi Kivity2007-07-161-0/+1
| | | | | | | | This allows us to remove write protection earlier than otherwise. Should some mad OS choose to use byte writes to update pagetables, it will suffer a performance hit, but still work correctly. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: SVM: Allow direct guest access to PC debug portAnthony Liguori2007-07-161-3/+5
| | | | | | | The PC debug port is used for IO delay and does not require emulation. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Enable io bitmaps to avoid IO port 0x80 VMEXITsHe, Qing2007-07-161-4/+46
| | | | | | | | | | | | | This patch enables IO bitmaps control on vmx and unmask the 0x80 port to avoid VMEXITs caused by accessing port 0x80. 0x80 is used as delays (see include/asm/io.h), and handling VMEXITs on its access is unnecessary but slows things down. This patch improves kernel build test at around 3%~5%. Because every VM uses the same io bitmap, it is shared between all VMs rather than a per-VM data structure. Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* Merge git://git.infradead.org/battery-2.6Linus Torvalds2007-07-1610-49/+20Star
|\ | | | | | | | | | | | | | | | | | | * git://git.infradead.org/battery-2.6: git-battery vs git-acpi Power supply class and drivers: remove non obligatory return statements pda_power: clean up irq, timer MAINTAINERS: Add maintainers for power supply subsystem and drivers Fixed up trivial conflict in drivers/w1/slaves/w1_ds2760.c manually
| * git-battery vs git-acpiAndrew Morton2007-07-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | drivers/w1/slaves/w1_ds2760.c:85: warning: initialization from incompatible pointer type The ACPI guys changed the bin_attr APIs (commit 91a6902958f052358899f58683d44e36228d85c2) Cc: Anton Vorontsov <cbou@mail.ru> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * Power supply class and drivers: remove non obligatory return statementsAnton Vorontsov2007-07-159-39/+0Star
| | | | | | | | | | | | | | Per Jeff Garzik request. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Anton Vorontsov <cbou@mail.ru>
| * pda_power: clean up irq, timerJeff Garzik2007-07-151-9/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up pda_power interrupt handling: Prior to this patch, the driver would pass information it needed to the interrupt handler dev_id pointer, and then prompt forget it ever did so, recreating that same information after a couple passes through the timer-based state machine. This patch removes the redundant checks by passing the pda_power_supply[] pointer through the state machine. The current code passed 'irq' through the state machine, as an index to recreate the pointer, when we could more simply pass around the pointer itself. This patch makes it easier to remove the 'irq' argument in the future, in addition to cleaning up the driver today. Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * MAINTAINERS: Add maintainers for power supply subsystem and driversAnton Vorontsov2007-07-151-0/+10
| | | | | | | | | | Signed-off-by: Anton Vorontsov <cbou@mail.ru> Acked-by: David Woodhouse <dwmw2@infradead.org>
* | Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2007-07-16190-26337/+21725Star
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits) [SCSI] ibmvscsi: convert to use the data buffer accessors [SCSI] dc395x: convert to use the data buffer accessors [SCSI] ncr53c8xx: convert to use the data buffer accessors [SCSI] sym53c8xx: convert to use the data buffer accessors [SCSI] ppa: coding police and printk levels [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c [SCSI] remove the dead CYBERSTORMIII_SCSI option [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA [SCSI] Clean up scsi_add_lun a bit [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs [SCSI] sni_53c710: Cleanup [SCSI] qla4xxx: Fix underrun/overrun conditions [SCSI] megaraid_mbox: use mutex instead of semaphore [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation. [SCSI] qla2xxx: update version to 8.02.00-k1. [SCSI] qla2xxx: add support for NPIV [SCSI] stex: use resid for xfer len information [SCSI] Add Brownie 1200U3P to blacklist [SCSI] scsi.c: convert to use the data buffer accessors ...
| * | [SCSI] ibmvscsi: convert to use the data buffer accessorsFUJITA Tomonori2007-07-151-57/+23Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Santiago Leon <santil@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] dc395x: convert to use the data buffer accessorsFUJITA Tomonori2007-07-151-103/+60Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Jamie Lenehan <lenehan@twibble.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] ncr53c8xx: convert to use the data buffer accessorsFUJITA Tomonori2007-07-151-59/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] sym53c8xx: convert to use the data buffer accessorsFUJITA Tomonori2007-07-152-73/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] ppa: coding police and printk levelsAlan Cox2007-07-151-30/+27Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add printk levels Clean up some oddities of formatting Fix goto labels Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmallocSatyam Sharma2007-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/scsi/aic7xxx_old.c:aic7xxx_slave_alloc() unnecessarily passes GFP_ATOMIC (along with GFP_KERNEL) to kmalloc() from a context that is not atomic. Remove the pointless GFP_ATOMIC. Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Doug Ledford <dledford@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.cSatyam Sharma2007-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/message/i2o/device.c:i2o_parm_field_get() unnecessarily passes GFP_ATOMIC (along with GFP_KERNEL) to kmalloc() from a context that is not atomic. Remove the pointless GFP_ATOMIC. Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] remove the dead CYBERSTORMIII_SCSI optionAdrian Bunk2007-07-151-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | Not converted to the 2.6 kconfig system and no code in the tree. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMACornelia Huck2007-07-154-41/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With dma-mapping-prevent-dma-dependent-code-from-linking-on.patch scsi fails to build on !HAS_DMA architectures: drivers/built-in.o(.text+0x20af6): In function `scsi_dma_map': : undefined reference to `dma_map_sg' drivers/built-in.o(.text+0x20b5c): In function `scsi_dma_unmap': : undefined reference to `dma_unmap_sg' I split those functions out into a new file. Builds on s390 and i386. Move scsi_dma_{map,unmap} into scsi_lib_dma.c which is only build if HAS_DMA is set. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: James Bottomley <James.Bottomley@SteelEye.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] Clean up scsi_add_lun a bitMatthew Wilcox2007-07-151-38/+26Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch tidies up scsi_add_lun a bit. I rewrote the kerneldoc to match the actual parameters, moved the check for RBC and MMC REPORT_LUN devices away from the switch(), changed the setup of sdev->type to account for BLIST_ISROM, moved the check for BLIST_NO_ULD_ATTACH further down in the function, removed a bogus comment and fixed some whitespace issues. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on ↵Thomas Bogendoerfer2007-07-151-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | SNI RMs remove printk, which triggers because of low scsi clock on SNI RMs Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] sni_53c710: CleanupThomas Bogendoerfer2007-07-151-8/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | - base address is now a physical address; no need to convert it - remove not needed error printk in module init function Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>