diff mbox

[2/4] mm: Don't poison a page if boot-time scrubbing is off

Message ID 1503952829-11065-3-git-send-email-boris.ostrovsky@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris Ostrovsky Aug. 28, 2017, 8:40 p.m. UTC
If boot-time scrubbing is turned off we don't check pages in
check_one_page(). Thus there is no reason to ever poison them.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/common/page_alloc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Wei Liu Aug. 29, 2017, 11:52 a.m. UTC | #1
On Mon, Aug 28, 2017 at 04:40:27PM -0400, Boris Ostrovsky wrote:
> If boot-time scrubbing is turned off we don't check pages in
> check_one_page(). Thus there is no reason to ever poison them.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>
diff mbox

Patch

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 7d56e92..34a7992 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -712,6 +712,9 @@  static void poison_one_page(struct page_info *pg)
     mfn_t mfn = _mfn(page_to_mfn(pg));
     uint64_t *ptr;
 
+    if ( !boot_scrub_done )
+        return;
+
     ptr = map_domain_page(mfn);
     *ptr = ~SCRUB_PATTERN;
     unmap_domain_page(ptr);