Re: [Qemu-devel] [PATCH 00/17] iotests: don't choke on disabled drivers

2018-05-30 Thread Roman Kagan
On Wed, May 30, 2018 at 02:35:34PM +0200, Max Reitz wrote: > On 2018-04-26 18:19, Roman Kagan wrote: > > Some iotests assume availability of certain block drivers, and fail if > > the driver is not supported by QEMU because it was disabled at configure > > time. > >

Re: [Qemu-devel] [PATCH 03/17] iotests: ask qemu for supported formats

2018-05-30 Thread Roman Kagan
On Wed, May 30, 2018 at 02:17:55PM +0200, Max Reitz wrote: > On 2018-04-26 18:19, Roman Kagan wrote: > > @@ -550,13 +561,26 @@ def verify_cache_mode(supported_cache_modes=[]): > > if supported_cache_modes and (cachemode not in supported_cache_modes): > > notrun(&

Re: [Qemu-devel] [Qemu-block] [PATCH 00/17] iotests: don't choke on disabled drivers

2018-05-17 Thread Roman Kagan
On Thu, Apr 26, 2018 at 07:19:41PM +0300, Roman Kagan wrote: > Some iotests assume availability of certain block drivers, and fail if > the driver is not supported by QEMU because it was disabled at configure > time. > > This series tries to address that, by making QEMU report

[Qemu-devel] [PATCH 13/17] iotest 099: notrun if blkdebug or blkverify is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/099 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099 index caaf58eee5..80dab909d5 100755 --- a/tests/qemu-iotests/099 +++ b/tests/qemu-iotests/099 @@ -45,6 +45,7 @@ _supported_proto file

[Qemu-devel] [PATCH 17/17] iotest 184: notrun if null-co or throttle is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/184 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/184 b/tests/qemu-iotests/184 index 2b68284d58..87ae30df46 100755 --- a/tests/qemu-iotests/184 +++ b/tests/qemu-iotests/184 @@ -34,6 +34,7 @@ trap "exit \$status&quo

[Qemu-devel] [PATCH 06/17] iotest 055: skip unsupported backup target formats

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/055 | 12 1 file changed, 12 insertions(+) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 3437c11507..3a47aaa886 100755 --- a/tests/qemu-iotests/055 +++ b/tests/qemu-iotests/055 @@ -490,11 +490,15 @@ class

[Qemu-devel] [PATCH 11/17] iotest 087: notrun if null-co is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/087 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087 index 2561a14456..83710babe3 100755 --- a/tests/qemu-iotests/087 +++ b/tests/qemu-iotests/087 @@ -34,6 +34,7 @@ status=1 # failure is the

[Qemu-devel] [PATCH 15/17] iotest 139: skip testcases using disabled drivers

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/139 | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index cc7fe337f3..ca932a5c29 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -326,6 +326,8 @@ class TestBlockdevDel

[Qemu-devel] [PATCH 09/17] iotest 071: notrun if blkdebug or blkverify is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/071 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 index 48b495513f..2385ab33be 100755 --- a/tests/qemu-iotests/071 +++ b/tests/qemu-iotests/071 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$s

[Qemu-devel] [PATCH 16/17] iotest 147: notrun if nbd is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/147 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index d2081df84b..f66a777351 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -249,6 +249,7 @@ class BuiltinNBD

[Qemu-devel] [PATCH 05/17] iotest 030: require blkdebug

2018-04-26 Thread Roman Kagan
This test uses blkdebug extensively so notrun it if blkdebug is disabled in QEMU. Signed-off-by: Roman Kagan --- tests/qemu-iotests/030 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 6b20ff005e..ac96331899 100755 --- a/tests/qemu

[Qemu-devel] [PATCH 10/17] iotest 081: notrun if quorum is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/081 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index da3fb0984b..3489f2975f 100755 --- a/tests/qemu-iotests/081 +++ b/tests/qemu-iotests/081 @@ -42,6 +42,7 @@ trap "_cleanup; exit \$s

[Qemu-devel] [PATCH 14/17] iotest 124: skip testcases using blkdebug if disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/124 | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 8e76e62f93..f26c9170fb 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -401,6 +401,8 @@ class

[Qemu-devel] [PATCH 08/17] iotest 056: skip testcases using blkdebug if disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/056 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index 223292175a..ff40313851 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -230,6 +230,9 @@ class BackupTest

[Qemu-devel] [PATCH 07/17] iotest 055: require blkdebug

2018-04-26 Thread Roman Kagan
This test uses blkdebug extensively so notrun it if blkdebug is disabled in QEMU. Signed-off-by: Roman Kagan --- tests/qemu-iotests/055 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 3a47aaa886..02ea3cb72d 100755 --- a/tests/qemu

[Qemu-devel] [PATCH 03/17] iotests: ask qemu for supported formats

2018-04-26 Thread Roman Kagan
Add helper functions to query the block drivers actually supported by QEMU using "-drive format=?". This allows to skip certain tests that require drivers not built in or whitelisted in QEMU. Signed-off-by: Roman Kagan --- tests/qemu-iotests/common.rc | 19 +++

[Qemu-devel] [PATCH 12/17] iotest 093: notrun if null-co or null-aio is disabled

2018-04-26 Thread Roman Kagan
Signed-off-by: Roman Kagan --- tests/qemu-iotests/093 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index c3404a3171..6a62f6f01d 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -372,4 +372,5 @@ class

[Qemu-devel] [PATCH 01/17] block: iterate_format with account of whitelisting

2018-04-26 Thread Roman Kagan
ormats (r/w and r/o) in main qemu. Signed-off-by: Roman Kagan --- include/block/block.h | 2 +- block.c | 23 +++ blockdev.c| 4 +++- qemu-img.c| 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/block/bl

[Qemu-devel] [PATCH 04/17] iotest 030: skip quorum test setup/teardown too

2018-04-26 Thread Roman Kagan
If quorum driver is not enabled, test 030 skips the corresponding testcase. This, however, is insufficient: quorum is first used in the testsuite's setUp. To avoid erroring out here, skip setUp/tearDown, too. Signed-off-by: Roman Kagan --- tests/qemu-iotests/030 | 6 ++ 1 file chang

[Qemu-devel] [PATCH 02/17] iotests: iotests.py: prevent deadlock in subprocess

2018-04-26 Thread Roman Kagan
A subprocess whose std{out,err} is subprocess.PIPE may block writing its output, so .wait() should not be called on it until the pipes are read completely on the caller's side. Subprocess.communicate takes care of this. Signed-off-by: Roman Kagan --- tests/qemu-iotests/iotests.py

[Qemu-devel] [PATCH 00/17] iotests: don't choke on disabled drivers

2018-04-26 Thread Roman Kagan
and using this information to skip the parts of the io testsuite that can not be run in this configuration. Roman Kagan (17): block: iterate_format with account of whitelisting iotests: iotests.py: prevent deadlock in subprocess iotests: ask qemu for supported formats iotest 030: skip quorum

[Qemu-devel] [PATCH] update-linux-headers: drop hyperv.h

2018-04-13 Thread Roman Kagan
As of mainline linux commit 5a485803221777013944cbd1a7cd5c62efba3ffa "x86/hyper-v: move hyperv.h out of uapi" by Vitaly Kuznetsov, no linux uapi header includes it, so we no longer need to create a stub for it. Cc: Vitaly Kuznetsov Signed-off-by: Roman Kagan --- scripts/update-linux-

Re: [Qemu-devel] [PATCH v5 1/1] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-04-11 Thread Roman Kagan
- > target/i386/kvm.c | 39 ++- > target/i386/machine.c | 24 > 5 files changed, 77 insertions(+), 3 deletions(-) Reviewed-by: Roman Kagan

[Qemu-devel] [PATCH for-2.12 v3 0/2] i386/hyperv: fully control Hyper-V features in CPUID

2018-03-30 Thread Roman Kagan
warnings; I'll post a separate series. v2 -> v3: - include the fix for 'hv-time' missed previously v1 -> v2: - indicate what flag requested the feature that can't be enabled in the error message - fix a typo in the error message for VP_RUNTIME Roman Kagan (2): i386/

[Qemu-devel] [PATCH for-2.12 v3 2/2] i386/hyperv: error out if features requested but unsupported

2018-03-30 Thread Roman Kagan
and the feature is not announced to the guest. Refuse to start with an error instead. Signed-off-by: Roman Kagan --- v2 -> v3: - include the fix for 'hv-time' missed previously v1 -> v2: - indicate what flag requested the feature that can't be enabled in the error mes

[Qemu-devel] [PATCH for-2.12 v3 1/2] i386/hyperv: add hv-frequencies cpu property

2018-03-30 Thread Roman Kagan
underlying KVM. Introduce "hv-frequencies" cpu property (off by default) which gives QEMU full control over whether these MSRs are announced. While at this, drop the redundant check of the cpu tsc frequency, and decouple this feature from hv-time. Signed-off-by: Roman Kagan Reviewed-b

Re: [Qemu-devel] [PATCH for-2.12 v2 2/2] i386/hyperv: error out if features requested but unsupported

2018-03-29 Thread Roman Kagan
On Wed, Mar 28, 2018 at 03:53:31PM -0300, Eduardo Habkost wrote: > On Wed, Mar 28, 2018 at 06:30:24PM +0300, Roman Kagan wrote: > > In order to guarantee compatibility on migration, QEMU should have > > complete control over the features it announces to the guest via CPUID. > >

[Qemu-devel] [PATCH for-2.12 v2 1/2] i386/hyperv: add hv-frequencies cpu property

2018-03-28 Thread Roman Kagan
underlying KVM. Introduce "hv-frequencies" cpu property (off by default) which gives QEMU full control over whether these MSRs are announced. While at this, drop the redundant check of the cpu tsc frequency, and decouple this feature from hv-time. Signed-off-by: Roman Kagan --

[Qemu-devel] [PATCH for-2.12 v2 0/2] i386/hyperv: fully control Hyper-V features in CPUID

2018-03-28 Thread Roman Kagan
warnings; I'll post a separate series. v1 -> v2: - indicate what flag requested the feature that can't be enabled in the error message - fix a typo in the error message for VP_RUNTIME Roman Kagan (2): i386/hyperv: add hv-frequencies cpu property i386/hyperv: error out if featu

[Qemu-devel] [PATCH for-2.12 v2 2/2] i386/hyperv: error out if features requested but unsupported

2018-03-28 Thread Roman Kagan
and the feature is not announced to the guest. Refuse to start with an error instead. Signed-off-by: Roman Kagan --- v1 -> v2: - indicate what flag requested the feature that can't be enabled in the error message - fix a typo in the error message for VP_RUNTIME target/i386/kv

Re: [Qemu-devel] [PATCH for-2.12 2/2] i386/hyperv: error out if features requested but unsupported

2018-03-26 Thread Roman Kagan
On Fri, Mar 23, 2018 at 04:56:21PM -0300, Eduardo Habkost wrote: > On Fri, Mar 23, 2018 at 03:58:08PM +0300, Roman Kagan wrote: > > In order to guarantee compatibility on migration, QEMU should have > > complete control over the features it announces to the guest via CPUID. > >

Re: [Qemu-devel] [PATCH v4 2/2] i386/kvm: expose Hyper-V frequency MSRs with reenlightenment

2018-03-26 Thread Roman Kagan
On Fri, Mar 23, 2018 at 03:45:49PM +0100, Vitaly Kuznetsov wrote: > Eduardo Habkost writes: > > > On Thu, Mar 22, 2018 at 02:13:58PM +0100, Vitaly Kuznetsov wrote: > >> We can also expose Hyper-V frequency MSRs when reenlightenment feature is > >> enabled and TSC frequency is known, Hyper-V on KV

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-26 Thread Roman Kagan
On Fri, Mar 23, 2018 at 04:48:27PM -0300, Eduardo Habkost wrote: > On Fri, Mar 23, 2018 at 12:45:30PM +0300, Roman Kagan wrote: > > On Thu, Mar 22, 2018 at 03:38:13PM -0300, Eduardo Habkost wrote: > > > It looks like the guest can still crash if we migrate > > > "

[Qemu-devel] [PATCH for-2.12 1/2] i386/hyperv: add hv-frequencies cpu property

2018-03-23 Thread Roman Kagan
ned-off-by: Roman Kagan --- Note: this patch introduces a new cpu property, which is not what we normally do in stable branches. However, this appears to be the minimal effort/churn approach to reduce the number of published QEMU releases where the behavior of the feature is unpredictable, with p

[Qemu-devel] [PATCH for-2.12 0/2] i386/hyperv: fully control Hyper-V features in CPUID

2018-03-23 Thread Roman Kagan
potentially fatal consequences for the guest. Note #2: there are other problems in the surrounding code, like ugly error reporting or inconsistent population of MSRs. I think this can be put off to post-2.12. Roman Kagan (2): i386/hyperv: add hv-frequencies cpu property i386/hyperv: error out

[Qemu-devel] [PATCH for-2.12 2/2] i386/hyperv: error out if features requested but unsupported

2018-03-23 Thread Roman Kagan
and the feature is not announced to the guest. Refuse to start with an error instead. Cc: qemu-sta...@nongnu.org Signed-off-by: Roman Kagan --- target/i386/kvm.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c

Re: [Qemu-devel] [PATCH v4 2/2] i386/kvm: expose Hyper-V frequency MSRs with reenlightenment

2018-03-23 Thread Roman Kagan
On Thu, Mar 22, 2018 at 04:01:46PM -0300, Eduardo Habkost wrote: > On Thu, Mar 22, 2018 at 02:13:58PM +0100, Vitaly Kuznetsov wrote: > > We can also expose Hyper-V frequency MSRs when reenlightenment feature is > > enabled and TSC frequency is known, Hyper-V on KVM will provide stable TSC > > page

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-23 Thread Roman Kagan
On Thu, Mar 22, 2018 at 03:38:13PM -0300, Eduardo Habkost wrote: > On Thu, Mar 22, 2018 at 04:58:03PM +0300, Roman Kagan wrote: > > On Thu, Mar 22, 2018 at 10:22:18AM -0300, Eduardo Habkost wrote: > > > On Thu, Mar 22, 2018 at 04:00:14PM +0300, Roman Kagan wrote: > > > &

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-22 Thread Roman Kagan
On Thu, Mar 22, 2018 at 10:22:18AM -0300, Eduardo Habkost wrote: > On Thu, Mar 22, 2018 at 04:00:14PM +0300, Roman Kagan wrote: > > On Wed, Mar 21, 2018 at 05:19:24PM -0300, Eduardo Habkost wrote: > > > On Wed, Mar 21, 2018 at 07:57:29PM +0300, Roman Kagan wrote: > > > &

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-22 Thread Roman Kagan
On Wed, Mar 21, 2018 at 05:19:24PM -0300, Eduardo Habkost wrote: > On Wed, Mar 21, 2018 at 07:57:29PM +0300, Roman Kagan wrote: > > On Wed, Mar 21, 2018 at 02:18:54PM +0100, Vitaly Kuznetsov wrote: > > > Roman Kagan writes: > > > > > > > On Tue, Mar 20, 201

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-21 Thread Roman Kagan
On Wed, Mar 21, 2018 at 05:17:38PM +0100, Vitaly Kuznetsov wrote: > (What I'm worried about with all our hv_* knobs is that more of them we > have easier it is to assemble some frankenstien which won't look like > any existing Hyper-V version; we're probably not doing a very good job > tesing all p

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-21 Thread Roman Kagan
On Wed, Mar 21, 2018 at 02:18:54PM +0100, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > > On Tue, Mar 20, 2018 at 06:35:00PM +0100, Vitaly Kuznetsov wrote: > >> Requiring tsc_is_stable_and_known() is too restrictive: even without INVTCS > >> nested Hyper-V-on

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-21 Thread Roman Kagan
On Wed, Mar 21, 2018 at 04:33:33PM +0100, Paolo Bonzini wrote: > On 20/03/2018 18:35, Vitaly Kuznetsov wrote: > > +if (has_msr_hv_frequencies && env->tsc_khz) { > > env->features[FEAT_HYPERV_EAX] |= HV_ACCESS_FREQUENCY_MSRS; > > env->features[FEAT_HYPERV_EDX] |= HV

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 03:32:27PM -0300, Eduardo Habkost wrote: > The difference between both approaches is that checking just > has_msr_hv_* would let a non-cooperating guest prevent itself > from being migrated to an older host by writing a non-zero value > to a MSR, even if hyperv support was n

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 06:35:00PM +0100, Vitaly Kuznetsov wrote: > Requiring tsc_is_stable_and_known() is too restrictive: even without INVTCS > nested Hyper-V-on-KVM enables TSC pages for its guests e.g. when > Reenlightenment MSRs are present. Presence of frequency MSRs doesn't mean > these freq

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
u > as it effectively blocks migration). > > Signed-off-by: Vitaly Kuznetsov > --- > Changes since v2: > - add hv-reenlightenment CPU property [Roman Kagan, Paolo Bonzini] > - add a comment to feature_word_info [Roman Kagan] > --- > target/i386/cpu.c | 4 +++

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 03:32:27PM -0300, Eduardo Habkost wrote: > On Tue, Mar 20, 2018 at 06:34:59PM +0100, Vitaly Kuznetsov wrote: > > @@ -1747,6 +1760,15 @@ static int kvm_put_msrs(X86CPU *cpu, int level) > > if (cpu->hyperv_time) { > > kvm_msr_entry_add(cpu, HV_X64

Re: [Qemu-devel] [PATCH v2 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 03:16:52PM -0300, Eduardo Habkost wrote: > On Mon, Mar 19, 2018 at 06:29:08PM +0100, Vitaly Kuznetsov wrote: > > Roman Kagan writes: > > > (This is also a problem with has_msr_hv_frequencies, and is in general a > > > long-standing issue of

Re: [Qemu-devel] [PATCH v2 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-19 Thread Roman Kagan
On Mon, Mar 19, 2018 at 06:29:08PM +0100, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > > On Fri, Mar 16, 2018 at 06:00:19PM +0100, Vitaly Kuznetsov wrote: > >> KVM recently gained support for Hyper-V Reenlightenment MSRs which are > >> required to make

Re: [Qemu-devel] [PATCH v2 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-19 Thread Roman Kagan
On Fri, Mar 16, 2018 at 06:00:19PM +0100, Vitaly Kuznetsov wrote: > KVM recently gained support for Hyper-V Reenlightenment MSRs which are > required to make KVM-on-Hyper-V enable TSC page clocksource to its guests > when INVTSC is not passed to it (and it is not passed by default in Qemu > as it e

Re: [Qemu-devel] [Qemu-block] [RFC PATCH 0/2] Increase usability of external snapshots

2018-03-02 Thread Roman Kagan
On Tue, Feb 27, 2018 at 12:56:49PM +0100, Richard Palethorpe wrote: > Following on from the discussion about creating savevm/loadvm QMP > equivalents. I decided to take the advice given that we should use external > snapshots. However reverting to a snapshot currently requires QEMU to be > restarte

Re: [Qemu-devel] [RFC PATCH 29/34] net: add Hyper-V/VMBus network protocol definitions

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 01:00:14PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > +/* NdisInitialize message */ > > +struct rndis_initialize_request { > > +uint32_t req_id; > > +uint32_t major_ver; > > +uint32_t minor_ver

Re: [Qemu-devel] [RFC PATCH 25/34] scsi: add Hyper-V/VMBus SCSI controller

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:11:50PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > +blk_io_plug(d->conf.blk); > > +if (scsi_req_enqueue(sreq)) { > > +scsi_req_continue(sreq); > > +} > > +blk_io_unplug(d->conf.

Re: [Qemu-devel] [RFC PATCH 33/34] vmbus: add support for rom files

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:18:38PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > In order to leverage third-party drivers for VMBus devices in firmware > > (in particular, there's a case with iPXE driver for hv-net in SeaBIOS > > and OVMF), i

Re: [Qemu-devel] [RFC PATCH 27/34] tests: hv-scsi: add start-stop test

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:15:50PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > +if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) { > > +g_printerr("Hyper-V / VMBus are only available on x86\n");

Re: [Qemu-devel] [RFC PATCH 22/34] i386: Hyper-V VMBus ACPI DSDT entry

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:05:23PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > From: Andrey Smetanin > > > > Guest OS uses ACPI to discover vmbus presence. Add a corresponding > > entry to DSDT in case vmbus has been enabled. > >

Re: [Qemu-devel] [RFC PATCH 21/34] vmbus: build configuration

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:04:01PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > From: Evgeny Yakovlev > > > > Add option to configure and makefiles to enable building vmbus support > > (default to "on" on Linux and "off"

Re: [Qemu-devel] [RFC PATCH 18/34] hyperv: add support for KVM_HYPERV_EVENTFD

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 12:01:41PM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > When setting up a notifier for Hyper-V event connection, attempt to use > > the KVM-assisted one first, and fall back to userspace handling of the > > hypercall

Re: [Qemu-devel] [RFC PATCH 12/34] hyperv: add synic event flag signaling

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 11:58:58AM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > +/* > > + * Set given event flag for a given sint on a given vcpu, and signal the > > sint. > > + */ > > +int hyperv_set_evt_flag(HvSintRoute *sint_route

Re: [Qemu-devel] [RFC PATCH 11/34] hyperv: add synic message delivery

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 11:58:08AM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > + > > +HvSintMsgCb msg_cb; > > +void *msg_cb_data; > > +struct hyperv_message *msg; > > +/* > > + * the state of the message sta

Re: [Qemu-devel] [RFC PATCH 09/34] hyperv: block SynIC use in QEMU in incompatible configurations

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 11:46:30AM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > Certain configurations do not allow SynIC to be used in QEMU. In > > particular, > > > > - when hyperv_vpindex is off, SINT routes can't be used as the

Re: [Qemu-devel] [RFC PATCH 08/34] hyperv: qom-ify SynIC

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 11:45:28AM +0100, Paolo Bonzini wrote: > On 06/02/2018 21:30, Roman Kagan wrote: > > +static SynICState *get_synic(X86CPU *cpu) > > +{ > > +SynICState *synic = > > +SYNIC(object_resolve_path_component(OBJECT(cpu), "

[Qemu-devel] [RFC PATCH 33/34] vmbus: add support for rom files

2018-02-06 Thread Roman Kagan
UID). The format and the calling convention for the ROMs is out of scope for this patch: QEMU doesn't try to interpret them. Signed-off-by: Roman Kagan --- include/hw/vmbus/vmbus.h | 3 +++ hw/vmbus/vmbus.c | 39 +++ 2 files changed, 42 insertio

[Qemu-devel] [RFC PATCH 29/34] net: add Hyper-V/VMBus network protocol definitions

2018-02-06 Thread Roman Kagan
Add a header with data structures and constants defining the protocol for communication between the guest and the hypervisor implementing the Hyper-V/VMBus network adapter. Mostly taken from the corresponding definitions in the Linux kernel. TODO: move RNDIS stuff to rndis.h Signed-off-by: Roman

[Qemu-devel] [RFC PATCH 32/34] loader: allow arbitrary basename for fw_cfg file roms

2018-02-06 Thread Roman Kagan
nstead of interpreting the trailing dash. Signed-off-by: Roman Kagan --- include/hw/loader.h | 2 +- hw/core/loader.c| 43 +-- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/include/hw/loader.h b/include/hw/loader.h index 355fe0f5a2..a30

[Qemu-devel] [RFC PATCH 27/34] tests: hv-scsi: add start-stop test

2018-02-06 Thread Roman Kagan
It's trivial and tests only a tiny fraction of the relevant code, but it's better than nothing. Signed-off-by: Roman Kagan --- tests/hv-scsi-test.c | 57 ++ tests/Makefile.include | 3 +++ 2 files changed, 60 insertions(+) create m

[Qemu-devel] [RFC PATCH 25/34] scsi: add Hyper-V/VMBus SCSI controller

2018-02-06 Thread Roman Kagan
Add an implementation of Hyper-V/VMBus SCSI controller. Kudos to Evgeny Yakovlev (formerly eyakov...@virtuozzo.com) for research and prototyping. Signed-off-by: Roman Kagan --- hw/scsi/hv-scsi.c | 398 ++ hw/scsi/Makefile.objs | 2 + hw

[Qemu-devel] [RFC PATCH 26/34] hv-scsi: limit the number of requests per notification

2018-02-06 Thread Roman Kagan
than this Signed-off-by: Roman Kagan --- hw/scsi/hv-scsi.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/scsi/hv-scsi.c b/hw/scsi/hv-scsi.c index bbfc26bf0a..aa055340ef 100644 --- a/hw/scsi/hv-scsi.c +++ b/hw/scsi/hv-scsi.c @@ -294,8 +294,9 @@ static

[Qemu-devel] [RFC PATCH 17/34] [not to commit] import HYPERV_EVENTFD stuff from kernel

2018-02-06 Thread Roman Kagan
Allow to build and test HYPERV_EVENTD until it comes through the regular kernel headers import. Signed-off-by: Roman Kagan --- linux-headers/linux/kvm.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index d92c9b2f0e

[Qemu-devel] [RFC PATCH 13/34] hyperv: process SIGNAL_EVENT hypercall

2018-02-06 Thread Roman Kagan
avoid expensive user exit just to look up an eventfd by connection number and signal it. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 + target/i386/hyperv.c | 113 +-- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/t

[Qemu-devel] [RFC PATCH 30/34] net: add Hyper-V/VMBus net adapter

2018-02-06 Thread Roman Kagan
TODO: - add MAC filtering - add offloads - perf tuning Signed-off-by: Roman Kagan --- hw/net/hv-net.c | 1440 ++ hw/net/Makefile.objs |2 + 2 files changed, 1442 insertions(+) create mode 100644 hw/net/hv-net.c diff --git a/hw/net/hv

[Qemu-devel] [RFC PATCH 10/34] hyperv: make overlay pages for SynIC

2018-02-06 Thread Roman Kagan
added when in_kvm_only == false, no extra compat logic is necessary. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 70 +++- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 933bfe5bcb..

[Qemu-devel] [RFC PATCH 20/34] vmbus: vmbus implementation

2018-02-06 Thread Roman Kagan
(formerly asmeta...@virtuozzo.com) for research and prototyping. Signed-off-by: Roman Kagan --- Makefile.objs|1 + include/hw/vmbus/vmbus.h | 106 ++ hw/vmbus/vmbus.c | 2436 ++ hw/vmbus/Makefile.objs |1 + hw/vmbus/trace-events

[Qemu-devel] [RFC PATCH 09/34] hyperv: block SynIC use in QEMU in incompatible configurations

2018-02-06 Thread Roman Kagan
lder kernel and/or without vp_index enabled but will refuse the in-QEMU uses of SynIC (e.g. VMBus). Also a function is added that allows the devices to query the status of SynIC support across vCPUs. Signed-off-by: Roman Kagan --- include/hw/i386/pc.h | 5 target/i386/hyperv.h | 4 +

[Qemu-devel] [RFC PATCH 22/34] i386: Hyper-V VMBus ACPI DSDT entry

2018-02-06 Thread Roman Kagan
). This results, in particular, in parallel port conflicting with vmbus. TODO: discover and use spare IRQs to avoid conflicts. Signed-off-by: Evgeny Yakovlev Signed-off-by: Roman Kagan --- hw/i386/acpi-build.c | 42 ++ 1 file changed, 42 insertions(+) diff

[Qemu-devel] [RFC PATCH 06/34] hyperv: address HvSintRoute by X86CPU pointer

2018-02-06 Thread Roman Kagan
Use X86CPU pointer to refer to the respective HvSintRoute instead of vp_index. This is more convenient and also paves the way for future enhancements. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/i386

[Qemu-devel] [RFC PATCH 19/34] vmbus: add vmbus protocol definitions

2018-02-06 Thread Roman Kagan
Add a header with data structures and constants used in Hyper-V VMBus hypervisor <-> guest interactions. Based on the respective stuff from Linux kernel. Signed-off-by: Roman Kagan --- include/hw/vmbus/vmbus-proto.h | 222 + 1 file change

[Qemu-devel] [RFC PATCH 04/34] hyperv: synic: only setup ack notifier if there's a callback

2018-02-06 Thread Roman Kagan
There's no point setting up an sint ack notifier if no callback is specified. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index e762e

[Qemu-devel] [RFC PATCH 18/34] hyperv: add support for KVM_HYPERV_EVENTFD

2018-02-06 Thread Roman Kagan
When setting up a notifier for Hyper-V event connection, attempt to use the KVM-assisted one first, and fall back to userspace handling of the hypercall if the kernel doesn't provide the requested feature. Signed-off-by: Roman Kagan --- include/sysemu/kvm.h | 1 + accel/kvm/kvm-all.c

[Qemu-devel] [RFC PATCH 05/34] hyperv: allow passing arbitrary data to sint ack callback

2018-02-06 Thread Roman Kagan
the header. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 14 +++--- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 16 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 82f4757975

[Qemu-devel] [RFC PATCH 14/34] hyperv: process POST_MESSAGE hypercall

2018-02-06 Thread Roman Kagan
Add handling of POST_MESSAGE hypercall. For that, add an interface to regsiter a handler for the messages arrived from the guest on a particular connection id (IOW set up a message connection in Hyper-V speak). Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 5 +++ target/i386/hyperv.c

[Qemu-devel] [RFC PATCH 34/34] hv-net: define default rom file name

2018-02-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- hw/net/hv-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/hv-net.c b/hw/net/hv-net.c index 3d719458ea..b44ab20b0f 100644 --- a/hw/net/hv-net.c +++ b/hw/net/hv-net.c @@ -1423,6 +1423,7 @@ static void hv_net_class_init(ObjectClass *klass, void *data

[Qemu-devel] [RFC PATCH 00/34] Hyper-V / VMBus

2018-02-06 Thread Roman Kagan
-hd,... \ ... -netdev ... \ -device hv-net,(usual net props),(instanceid= optional) \ ... Big kudos to Andrey Smetanin and Evgeny Yakovlev for their research and prototyping. Andrey Smetanin (1): i386: Hyper-V VMBus ACPI DSDT entry Evgeny Yakovlev (1): vmbus: build configuration Roman Ka

[Qemu-devel] [RFC PATCH 08/34] hyperv: qom-ify SynIC

2018-02-06 Thread Roman Kagan
Make Hyper-V SynIC a device which is attached as a child to X86CPU. For now it only makes SynIC visibile in the qom hierarchy, and maintains its internal fields in sync with the respecitve msrs of the parent cpu (the fields will be used in followup patches). Signed-off-by: Roman Kagan

[Qemu-devel] [RFC PATCH 28/34] net: add RNDIS definitions

2018-02-06 Thread Roman Kagan
Add a header with constants used in Microsoft RNDIS protocol. The header is taken unchanged from the Linux kernel. TODO: reconcile with usb-net Signed-off-by: Roman Kagan --- hw/net/rndis.h | 391 + 1 file changed, 391 insertions

[Qemu-devel] [RFC PATCH 23/34] i386: en/disable vmbus by a machine property

2018-02-06 Thread Roman Kagan
Hyper-V VMBus logically belongs to the machine, so make its presence be controlled by a boolean property of the machine. TODO: consider doing this through adding the vmbus-bridge device instead Signed-off-by: Roman Kagan --- include/hw/i386/pc.h | 3 +++ hw/i386/pc.c | 34

[Qemu-devel] [RFC PATCH 31/34] hv-net: add .bootindex support

2018-02-06 Thread Roman Kagan
Add support for .bootindex property in hv-net. This results in a corresponding entry appearing in fw_cfg "bootorder". In order to actually boot off a hv-net device (via PXE) the firmware needs also a driver for it (either built-in or supplied via ROM). Signed-off-by: Roman Kagan ---

[Qemu-devel] [RFC PATCH 16/34] hyperv: update copyright notices

2018-02-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 1 + hw/misc/hyperv_testdev.c | 1 + target/i386/hyperv.c | 1 + 3 files changed, 3 insertions(+) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index fcc41caf1f..8b7fcd0b48 100644 --- a/target/i386/hyperv.h +++ b/target

[Qemu-devel] [RFC PATCH 24/34] scsi: add Hyper-V/VMBus SCSI protocol definitions

2018-02-06 Thread Roman Kagan
Add a header with data structures and constants defining the protocol between the guest and the hypervisor implementing the Hyper-V VMBus SCSI controller. Mostly taken from the corresponding definitions in the Linux kernel. Signed-off-by: Roman Kagan --- hw/scsi/hvscsi-proto.h | 150

[Qemu-devel] [RFC PATCH 12/34] hyperv: add synic event flag signaling

2018-02-06 Thread Roman Kagan
Add infrastructure to signal SynIC event flags by atomically setting the corresponding bit in the event flags page and firing a SINT if necessary. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 ++ target/i386/hyperv.c | 32 2 files changed, 34

[Qemu-devel] [RFC PATCH 21/34] vmbus: build configuration

2018-02-06 Thread Roman Kagan
From: Evgeny Yakovlev Add option to configure and makefiles to enable building vmbus support (default to "on" on Linux and "off" otherwise). Signed-off-by: Roman Kagan --- configure| 11 +++ hw/Makefile.objs | 1 + 2 files changed, 12 insertions(+) diff

[Qemu-devel] [RFC PATCH 07/34] hyperv: make HvSintRoute reference-counted

2018-02-06 Thread Roman Kagan
Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 10 +- hw/misc

[Qemu-devel] [RFC PATCH 15/34] hyperv_testdev: add SynIC message and event testmodes

2018-02-06 Thread Roman Kagan
the incoming events are signaled on the configured vCPUs. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 162 ++- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index

[Qemu-devel] [RFC PATCH 03/34] hyperv: cosmetic: g_malloc -> g_new

2018-02-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index c9a4bb539d..e762eac79f 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -88,7 +88,7 @@ HvSintRoute

[Qemu-devel] [RFC PATCH 11/34] hyperv: add synic message delivery

2018-02-06 Thread Roman Kagan
callback. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 7 +-- target/i386/hyperv.c | 118 ++- 2 files changed, 111 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 249bc15232..df17d9c3b7 100644

[Qemu-devel] [RFC PATCH 02/34] hyperv_testdev: refactor for readability

2018-02-06 Thread Roman Kagan
Make hyperv_testdev slightly easier to follow and enhance in future. For that, put the hyperv sint routes (wrapped in a helper structure) on a linked list rather than a fixed-size array. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 114

[Qemu-devel] [RFC PATCH 01/34] hyperv: ensure VP index equal to QEMU cpu_index

2018-02-06 Thread Roman Kagan
to wrap the mapping between a vCPU and its vp_index. Besides, a few variables are renamed to avoid confusion of vp_index with vcpu_id (== apic_id). Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 5 - target/i386/hyperv.c | 16 +--- targe

Re: [Qemu-devel] [PATCH] scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0

2017-12-22 Thread Roman Kagan
On Fri, Dec 22, 2017 at 04:55:22PM +0100, Paolo Bonzini wrote: > scsi_disk_emulate_command passes in_buf == NULL when sent a REQUEST > SENSE command. Check for in_len == 0 before dereferencing in_buf. > > Fixes: f68d98b21fa74155dc7c1fd212474379ac3c7531 > Reported-by: Roman Kagan

Re: [Qemu-devel] [PULL 32/46] scsi: provide general-purpose functions to manage sense data

2017-12-22 Thread Roman Kagan
On Wed, Dec 20, 2017 at 06:14:44PM +0100, Paolo Bonzini wrote: > @@ -274,52 +319,21 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = { > int scsi_convert_sense(uint8_t *in_buf, int in_len, > uint8_t *buf, int len, bool fixed) > { > -bool fixed_in; > SCSIS

Re: [Qemu-devel] [Qemu-block] [PATCH 2/5] configure: add dependency

2017-12-22 Thread Roman Kagan
On Mon, Dec 18, 2017 at 02:09:08PM +0300, Denis V. Lunev wrote: > From: Klim Kireev > > This dependency is required for adequate Parallels images support. > Typically the disk consists of several images which are glued by > XML disk descriptor. Also XML hides inside several important parameters >

<    1   2   3   4   5   6   7   >