All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Joao Martins <joao.m.martins@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Ankur Arora <ankur.a.arora@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Sean Christopherson <seanjc@google.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 03/15] KVM: x86/xen: intercept xen hypercalls if enabled
Date: Sat, 05 Dec 2020 18:51:08 +0000	[thread overview]
Message-ID: <9A93D396-9C77-4E57-A7E0-61BBEEB83658@infradead.org> (raw)
In-Reply-To: <e62dd528-2bee-9e8b-c395-256e6980307e@oracle.com>



On 5 December 2020 18:42:53 GMT, Joao Martins <joao.m.martins@oracle.com> wrote:
>On 12/4/20 1:18 AM, David Woodhouse wrote:
>> @@ -3742,6 +3716,9 @@ int kvm_vm_ioctl_check_extension(struct kvm
>*kvm, long ext)
>>  	case KVM_CAP_ENFORCE_PV_FEATURE_CPUID:
>>  		r = 1;
>>  		break;
>> +	case KVM_CAP_XEN_HVM:
>> +		r = 1 | KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL;
>> +		break;
>
>Maybe:
>
>	r = KVM_XEN_HVM_CONFIG_HYPERCALL_MSR |
>		KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL;

Yeah, I already did that as I did the docs. In my tree it's already folded into this patch for when I post v2. Thanks.


>I suppose it makes sense restricting to INTERCEPT_HCALL to make sure
>that the kernel only
>forwards the hcall if it is control off what it put there in the
>hypercall page (i.e.
>vmmcall/vmcall). hcall userspace exiting without INTERCEPT_HCALL would
>break ABI over how
>this ioctl was used before the new flag... In case
>kvm_xen_hypercall_enabled() would
>return true with KVM_XEN_HVM_CONFIG_HYPERCALL_MSR, as now it needs to
>handle a new
>userspace exit.

Right. 

>If we're are being pedantic, the Xen hypercall MSR is a utility more
>than a necessity as
>the OS can always do without the hcall msr IIUC. But it is defacto used
>by enlightened Xen
>guests included FreeBSD.

Not sure about that. Xen doesn't guarantee that the hypercall will be VMCALL; the ABI *is* ",use the hypercall page MSR and call it" I believe.

But if they do just do the VMCALL, that *will* work as I have it, won't it?

>
>And adding:
>
>#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR	(1 << 0)
>
>Of course, this is a nit for readability only, but it aligns with what
>you write
>in the docs update you do in the last patch.

Yep, already there. Thanks.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

  reply	other threads:[~2020-12-05 18:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  1:18 [PATCH 00/15] KVM: Add Xen hypercall and shared info pages David Woodhouse
2020-12-04  1:18 ` [PATCH 01/15] KVM: Fix arguments to kvm_{un,}map_gfn() David Woodhouse
2020-12-04 18:27   ` Alexander Graf
2020-12-04 19:02     ` David Woodhouse
2020-12-04  1:18 ` [PATCH 02/15] KVM: x86/xen: fix Xen hypercall page msr handling David Woodhouse
2020-12-04 18:26   ` Alexander Graf
2020-12-04 18:54     ` David Woodhouse
2020-12-04  1:18 ` [PATCH 03/15] KVM: x86/xen: intercept xen hypercalls if enabled David Woodhouse
2020-12-04 18:26   ` Alexander Graf
2020-12-04 18:58     ` David Woodhouse
2020-12-05 18:42   ` Joao Martins
2020-12-05 18:51     ` David Woodhouse [this message]
2020-12-05 19:13       ` Joao Martins
2020-12-04  1:18 ` [PATCH 04/15] KVM: x86/xen: Fix coexistence of Xen and Hyper-V hypercalls David Woodhouse
2020-12-04 18:34   ` Alexander Graf
2020-12-04 19:04     ` David Woodhouse
2020-12-04  1:18 ` [PATCH 05/15] KVM: x86/xen: add KVM_XEN_HVM_SET_ATTR/KVM_XEN_HVM_GET_ATTR David Woodhouse
2020-12-04  1:18 ` [PATCH 06/15] KVM: x86/xen: latch long_mode when hypercall page is set up David Woodhouse
2020-12-04 18:38   ` Alexander Graf
2020-12-04 19:08     ` David Woodhouse
2020-12-04  1:18 ` [PATCH 07/15] KVM: x86/xen: add definitions of compat_shared_info, compat_vcpu_info David Woodhouse
2020-12-05 18:43   ` Joao Martins
2020-12-05 19:48     ` David Woodhouse
2020-12-04  1:18 ` [PATCH 08/15] KVM: x86/xen: register shared_info page David Woodhouse
2020-12-04  1:18 ` [PATCH 09/15] KVM: x86/xen: setup pvclock updates David Woodhouse
2020-12-04  1:18 ` [PATCH 10/15] xen: add wc_sec_hi to struct shared_info David Woodhouse
2020-12-04  1:18 ` [PATCH 11/15] KVM: x86/xen: update wallclock region David Woodhouse
2020-12-04  1:18 ` [PATCH 12/15] KVM: x86/xen: register vcpu info David Woodhouse
2020-12-04  1:18 ` [PATCH 13/15] KVM: x86/xen: register vcpu time info region David Woodhouse
2020-12-04  1:18 ` [PATCH 14/15] KVM: x86/xen: register runstate info David Woodhouse
2020-12-04  1:18 ` [PATCH 15/15] KVM: x86: declare Xen HVM shared info capability and add test case David Woodhouse
2020-12-04  9:11 ` [PATCH 16/15] KVM: Add documentation for Xen hypercall and shared_info updates David Woodhouse
2020-12-05 10:48 ` [PATCH 00/15] KVM: Add Xen hypercall and shared info pages David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9A93D396-9C77-4E57-A7E0-61BBEEB83658@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=ankur.a.arora@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.