* No setting was found in the Radix tree. Check if the
* entry exists in the page-tables.
*/
- mfn_t mfn = p2m_get_entry(p2m, gfn, NULL, NULL, NULL);
+ mfn_t mfn = p2m_get_entry(p2m, gfn, NULL, NULL, NULL, NULL);
if ( mfn_eq(mfn, INVALID_MFN) )
return -ESRCH;
* We had a mem_access permission limiting the access, but the page type
* could also be limiting, so we need to check that as well.
*/
- mfn = p2m_get_entry(p2m, gfn, &t, NULL, NULL);
+ mfn = p2m_get_entry(p2m, gfn, &t, NULL, NULL, NULL);
if ( mfn_eq(mfn, INVALID_MFN) )
goto err;
gfn = gfn_next_boundary(gfn, order) )
{
p2m_type_t t;
- mfn_t mfn = p2m_get_entry(p2m, gfn, &t, NULL, &order);
+ mfn_t mfn = p2m_get_entry(p2m, gfn, &t, NULL, &order, NULL);
if ( !mfn_eq(mfn, INVALID_MFN) )
*
* If the entry is not present, INVALID_MFN will be returned and the
* page_order will be set according to the order of the invalid range.
+ *
+ * valid will contain the value of bit[0] (e.g valid bit) of the
+ * entry.
*/
mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
p2m_type_t *t, p2m_access_t *a,
- unsigned int *page_order)
+ unsigned int *page_order,
+ bool *valid)
{
paddr_t addr = gfn_to_gaddr(gfn);
unsigned int level = 0;
*t = p2m_invalid;
+ if ( valid )
+ *valid = false;
+
/* XXX: Check if the mapping is lower than the mapped gfn */
/* This gfn is higher than the highest the p2m map currently holds */
* to the GFN.
*/
mfn = mfn_add(mfn, gfn_x(gfn) & ((1UL << level_orders[level]) - 1));
+
+ if ( valid )
+ *valid = lpae_is_valid(entry);
}
out_unmap:
struct p2m_domain *p2m = p2m_get_hostp2m(d);
p2m_read_lock(p2m);
- mfn = p2m_get_entry(p2m, gfn, t, NULL, NULL);
+ mfn = p2m_get_entry(p2m, gfn, t, NULL, NULL, NULL);
p2m_read_unlock(p2m);
return mfn;
for ( ; gfn_x(start) < gfn_x(end);
start = gfn_next_boundary(start, order) )
{
- mfn_t mfn = p2m_get_entry(p2m, start, &t, NULL, &order);
+ mfn_t mfn = p2m_get_entry(p2m, start, &t, NULL, &order, NULL);
count++;
/*
for ( ; gfn_x(start) < gfn_x(end); start = next_gfn )
{
- mfn_t mfn = p2m_get_entry(p2m, start, &t, NULL, &order);
+ mfn_t mfn = p2m_get_entry(p2m, start, &t, NULL, &order, NULL);
next_gfn = gfn_next_boundary(start, order);