[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 05/10] x86/hyperv: setup hypercall page



On Wed, Feb 05, 2020 at 03:00:24PM +0000, Wei Liu wrote:
> On Wed, Feb 05, 2020 at 03:04:16PM +0100, Roger Pau Monné wrote:
> [...]
> > > +static void __init setup_hypercall_page(void)
> > > +{
> > > +    union hv_x64_msr_hypercall_contents hypercall_msr;
> > > +    union hv_guest_os_id guest_id;
> > > +    unsigned long mfn;
> > > +
> > > +    BUILD_BUG_ON(HV_HYP_PAGE_SHIFT != PAGE_SHIFT);
> > > +
> > > +    rdmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id.raw);
> > > +    if ( !guest_id.raw )
> > > +    {
> > > +        guest_id.raw = generate_guest_id();
> > > +        wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id.raw);
> > > +    }
> > > +
> > > +    rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
> > > +    if ( !hypercall_msr.enable )
> > > +    {
> > > +        mfn = HV_HCALL_MFN;
> > > +        hypercall_msr.enable = 1;
> > > +        hypercall_msr.guest_physical_address = mfn;
> > > +        wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
> > > +    }
> > > +    else
> > > +        mfn = hypercall_msr.guest_physical_address;
> > 
> > Is it expected that the guest ID or the hypercal page is already
> > setup?
> > 
> > Ie: would virtual firmware setup any of this? (and not clean it up
> > afterwards)
> 
> There is no definitive answer to why/when this happens in TLFS, but it
> does require guest to respect that is already in the MSR.

My guess would be after migration Hyper-V sets up the same MSR/page
FWIW.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.