We can know the guest is panicked when the guest runs on xen.
But we do not have such feature on kvm.
Another purpose of this feature is: management app(for example:
libvirt) can do auto dump when the guest is panicked. If management
app does not do auto dump, the guest's user can do dump by hand
The guest should run after reseting it, but it does not
run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED.
Signed-off-by: Wen Congyang we...@cn.fujitsu.com
---
block.h |2 ++
qmp.c |2 +-
vl.c|3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff
Signed-off-by: Wen Congyang we...@cn.fujitsu.com
---
linux-headers/asm-x86/kvm_para.h |2 ++
linux-headers/linux/kvm_para.h |6 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/linux-headers/asm-x86/kvm_para.h b/linux-headers/asm-x86/kvm_para.h
index
Add a new runstate RUN_STATE_GUEST_PANICKED. The guest can be in this
state if it is paused due to panicked event.
Signed-off-by: Wen Congyang we...@cn.fujitsu.com
---
qapi-schema.json |6 +-
qmp.c|3 ++-
vl.c |7 ++-
3 files changed, 13 insertions(+),
Add a new qevent QEVENT_GUEST_PANICKED. QEMU will emit this
event if the guest is panicked.
Signed-off-by: Wen Congyang we...@cn.fujitsu.com
---
monitor.c |1 +
monitor.h |1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/monitor.c b/monitor.c
index f6107ba..28f7482
When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
So if qemu reads 0x1 from this port, we can do the folloing three
things according to the parameter -onpanic:
1. emit QEVENT_GUEST_PANICKED only
2. emit QEVENT_GUEST_PANICKED and pause the guest
3. emit QEVENT_GUEST_PANICKED
On Tue, Jun 26, 2012 at 8:34 PM, Marcelo Tosatti mtosa...@redhat.com wrote:
On Sat, Jun 23, 2012 at 12:55:49AM +0200, Jan Kiszka wrote:
net.txt
iothread flow
=
1) Skip-work-if-device-locked
select(tap fd ready)
tap_send
if (trylock(TAPState-NetClientState-dev))
The action is the same as -onpanic parameter.
Signed-off-by: Wen Congyang we...@cn.fujitsu.com
---
qemu-config.c |4
qemu-options.hx |4 +++-
vl.c|7 +++
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/qemu-config.c b/qemu-config.c
index
On Wed, Jun 27, 2012 at 8:39 AM, Stefan Hajnoczi stefa...@gmail.com wrote:
On Tue, Jun 26, 2012 at 8:34 PM, Marcelo Tosatti mtosa...@redhat.com wrote:
On Sat, Jun 23, 2012 at 12:55:49AM +0200, Jan Kiszka wrote:
net.txt
iothread flow
=
1) Skip-work-if-device-locked
On 06/26/2012 10:34 PM, Marcelo Tosatti 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)
8.
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index d171a56..a083c7a 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1287,6 +1287,20 @@ void test_jcxz(void)
This series adds unit tests for the big real mode kernel patchset.
Avi Kivity (12):
realmode: test cpuid
emulator: test leave
emulator: test long-mode lidt/lgdt
emulator: check for mov null, %ss
realmode: test for ss base used with esp/ebp base register
realmode: test sigt/sgdt
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/x86/emulator.c b/x86/emulator.c
index 969944a..4867f58 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -213,7 +213,7 @@ void test_push(void *mem)
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index a083c7a..b1d089a 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1301,6 +1301,23 @@ static void test_cpuid(void)
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index b1d089a..98a25c2 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1318,6 +1318,23 @@ static void
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index 29f3461..710a06b 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1356,6 +1356,15 @@ static void test_movzx_movsx(void)
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/x86/emulator.c b/x86/emulator.c
index a18ba27..9e76de8 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -213,7 +213,7 @@ void test_push(void *mem)
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index a2cc8a9..29f3461 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1344,6 +1344,18 @@ static void test_lahf(void)
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/x86/emulator.c b/x86/emulator.c
index 9e76de8..e251933 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -787,6 +787,22 @@ static void test_sreg(volatile uint16_t
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/x86/emulator.c b/x86/emulator.c
index e251933..24b33d1 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -803,6 +803,22 @@ static void test_lldt(volatile uint16_t
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/realmode.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/x86/realmode.c b/x86/realmode.c
index 98a25c2..a2cc8a9 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1335,6 +1335,15 @@ static void test_sgdt_sidt(void)
But check that rpl matches cpl.
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 28
1 file changed, 28 insertions(+)
diff --git a/x86/emulator.c b/x86/emulator.c
index 337429c..a18ba27 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -747,6 +747,33
A bug in kvm caused it to fail on long-mode lidt/lgdt. This patch tests for
the failure.
However, kvm doesn't allow lidt/lgdt from mmio, so the test is disabled.
Signed-off-by: Avi Kivity a...@redhat.com
---
x86/emulator.c | 30 ++
1 file changed, 30 insertions(+)
This patch set exports offsets of VMCS fields as note information for
kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve
runtime state of guest machine image, such as registers, in host
machine's crash dump as VMCS format. The problem is that VMCS internal
is hidden by Intel in its
This patch provides a set of variables to hold the VMCSINFO and also
some helper functions to help fill the VMCSINFO.
Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com
---
arch/x86/include/asm/vmcsinfo.h | 219 ++
arch/x86/include/asm/vmx.h | 158 +
A new module named vmcsinfo-intel is used to fill VMCSINFO. And
this module depends on kvm-intel and kvm module. So we should
export some symbols of kvm-intel and kvm module that are needed
by vmcsinfo-intel.
Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com
---
arch/x86/include/asm/vmx.h |
This patch implements a new module named vmcsinfo-intel. The
module fills VMCSINFO with the VMCS revision identifier,
and offsets of VMCS fields.
Note, offsets of fields below will not be filled into VMCSINFO:
1. fields defined in Intel specification (Intel® 64 and
IA-32 Architectures Software
This patch export offsets of fields via /sys/devices/cpu/vmcs/.
Individual offsets are contained in subfiles named by the filed's
encoding, e.g.: /sys/devices/cpu/vmcs/0800
Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com
---
drivers/base/core.c | 13 +
1 files changed, 13
Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com
---
Documentation/ABI/testing/sysfs-devices-cpu-vmcs | 11 +++
1 files changed, 11 insertions(+), 0 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-devices-cpu-vmcs
diff --git
On Tue, Jun 26, 2012 at 04:21:58PM -0700, Frank Swiderski wrote:
On Tue, Jun 26, 2012 at 2:47 PM, Michael S. Tsirkin m...@redhat.com wrote:
On Tue, Jun 26, 2012 at 02:31:26PM -0700, Frank Swiderski wrote:
On Tue, Jun 26, 2012 at 1:40 PM, Rik van Riel r...@redhat.com wrote:
On 06/26/2012
On Tue, Jun 26, 2012 at 04:45:36PM -0700, Frank Swiderski wrote:
On Tue, Jun 26, 2012 at 2:45 PM, Rik van Riel r...@redhat.com wrote:
On 06/26/2012 05:31 PM, Frank Swiderski wrote:
On Tue, Jun 26, 2012 at 1:40 PM, Rik van Rielr...@redhat.com wrote:
The code looks good to me, my only
irqfd sets and clears the level immediately.
This used to be necessary for MSI interrupts but isn't anymore.
Note! We never officially supported irqfd for level
interrupts but it usually seemed to kind of work,
and this change will break it. There are no known
real users of that feature though -
On Tue, Jun 26, 2012 at 11:08:52PM -0600, Alex Williamson wrote:
I don't address whether injecting an edge irqfd really needs an assert
followed by de-assert (I don't know).
So I just sent a patch removing that (works fine for me),
and we'll see what others say. If it gets applied
your patch
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 alex.william...@redhat.com
Ugh. So we have a bug: we should have sanitized the fields.
If there's buggy userspace that only set the low bit
it will break with this
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
In order to inject an interrupt from an external source using an
irqfd, we need to allocate a new irq_source_id. This allows us to
assert and (later) de-assert an interrupt line independently from
users of KVM_IRQ_LINE and avoid
On Tue, Jun 26, 2012 at 11:09:04PM -0600, Alex Williamson wrote:
Prune this down to just the struct kvm_irqfd so we can avoid
changing function definition for every flag or field we use.
Signed-off-by: Alex Williamson alex.william...@redhat.com
This is not needed anymore, right? We are not
On (Tue) 26 Jun 2012 [13:32:58], Frank Swiderski wrote:
This implementation of a virtio balloon driver uses the page cache to
store pages that have been released to the host. The communication
(outside of target counts) is one way--the guest notifies the host when
it adds a page to the page
On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
This new ioctl enables an eventfd to be triggered when an EOI is
written for a specified irqchip pin. By default this is a simple
notification, but we can also tie the eoifd to a level irqfd, which
enables the irqchip pin to be
On Wed, 27 Jun 2012 00:41:06 +0300, Michael S. Tsirkin m...@redhat.com
wrote:
On Tue, Jun 26, 2012 at 01:32:58PM -0700, Frank Swiderski wrote:
This implementation of a virtio balloon driver uses the page cache to
store pages that have been released to the host. The communication
(outside
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
In order to inject an interrupt from an external source using an
irqfd, we need to allocate a new irq_source_id. This allows us to
assert and (later) de-assert an interrupt line independently from
users of KVM_IRQ_LINE and avoid
On Tue, Jun 26, 2012 at 11:09:17PM -0600, Alex Williamson wrote:
Signed-off-by: Alex Williamson alex.william...@redhat.com
Acked-by: Michael S. Tsirkin m...@redhat.com
---
Documentation/virtual/kvm/api.txt | 16
1 file changed, 16 insertions(+)
diff --git
On Tue, Jun 26, 2012 at 11:08:52PM -0600, Alex Williamson wrote:
Ok, let's see how this flies. I actually quite like this, so be
gentle tearing it apart ;)
I just couldn't bring myself to contort KVM_IRQFD into something
that either sets up an irqfd or specifies a nearly unrelated EOI
On Wed, Jun 27, 2012 at 12:13:43PM +0300, Michael S. Tsirkin wrote:
irqfd sets and clears the level immediately.
This used to be necessary for MSI interrupts but isn't anymore.
Note! We never officially supported irqfd for level
interrupts but it usually seemed to kind of work,
and this
On Wed, Jun 27, 2012 at 01:03:46PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 12:13:43PM +0300, Michael S. Tsirkin wrote:
irqfd sets and clears the level immediately.
This used to be necessary for MSI interrupts but isn't anymore.
Note! We never officially supported irqfd for
On Wed, Jun 27, 2012 at 01:20:24PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:03:46PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 12:13:43PM +0300, Michael S. Tsirkin wrote:
irqfd sets and clears the level immediately.
This used to be necessary for MSI interrupts
Hi,
we recently came across multiple VMs racing and stopping working. It
seems to happen when the system is at 100% cpu.
One way to reproduce this is:
qemu-kvm-1.0.1 with vnc-thread enabled
cmdline (or similar):
/usr/bin/qemu-kvm-1.0.1 -net
On Wed, Jun 27, 2012 at 08:41:49AM +0100, Stefan Hajnoczi wrote:
On Wed, Jun 27, 2012 at 8:39 AM, Stefan Hajnoczi stefa...@gmail.com wrote:
On Tue, Jun 26, 2012 at 8:34 PM, Marcelo Tosatti mtosa...@redhat.com
wrote:
On Sat, Jun 23, 2012 at 12:55:49AM +0200, Jan Kiszka wrote:
net.txt
On Wed, Jun 27, 2012 at 01:22:54PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 01:20:24PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:03:46PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 12:13:43PM +0300, Michael S. Tsirkin wrote:
irqfd sets and clears the
-Original Message-
From: Wood Scott-B07421
Sent: Wednesday, June 27, 2012 1:35 AM
To: Caraman Mihai Claudiu-B02008
Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
d...@lists.ozlabs.org; qemu-...@nongnu.org
Subject: Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR
-Original Message-
From: Benjamin Herrenschmidt [mailto:b...@kernel.crashing.org]
Sent: Wednesday, June 27, 2012 1:13 AM
To: Caraman Mihai Claudiu-B02008
Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
d...@lists.ozlabs.org; qemu-...@nongnu.org
Subject: Re: [RFC PATCH
On Wed, Jun 27, 2012 at 02:38:43PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:22:54PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 01:20:24PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:03:46PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at
From: David Gibson da...@gibson.dropbear.id.au
This adds support for then new reset htab ioctl which allows qemu
to properly cleanup the MMU hash table when the guest is reset. With
the corresponding kernel support, reset of a guest now works properly.
This also paves the way for indicating a
On Wed, 2012-06-27 at 22:10 +1000, Benjamin Herrenschmidt wrote:
From: David Gibson da...@gibson.dropbear.id.au
This adds support for then new reset htab ioctl which allows qemu
to properly cleanup the MMU hash table when the guest is reset. With
the corresponding kernel support, reset of a
On 27.06.2012, at 14:10, Benjamin Herrenschmidt wrote:
From: David Gibson da...@gibson.dropbear.id.au
This adds support for then new reset htab ioctl which allows qemu
to properly cleanup the MMU hash table when the guest is reset. With
the corresponding kernel support, reset of a guest
On Mon, Jun 25, 2012 at 10:55:52PM -0600, Alex Williamson wrote:
Hi,
VFIO has been kicking around for well over a year now and has been
posted numerous times for review. The pre-requirements are finally
available in linux-next (or will be in the 20120626 build) so I'd like
to request a new
[ Added Avi]
On Wed, 2012-06-27 at 09:41 +0900, Namhyung Kim wrote:
From: Namhyung Kim namhyung@lge.com
The kvm_emulate_insn tracepoint used __print_insn()
for printing its instructions. However it makes the
format of the event hard to parse as it reveals TP
internals.
Fortunately,
On 06/27/2012 03:49 PM, Steven Rostedt wrote:
[ Added Avi]
On Wed, 2012-06-27 at 09:41 +0900, Namhyung Kim wrote:
From: Namhyung Kim namhyung@lge.com
The kvm_emulate_insn tracepoint used __print_insn()
for printing its instructions. However it makes the
format of the event hard to
On Wed, 2012-06-27 at 15:54 +0300, Avi Kivity wrote:
Acked-by: Avi Kivity a...@redhat.com
Thanks Avi!
Some time ago we discussed moving the trace-cmd plugins to /lib/modules,
which would make this trace display as mov %edx,(%eax) instead of 89
10, even for non-trace-cmd users. Was there
On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
This new ioctl enables an eventfd to be triggered when an EOI is
written for a specified irqchip pin. By default this is a simple
notification, but we can also tie the eoifd to a level irqfd, which
enables the irqchip pin to be
On Tue, 26 Jun 2012 23:09:04 -0600
Alex Williamson alex.william...@redhat.com wrote:
Prune this down to just the struct kvm_irqfd so we can avoid
changing function definition for every flag or field we use.
Signed-off-by: Alex Williamson alex.william...@redhat.com
I'm currently trying to
On Wed, 2012-06-27 at 16:58 +0300, Gleb Natapov wrote:
On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
This new ioctl enables an eventfd to be triggered when an EOI is
written for a specified irqchip pin. By default this is a simple
notification, but we can also tie the
On Wed, 2012-06-27 at 12:35 +0300, Michael S. Tsirkin wrote:
On Tue, Jun 26, 2012 at 11:09:04PM -0600, Alex Williamson wrote:
Prune this down to just the struct kvm_irqfd so we can avoid
changing function definition for every flag or field we use.
Signed-off-by: Alex Williamson
On Wed, 2012-06-27 at 12:58 +0300, Michael S. Tsirkin wrote:
On Tue, Jun 26, 2012 at 11:08:52PM -0600, Alex Williamson wrote:
Ok, let's see how this flies. I actually quite like this, so be
gentle tearing it apart ;)
I just couldn't bring myself to contort KVM_IRQFD into something
On 2012-06-26 21:34, Marcelo Tosatti wrote:
The following plan would allow progressive convertion to parallel
operation.
Jan mentioned the MMIO handler-MMIO handler deadlock in a private message.
Jan: if there is recursive MMIO accesses, you can detect that and skip
such MMIO handlers in
On 2012-06-27 09:02, Wen Congyang wrote:
When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
So if qemu reads 0x1 from this port, we can do the folloing three
things according to the parameter -onpanic:
1. emit QEVENT_GUEST_PANICKED only
2. emit QEVENT_GUEST_PANICKED and
On Wed, 2012-06-27 at 14:38 +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:22:54PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 01:20:24PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:03:46PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 12:13:43PM
On Wed, Jun 27, 2012 at 08:29:04AM -0600, Alex Williamson wrote:
On Wed, 2012-06-27 at 16:58 +0300, Gleb Natapov wrote:
On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
This new ioctl enables an eventfd to be triggered when an EOI is
written for a specified irqchip pin.
On Wed, 27 Jun 2012 15:02:23 +0800
Wen Congyang we...@cn.fujitsu.com wrote:
When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
So if qemu reads 0x1 from this port, we can do the folloing three
things according to the parameter -onpanic:
1. emit QEVENT_GUEST_PANICKED only
On Wed, Jun 27, 2012 at 04:52:32PM +0200, Cornelia Huck wrote:
On Wed, 27 Jun 2012 15:02:23 +0800
Wen Congyang we...@cn.fujitsu.com wrote:
When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
So if qemu reads 0x1 from this port, we can do the folloing three
things
On Wed, Jun 27, 2012 at 08:41:57AM -0600, Alex Williamson wrote:
On Wed, 2012-06-27 at 14:38 +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:22:54PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at 01:20:24PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at
On Wed, Jun 27, 2012 at 06:00:57PM +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 08:41:57AM -0600, Alex Williamson wrote:
On Wed, 2012-06-27 at 14:38 +0300, Michael S. Tsirkin wrote:
On Wed, Jun 27, 2012 at 01:22:54PM +0300, Gleb Natapov wrote:
On Wed, Jun 27, 2012 at
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.
The first patch is a little hacky; we should try to emulate svm here
In protected mode, the CPL is defined as the lower two bits of CS, as set by
the last far jump. But during the transition to protected mode, there is no
last far jump, so we need to return zero (the inherited real mode CPL).
Fix by reading CPL from the cache during the transition. This isn't
Introduce kvm_cpuid() to perform the leaf limit check and calculate
register values, and let kvm_emulate_cpuid() just handle reading and
writing the registers from/to the vcpu. This allows us to reuse
kvm_cpuid() in a context where directly reading and writing registers
is not desired.
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 a...@redhat.com
---
arch/x86/include/asm/kvm_emulate.h | 4 +--
arch/x86/kvm/emulate.c | 53
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 a...@redhat.com
---
arch/x86/kvm/emulate.c | 16 +++-
1
Null SS is valid in long mode; allow loading it.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
---
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
Opcode c9; used by some variants of Windows during boot, in big real mode.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
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 Kivity
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
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 a...@redhat.com
---
arch/x86/kvm/emulate.c | 17 ++---
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 a...@redhat.com
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c
Opcode 9F.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
@@
Commit 2adb5ad9fe1 removed ByteOp from MOVZX/MOVSX, replacing them by
SrcMem8, but neglected to fix the dependency in the emulation code
on ByteOp. This caused the instruction not to have any effect in
some circumstances.
Fix by replacing the check for ByteOp with the equivalent src.op_bytes ==
This allows us to reuse the code without populating ctxt-src and
overriding ctxt-op_bytes.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
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 a...@redhat.com
---
arch/x86/kvm/emulate.c | 28 +++-
1 file changed,
Process the event, possibly injecting an interrupt, before continuing.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
+++
If instruction emulation fails, report it properly to userspace.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
---
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 a...@redhat.com
---
arch/x86/kvm/emulate.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity a...@redhat.com
---
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
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 a...@redhat.com
---
arch/x86/kvm/emulate.c | 4
1 file changed, 4 insertions(+)
diff
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity a...@redhat.com
---
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
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
+static void eoifd_event(struct kvm_irq_ack_notifier *notifier)
+{
+ struct _eoifd *eoifd;
+
+ eoifd = container_of(notifier, struct _eoifd, notifier);
+
+ if (eoifd-source)
+ kvm_set_irq(eoifd-kvm,
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 a...@redhat.com
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity a...@redhat.com
---
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
1 - 100 of 209 matches
Mail list logo