linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <graf@amazon.com>
To: Paolo Bonzini <pbonzini@redhat.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 11:58:13 +0200	[thread overview]
Message-ID: <ded8db53-0e58-654a-fff2-de536bcbc961@amazon.com> (raw)
In-Reply-To: <213887af-78b8-03ad-b3f9-c2194cb27b13@redhat.com>



On 23.04.21 11:50, Paolo Bonzini wrote:
> CAUTION: This email originated from outside of the organization. Do not 
> click links or open attachments unless you can confirm the sender and 
> know thecontent is safe.
> 
> 
> 
> On 23/04/21 11:24, Alexander Graf wrote:
>> I can see how that may get interesting for other overlay pages later,
>> but this one in particular is just an MSR write, no? Is there any reason
>> we can't just use the user space MSR handling logic instead?
>>
>> What's missing then is a way to pull the hcall page contents from KVM.
>> But even there I'm not convinced that KVM should be the reference point
>> for its contents. Isn't user space in an as good position to assemble it?
> 
> 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?

> 
> 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 :).


Alex



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



  reply	other threads:[~2021-04-23  9:59 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 [this message]
2021-04-23 10:15       ` Paolo Bonzini
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=ded8db53-0e58-654a-fff2-de536bcbc961@amazon.com \
    --to=graf@amazon.com \
    --cc=bp@alien8.de \
    --cc=eyakovl@amazon.de \
    --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=pbonzini@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).