| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 01/17] xen/x86: Introduce helpers to generate/convert the CR3 from/to a MFN/GFN
 Hi Jan, On 25/03/2020 14:46, Jan Beulich wrote: On 22.03.2020 17:14, julien@xxxxxxx wrote:From: Julien Grall <jgrall@xxxxxxxxxx> Introduce handy helpers to generate/convert the CR3 from/to a MFN/GFN. Note that we are using cr3_pa() rather than xen_cr3_to_pfn() because the latter does not ignore the top 12-bits.I'm afraid this remark of yours points at some issue here: cr3_pa() is meant to act on (real or virtual) CR3 values, but not (necessarily) on para-virtual ones. E.g. ... There are use of GFN helpers in the series, but I wanted to avoid introducing them in the middle of something else. I can try to find a couple of occurences I can switch to use them now. Regarding the term GFN, it is not meant to be HVM only. So we may want to prefix the helpers with hvm_ to make it clear. 
I am thinking to introduce 3 sets of helpers:
    - hvm_cr3_to_gfn()/hvm_gfn_to_cr3(): Handle the CR3 for HVM guest
    - {xen, compat}_mfn_to_cr3()/{xen, compat}_cr3_to_mfn(): Handle the 
CR3 for PV guest.
    - host_cr3_to_mfn()/host_mfn_to_cr3(): To handle the host cr3.
What do you think?
Cheers,
--
Julien Grall
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |