Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/xen/x86 Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/c48ed3e162a9
branches:  netbsd-9
changeset: 366073:c48ed3e162a9
user:      martin <martin%NetBSD.org@localhost>
date:      Fri May 13 11:12:49 2022 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1444):

        sys/arch/xen/x86/x86_xpmap.c: revision 1.91

In bootstrap, after switching to a new page table make sure that
now-unused memory is unmapped.

diffstat:

 sys/arch/xen/x86/x86_xpmap.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 0b49f94170a0 -r c48ed3e162a9 sys/arch/xen/x86/x86_xpmap.c
--- a/sys/arch/xen/x86/x86_xpmap.c      Fri May 13 11:10:38 2022 +0000
+++ b/sys/arch/xen/x86/x86_xpmap.c      Fri May 13 11:12:49 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_xpmap.c,v 1.84.4.1 2020/05/31 10:39:34 martin Exp $        */
+/*     $NetBSD: x86_xpmap.c,v 1.84.4.2 2022/05/13 11:12:49 martin Exp $        */
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.84.4.1 2020/05/31 10:39:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.84.4.2 2022/05/13 11:12:49 martin Exp $");
 
 #include "opt_xen.h"
 #include "opt_ddb.h"
@@ -909,7 +909,7 @@
        /* Unpin old PGD */
        xpq_queue_unpin_table(xpmap_ptom_masked(old_pgd - KERNBASE));
 
-       /* Mark old tables RW */
+       /* Mark old tables RW if used, unmap otherwise */
        page = old_pgd;
        addr = xpmap_mtop((paddr_t)L2[pl2_pi(page)] & PG_FRAME);
        pte = (pd_entry_t *)((u_long)addr + KERNBASE);
@@ -923,6 +923,12 @@
                 */
                pte++;
        }
+       while (page < old_pgd + (old_count * PAGE_SIZE)) {
+               addr = xpmap_ptom(((u_long)pte) - KERNBASE);
+               xpq_queue_pte_update(addr, 0);
+               page += PAGE_SIZE;
+               pte++;
+       }
        xpq_flush_queue();
 }
 



Home | Main Index | Thread Index | Old Index