|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 1/3] xen/mm: enforce SCRUB_DEBUG checks for MEMF_no_scrub allocations
The logic in alloc_heap_pages() only checks for scrubbing pattern
correctness when the caller doesn't pass MEMF_no_scrub in memflags.
However already scrubbed pages can be checked for correctness, regardless
of the caller having requested MEMF_no_scrub.
Relax the checking around the check_one_page() call, to allow for calls
with MEMF_no_scrub to also check the correctness of pages marked as already
scrubbed when allocated. This widens the checking of scrubbing
correctness, so it would also check the scrubbing correctness of
MEMF_no_scrub allocations.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
After discussing with Jan I've deliberately omitted the tag:
Fixes: 0c5f2f9cefac ("mm: Make sure pages are scrubbed")
The intended approach might have been to ensure the caller of
alloc_heap_pages() gets properly scrubbed pages, rather than asserting the
internal state of free pages is as expected.
---
xen/common/page_alloc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2efc11ce095f..de1480316f05 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1105,8 +1105,7 @@ static struct page_info *alloc_heap_pages(
spin_unlock(&heap_lock);
- if ( first_dirty != INVALID_DIRTY_IDX ||
- (scrub_debug && !(memflags & MEMF_no_scrub)) )
+ if ( first_dirty != INVALID_DIRTY_IDX || scrub_debug )
{
bool cold = d && d != current->domain;
@@ -1119,7 +1118,7 @@ static struct page_info *alloc_heap_pages(
dirty_cnt++;
}
- else if ( !(memflags & MEMF_no_scrub) )
+ else
check_one_page(&pg[i]);
}
--
2.51.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |