@@ -84,8 +84,8 @@ void shadow_final_teardown(struct domain
void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all);
/* Adjust shadows ready for a guest page to change its type. */
-void shadow_prepare_page_type_change(struct domain *d, struct page_info *page,
- unsigned long new_type);
+void shadow_prepare_page_type_change(struct domain *d,
+ const struct page_info *page);
/* Discard _all_ mappings from the domain's shadows. */
void shadow_blow_tables_per_domain(struct domain *d);
@@ -113,8 +113,7 @@ static inline void sh_remove_shadows(str
int fast, int all) {}
static inline void shadow_prepare_page_type_change(struct domain *d,
- struct page_info *page,
- unsigned long new_type) {}
+ const struct page_info *page) {}
static inline void shadow_blow_tables_per_domain(struct domain *d) {}
@@ -3018,7 +3018,7 @@ static int _get_page_type(struct page_in
struct domain *d = page_get_owner(page);
if ( d && shadow_mode_enabled(d) )
- shadow_prepare_page_type_change(d, page, type);
+ shadow_prepare_page_type_change(d, page);
if ( (x & PGT_type_mask) != type )
{
@@ -2265,8 +2265,8 @@ void sh_remove_shadows(struct domain *d,
paging_unlock(d);
}
-void shadow_prepare_page_type_change(struct domain *d, struct page_info *page,
- unsigned long new_type)
+void shadow_prepare_page_type_change(struct domain *d,
+ const struct page_info *page)
{
if ( !(page->count_info & PGC_page_table) )
return;
@@ -2278,7 +2278,7 @@ void shadow_prepare_page_type_change(str
* pages are allowed to become writeable.
*/
if ( (page->shadow_flags & SHF_oos_may_write) &&
- new_type == PGT_writable_page )
+ (page->u.inuse.type_info & PGT_type_mask) == PGT_writable_page )
return;
#endif
As of 8cc5036bc385 ("x86/pv: Fix ABAC cmpxchg() race in _get_page_type()") this no longer needs passing separately - the type can now be read from struct page_info, as the call now happens after its writing. While there also constify the 2nd parameter. Signed-off-by: Jan Beulich <jbeulich@suse.com>