Re: [question] updating the base image for all clones which have been running for months

2014-11-03 Thread Kevin Wolf
Am 03.11.2014 um 13:04 hat Zhang Haoyu geschrieben: Hi, all I used base image A to clone so many vm, after running for months, each vm has its own private applications and data, which maybe different from each other. Now, I want to install some applications for all of the clones, what

Re: [PATCH] qcow2: fix double-free of Qcow2DiscardRegion in qcow2_process_discards

2014-10-12 Thread Kevin Wolf
Am 11.10.2014 um 09:14 hat Zhang Haoyu geschrieben: In qcow2_update_snapshot_refcount - qcow2_process_discards() - bdrv_discard() may free the Qcow2DiscardRegion which is referenced by next pointer in qcow2_process_discards() now, in next iteration, d = next, so g_free(d) will double-free

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 13:32 hat Stefan Hajnoczi geschrieben: On Mon, Mar 03, 2014 at 01:13:41AM +, Huangpeng (Peter) wrote: Just to summarize the idea of live savevm for people joining the discussion: It should be possible to save a snapshot of the guest (including memory, devices, and

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 14:19 hat Paolo Bonzini geschrieben: Il 03/03/2014 13:55, Kevin Wolf ha scritto: Due to memory-modifications may happen in kvm, qemu, or vhost, the key-part is how we can provide common page-modify-tracking-and-saving api, we completed a prototype by simply add

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 14:47 hat Paolo Bonzini geschrieben: Il 03/03/2014 14:30, Kevin Wolf ha scritto: So why don't we simply reuse the existing migration code? I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make

Re: [Qemu-devel] KVM call agenda for 2013-12-10

2013-12-10 Thread Kevin Wolf
Am 10.12.2013 um 16:05 hat Juan Quintela geschrieben: Anthony Liguori anth...@codemonkey.ws wrote: On Tue, Dec 10, 2013 at 4:37 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 10/12/2013 12:42, Juan Quintela ha scritto: Hi Please, send any topic that you are interested in covering.

Re: [Qemu-devel] RFC: kvm call reschedule

2013-12-10 Thread Kevin Wolf
Am 10.12.2013 um 16:11 hat Juan Quintela geschrieben: Anthony can't assist this call, just in the middle of his commute. As it looks like a good idea that he can assit, can we move the call? Options so far are (his local time): - Current time is 7am His suggestions: - 6:00am (15pm

Re: [PATCH kvm-unittests v2 0/4] Add run_tests.sh script and update unittests.cfg

2013-04-15 Thread Kevin Wolf
Am 14.04.2013 um 01:26 hat Cole Robinson geschrieben: On 04/12/2013 07:27 AM, Kevin Wolf wrote: This adds a small script that allows to conveniently run all test cases and that reports back one PASS or FAIL line for each test case; it also creates a test.log file with the full output

Re: [PATCH kvm-unit-tests v2 0/4] Have x86-run parse unittests.cfg

2013-04-15 Thread Kevin Wolf
Am 14.04.2013 um 20:18 hat Cole Robinson geschrieben: First two patches are trivial bits. Rest rewrites x86-run in python, which then makes it easy to parse unittests.cfg. This makes it simpler to invoke individual unittests the same way autotest does. Kevin has a similar series[1], but I'm

Re: [PATCH kvm-unittests v2] x86/taskswitch2: Task switches into/out of VM86

2013-04-15 Thread Kevin Wolf
Am 14.04.2013 um 14:42 hat Gleb Natapov geschrieben: On Fri, Apr 12, 2013 at 01:14:47PM +0200, Kevin Wolf wrote: This adds a test case that jumps into VM86 by iret-ing to a TSS and back to Protected Mode using a task gate in the IDT. Signed-off-by: Kevin Wolf kw...@redhat.com Applied

Re: [PATCH kvm-unittests v2] x86/taskswitch2: Task switches into/out of VM86

2013-04-15 Thread Kevin Wolf
Am 15.04.2013 um 17:38 hat Gleb Natapov geschrieben: On Mon, Apr 15, 2013 at 10:56:42AM +0200, Kevin Wolf wrote: Am 14.04.2013 um 14:42 hat Gleb Natapov geschrieben: On Fri, Apr 12, 2013 at 01:14:47PM +0200, Kevin Wolf wrote: This adds a test case that jumps into VM86 by iret-ing

[PATCH kvm-unittests v2] x86/taskswitch2: Task switches into/out of VM86

2013-04-12 Thread Kevin Wolf
This adds a test case that jumps into VM86 by iret-ing to a TSS and back to Protected Mode using a task gate in the IDT. Signed-off-by: Kevin Wolf kw...@redhat.com --- lib/x86/desc.c| 41 -- lib/x86/desc.h| 36 ++ lib/x86/vm.c

[PATCH kvm-unittests v2 0/4] Add run_tests.sh script and update unittests.cfg

2013-04-12 Thread Kevin Wolf
in the future and skip them (and possibly introduce an i386 run besides the x86_64 one so that they actually get tested). Kevin Wolf (4): Add run_tests.sh x86/unittests.cfg: Add arch for x86_64-only tests x86/unittests.cfg: Add missing test cases x86/unittests.cfg: Create test case groups

[PATCH kvm-unittests v2 1/4] Add run_tests.sh

2013-04-12 Thread Kevin Wolf
This adds a convenient way to run all tests without having to set up Autotest. Signed-off-by: Kevin Wolf kw...@redhat.com --- run_tests.sh | 123 ++ x86-run | 9 +++- x86/unittests.cfg | 2 + 3 files changed, 132 insertions

[PATCH kvm-unittests v2 2/4] x86/unittests.cfg: Add arch for x86_64-only tests

2013-04-12 Thread Kevin Wolf
Their kernel binaries would be missing when the tests are built for i386. Signed-off-by: Kevin Wolf kw...@redhat.com --- x86/unittests.cfg | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 7d0fa73..f2336bb 100644 --- a/x86

[PATCH kvm-unittests v2 3/4] x86/unittests.cfg: Add missing test cases

2013-04-12 Thread Kevin Wolf
Some test cases seem to have been added without updating the configuration file. This adds them, and leaves cases commented out that don't seem to complete. Signed-off-by: Kevin Wolf kw...@redhat.com --- x86/unittests.cfg | 26 ++ 1 file changed, 26 insertions(+) diff

[PATCH kvm-unittests v2 4/4] x86/unittests.cfg: Create test case groups

2013-04-12 Thread Kevin Wolf
Put all vmexit test cases and all task switch test cases into a group, so that you can use something like ./run_tests -g tasks Signed-off-by: Kevin Wolf kw...@redhat.com --- x86/unittests.cfg | 10 ++ 1 file changed, 10 insertions(+) diff --git a/x86/unittests.cfg b/x86/unittests.cfg

[PATCH] KVM: x86 emulator: Fix segment loading in VM86

2013-04-11 Thread Kevin Wolf
is in VM86, so we end up with: KVM: entry failed, hardware error 0x8021 Fix this by effectively reverting commit 03ebebeb1 for VM86 and leaving it only in place for real mode, which is where it's really needed. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/emulate.c | 15

Re: KVM call agenda for 2012-12-11

2012-12-11 Thread Kevin Wolf
Am 11.12.2012 15:45, schrieb Juan Quintela: Anthony Liguori aligu...@us.ibm.com wrote: Kevin Wolf kw...@redhat.com writes: Am 10.12.2012 14:59, schrieb Juan Quintela: Hi Please send in any agenda topics you are interested in. Can probably be answered on the list, but what is the status

Re: [Qemu-devel] Block Migration Assertion in qemu-kvm 1.2.0

2012-09-25 Thread Kevin Wolf
Am 19.09.2012 07:49, schrieb Peter Lieven: On 09/18/12 12:31, Kevin Wolf wrote: Am 18.09.2012 12:28, schrieb Peter Lieven: On 09/17/12 22:12, Peter Lieven wrote: On 09/17/12 10:41, Kevin Wolf wrote: Am 16.09.2012 12:13, schrieb Peter Lieven: Hi, when trying to block migrate a VM from one

Re: [Qemu-devel] KVM call agenda for September 25th

2012-09-25 Thread Kevin Wolf
Am 25.09.2012 14:57, schrieb Anthony Liguori: Paolo Bonzini pbonz...@redhat.com writes: Il 24/09/2012 13:28, Juan Quintela ha scritto: Hi Please send in any agenda items you are interested in covering. URI parsing library for glusterfs: libxml2 vs. in-tree fork of the same code. The

Re: [Qemu-devel] Block Migration Assertion in qemu-kvm 1.2.0

2012-09-18 Thread Kevin Wolf
Am 18.09.2012 12:28, schrieb Peter Lieven: On 09/17/12 22:12, Peter Lieven wrote: On 09/17/12 10:41, Kevin Wolf wrote: Am 16.09.2012 12:13, schrieb Peter Lieven: Hi, when trying to block migrate a VM from one node to another, the source VM crashed with the following assertion: block.c:3829

Re: [Qemu-devel] Block Migration Assertion in qemu-kvm 1.2.0

2012-09-17 Thread Kevin Wolf
Am 16.09.2012 12:13, schrieb Peter Lieven: Hi, when trying to block migrate a VM from one node to another, the source VM crashed with the following assertion: block.c:3829: bdrv_set_in_use: Assertion `bs-in_use != in_use' failed. Is this sth already addresses/known? Not that I'm aware

Re: [QEMU PATCH 0/2] virtio-blk: writeback cache enable improvements

2012-08-01 Thread Kevin Wolf
Am 01.08.2012 17:52, schrieb Paolo Bonzini: Il 23/07/2012 18:32, Paolo Bonzini ha scritto: Il 03/07/2012 15:20, Paolo Bonzini ha scritto: These patches let virtio-blk use the new support for toggling the cache mode between writethrough and writeback. The first patch introduces a new feature

Re: [Qemu-devel] [PATCH 2/5] scsi-disk: report resized disk via sense codes

2012-07-17 Thread Kevin Wolf
Am 16.07.2012 16:25, schrieb Paolo Bonzini: Linux will not use these, but a very similar mechanism will be used to report the condition via virtio-scsi events. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- hw/scsi-bus.c |5 + hw/scsi-disk.c | 15 +++

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: disable write cache if not negotiated

2012-07-04 Thread Kevin Wolf
Am 03.07.2012 15:51, schrieb Paolo Bonzini: Il 03/07/2012 15:49, Kevin Wolf ha scritto: If the guest does not support flushes, we should run in writethrough mode. The setting is temporary until the next reset, so that for example the BIOS will run in writethrough mode while Linux will run

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: disable write cache if not negotiated

2012-07-04 Thread Kevin Wolf
Am 04.07.2012 14:21, schrieb Paolo Bonzini: Il 04/07/2012 12:16, Kevin Wolf ha scritto: Yes. It doesn't override cache=unsafe though. When the guest doesn't support flushes, cache=writeback is equivalent to cache=unsafe, so if you want the old behaviour back you can switch to cache=unsafe

Re: [Qemu-devel] KVM call agenda for Tuesday, July 3rd

2012-07-03 Thread Kevin Wolf
Am 02.07.2012 19:33, schrieb Eric Blake: On 07/02/2012 04:16 AM, Juan Quintela wrote: Hi Please send in any agenda items you are interested in covering. Can we discuss the future of 'getfd', the possibility of 'pass-fd', or even the enhancement of all existing monitor commands to take an

Re: [PATCH 1/2] virtio-blk: support VIRTIO_BLK_F_CONFIG_WCE

2012-07-03 Thread Kevin Wolf
Am 03.07.2012 15:20, schrieb Paolo Bonzini: Introduce a new feature bit and configuration field that provide support for toggling the cache mode between writethrough and writeback. Also rename VIRTIO_BLK_F_WCACHE to VIRTIO_BLK_F_WCE for consistency with the spec. My spec (and my kernel as

Re: [PATCH 2/2] virtio-blk: disable write cache if not negotiated

2012-07-03 Thread Kevin Wolf
Am 03.07.2012 15:20, schrieb Paolo Bonzini: If the guest does not support flushes, we should run in writethrough mode. The setting is temporary until the next reset, so that for example the BIOS will run in writethrough mode while Linux will run with a writeback cache. VIRTIO_BLK_F_FLUSH

Re: [PATCH 05/21] KVM: x86 emulator: allow loading null SS in long mode

2012-06-18 Thread Kevin Wolf
Am 12.06.2012 19:34, schrieb Avi Kivity: Null SS is valid in long mode; allow loading it. Signed-off-by: Avi Kivity a...@redhat.com The documentation suggests that trying to load it in CPL 3 should still fail in long mode. Kevin -- To unsubscribe from this list: send the line unsubscribe kvm

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-13 Thread Kevin Wolf
Am 13.06.2012 12:28, schrieb Ren, Yongjie: -Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Wednesday, June 13, 2012 7:25 AM To: Kevin Wolf Cc: Stefan Hajnoczi; Ren, Yongjie; Avi Kivity; kvm@vger.kernel.org; Liu, RongrongX; Anthony Liguori Subject: Re

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-12 Thread Kevin Wolf
Am 12.06.2012 03:52, schrieb Marcelo Tosatti: On Thu, Jun 07, 2012 at 01:13:50PM +0100, Stefan Hajnoczi wrote: The 1st bad commit in your attached list is abc551bd More detailed info: 171d2f2249a360d7d623130d3aa991418c53716d good fd453a24166e36a3d376c9bc221e520e3ee425afgood

Re: Swap virtio images

2012-06-06 Thread Kevin Wolf
Am 06.06.2012 15:35, schrieb Iain J. Watson: Hello, I am trying to find a way to use backing files to make snapshots of running VMs. The idea is I pause the VM, use qemu-img to create a new disk file with the currently used file as a backing file, swap the images then unpause the VM.

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-04 Thread Kevin Wolf
Am 01.06.2012 10:31, schrieb Kevin Wolf: Am 01.06.2012 09:57, schrieb Ren, Yongjie: -Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Thursday, May 31, 2012 4:28 AM To: Ren, Yongjie Cc: Kevin Wolf; Avi Kivity; kvm@vger.kernel.org; Liu, RongrongX Subject: Re

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Kevin Wolf
Am 21.05.2012 10:27, schrieb Avi Kivity: On 05/21/2012 06:34 AM, Ren, Yongjie wrote: Hi All, This is KVM upstream test result against kvm.git 51bfd2998113e1f8ce8dcf853407b76a04b5f2a0 based on kernel 3.4.0-rc7, and qemu-kvm.git a1fce560c0e5f287ed65d2aaadb3e59578aaa983. We found 1 new bug

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Kevin Wolf
Am 21.05.2012 11:45, schrieb Ren, Yongjie: -Original Message- From: Kevin Wolf [mailto:kw...@redhat.com] Sent: Monday, May 21, 2012 5:05 PM To: Avi Kivity Cc: Ren, Yongjie; kvm@vger.kernel.org Subject: Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560... Am 21.05.2012

Re: [Qemu-devel] KVM call agenda for June, Tuesday 15th

2012-05-15 Thread Kevin Wolf
Am 14.05.2012 17:42, schrieb Anthony Liguori: On 05/14/2012 07:41 AM, Juan Quintela wrote: Hi Please send in any agenda items you are interested in covering. -open-fd-hook proposal The discussion seems to have tapered out without a consensus. I asked for really good reasons to justify

Re: [Qemu-devel] [PATCH v3 1/9] net: introduce tcp_server_start()

2012-03-14 Thread Kevin Wolf
Am 14.03.2012 08:51, schrieb Amos Kong: On 14/03/12 15:27, Paolo Bonzini wrote: Hi Paolo, Il 14/03/2012 08:14, Orit Wasserman ha scritto: if (bind(*fd, (struct sockaddr *)saddr, sizeof(saddr)) 0) { closesocket(*fd); return -socket_error(); } return 0; and than you

Re: [Qemu-devel] [PATCH 3/4] net: split hostname and service by last colon

2012-03-05 Thread Kevin Wolf
Am 02.03.2012 20:54, schrieb Laine Stump: On 03/02/2012 05:35 AM, Kevin Wolf wrote: Am 02.03.2012 10:58, schrieb Amos Kong: On 02/03/12 11:38, Amos Kong wrote: --- a/net.c +++ b/net.c @@ -84,7 +84,7 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) const

Re: [Qemu-devel] [PATCH 3/4] net: split hostname and service by last colon

2012-03-05 Thread Kevin Wolf
Am 05.03.2012 09:59, schrieb Amos Kong: - Original Message - Am 02.03.2012 20:54, schrieb Laine Stump: On 03/02/2012 05:35 AM, Kevin Wolf wrote: Am 02.03.2012 10:58, schrieb Amos Kong: On 02/03/12 11:38, Amos Kong wrote: --- a/net.c +++ b/net.c @@ -84,7 +84,7 @@ static int

Re: [Qemu-devel] [PATCH 1/4] Use getaddrinfo for migration

2012-03-02 Thread Kevin Wolf
Am 02.03.2012 03:50, schrieb Amos Kong: On 24/02/12 17:34, Kevin Wolf wrote: Am 10.02.2012 07:27, schrieb Amos Kong: This allows us to use ipv4/ipv6 for migration addresses. Once there, it also uses /etc/services names (it came free). Signed-off-by: Juan Quintelaquint...@redhat.com Signed

Re: [Qemu-devel] [PATCH 1/4] Use getaddrinfo for migration

2012-03-02 Thread Kevin Wolf
Am 02.03.2012 04:33, schrieb Amos Kong: On 24/02/12 17:08, Kevin Wolf wrote: Am 10.02.2012 07:27, schrieb Amos Kong: This allows us to use ipv4/ipv6 for migration addresses. Once there, it also uses /etc/services names (it came free). Signed-off-by: Juan Quintelaquint...@redhat.com Signed

Re: [Qemu-devel] [PATCH 3/4] net: split hostname and service by last colon

2012-03-02 Thread Kevin Wolf
Am 02.03.2012 10:58, schrieb Amos Kong: On 02/03/12 11:38, Amos Kong wrote: --- a/net.c +++ b/net.c @@ -84,7 +84,7 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) const char *p, *p1; int len; p = *pp; -p1 = strchr(p, sep); +p1 =

Re: [Qemu-devel] blockdev operations [was: KVM call agenda for Tuesday 28th]

2012-02-29 Thread Kevin Wolf
Am 28.02.2012 17:07, schrieb Eric Blake: On 02/28/2012 07:58 AM, Stefan Hajnoczi wrote: On Tue, Feb 28, 2012 at 2:47 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 28/02/2012 15:39, Stefan Hajnoczi ha scritto: I'm not a fan of transactions or freeze/thaw (if used to atomically perform other

Re: [Qemu-devel] [PATCH 1/4] Use getaddrinfo for migration

2012-02-24 Thread Kevin Wolf
Am 10.02.2012 07:27, schrieb Amos Kong: This allows us to use ipv4/ipv6 for migration addresses. Once there, it also uses /etc/services names (it came free). Signed-off-by: Juan Quintela quint...@redhat.com Signed-off-by: Amos Kong ak...@redhat.com --- migration-tcp.c | 60

Re: [Qemu-devel] [PATCH 2/4] net/socket: allow ipv6 for net_socket_listen_init and socket_connect_init

2012-02-24 Thread Kevin Wolf
Am 10.02.2012 07:27, schrieb Amos Kong: Remove use of parse_host_port. More SO_SOCKADDR changes. Signed-off-by: Juan Quintela quint...@redhat.com Signed-off-by: Amos Kong ak...@redhat.com --- net/socket.c | 60 +++--- 1 files

Re: [Qemu-devel] [PATCH 3/4] net: split hostname and service by last colon

2012-02-24 Thread Kevin Wolf
Am 10.02.2012 07:27, schrieb Amos Kong: IPv6 address contains colons, parse will be wrong. [2312::8274]:5200 Signed-off-by: Amos Kong ak...@redhat.com --- net.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.c b/net.c index f63014c..9e1ef9e 100644

Re: [Qemu-devel] [PATCH 1/4] Use getaddrinfo for migration

2012-02-24 Thread Kevin Wolf
Am 10.02.2012 07:27, schrieb Amos Kong: This allows us to use ipv4/ipv6 for migration addresses. Once there, it also uses /etc/services names (it came free). Signed-off-by: Juan Quintela quint...@redhat.com Signed-off-by: Amos Kong ak...@redhat.com --- migration-tcp.c | 60

Re: [Qemu-devel] [PATCH 0/4] support to migrate with IPv6 address

2012-02-24 Thread Kevin Wolf
Am 10.02.2012 07:26, schrieb Amos Kong: Those four patches make migration of IPv6 address work. Use getaddrinfo() to socket addresses infomation. --- Amos Kong (4): Use getaddrinfo for migration net/socket: allow ipv6 for net_socket_listen_init and socket_connect_init

Re: [Qemu-devel] KVM call agenda for Tuesday 21th

2012-02-21 Thread Kevin Wolf
Am 20.02.2012 11:13, schrieb Juan Quintela: Hi Please send in any agenda items you are interested in covering. What's the status with qtest? (Though probably a one-line email would already answer this) Kevin -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a

[PATCH v4 1/4] KVM: x86 emulator: Fix task switch privilege checks

2012-02-08 Thread Kevin Wolf
Currently, all task switches check privileges against the DPL of the TSS. This is only correct for jmp/call to a TSS. If a task gate is used, the DPL of this take gate is used for the check instead. Exceptions, external interrupts and iret shouldn't perform any check. Signed-off-by: Kevin Wolf kw

[PATCH v4 2/4] KVM: x86 emulator: VM86 segments must have DPL 3

2012-02-08 Thread Kevin Wolf
Setting the segment DPL to 0 for at least the VM86 code segment makes the VM entry fail on VMX. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[PATCH v4 3/4] KVM: SVM: Fix CPL updates

2012-02-08 Thread Kevin Wolf
Keep CPL at 0 in real mode and at 3 in VM86. In protected/long mode, use RPL rather than DPL of the code segment. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/svm.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm.c b

[PATCH v4 0/4] Fix task switches into/out of VM86

2012-02-08 Thread Kevin Wolf
Kevin Wolf (4): KVM: x86 emulator: Fix task switch privilege checks KVM: x86 emulator: VM86 segments must have DPL 3 KVM: SVM: Fix CPL updates KVM: x86 emulator: Allow PM/VM86 switch during task switch arch/x86/include/asm/kvm_emulate.h |3 +- arch/x86/include/asm/kvm_host.h

[PATCH v4 4/4] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-02-08 Thread Kevin Wolf
update. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c | 20 arch/x86/kvm/svm.c |4 arch/x86/kvm/x86.c |6 ++ 4 files changed, 31 insertions(+), 0

Re: [PATCH v3 3/4] KVM: SVM: Fix CPL updates

2012-02-06 Thread Kevin Wolf
Am 05.02.2012 12:16, schrieb Gleb Natapov: On Fri, Feb 03, 2012 at 07:29:24PM +0100, Kevin Wolf wrote: Keep CPL at 0 in real mode and at 3 in VM86. In protected/long mode, use RPL rather than DPL of the code segment. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/svm.c | 19

Re: [PATCH v3 3/4] KVM: SVM: Fix CPL updates

2012-02-06 Thread Kevin Wolf
Am 06.02.2012 10:57, schrieb Gleb Natapov: On Mon, Feb 06, 2012 at 10:18:35AM +0100, Kevin Wolf wrote: Am 05.02.2012 12:16, schrieb Gleb Natapov: On Fri, Feb 03, 2012 at 07:29:24PM +0100, Kevin Wolf wrote: Keep CPL at 0 in real mode and at 3 in VM86. In protected/long mode, use RPL rather

Re: [PATCH v3 4/4] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-02-06 Thread Kevin Wolf
Am 06.02.2012 11:32, schrieb Avi Kivity: On 02/03/2012 08:29 PM, Kevin Wolf wrote: Task switches can switch between Protected Mode and VM86. The current mode must be updated during the task switch emulation so that the new segment selectors are interpreted correctly. In order to let

[PATCH v3 0/4] Fix task switches into/out of VM86

2012-02-03 Thread Kevin Wolf
Kevin Wolf (4): KVM: x86 emulator: Fix task switch privilege checks KVM: x86 emulator: VM86 segments must have DPL 3 KVM: SVM: Fix CPL updates KVM: x86 emulator: Allow PM/VM86 switch during task switch arch/x86/include/asm/kvm_emulate.h |3 +- arch/x86/include/asm/kvm_host.h

[PATCH v3 1/4] KVM: x86 emulator: Fix task switch privilege checks

2012-02-03 Thread Kevin Wolf
Currently, all task switches check privileges against the DPL of the TSS. This is only correct for jmp/call to a TSS. If a task gate is used, the DPL of this take gate is used for the check instead. Exceptions, external interrupts and iret shouldn't perform any check. Signed-off-by: Kevin Wolf kw

[PATCH v3 2/4] KVM: x86 emulator: VM86 segments must have DPL 3

2012-02-03 Thread Kevin Wolf
Setting the segment DPL to 0 for at least the VM86 code segment makes the VM entry fail on VMX. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[PATCH v3 3/4] KVM: SVM: Fix CPL updates

2012-02-03 Thread Kevin Wolf
Keep CPL at 0 in real mode and at 3 in VM86. In protected/long mode, use RPL rather than DPL of the code segment. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/svm.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm.c b

[PATCH v3 4/4] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-02-03 Thread Kevin Wolf
update. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c | 20 arch/x86/kvm/svm.c |1 + arch/x86/kvm/x86.c |6 ++ 4 files changed, 28 insertions(+), 0

Re: [PATCH v2 0/3] Fix task switches into/out of VM86

2012-01-30 Thread Kevin Wolf
Am 27.01.2012 20:52, schrieb Gleb Natapov: On Fri, Jan 27, 2012 at 08:23:33PM +0100, Kevin Wolf wrote: I believe this should work with both VMX and SVM now. Gleb, Jörg, can one of you test this with SVM? I did some testing on my buggy processor and it looks as good as it gets, but it would

Re: [PATCH v2 0/3] Fix task switches into/out of VM86

2012-01-30 Thread Kevin Wolf
Am 30.01.2012 09:55, schrieb Gleb Natapov: On Mon, Jan 30, 2012 at 09:48:33AM +0100, Kevin Wolf wrote: Am 27.01.2012 20:52, schrieb Gleb Natapov: On Fri, Jan 27, 2012 at 08:23:33PM +0100, Kevin Wolf wrote: I believe this should work with both VMX and SVM now. Gleb, Jörg, can one of you test

Re: [PATCH v2 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-30 Thread Kevin Wolf
Am 30.01.2012 11:24, schrieb Avi Kivity: On 01/27/2012 09:23 PM, Kevin Wolf wrote: Task switches can switch between Protected Mode and VM86. The current mode must be updated during the task switch emulation so that the new segment selectors are interpreted correctly and privilege checks

Re: [PATCH v2 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-30 Thread Kevin Wolf
Am 30.01.2012 11:39, schrieb Avi Kivity: On 01/27/2012 09:23 PM, Kevin Wolf wrote: Currently, all task switches check privileges against the DPL of the TSS. This is only correct for jmp/call to a TSS. If a task gate is used, the DPL of this take gate is used for the check instead. Exceptions

Re: [PATCH v2 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-30 Thread Kevin Wolf
Am 30.01.2012 14:23, schrieb Avi Kivity: On 01/30/2012 01:05 PM, Kevin Wolf wrote: Am 30.01.2012 11:24, schrieb Avi Kivity: On 01/27/2012 09:23 PM, Kevin Wolf wrote: Task switches can switch between Protected Mode and VM86. The current mode must be updated during the task switch emulation so

Re: [PATCH v2 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-30 Thread Kevin Wolf
Am 30.01.2012 15:32, schrieb Avi Kivity: On 01/30/2012 04:01 PM, Kevin Wolf wrote: Am 30.01.2012 14:23, schrieb Avi Kivity: On 01/30/2012 01:05 PM, Kevin Wolf wrote: Am 30.01.2012 11:24, schrieb Avi Kivity: On 01/27/2012 09:23 PM, Kevin Wolf wrote: Task switches can switch between Protected

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-27 Thread Kevin Wolf
Am 25.01.2012 17:00, schrieb Joerg Roedel: On Tue, Jan 24, 2012 at 06:23:50PM +0200, Gleb Natapov wrote: On Tue, Jan 24, 2012 at 03:24:50PM +0100, Kevin Wolf wrote: However, task_switch_interception() itself does some more based on the value of reason, for example it decides whether

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-27 Thread Kevin Wolf
Am 27.01.2012 14:34, schrieb Joerg Roedel: On Fri, Jan 27, 2012 at 01:58:38PM +0100, Kevin Wolf wrote: Am 25.01.2012 17:00, schrieb Joerg Roedel: I just retried. I use kvm-kmod and kvm.git with HEAD at ff92e9b5 plus the tree patches of this series plus a printk to output exit_int_info

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-27 Thread Kevin Wolf
Am 27.01.2012 15:17, schrieb Joerg Roedel: On Fri, Jan 27, 2012 at 02:55:12PM +0100, Kevin Wolf wrote: Am 27.01.2012 14:34, schrieb Joerg Roedel: On Fri, Jan 27, 2012 at 01:58:38PM +0100, Kevin Wolf wrote: Am 25.01.2012 17:00, schrieb Joerg Roedel: I just retried. I use kvm-kmod and kvm.git

[PATCH v2 0/3] Fix task switches into/out of VM86

2012-01-27 Thread Kevin Wolf
I believe this should work with both VMX and SVM now. Gleb, Jörg, can one of you test this with SVM? I did some testing on my buggy processor and it looks as good as it gets, but it would be better if you could confirm. Kevin Wolf (3): KVM: x86 emulator: Fix task switch privilege checks KVM

[PATCH v2 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-27 Thread Kevin Wolf
Currently, all task switches check privileges against the DPL of the TSS. This is only correct for jmp/call to a TSS. If a task gate is used, the DPL of this take gate is used for the check instead. Exceptions, external interrupts and iret shouldn't perform any check. Signed-off-by: Kevin Wolf kw

[PATCH v2 2/3] KVM: x86 emulator: VM86 segments must have DPL 3

2012-01-27 Thread Kevin Wolf
Setting the segment DPL to 0 for at least the VM86 code segment makes the VM entry fail on VMX. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[PATCH v2 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-27 Thread Kevin Wolf
rflags to be updated in the vcpu struct. SVM stores the DPL of the code segment instead, so we must be sure to give the right one when updating the selector. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c | 26

Re: [PATCH kvm-unit-tests 3/4] Fix i386 build

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 10:51, schrieb Takuya Yoshikawa: (2012/01/24 1:07), Kevin Wolf wrote: Commit 1d946e07 removed idt, but left a reference to idt in i386-only code. This is already fixed by commit b319491d278d4e85de7ea967982f7d416f4a44e4 desc: fix build for i386 Whoops, my .git

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 10:52, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:10:46PM +0100, Kevin Wolf wrote: Currently, all task switches check privileges against the DPL of the TSS. This is only correct for jmp/call to a TSS. If a task gate is used, the DPL of this take gate is used for the check

Re: [PATCH kvm-unit-tests 4/4] x86/taskswitch_vm86: Task switches into/out of VM86

2012-01-24 Thread Kevin Wolf
Am 23.01.2012 17:42, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:32:59PM +0100, Kevin Wolf wrote: Am 23.01.2012 17:22, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:20:22PM +0100, Kevin Wolf wrote: Am 23.01.2012 17:10, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:07:13PM +0100

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 11:17, schrieb Gleb Natapov: On Tue, Jan 24, 2012 at 11:09:09AM +0100, Kevin Wolf wrote: + } else if (reason != TASK_SWITCH_IRET) { + dpl = next_tss_desc.dpl; } No need parentheses around one statement. Documentation/CodingStyle says: This does not apply if only

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 11:52, schrieb Gleb Natapov: On Tue, Jan 24, 2012 at 11:38:24AM +0100, Kevin Wolf wrote: Am 24.01.2012 11:17, schrieb Gleb Natapov: On Tue, Jan 24, 2012 at 11:09:09AM +0100, Kevin Wolf wrote: +} else if (reason != TASK_SWITCH_IRET) { +dpl

Re: [PATCH 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 11:57, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:10:48PM +0100, Kevin Wolf wrote: Task switches can switch between Protected Mode and VM86. The current mode must be updated during the task switch emulation so that the new segment selectors are interpreted correctly

Re: [PATCH 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 12:37, schrieb Gleb Natapov: On Tue, Jan 24, 2012 at 12:31:48PM +0100, Kevin Wolf wrote: Am 24.01.2012 11:57, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:10:48PM +0100, Kevin Wolf wrote: Task switches can switch between Protected Mode and VM86. The current mode must

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 15:03, schrieb Joerg Roedel: On Mon, Jan 23, 2012 at 05:10:46PM +0100, Kevin Wolf wrote: This patch fixes the problem for VMX. For SVM, the logic used to determine the source of the task switch is buggy, so we can't pass useful information to the emulator there and just disable

Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 15:16, schrieb Gleb Natapov: On Tue, Jan 24, 2012 at 03:15:13PM +0100, Kevin Wolf wrote: Am 24.01.2012 15:03, schrieb Joerg Roedel: On Mon, Jan 23, 2012 at 05:10:46PM +0100, Kevin Wolf wrote: This patch fixes the problem for VMX. For SVM, the logic used to determine the source

Re: [Qemu-devel] KVM call agenda for Tuesday 24

2012-01-24 Thread Kevin Wolf
Am 24.01.2012 15:08, schrieb Anthony Liguori: On 01/24/2012 08:03 AM, Paolo Bonzini wrote: On 01/24/2012 02:57 PM, Anthony Liguori wrote: Please send in any agenda items you are interested in covering. I don't have anything pressing. I vote to cancel the call. Nothing that cannot be

[PATCH kvm-unit-tests 0/4] VM86 testcase and run_tests.sh

2012-01-23 Thread Kevin Wolf
locally for a while, but maybe someone else finds it handy, too. Kevin Wolf (4): Add run_tests.sh Add taskswitch testcases to unittest.cfg Fix i386 build x86/taskswitch_vm86: Task switches into/out of VM86 config-i386.mak |3 +- lib/x86/desc.c| 39 +- lib

[PATCH kvm-unit-tests 1/4] Add run_tests.sh

2012-01-23 Thread Kevin Wolf
This adds a convenient way to run all tests without having to set up Autotest. Signed-off-by: Kevin Wolf kw...@redhat.com --- run_tests.sh | 107 ++ 1 files changed, 107 insertions(+), 0 deletions(-) create mode 100755 run_tests.sh diff

[PATCH kvm-unit-tests 2/4] Add taskswitch testcases to unittest.cfg

2012-01-23 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com --- x86/unittests.cfg | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 065020a..dac7d44 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -64,6 +64,18 @@ file

[PATCH kvm-unit-tests 3/4] Fix i386 build

2012-01-23 Thread Kevin Wolf
Commit 1d946e07 removed idt, but left a reference to idt in i386-only code. Signed-off-by: Kevin Wolf kw...@redhat.com --- lib/x86/desc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index c268955..770c250 100644 --- a/lib/x86/desc.c

[PATCH kvm-unit-tests 4/4] x86/taskswitch_vm86: Task switches into/out of VM86

2012-01-23 Thread Kevin Wolf
This adds a test case that jumps into VM86 by iret-ing to a TSS and back to Protected Mode using a task gate in the IDT. Signed-off-by: Kevin Wolf kw...@redhat.com --- config-i386.mak |3 +- lib/x86/desc.c| 37 +- lib/x86/desc.h| 36

[PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks

2012-01-23 Thread Kevin Wolf
for VMX. For SVM, the logic used to determine the source of the task switch is buggy, so we can't pass useful information to the emulator there and just disable the check in all cases. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 +- arch/x86/include

[PATCH 2/3] KVM: x86 emulator: VM86 segments must have DPL 3

2012-01-23 Thread Kevin Wolf
Setting the segment DPL to 0 for at least the VM86 code segment makes the VM entry fail on VMX. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[PATCH 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch

2012-01-23 Thread Kevin Wolf
Task switches can switch between Protected Mode and VM86. The current mode must be updated during the task switch emulation so that the new segment selectors are interpreted correctly and privilege checks succeed. Signed-off-by: Kevin Wolf kw...@redhat.com --- arch/x86/include/asm/kvm_emulate.h

Re: [PATCH kvm-unit-tests 4/4] x86/taskswitch_vm86: Task switches into/out of VM86

2012-01-23 Thread Kevin Wolf
Am 23.01.2012 17:10, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:07:13PM +0100, Kevin Wolf wrote: This adds a test case that jumps into VM86 by iret-ing to a TSS and back to Protected Mode using a task gate in the IDT. Can you add the test case to taskswitch2.c? That's actually what I

Re: [PATCH kvm-unit-tests 4/4] x86/taskswitch_vm86: Task switches into/out of VM86

2012-01-23 Thread Kevin Wolf
Am 23.01.2012 17:22, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:20:22PM +0100, Kevin Wolf wrote: Am 23.01.2012 17:10, schrieb Gleb Natapov: On Mon, Jan 23, 2012 at 05:07:13PM +0100, Kevin Wolf wrote: This adds a test case that jumps into VM86 by iret-ing to a TSS and back to Protected

Re: [RFC PATCH] emulator: Fix task switch into/out of VM86

2012-01-16 Thread Kevin Wolf
Am 10.01.2012 18:51, schrieb Joerg Roedel: On Tue, Jan 10, 2012 at 01:30:47PM +0200, Gleb Natapov wrote: On Tue, Jan 10, 2012 at 12:25:18PM +0100, Kevin Wolf wrote: Did that now, and it looks like exit_int_info is always 0 during the task switch intercept for a task gate in the IDT. So special

Re: [RFC PATCH] emulator: Fix task switch into/out of VM86

2012-01-10 Thread Kevin Wolf
Am 10.01.2012 10:01, schrieb Gleb Natapov: On Mon, Jan 09, 2012 at 09:10:10PM +0100, Kevin Wolf wrote: * This works with VMX, but with SVM I have an additional problem: When trying to exit VM86 (usually by an exception) through a task gate in the IDT, the code runs into the reason

Re: [RFC PATCH] emulator: Fix task switch into/out of VM86

2012-01-10 Thread Kevin Wolf
Am 10.01.2012 10:28, schrieb Kevin Wolf: Am 10.01.2012 10:01, schrieb Gleb Natapov: On Mon, Jan 09, 2012 at 09:10:10PM +0100, Kevin Wolf wrote: * This works with VMX, but with SVM I have an additional problem: When trying to exit VM86 (usually by an exception) through a task gate

  1   2   3   >