[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 8/8] x86/hyperv: setup VP assist page
On Sun, Dec 29, 2019 at 07:59:48PM +0000, Michael Kelley wrote: > From: Wei Liu <wei.liu.xen@xxxxxxxxx> On Behalf Of Wei Liu Sent: Sunday, > December 29, 2019 10:34 AM > > > > VP assist page is rather important as we need to toggle some bits in > > that page such that L1 guest can make hypercalls directly to L0 Hyper-V. > > > > Preemptively split out set_vp_assist page which will be used in the resume > > path. > > > > Signed-off-by: Wei Liu <liuwe@xxxxxxxxxxxxx> > > --- > > xen/arch/x86/guest/hyperv/hyperv.c | 35 ++++++++++++++++++++++++++++++ > > xen/include/asm-x86/guest/hyperv.h | 1 + > > 2 files changed, 36 insertions(+) > > > > diff --git a/xen/arch/x86/guest/hyperv/hyperv.c > > b/xen/arch/x86/guest/hyperv/hyperv.c > > index da3a8cd85d..a88b9ae6d9 100644 > > --- a/xen/arch/x86/guest/hyperv/hyperv.c > > +++ b/xen/arch/x86/guest/hyperv/hyperv.c > > @@ -30,6 +30,7 @@ void *hv_hypercall; > > static struct page_info *hv_hypercall_page; > > DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_pcpu_input_arg); > > DEFINE_PER_CPU_READ_MOSTLY(unsigned int, hv_vp_index); > > +DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_vp_assist); > > > > static const struct hypervisor_ops ops; > > const struct hypervisor_ops *__init hyperv_probe(void) > > @@ -125,17 +126,51 @@ static void setup_vp_index(void) > > this_cpu(hv_vp_index) = vp_index_msr; > > } > > > > +static void set_vp_assist(void) > > +{ > > + uint64_t val = paddr_to_pfn(this_cpu(hv_vp_assist).maddr); > > + > > + val = (val << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT) | > > I'd recommend using HV_HYP_PAGE_SHIFT instead of > HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT. On the Linux side, > I'm planning to remove that #define and the similar > *_PAGE_ADDRESS_MASK in favor of the newer HV_HYP_PAGE_* values. > There's nothing special about the VP assist page, so using the generic > #defines based on the Hyper-V page size is reasonable. Ack. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |