aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86_emulate.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2008-12-31KVM: SVM: Set the 'busy' flag of the TR selectorAmit Shah1-0/+7
The busy flag of the TR selector is not set by the hardware. This breaks migration from amd hosts to intel hosts. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: SVM: Set the 'g' bit of the cs selector for cross-vendor migrationAmit Shah1-0/+9
The hardware does not set the 'g' bit of the cs selector and this breaks migration from amd hosts to intel hosts. Set this bit if the segment limit is beyond 1 MB. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Fix typo in function nameAmit Shah1-5/+5
get_segment_descritptor_dtable() contains an obvious type. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: IRQ ACK notifier should be used with in-kernel irqchipSheng Yang3-5/+8
Also remove unnecessary parameter of unregister irq ack notifier. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Optimize NMI watchdog deliveryJan Kiszka3-8/+27
As suggested by Avi, this patch introduces a counter of VCPUs that have LVT0 set to NMI mode. Only if the counter > 0, we push the PIT ticks via all LAPIC LVT0 lines to enable NMI watchdog support. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Fix and refactor NMI watchdog emulationJan Kiszka3-17/+20
This patch refactors the NMI watchdog delivery patch, consolidating tests and providing a proper API for delivering watchdog events. An included micro-optimization is to check only for apic_hw_enabled in kvm_apic_local_deliver (the test for LVT mask is covering the soft-disabled case already). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: Add decode entries for 0x04 and 0x05 opcodes (add acc, imm)Guillaume Thouvenin1-1/+1
Add decode entries for 0x04 and 0x05 (ADD) opcodes, execution is already implemented. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Move private memory slot positionSheng Yang2-3/+4
PCI device assignment would map guest MMIO spaces as separate slot, so it is possible that the device has more than 2 MMIO spaces and overwrite current private memslot. The patch move private memory slot to the top of userspace visible memory slots. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: Extend kvm_mmu_page->slot_bitmap sizeSheng Yang2-6/+8
Otherwise set_bit() for private memory slot(above KVM_MEMORY_SLOTS) would corrupted memory in 32bit host. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Clean up kvm_x86_emulate.hSheng Yang1-7/+3
Remove one left improper comment of removed CR2. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Enable MTRR for EPTSheng Yang5-5/+27
The effective memory type of EPT is the mixture of MSR_IA32_CR_PAT and memory type field of EPT entry. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Add local get_mtrr_type() to support MTRRSheng Yang1-0/+104
For EPT memory type support. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Add PAT support for EPTSheng Yang3-4/+34
GUEST_PAT support is a new feature introduced by Intel Core i7 architecture. With this, cpu would save/load guest and host PAT automatically, for EPT memory type in guest depends on MSR_IA32_CR_PAT. Also add save/restore for MSR_IA32_CR_PAT. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Improve MTRR structureSheng Yang2-3/+63
As well as reset mmu context when set MTRR. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31x86: Export some definition of MTRRSheng Yang3-26/+28
For KVM can reuse the type define, and need them to support shadow MTRR. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31x86: Rename mtrr_state struct and macro namesSheng Yang3-9/+10
Prepare for exporting them. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: call kvm_arch_vcpu_reset() instead of the kvm_x86_ops callbackGleb Natapov1-1/+1
Call kvm_arch_vcpu_reset() instead of directly using arch callback. The function does additional things. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: work around lacking VNMI supportJan Kiszka1-59/+115
Older VMX supporting CPUs do not provide the "Virtual NMI" feature for tracking the NMI-blocked state after injecting such events. For now KVM is unable to inject NMIs on those CPUs. Derived from Sheng Yang's suggestion to use the IRQ window notification for detecting the end of NMI handlers, this patch implements virtual NMI support without impact on the host's ability to receive real NMIs. The downside is that the given approach requires some heuristics that can cause NMI nesting in vary rare corner cases. The approach works as follows: - inject NMI and set a software-based NMI-blocked flag - arm the IRQ window start notification whenever an NMI window is requested - if the guest exits due to an opening IRQ window, clear the emulated NMI-blocked flag - if the guest net execution time with NMI-blocked but without an IRQ window exceeds 1 second, force NMI-blocked reset and inject anyway This approach covers most practical scenarios: - succeeding NMIs are seperated by at least one open IRQ window - the guest may spin with IRQs disabled (e.g. due to a bug), but leaving the NMI handler takes much less time than one second - the guest does not rely on strict ordering or timing of NMIs (would be problematic in virtualized environments anyway) Successfully tested with the 'nmi n' monitor command, the kgdbts testsuite on smp guests (additional patches required to add debug register support to kvm) + the kernel's nmi_watchdog=1, and a Siemens- specific board emulation (+ guest) that comes with its own NMI watchdog mechanism. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Provide support for user space injected NMIsJan Kiszka1-0/+33
This patch adds the required bits to the VMX side for user space injected NMIs. As with the preexisting in-kernel irqchip support, the CPU must provide the "virtual NMI" feature for proper tracking of the NMI blocking state. Based on the original patch by Sheng Yang. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Support for user space injected NMIsJan Kiszka3-4/+55
Introduces the KVM_NMI IOCTL to the generic x86 part of KVM for injecting NMIs from user space and also extends the statistic report accordingly. Based on the original patch by Sheng Yang. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Kick NMI receiving VCPUJan Kiszka2-0/+2
Kick the NMI receiving VCPU in case the triggering caller runs in a different context. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: VCPU with pending NMI is runnabledJan Kiszka1-1/+2
Ensure that a VCPU with pending NMIs is considered runnable. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Enable NMI Watchdog via in-kernel PIT sourceJan Kiszka3-5/+45
LINT0 of the LAPIC can be used to route PIT events as NMI watchdog ticks into the guest. This patch aligns the in-kernel irqchip emulation with the user space irqchip with already supports this feature. The trick is to route PIT interrupts to all LAPIC's LVT0 lines. Rebased and slightly polished patch originally posted by Sheng Yang. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: fix real-mode NMI supportJan Kiszka1-0/+13
Fix NMI injection in real-mode with the same pattern we perform IRQ injection. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: refactor IRQ and NMI window enablingJan Kiszka1-46/+32
do_interrupt_requests and vmx_intr_assist go different way for achieving the same: enabling the nmi/irq window start notification. Unify their code over enable_{irq|nmi}_window, get rid of a redundant call to enable_intr_window instead of direct enable_nmi_window invocation and unroll enable_intr_window for both in-kernel and user space irq injection accordingly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: refactor/fix IRQ and NMI injectability determinationJan Kiszka2-25/+22
There are currently two ways in VMX to check if an IRQ or NMI can be injected: - vmx_{nmi|irq}_enabled and - vcpu.arch.{nmi|interrupt}_window_open. Even worse, one test (at the end of vmx_vcpu_run) uses an inconsistent, likely incorrect logic. This patch consolidates and unifies the tests over {nmi|interrupt}_window_open as cache + vmx_update_window_states for updating the cache content. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Reset pending/inject NMI state on CPU resetJan Kiszka1-0/+3
CPU reset invalidates pending or already injected NMIs, therefore reset the related state variables. Based on original patch by Gleb Natapov. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Support for NMI task gatesJan Kiszka1-3/+15
Properly set GUEST_INTR_STATE_NMI and reset nmi_injected when a task-switch vmexit happened due to a task gate being used for handling NMIs. Also avoid the false warning about valid vectoring info in kvm_handle_exit. Based on original patch by Gleb Natapov. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Use INTR_TYPE_NMI_INTR instead of magic valueJan Kiszka1-2/+2
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: include all IRQ window exits in statisticsJan Kiszka1-1/+1
irq_window_exits only tracks IRQ window exits due to user space requests, nmi_window_exits include all exits. The latter makes more sense, so let's adjust irq_window_exits accounting. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: consolidate push regGuillaume Thouvenin1-7/+1
This patch consolidate the emulation of push reg instruction. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-30tracing: removed duplicated #includeHuang Weiyi1-1/+0
Removed duplicated #include in kernel/trace/trace.c. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-30IB/mlx4: Fix reading SL field out of cqe->sl_vidRoland Dreier1-1/+1
Commit f780a9f1 ("mlx4_core: Add ethernet fields to CQE struct") introduced a bug in how wc->sl is set in mlx4_ib_poll_one() -- since cqe->sl_vid is a big-endian value, the shift must be done after converting to host endianness. This bug was found using sparse endianness checking. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-30fs/nfs/nfs4proc.c: make nfs4_map_errors() staticWANG Cong2-2/+1
nfs4_map_errors() can become static. Signed-off-by: WANG Cong <wangcong@zeuux.org> Cc: J. Bruce Fields <bfields@fieldses.org> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2008-12-30[SCSI] fcoe: fix configuration problemsJames Bottomley1-2/+2
fcoe selects libfc and requires SCSI and PCI (the SCSI requirement is implicitly covered by an enclosing if). Fix them both up so they cannot be configured in an invalid state: make LIBFC select SCSI_FC_ATTRS and make FCOE depend on PCI and select LIBFC. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-30[SCSI] cxgb3i: fix select/depend problemJames Bottomley2-1/+7
cxgb3i requires the cxgb3 net driver, so it selects it. However, cxgb3 has dependencies which the select cannot see. Fix this by separating out the cxgb3 dependencies into a separate hidden config option (CONFIG_CHELSIO_T3_DEPENDS) and make both cxgb3 and cxgb3i depend on it. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Karen Xie <kxie@chelsio.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-30[SCSI] fcoe: fix incorrect use of struct moduleJames Bottomley1-5/+5
This structure may not be defined if CONFIG_MODULE=n, so never deref it. Change uses of module->name to module_name(module) and corrects some dyslexic printks and docbook comments. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-30[SCSI] cxgb3i: remove use of skb->spKaren Xie2-7/+7
The cxgb3i was using skb->sp pointer for some internal book-keeping which is not related to the secure path. Changed it to use skb->cb[] instead. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karen Xie <kxie@chelsio.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-30[SCSI] cxgb3i: Add cxgb3i iSCSI driver.Karen Xie14-0/+4873
This patch implements the cxgb3i iscsi connection acceleration for the open-iscsi initiator. The cxgb3i driver offers the iscsi PDU based offload: - digest insertion and verification - payload direct-placement into host memory buffer. Signed-off-by: Karen Xie <kxie@chelsio.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-30V4L/DVB (10130): use USB API functions rather than constantsJulia Lawall8-25/+17
This set of patches introduces calls to the following set of functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_is_isoc_in(epd) usb_endpoint_is_isoc_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) In some cases, introducing one of these functions is not possible, and it just replaces an explicit integer value by one of the following constants: USB_ENDPOINT_XFER_BULK USB_ENDPOINT_XFER_CONTROL USB_ENDPOINT_XFER_INT USB_ENDPOINT_XFER_ISOC An extract of the semantic patch that makes these changes is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r1@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == - \(USB_ENDPOINT_XFER_CONTROL\|0\)) + usb_endpoint_xfer_control(epd) @r5@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == - \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10129): dvb: remove deprecated use of RW_LOCK_UNLOCKED in frontendsSteven Rostedt2-8/+8
Impact: clean up RW_LOCK_UNLOCKED is deprecated. This patch replaces it with the __RW_LOCK_UNLOCKED(lock) macro. This change was a little trickier than others due to the macro being used in another macro that fills an array. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10128): modify V4L documentation to be a valid XHTMLNémeth Márton1-16/+27
Modify Documentation/video4linux/API.html to be a valid XHTML 1.0 Strict. The result was verified using the http://validator.w3.org/ service. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10127): stv06xx: Avoid having y unitializedErik Andrén1-2/+4
As pointed by gcc: drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c: In function ‘hdcs_set_size’: drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c:301: warning: ‘y’ may be used uninitialized in this function Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10125): em28xx: Don't do AC97 vendor detection for i2s audio devicesDevin Heitmueller1-1/+2
The current code was trying to query the AC97 registers for the vendor information even if it was clearly not a AC97 audio device (resulting in errors in the dmesg output). This was due to a bug in the way we did the check. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10124): em28xx: expand output formats availableDevin Heitmueller2-1/+14
Add additional output formats, which will be useful for the Pinnacle PCTV Ultimate 880e integration with the saa7136. Thanks to Ray Lu from Empia for providing the em2860/em2880 datasheet. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10123): em28xx: fix reversed definitions of I2S audio modesDevin Heitmueller1-2/+2
Noticed when doing the audio support for the Pinnacle PCTV HD Ultimate 808e that the modes were incorrect (the 808e uses I2S in 5 sample mode) Thanks for Ray Lu from Empia for providing the em2860/em2880 datasheet. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10122): em28xx: don't load em28xx-alsa for em2870 based devicesDevin Heitmueller1-1/+1
Like the em2874, the em2870 does not have any analog support, so don't bother loading the em28xx-alsa module. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10121): em28xx: remove worthless Pinnacle PCTV HD Mini 80e device profileDevin Heitmueller3-36/+0
The Pinnacle 80e cannot be supported since Micronas yanked their driver support for the drx-j chipset at the last minute. Remove the device profile since it cannot work without the drx driver and it being there is only likely to confuse people into thinking the device is supported but not working. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10120): em28xx: remove redundant Pinnacle Dazzle DVC 100 profileDevin Heitmueller3-16/+0
The DVC 100 profile is redundant since we already have an existing identical profile named "Pinnacle Dazzle DVC 90/DVC 100" Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10119): em28xx: fix corrupted XCLK valueDevin Heitmueller1-11/+13
Correct problem introduced during the board refactoring where the XCLK frequency would get zero'd out. The sequence of events was as follows: em28xx_pre_card_setup() called em28xx_set_model() em28xx_set_model() would memcpy to dev->board configuration em28xx_pre_card_setup() would set the dev->board.xclk if not set em28xx_pre_card_setup() would set the XCLK register based on dev->board.xclk ... em28xx_card_setup() would call em28xx_set_model() em28xx_set_model() would memcpy to dev->board configuration (clearing out value of dev->board.xclk set in em28xx_pre_card_setup) ... em28xx_audio_analog_set() sets the XCLK register based on dev->board.xclk (which now contains zero) The change sets the default XCLK and I2C Clock fields in the board definition inside of em28xx_set_model() so that subsequent calls do not cause the values to be overwritten. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>