linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Graf <graf@amazon.com>,
	Siddharth Chandrasekaran <sidcha@amazon.de>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Evgeny Iakovlev <eyakovl@amazon.de>,
	Liran Alon <liran@amazon.com>,
	Ioannis Aslanidis <iaslan@amazon.de>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: hyper-v: Add new exit reason HYPERV_OVERLAY
Date: Fri, 23 Apr 2021 12:15:01 +0200	[thread overview]
Message-ID: <45888d26-89d2-dba6-41cb-de2d58cd5345@redhat.com> (raw)
In-Reply-To: <ded8db53-0e58-654a-fff2-de536bcbc961@amazon.com>

On 23/04/21 11:58, Alexander Graf wrote:
>> In theory userspace doesn't know how KVM wishes to implement the
>> hypercall page, especially if Xen hypercalls are enabled as well.
> 
> I'm not sure I agree with that sentiment :). User space is the one that 
> sets the xen compat mode. All we need to do is declare the ORing as part 
> of the KVM ABI. Which we effectively are doing already, because it's 
> part of the ABI to the guest, no?

Good point.  But it may change in the future based on KVM_ENABLE_CAP or 
whatever, and duplicating code between userspace and kernel is ugly.  We 
already have too many unwritten conventions around CPUID, MSRs, get/set 
state ioctls, etc.

That said, this definitely tilts the balance against adding an ioctl to 
write the hypercall page contents.  Userspace can either use the 
KVM_SET_MSR or assemble it on its own, and one of the two should be okay.

Paolo

>>
>> But userspace has two plausible ways to get the page contents:
>>
>> 1) add a ioctl to write the hypercall page contents to an arbitrary
>> userspace address
>>
>> 2) after userspace updates the memslots to add the overlay page at the
>> right place, use KVM_SET_MSR from userspace (which won't be filtered
>> because it's host initiated)
>>
>> The second has the advantage of not needing any new code at all, but
>> it's a bit more ugly.
> 
> The more of all of that hyper-v code we can have live in user space, the 
> happier I am :).


  reply	other threads:[~2021-04-23 10:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  9:03 [PATCH] KVM: hyper-v: Add new exit reason HYPERV_OVERLAY Siddharth Chandrasekaran
2021-04-23  9:24 ` Alexander Graf
2021-04-23  9:42   ` Siddharth Chandrasekaran
2021-04-23  9:50   ` Paolo Bonzini
2021-04-23  9:58     ` Alexander Graf
2021-04-23 10:15       ` Paolo Bonzini [this message]
2021-04-23 10:18         ` Alexander Graf
2021-04-26 21:41           ` Siddharth Chandrasekaran
2021-04-23  9:36 ` Vitaly Kuznetsov
2021-04-23 10:05   ` Siddharth Chandrasekaran

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=45888d26-89d2-dba6-41cb-de2d58cd5345@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=eyakovl@amazon.de \
    --cc=graf@amazon.com \
    --cc=hpa@zytor.com \
    --cc=iaslan@amazon.de \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liran@amazon.com \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=sidcha@amazon.de \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).