Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-31 Thread Jan Beulich
On 30.01.2020 12:47, Wei Liu wrote: > On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: >> I think what you need is a hook that modifies the memory map and adds >> a reserved region at ((1 << paddr_bits) - PAGE_SIZE) of size >> PAGE_SIZE. See where pv_shim_fixup_e820 is used, and I t

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-31 Thread Wei Liu
On Thu, Jan 30, 2020 at 01:11:59PM +0100, Roger Pau Monné wrote: > On Thu, Jan 30, 2020 at 11:47:52AM +, Wei Liu wrote: > > On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: > > > On Thu, Jan 30, 2020 at 11:18:21AM +, Wei Liu wrote: > > > > On Thu, Jan 30, 2020 at 11:41:43AM

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Roger Pau Monné
On Thu, Jan 30, 2020 at 11:47:52AM +, Wei Liu wrote: > On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: > > On Thu, Jan 30, 2020 at 11:18:21AM +, Wei Liu wrote: > > > On Thu, Jan 30, 2020 at 11:41:43AM +0100, Roger Pau Monné wrote: > > > > On Wed, Jan 29, 2020 at 08:20:29PM

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Wei Liu
On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: > On Thu, Jan 30, 2020 at 11:18:21AM +, Wei Liu wrote: > > On Thu, Jan 30, 2020 at 11:41:43AM +0100, Roger Pau Monné wrote: > > > On Wed, Jan 29, 2020 at 08:20:29PM +, Wei Liu wrote: > > > > Hyper-V uses a technique called ove

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Roger Pau Monné
On Thu, Jan 30, 2020 at 11:18:21AM +, Wei Liu wrote: > On Thu, Jan 30, 2020 at 11:41:43AM +0100, Roger Pau Monné wrote: > > On Wed, Jan 29, 2020 at 08:20:29PM +, Wei Liu wrote: > > > Hyper-V uses a technique called overlay page for its hypercall page. It > > > will insert a backing page to

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Wei Liu
On Thu, Jan 30, 2020 at 09:57:17AM +, Durrant, Paul wrote: > > -static const struct hypervisor_ops ops = { > > -.name = "Hyper-V", > > -}; > > +static uint64_t generate_guest_id(void) > > +{ > > +uint64_t id; > > + > > +id = (uint64_t)HV_XEN_VENDOR_ID << 48; > > +id |= (xen_majo

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Wei Liu
On Thu, Jan 30, 2020 at 11:41:43AM +0100, Roger Pau Monné wrote: > On Wed, Jan 29, 2020 at 08:20:29PM +, Wei Liu wrote: > > Hyper-V uses a technique called overlay page for its hypercall page. It > > will insert a backing page to the guest when the hypercall functionality > > is enabled. That m

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Roger Pau Monné
On Wed, Jan 29, 2020 at 08:20:29PM +, Wei Liu wrote: > Hyper-V uses a technique called overlay page for its hypercall page. It > will insert a backing page to the guest when the hypercall functionality > is enabled. That means we can use a page that is not backed by real > memory for hypercall

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-30 Thread Durrant, Paul
> -Original Message- > From: Wei Liu On Behalf Of Wei Liu > Sent: 29 January 2020 20:20 > To: Xen Development List > Cc: Durrant, Paul ; Michael Kelley > ; Wei Liu ; Jan Beulich > ; Andrew Cooper ; Wei Liu > ; Roger Pau Monné > Subject: [PATCH v5 07/12] x86/hyperv: setup hypercall page >

[Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-29 Thread Wei Liu
Hyper-V uses a technique called overlay page for its hypercall page. It will insert a backing page to the guest when the hypercall functionality is enabled. That means we can use a page that is not backed by real memory for hypercall page. Use the top-most addressable page for that purpose. Adjust