diff mbox

[v2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers

Message ID 1453385060-14945-1-git-send-email-asmetanin@virtuozzo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrey Smetanin Jan. 21, 2016, 2:04 p.m. UTC
Add Hyper-V VMBus hypercalls blank handlers which
just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE.

Changes v2:
* use KVM_EXIT_HYPERV exit type

Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Eduardo Habkost <ehabkost@redhat.com>
CC: "Andreas Färber" <afaerber@suse.de>
CC: Marcelo Tosatti <mtosatti@redhat.com>
CC: Roman Kagan <rkagan@virtuozzo.com>
CC: Denis V. Lunev <den@openvz.org>
CC: kvm@vger.kernel.org

---
 target-i386/hyperv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Eduardo Habkost Jan. 23, 2016, 3:20 p.m. UTC | #1
On Thu, Jan 21, 2016 at 05:04:20PM +0300, Andrey Smetanin wrote:
> Add Hyper-V VMBus hypercalls blank handlers which
> just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE.
> 
> Changes v2:
> * use KVM_EXIT_HYPERV exit type
> 

Paolo, this needs a linux-headers update. Should I let you update
the headers in your tree and apply this patch, or can I run
update-linux-headers.sh on my x86 branch?
Paolo Bonzini Jan. 23, 2016, 5:20 p.m. UTC | #2
----- Original Message -----
> From: "Eduardo Habkost" <ehabkost@redhat.com>
> To: "Andrey Smetanin" <asmetanin@virtuozzo.com>
> Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, "Marcelo Tosatti" <mtosatti@redhat.com>, "Roman Kagan"
> <rkagan@virtuozzo.com>, "Denis V. Lunev" <den@openvz.org>, "Paolo Bonzini" <pbonzini@redhat.com>, "Andreas Färber"
> <afaerber@suse.de>, "Richard Henderson" <rth@twiddle.net>
> Sent: Saturday, January 23, 2016 4:20:13 PM
> Subject: Re: [Qemu-devel] [PATCH v2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers
> 
> On Thu, Jan 21, 2016 at 05:04:20PM +0300, Andrey Smetanin wrote:
> > Add Hyper-V VMBus hypercalls blank handlers which
> > just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE.
> > 
> > Changes v2:
> > * use KVM_EXIT_HYPERV exit type
> > 
> 
> Paolo, this needs a linux-headers update. Should I let you update
> the headers in your tree and apply this patch, or can I run
> update-linux-headers.sh on my x86 branch?

This patch's dependency is not even in any upstream KVM branch, so it
will take some time.  For now, just apply it with the linux-headers
changes, and don't "graduate" it from x86-next to x86 until the
headers are updated.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Feb. 23, 2016, 2:39 p.m. UTC | #3
On 21/01/2016 15:04, Andrey Smetanin wrote:
> Add Hyper-V VMBus hypercalls blank handlers which
> just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE.
> 
> Changes v2:
> * use KVM_EXIT_HYPERV exit type
> 
> Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> CC: "Andreas Färber" <afaerber@suse.de>
> CC: Marcelo Tosatti <mtosatti@redhat.com>
> CC: Roman Kagan <rkagan@virtuozzo.com>
> CC: Denis V. Lunev <den@openvz.org>
> CC: kvm@vger.kernel.org
> 
> ---
>  target-i386/hyperv.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/target-i386/hyperv.c b/target-i386/hyperv.c
> index e79b173..d3f3059 100644
> --- a/target-i386/hyperv.c
> +++ b/target-i386/hyperv.c
> @@ -43,6 +43,18 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
>              return -1;
>          }
>          return 0;
> +    case KVM_EXIT_HYPERV_HCALL: {
> +        uint16_t code;
> +
> +        code  = exit->u.hcall.input & 0xffff;
> +        switch (code) {
> +        case HV_X64_HCALL_POST_MESSAGE:
> +        case HV_X64_HCALL_SIGNAL_EVENT:
> +        default:
> +            exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE;
> +            return 0;
> +        }
> +    }
>      default:
>          return -1;
>      }
> 

This is okay BTW, but I'm waiting for the header file update.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/target-i386/hyperv.c b/target-i386/hyperv.c
index e79b173..d3f3059 100644
--- a/target-i386/hyperv.c
+++ b/target-i386/hyperv.c
@@ -43,6 +43,18 @@  int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
             return -1;
         }
         return 0;
+    case KVM_EXIT_HYPERV_HCALL: {
+        uint16_t code;
+
+        code  = exit->u.hcall.input & 0xffff;
+        switch (code) {
+        case HV_X64_HCALL_POST_MESSAGE:
+        case HV_X64_HCALL_SIGNAL_EVENT:
+        default:
+            exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE;
+            return 0;
+        }
+    }
     default:
         return -1;
     }