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

Re: [Xen-devel] [PATCH 05/11] x86/altp2m: basic data structures and support routines.



On 03/26/2015 03:48 AM, Tim Deegan wrote:
> At 13:59 -0700 on 25 Mar (1427291983), Ed White wrote:
>>>>> diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
>>>>> index abf3d7a..8fe0650 100644
>>>>> --- a/xen/arch/x86/mm/hap/hap.c
>>>>> +++ b/xen/arch/x86/mm/hap/hap.c
>>>>> @@ -439,7 +439,7 @@ void hap_domain_init(struct domain *d)
>>>>>  int hap_enable(struct domain *d, u32 mode)
>>>>>  {
>>>>>      unsigned int old_pages;
>>>>> -    uint8_t i;
>>>>> +    uint16_t i;
>>>>>      int rv = 0;
>>>>>  
>>>>>      domain_pause(d);
>>>>> @@ -485,6 +485,23 @@ int hap_enable(struct domain *d, u32 mode)
>>>>>             goto out;
>>>>>      }
>>>>>  
>>>>> +    /* Init alternate p2m data */
>>>>> +    if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL )
>>>>
>>>> This memory should be allocated from some domain-accounted pool,
>>>> probably the paging pool (d->->arch.paging.alloc_page()).  You can use
>>>> map_domain_page_global() to get a safe pointer to anchor in
>>>> d->arch.altp2m_eptp for hardware.
>>
>> I tried this but could not get it to work due to panics in Xen.
>> Looking at the current VMX code, all the existing structures
>> shared with hardware (VMCS, exception bitmap, etc.) are allocated
>> using alloc_xenheap_page(), which is what induced me to write the
>> code this way.
> 
> This page is a per-domain page of pointers, right, and not the actual
> top-level page of an alt-EPT table?  In that case, alloc_xenheap_page()
> should be OK.
> 
> Cheers,
> 
> Tim.
> 

Yep, one page of pointers per domain. Thanks, I'll leave this code
as I originally wrote it then.

Ed


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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