[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 4/8] xen/arm: Store p2m type in each page of the guest
On 12/05/2013 03:55 PM, Ian Campbell wrote: On Thu, 2013-12-05 at 15:42 +0000, Julien Grall wrote:Use the field 'avail' to store the type of the page. This information will be retrieved in a future patch to change the behaviour when the page is removed. Also introduce guest_physmap_add_entry to map and set a specific p2m type for a page. Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx> --- xen/arch/arm/p2m.c | 49 +++++++++++++++++++++++++++++++-------------- xen/include/asm-arm/p2m.h | 18 +++++++++++++---- 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 8f8b47e..5449a35 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -124,7 +124,8 @@ int p2m_pod_decrease_reservation(struct domain *d, return -ENOSYS; } -static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr) +static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr, + p2m_type_t t) { paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT; lpae_t e = (lpae_t) { @@ -132,12 +133,25 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr) .p2m.af = 1, .p2m.sh = LPAE_SH_OUTER, .p2m.read = 1, - .p2m.write = 1, .p2m.mattr = mattr, .p2m.table = 1, .p2m.valid = 1, + .p2m.avail = t, /* Use avail to store p2m type */Can we change the name in the struct instead and have a comment "using avail bits for type" there instead please. We only have 5 types so could only steal 3 but we may as well take all 4. A BUILD_BUG_ON to check that the last p2m entry is < 2^4 would be good too. I will do both modification for the next version. -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |