On 07/03/2012 04:15 PM, Peter Lieven wrote:
> On 03.07.2012 15:13, Avi Kivity wrote:
>> On 07/03/2012 04:01 PM, Peter Lieven wrote:
>>> Further output from my testing.
>>>
>>> Working:
>>> Linux 2.6.38 with included kvm module
>>> Linux 3.0.0 w
On 07/03/2012 04:14 PM, Peter Maydell wrote:
> On 3 July 2012 14:10, Avi Kivity wrote:
>> Or you could just call kvm_vcpu_block() here without having the
>> variable. But eventually you'll need it since you want to expose wfi
>> state to userspace for live migration.
On 07/03/2012 04:01 PM, Peter Lieven wrote:
> Further output from my testing.
>
> Working:
> Linux 2.6.38 with included kvm module
> Linux 3.0.0 with included kvm module
>
> Not-Working:
> Linux 3.2.0 with included kvm module
> Linux 2.6.28 with kvm-kmod 3.4
> Linux 3.0.0 with kvm-kmod 3.4
> Linu
On 07/03/2012 12:02 PM, Christoffer Dall wrote:
> From: Christoffer Dall
>
> When the guest executes a WFI instruction the operation is trapped to
> KVM, which emulates the instruction in software. There is no correlation
> between a guest executing a WFI instruction and actually putting the
> ha
On 07/03/2012 12:50 PM, Zhengwang Ruan wrote:
> Hi kashyapc & all,
>
> I see a piece of code in vmx_vcpu_run as below, is it used to switch
> context to a guest? Kvm don't used "vmlaunch" or "vmresume" to launch or
> resume a guest?
You trimmed the bit that contains vmlaunch/vmresume.
Why does
On 07/03/2012 12:01 PM, Christoffer Dall wrote:
> Provides complete world-switch implementation to switch to other guests
> running in non-secure modes. Includes Hyp exception handlers that
> capture necessary exception information and stores the information on
> the VCPU and KVM structures.
>
> T
On 07/02/2012 06:51 PM, Alex Williamson wrote:
> On Fri, 2012-06-29 at 09:56 -0600, Alex Williamson wrote:
>> Before we start fiddling with what we can and can't add to KVM_IRQFD
>> we need to figure out if anyone has been sloppy in their use of the
>> ioctl flags. This series has a minor cleanup
On 06/28/2012 12:38 PM, Peter Lieven wrote:
> does anyone know whats that here in handle_mmio?
>
> /* hack: Red Hat 7.1 generates these weird accesses. */
> if ((addr > 0xa-4 && addr <= 0xa) && kvm_run->mmio.len == 3)
> return 0;
>
Just what it says. There is a 4-byte ac
On 06/26/2012 07:39 PM, Alexander Graf wrote:
> When running QEMU without -cpu parameter, the user usually wants a sane
> default. So far, we're using the qemu64/qemu32 CPU type, which basically
> means "the maximum TCG can emulate".
>
> That's a really good default when using TCG, but when runnin
On 06/26/2012 07:39 PM, Alexander Graf wrote:
> During discussions on whether to make -cpu host the default in SLE, I found
> myself disagreeing to the thought, because it potentially opens a big can
> of worms for potential bugs. But if I already am so opposed to it for SLE, how
> can it possibly
On 07/02/2012 05:09 PM, Takuya Yoshikawa wrote:
> On Mon, 02 Jul 2012 15:41:30 +0300
> Avi Kivity wrote:
>
>> kvm_mmu_slot_remove_write_access: same. It's hard to continue the loop
>> after a lockbreak though. We can switch it to be rmap based instead.
>
> Sw
On 06/21/2012 08:54 PM, Christoffer Dall wrote:
>>> @@ -504,6 +514,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu
>>> *vcpu, struct kvm_run *run)
>>>*/
>>> preempt_disable();
>>> local_irq_disable();
>>> +
>>> + if (check_new_vmid_gen(kvm))
On 07/02/2012 03:05 PM, Avi Kivity wrote:
> We need something for lockbreaking too:
>
>def mmu_lockbreak():
>if not (contended or need_resched):
>return False
>remember flush counter
>cond_resched_lock
>return flush counter
Revisiting after hiatus.
On 05/21/2012 11:58 PM, Marcelo Tosatti wrote:
> On Thu, May 17, 2012 at 01:24:42PM +0300, Avi Kivity wrote:
>> Signed-off-by: Avi Kivity
>> ---
>> virt/kvm/kvm_main.c | 16
>> 1 file changed, 8 insertions(+), 8 deletions(
On 07/02/2012 12:30 PM, Jan Kiszka wrote:
> On 2012-07-02 11:18, Michael S. Tsirkin wrote:
>> I've been thinking hard about Jan's patches for device
>> assignment. Basically while I thought it makes sense
>> to make all devices: assignment and not - behave the
>> same and use same APIs for injectin
On 07/02/2012 12:18 PM, Michael S. Tsirkin wrote:
> I've been thinking hard about Jan's patches for device
> assignment. Basically while I thought it makes sense
> to make all devices: assignment and not - behave the
> same and use same APIs for injecting irqs, Anthony thinks there is huge
> value
KVM: MMU: Add memslot parameter to hva handlers
> KVM: MMU: Push trace_kvm_age_page() into kvm_age_rmapp()
> KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range()
>
Reviewed-by: Avi Kivity
--
error compiling committee.c: too many arguments to function
--
To unsubscri
On 07/02/2012 12:07 PM, Avi Kivity wrote:
>
> Reviewed-by: Avi Kivity
(for the entire patchset)
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger
but can also applied to other regions, e.g.
> of the same device, by calling memory_region_set_flush_coalesced.
Looks fine.
I have a hard time deciding whether this should go through the kvm tree
or memory tree. Anthony, perhaps you can commit it directly to avoid
the livelock?
Reviewed
On 07/02/2012 03:32 AM, Mao, Junjie wrote:
>> > I think this means I can replace the code here with a check in
>> nested_vmx_run. Do I understand correctly?
>>
>> Correct, but the check already exists:
>> if (!vmx_control_verify(vmcs12->cpu_based_vm_exec_control,
>> nested_vmx_procba
On 07/01/2012 04:18 PM, Takuya Yoshikawa wrote:
> On Sun, 01 Jul 2012 10:41:05 +0300
> Avi Kivity wrote:
>
>> >> > Note: in the new code we could not use trace_kvm_age_page(), so we just
>> >> > dropped the point from kvm_handle_hva_range().
>> >
On 07/01/2012 12:44 PM, Michael S. Tsirkin wrote:
> On Sun, Jul 01, 2012 at 12:41:45PM +0300, Avi Kivity wrote:
>> On 06/29/2012 09:05 PM, Randy Dunlap wrote:
>> > On 06/29/2012 12:53 AM, Stephen Rothwell wrote:
>> >
>> >> Hi all,
>> >>
>
On 06/29/2012 09:05 PM, Randy Dunlap wrote:
> On 06/29/2012 12:53 AM, Stephen Rothwell wrote:
>
>> Hi all,
>>
>> Changes since 20120628:
>
>
>
> on i386:
>
> arch/x86/built-in.o: In function `kvm_guest_apic_eoi_write':
> kvm.c:(.text+0x3561f): undefined reference to `apic'
>
>
> Full randco
On 06/28/2012 10:27 PM, Peter Lieven wrote:
>
> Am 28.06.2012 um 18:32 schrieb Avi Kivity:
>
>> On 06/28/2012 07:29 PM, Peter Lieven wrote:
>>>> Yes. A signal is sent, and KVM returns from the guest to userspace on
>>>> pending signals.
>>
>>
On 06/29/2012 04:46 AM, Takuya Yoshikawa wrote:
> On Thu, 28 Jun 2012 20:53:47 +0300
> Avi Kivity wrote:
>
>> > Note: in the new code we could not use trace_kvm_age_page(), so we just
>> > dropped the point from kvm_handle_hva_range().
>> >
>>
>>
On 06/29/2012 12:25 PM, Tomoki Sekiyama wrote:
> Hi, thanks for your comments.
>
> On 2012/06/29 2:34, Avi Kivity wrote:
> > On 06/28/2012 08:26 PM, Jan Kiszka wrote:
> >>> This is both impressive and scary. What is the target scenario here?
> >>> Part
On 06/29/2012 05:37 AM, Mao, Junjie wrote:
> >
> > >
> > > static void vmx_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2
> > > *entry) @@ -6610,6 +6641,9 @@ static void prepare_vmcs02(struct
> > kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
> > > page_to_phys(vmx->nes
On 06/28/2012 05:02 AM, Takuya Yoshikawa wrote:
> When we invalidate a THP page, we call the handler with the same
> rmap_pde argument 512 times in the following loop:
>
> for each guest page in the range
> for each level
> unmap using rmap
>
> This patch avoids these extra handler ca
On 06/28/2012 06:45 AM, Takuya Yoshikawa wrote:
> On Thu, 28 Jun 2012 11:12:51 +0800
> Xiao Guangrong wrote:
>
>> > struct kvm_arch_memory_slot {
>> > + unsigned long *rmap_pde[KVM_NR_PAGE_SIZES - 1];
>> >struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1];
>> > };
>> >
>>
>> It loo
On 06/28/2012 08:26 PM, Jan Kiszka wrote:
>>
>> This is both impressive and scary. What is the target scenario here?
>> Partitioning? I don't see this working for generic consolidation.
>>
>
> From my POV, partitioning - including hard realtime partitions - would
> provide some use cases. But,
On 06/28/2012 09:07 AM, Tomoki Sekiyama wrote:
> Add path to migrate execution of vcpu_enter_guest to a slave CPU when
> vcpu->arch.slave_cpu is set.
>
> After moving to the slave CPU, it goes back to the online CPU when the
> guest is exited by reasons that cannot be handled by the slave CPU only
On 06/28/2012 09:07 AM, Tomoki Sekiyama wrote:
> Hello,
>
> This RFC patch series provides facility to dedicate CPUs to KVM guests
> and enable the guests to handle interrupts from passed-through PCI devices
> directly (without VM exit and relay by the host).
>
> With this feature, we can improve
On 06/28/2012 09:08 AM, Tomoki Sekiyama wrote:
> Since NMI can not be disabled around VM enter, there is a race between
> receiving NMI to kick a guest and entering the guests on slave CPUs.If the
> NMI is received just before entering VM, after the NMI handler is invoked,
> it continues entering t
On 06/28/2012 09:08 AM, Tomoki Sekiyama wrote:
> For slave CPUs, it is inapropriate to request TLB flush using IPI.
> because the IPI may be sent to a KVM guest when the slave CPU is running
> the guest with direct interrupt routing.
>
> Instead, it registers a TLB flush request in per-cpu bitmask
On 06/28/2012 07:29 PM, Peter Lieven wrote:
>> Yes. A signal is sent, and KVM returns from the guest to userspace on
>> pending signals.
> is there a description available how this process exactly works?
The kernel part is in vcpu_enter_guest(), see the check for
signal_pending(). But this hasn'
On 06/24/2012 06:02 PM, Alex Williamson wrote:
> On Sun, 2012-06-24 at 15:56 +0300, Avi Kivity wrote:
>> On 06/23/2012 01:16 AM, Alex Williamson wrote:
>> > I think we're probably also going to need something like this.
>> > When running in non-accelerated qemu, we
On 06/27/2012 07:27 PM, Jan Kiszka wrote:
> Changes in v2:
> - added memory_region_clear_flush_coalesced
> - call memory_region_clear_flush_coalesced from
>memory_region_clear_coalescing
> - wrap all region manipulations via memory_region_transaction_begin/
>commit internally
> - flush
On 06/27/2012 07:27 PM, Jan Kiszka wrote:
> Instead of flushing pending coalesced MMIO requests on every vmexit,
> this provides a mechanism to selectively flush when memory regions
> related to the coalesced one are accessed. This first of all includes
> the coalesced region itself but can also ap
On 06/28/2012 06:49 PM, Avi Kivity wrote:
> On 06/14/2012 05:04 AM, Mao, Junjie wrote:
>> This patch handles PCID/INVPCID for guests.
>>
>> Process-context identifiers (PCIDs) are a facility by which a logical
>> processor
>> may cache information for multiple
On 06/14/2012 05:04 AM, Mao, Junjie wrote:
> This patch handles PCID/INVPCID for guests.
>
> Process-context identifiers (PCIDs) are a facility by which a logical
> processor
> may cache information for multiple linear-address spaces so that the processor
> may retain cached information when soft
On 06/28/2012 05:10 PM, Anthony Liguori wrote:
>>
>> 1. read_lock(memmap_lock)
>> 2. MemoryRegionSection mrs = lookup(addr)
>> 3. qom_ref(mrs.mr->dev)
>> 4. read_unlock(memmap_lock)
>>
>> 5. mutex_lock(dev->lock)
>> 6. dispatch(&mrs, addr, data, size)
>> 7. mutex_unlock(dev->lock)
>
> Just
On 06/27/2012 08:10 AM, Alex Williamson wrote:
> This is an alternate level irqfd de-assert mode that's potentially
> useful for emulated drivers. It's included here to show how easy it
> is to implement with the new level irqfd and eoifd support. It's
> possible this mode might also prove intere
On 06/28/2012 12:19 AM, Alex Williamson wrote:
>> > @@ -302,6 +385,7 @@ kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd
>> > *args)
>> > {
>> >struct _irqfd *irqfd, *tmp;
>> >struct eventfd_ctx *eventfd;
>> > + bool is_level = (args->flags & KVM_IRQFD_FLAG_LEVEL) != 0;
>>
>> != 0 i
On 06/27/2012 12:21 PM, Michael S. Tsirkin wrote:
> On Tue, Jun 26, 2012 at 11:09:32PM -0600, Alex Williamson wrote:
>> We only know of one so far.
>>
>> Signed-off-by: Alex Williamson
>
> Ugh. So we have a bug: we should have sanitized the fields.
> If there's buggy userspace that only set the
Instead of getting an exact leaf, follow the spec and fall back to the last
main leaf instead. This lets us easily emulate the cpuid instruction in the
emulator.
Signed-off-by: Avi Kivity
---
arch/x86/include/asm/kvm_emulate.h | 4 +--
arch/x86/kvm/emulate.c | 53
The operand size for these instructions is 8 bytes in long mode, even without
a REX prefix. Set it explicitly.
Triggered while booting Linux with emulate_invalid_guest_state=1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch
We correctly default to SS when BP is used as a base in 16-bit address mode,
but we don't do that for 32-bit mode.
Fix by adjusting the default to SS when either ESP or EBP is used as the base
register.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 17 ++---
1 file ch
Null SS is valid in long mode; allow loading it.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index db95a55..fe4340f 100644
--- a/arch/x86/kvm/emulate.c
+++ b
memop is not initialized; this can lead to a two-byte operation
following a 4-byte operation to see garbage values. Usually
truncation fixes things fot us later on, but at least in one case
(call abs) it doesn't.
Fix by moving memop to the auto-initialized field area.
Signed-off-by: Avi K
Our emulation should be complete enough that we can emulate guests
while they are in big real mode, or in a mode transition that is not
virtualizable without unrestricted guest support.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
If instruction emulation fails, report it properly to userspace.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 661df185..591dcea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch
This allows us to reuse the code without populating ctxt->src and
overriding ctxt->op_bytes.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 3
Checking EFLAGS.IF is incorrect as we might be in interrupt shadow. If
that is the case, the main loop will notice that and not inject the interrupt,
causing an endless loop.
Fix by using vmx_interrupt_allowed() to check if we can inject an interrupt
instead.
Signed-off-by: Avi Kivity
If we return early from an invalid guest state emulation loop, make
sure we return to it later if the guest state is still invalid.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index
Guest software doesn't actually depend on it, but vmx will refuse us
entry if we don't. Set the bit in both the cached segment and memory,
just to be nice.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 92a1add..97d9a99 100644
--- a
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index cfa5cc3..7b575ad 100644
--- a/arch
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7b575ad
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b4b326e
Process the event, possibly injecting an interrupt, before continuing.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 26e6bdf..661df185 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
Opcode C8.
Only ENTER with lexical nesting depth 0 is implemented, since others are
very rare. We'll fail emulation if nonzero lexical depth is used so data
is not corrupted.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 28 +++-
1 file changed, 27 inser
== 1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 90b549e..30f4912 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4517,12 +4517,12 @@ int
Opcode 9F.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5053e9e..90b549e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3227,6 +3227,13
Opcodes 0F 01 /0 and 0F 01 /1
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 33 +++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7552c0a..5053e9e 100644
--- a/arch/x86/kvm/emulate.c
Opcode c9; used by some variants of Windows during boot, in big real mode.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 25 -
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 24c8425..33ccd75
Otherwise, if the guest ends up looping, we never exit the srcu critical
section, which causes synchronize_srcu() to hang.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a9c0e40
Some userspace (e.g. QEMU 1.1) munge the d and g bits of segment
descriptors, causing us not to recognize them as unusable segments
with emulate_invalid_guest_state=1. Relax the check by testing for
segment not present (a non-present segment cannot be usable).
Signed-off-by: Avi Kivity
Opcode 0F A2.
Used by Linux during the mode change trampoline while in a state that is
not virtualizable on vmx without unrestricted_guest, so we need to emulate
it is emulate_invalid_guest_state=1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 16 +++-
1 file changed, 15
-off-by: Avi Kivity
---
arch/x86/kvm/cpuid.c | 38 --
arch/x86/kvm/cpuid.h | 1 +
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7df1c6d..44476fb 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86
!=RPL (noted by Kevin)
- fix SS base for ESP/EBP addressing without SIB
- more testing
Avi Kivity (26):
KVM: VMX: Return correct CPL during transition to protected mode
KVM: Split cpuid register access from computation
KVM: x86 emulator: change ->get_cpuid() accessor to use the
x27;t 100%
correct since we don't set the CPL cache on a far jump, but since protected
mode transition will always jump to a segment with RPL=0, it will always
work.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --
On 06/27/2012 06:18 PM, Avi Kivity wrote:
> This patchset fixes several bugs in the emulator and in vmx invalid guest
> state emulation. They are sufficient to boot several Linux and Windows
> guests, so the last patch turns vmx invalid guest state emulation on by
> default.
>
&g
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 4eea1e4..85f7a5f 100644
--- a/arch
Guest software doesn't actually depend on it, but vmx will refuse us
entry if we don't. Set the bit in both the cached segment and memory,
just to be nice.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c |8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --
Otherwise, if the guest ends up looping, we never exit the srcu critical
section, which causes synchronize_srcu() to hang.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a9c0e40
Opcodes 0F 01 /0 and 0F 01 /1
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 33 +++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7552c0a..5053e9e 100644
--- a/arch/x86/kvm/emulate.c
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index cfa5cc3..7b575ad 100644
--- a/arch
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7b575ad
Our emulation should be complete enough that we can emulate guests
while they are in big real mode, or in a mode transition that is not
virtualizable without unrestricted guest support.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 92a1add..97d9a99 100644
--- a
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b4b326e
The operand size for these instructions is 8 bytes in long mode, even without
a REX prefix. Set it explicitly.
Triggered while booting Linux with emulate_invalid_guest_state=1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index c804db2
Guest software doesn't actually depend on it, but vmx will refuse us
entry if we don't. Set the bit in both the cached segment and memory,
just to be nice.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
If instruction emulation fails, report it properly to userspace.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 661df185..591dcea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch
Process the event, possibly injecting an interrupt, before continuing.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 26e6bdf..661df185 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
Opcode C8.
Only ENTER with lexical nesting depth 0 is implemented, since others are
very rare. We'll fail emulation if nonzero lexical depth is used so data
is not corrupted.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 28 +++-
1 file changed, 27 inser
This allows us to reuse the code without populating ctxt->src and
overriding ctxt->op_bytes.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 3
== 1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 90b549e..30f4912 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4517,12 +4517,12 @@ int
Opcode 9F.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5053e9e..90b549e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3227,6 +3227,13
If we return early from an invalid guest state emulation loop, make
sure we return to it later if the guest state is still invalid.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index
Checking EFLAGS.IF is incorrect as we might be in interrupt shadow. If
that is the case, the main loop will notice that and not inject the interrupt,
causing an endless loop.
Fix by using vmx_interrupt_allowed() to check if we can inject an interrupt
instead.
Signed-off-by: Avi Kivity
We correctly default to SS when BP is used as a base in 16-bit address mode,
but we don't do that for 32-bit mode.
Fix by adjusting the default to SS when either ESP or EBP is used as the base
register.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 17 ++---
1 file ch
memop is not initialized; this can lead to a two-byte operation
following a 4-byte operation to see garbage values. Usually
truncation fixes things fot us later on, but at least in one case
(call abs) it doesn't.
Fix by moving memop to the auto-initialized field area.
Signed-off-by: Avi K
Opcode c9; used by some variants of Windows during boot, in big real mode.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 25 -
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 24c8425..33ccd75
Some userspace (e.g. QEMU 1.1) munge the d and g bits of segment
descriptors, causing us not to recognize them as unusable segments
with emulate_invalid_guest_state=1. Relax the check by testing for
segment not present (a non-present segment cannot be usable).
Signed-off-by: Avi Kivity
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index dff416f..218e731 100644
--- a
Null SS is valid in long mode; allow loading it.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index db95a55..fe4340f 100644
--- a/arch/x86/kvm/emulate.c
+++ b
Opcode 0F A2.
Used by Linux during the mode change trampoline while in a state that is
not virtualizable on vmx without unrestricted_guest, so we need to emulate
it is emulate_invalid_guest_state=1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 16 +++-
1 file changed, 15
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 85f7a5f
901 - 1000 of 14281 matches
Mail list logo