Skip to contentSkip to conversation

target/i386: fix feature check in hyperv-stub.c

PATCH Applied Alex Bennée 6 participants 7 messages Jun 24, 2019 – Jun 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386: fix feature check in hyperv-stub.c

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/hyperv-stub.c +1 -1
index fe548cbae2..0028527e79 100644
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/hyperv-stub.c +0 -0
index fe548cbae2..0028527e79 100644

target/i386/hyperv-stub.c int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) · line 20

Quoted 7 lines
target/i386/hyperv-stub.c +1 -1
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }

As I just sent out exactly the same patch, this probably means the fix is uncontroversial :-)

Signature · 1 line
Vitaly
#2 lore raw
In reply to Alex Bennée
Quoted 23 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/hyperv-stub.c +0 -0
index fe548cbae2..0028527e79 100644

target/i386/hyperv-stub.c int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) · line 21

Quoted 8 lines
target/i386/hyperv-stub.c +1 -1
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }
 

Queued, thanks.

Paolo

Acked-by
#3 lore raw
Quoted 18 lines · Paolo Bonzini
Quoted 17 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
target/i386/hyperv-stub.c +0 -0
index fe548cbae2..0028527e79 100644

target/i386/hyperv-stub.c int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) · line 21

Quoted 8 lines
target/i386/hyperv-stub.c +1 -1
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }
 

Queued, thanks.

Alex will queue it instead, so

Paolo

#4 lore raw
Quoted 36 lines · Paolo Bonzini
Quoted 18 lines · Paolo Bonzini
Quoted 17 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
target/i386/hyperv-stub.c +0 -0
index fe548cbae2..0028527e79 100644

target/i386/hyperv-stub.c int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) · line 21

Quoted 8 lines
target/i386/hyperv-stub.c +1 -1
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }
 

Queued, thanks.

Quoted 3 lines

Alex will queue it instead, so

I was planning to send a machine + x86 pull request today, and I'll have to include to make sure builds won't fail. I don't think this should prevent the patch from being applied to other trees, though.

Signature · 1 line
Eduardo
Reviewed-by on v1 1/1
#5 lore raw
In reply to Alex Bennée
Quoted 9 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

  configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Quoted 7 lines
Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>
---
 target/i386/hyperv-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
target/i386/hyperv-stub.c +1 -1
index fe548cbae2..0028527e79 100644
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
     switch (exit->type) {
     case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
             return -1;
         }
 
Signature · 1 line
2.20.1
#6 lore raw
In reply to Alex Bennée
Quoted 12 lines · Alex Bennée

Commit 2d384d7c8 broken the build when built with:

configure --without-default-devices --disable-user

The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c

Sorry, I failed to check on the mailing list before sending an exact duplicate of this patch…

Quoted 26 lines
Cc Vitaly Kuznetsov <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Roman Kagan <[email protected]>

---
target/i386/hyperv-stub.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/hyperv-stub.c +1 -1
index fe548cbae2..0028527e79 100644
@@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
 {
    switch (exit->type) {
    case KVM_EXIT_HYPERV_SYNIC:
-        if (!cpu->hyperv_synic) {
+        if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
            return -1;
        }
 
Signature · 1 line
2.20.1