Skip to contentSkip to conversation

Drop xenpaging

PATCH In review Andrew Cooper 2 participants 2 messages May 7 – May 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drop xenpaging

This capability is experimental, has seen no development since 2011, and these days only gets edited to fix the build.

While it can be compiled out (of Xen at least), it is a maintenance burden on surrounding code that we'd prefer to stop paying.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Tamas K Lengyel <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Oleksii Kurochko <[email protected]>

Slightly RFC. I'm suspect I might be asked to split this up a bit, but if so, suggestions on where to draw the lines please.

The diffstat speaks for itself, including the invasiveness on surrounding code. PFEC_page_paged and HVMTRANS_gfn_paged_out weren't even able to be elimiated by the compiler in !CONFIG_MEM_PAGING configurations.

---
 .gitignore                             |    1 -
 CHANGELOG.md                           |    3 +
 MAINTAINERS                            |    4 -
 automation/gitlab-ci/analyze.yaml      |    1 -
 config/Paths.mk.in                     |    1 -
 configure                              |    4 -
 docs/INDEX                             |    1 -
 docs/configure                         |    4 -
 docs/misc/xenpaging.txt                |   45 -
 m4/paths.m4                            |    3 -
 tools/Makefile                         |    1 -
 tools/configure                        |    4 -
 tools/hotplug/common/hotplugpath.sh.in |    1 -
 tools/include/xenctrl.h                |   20 +-
 tools/libs/ctrl/Makefile.common        |    1 -
 tools/libs/ctrl/xc_mem_paging.c        |  130 ---
 tools/xenpaging/Makefile               |   43 -
 tools/xenpaging/file_ops.c             |   71 --
 tools/xenpaging/file_ops.h             |   41 -
 tools/xenpaging/pagein.c               |   79 --
 tools/xenpaging/policy.h               |   48 --
 tools/xenpaging/policy_default.c       |  186 ----
 tools/xenpaging/xenpaging.c            | 1084 ------------------------
 tools/xenpaging/xenpaging.h            |  152 ----
 xen/arch/x86/hvm/Kconfig               |    4 -
 xen/arch/x86/hvm/dm.c                  |    6 -
 xen/arch/x86/hvm/emulate.c             |    9 +-
 xen/arch/x86/hvm/hvm.c                 |   21 +-
 xen/arch/x86/hvm/intercept.c           |    2 -
 xen/arch/x86/hvm/vmx/vvmx.c            |    2 -
 xen/arch/x86/include/asm/hvm/support.h |    1 -
 xen/arch/x86/include/asm/mem_paging.h  |   24 -
 xen/arch/x86/include/asm/p2m.h         |   39 +-
 xen/arch/x86/include/asm/processor.h   |    1 -
 xen/arch/x86/livepatch.c               |    4 -
 xen/arch/x86/mm.c                      |   21 +-
 xen/arch/x86/mm/Makefile               |    1 -
 xen/arch/x86/mm/altp2m.c               |    2 +-
 xen/arch/x86/mm/guest_walk.c           |    9 -
 xen/arch/x86/mm/hap/guest_walk.c       |   16 -
 xen/arch/x86/mm/hap/nested_ept.c       |    5 -
 xen/arch/x86/mm/hap/nested_hap.c       |    2 +-
 xen/arch/x86/mm/mem_paging.c           |  487 -----------
 xen/arch/x86/mm/mem_sharing.c          |   30 -
 xen/arch/x86/mm/p2m-ept.c              |    3 -
 xen/arch/x86/mm/p2m-pt.c               |    7 +-
 xen/arch/x86/mm/p2m.c                  |   15 +-
 xen/arch/x86/mm/shadow/hvm.c           |    1 -
 xen/arch/x86/msr.c                     |    6 -
 xen/arch/x86/x86_64/compat/mm.c        |    6 -
 xen/arch/x86/x86_64/mm.c               |    6 -
 xen/common/domain.c                    |    3 -
 xen/common/domctl.c                    |    3 -
 xen/common/keyhandler.c                |    6 -
 xen/common/memory.c                    |   37 +-
 xen/common/page_alloc.c                |    3 +-
 xen/common/vm_event.c                  |   83 --
 xen/drivers/passthrough/x86/iommu.c    |    2 -
 xen/include/public/memory.h            |    2 +-
 xen/include/public/vm_event.h          |    2 +-
 xen/include/xen/sched.h                |   18 +-
 xen/include/xsm/dummy.h                |    8 -
 xen/include/xsm/xsm.h                  |   11 -
 xen/xsm/dummy.c                        |    4 -
 xen/xsm/flask/hooks.c                  |   11 -
 xen/xsm/flask/policy/access_vectors    |    2 -
 66 files changed, 27 insertions(+), 2826 deletions(-)
 delete mode 100644 docs/misc/xenpaging.txt
 delete mode 100644 tools/libs/ctrl/xc_mem_paging.c
 delete mode 100644 tools/xenpaging/Makefile
 delete mode 100644 tools/xenpaging/file_ops.c
 delete mode 100644 tools/xenpaging/file_ops.h
 delete mode 100644 tools/xenpaging/pagein.c
 delete mode 100644 tools/xenpaging/policy.h
 delete mode 100644 tools/xenpaging/policy_default.c
 delete mode 100644 tools/xenpaging/xenpaging.c
 delete mode 100644 tools/xenpaging/xenpaging.h
 delete mode 100644 xen/arch/x86/include/asm/mem_paging.h
 delete mode 100644 xen/arch/x86/mm/mem_paging.c
.gitignore +0 -1
index bfc7bdf043c3..043e7b166ecc 100644
@@ -161,7 +161,6 @@ tools/xcutils/lsevtchn
 tools/xcutils/readnotes
 tools/xenmon/xentrace_setmask
 tools/xenmon/xenbaked
-tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xentop/xentop
 tools/xentrace/xentrace_setsize
CHANGELOG.md +3 -0
index ce46020dbdb4..56ea17275b8e 100644
@@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      a guest, but the vendors have been diverging since then in ways that Xen
      cannot compensate for, and the advent of speculative security issues has
      put to rest any possibility of this being a viable option.
+   - The xenpaging userspace daemon, and MEM_PAGING hypervisor infrastructure.
+     This never got beyond an experimental feature and hasn't seen any real
+     work since 2011.
 
  - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
    anything useful outside of x86.
MAINTAINERS +0 -4
index 77f72e52f46d..8df2700dd40b 100644
@@ -633,10 +633,6 @@ F:	tools/misc/xen-cpuid.c
 F:	tools/tests/cpu-policy/
 F:	tools/tests/x86_emulator/
 
-X86 MEMORY PAGING
-S:	Orphaned
-F:	xen/arch/x86/mm/mem_paging.c
-
 X86 MEMORY SHARING
 M:	Tamas K Lengyel <[email protected]>
 S:	Odd Fixes
automation/gitlab-ci/analyze.yaml +0 -1
index b3f99f472d9e..f94f1be0aa89 100644
@@ -52,7 +52,6 @@ eclair-x86_64-allcode:
       CONFIG_EXPERT=y
       CONFIG_HYPERV_GUEST=y
       CONFIG_LATE_HWDOM=y
-      CONFIG_MEM_PAGING=y
       CONFIG_MEM_SHARING=y
       CONFIG_PERF_ARRAYS=y
       CONFIG_PERF_COUNTERS=y
config/Paths.mk.in +0 -1
index 6aa392b9f299..0cf6bb574a0a 100644
@@ -40,7 +40,6 @@ INITD_DIR                := @INITD_DIR@
 CONFIG_LEAF_DIR          := @CONFIG_LEAF_DIR@
 BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
-XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 XEN_DUMP_DIR             := @XEN_DUMP_DIR@
 DEBUG_DIR                := @DEBUG_DIR@
 
configure +0 -4
index 1dbaeb3c5cfa..152c478abfd3 100755
@@ -627,7 +627,6 @@ xen
 subdirs
 DEBUG_DIR
 XEN_DUMP_DIR
-XEN_PAGING_DIR
 XEN_LOCK_DIR
 INITD_DIR
 SHAREDIR
@@ -2215,9 +2214,6 @@ esac
 printf "%s\n" "#define XEN_LOCK_DIR \"$XEN_LOCK_DIR\"" >>confdefs.h
 
 
-XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
-
-
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
docs/INDEX +0 -1
index e673edd75c31..6eec23f5cbc2 100644
@@ -18,7 +18,6 @@ misc/distro_mapping		Distro Directory Layouts
 misc/dump-core-format		Xen Core Dump Format
 misc/vtd			VT-d HOWTO
 misc/xen-error-handling		Xen Error Handling
-misc/xenpaging			Xen Paging
 misc/xsm-flask			XSM/FLASK Configuration
 misc/arm/booting		How to boot Xen on ARM
 misc/arm/early-printk		Enabling early printk on ARM
docs/configure +0 -4
index 8871914dcbe1..c8ef084e7ee3 100755
@@ -626,7 +626,6 @@ POD2MAN
 FIG2DEV
 DEBUG_DIR
 XEN_DUMP_DIR
-XEN_PAGING_DIR
 XEN_LOCK_DIR
 INITD_DIR
 SHAREDIR
@@ -2020,9 +2019,6 @@ esac
 printf "%s\n" "#define XEN_LOCK_DIR \"$XEN_LOCK_DIR\"" >>confdefs.h
 
 
-XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
-
-
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
docs/misc/xenpaging.txt deleted +0 -45

45 lines not on this page · raw message

m4/paths.m4 +0 -3
index 3f94c62efb99..e9382fd6534b 100644
@@ -158,9 +158,6 @@ esac
 AC_SUBST(XEN_LOCK_DIR)
 AC_DEFINE_UNQUOTED([XEN_LOCK_DIR], ["$XEN_LOCK_DIR"], [Xen's lock dir])
 
-XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
-AC_SUBST(XEN_PAGING_DIR)
-
 XEN_DUMP_DIR=$xen_dumpdir_path
 AC_SUBST(XEN_DUMP_DIR)
 AC_DEFINE_UNQUOTED([XEN_DUMP_DIR], ["$XEN_DUMP_DIR"], [Xen's dump directory])
tools/Makefile +0 -1
index 6ecf7c0da821..8752c9369688 100644
@@ -32,7 +32,6 @@ SUBDIRS-$(CONFIG_GOLANG) += golang
 SUBDIRS-y += xl
 SUBDIRS-y += helpers
 SUBDIRS-y += 9pfsd
-SUBDIRS-$(CONFIG_X86) += xenpaging
 SUBDIRS-$(CONFIG_X86) += debugger
 SUBDIRS-$(CONFIG_TESTS) += tests
 
tools/configure +0 -4
index 6f69b0b52634..9e8790d90a8a 100755
@@ -742,7 +742,6 @@ rpath
 werror
 DEBUG_DIR
 XEN_DUMP_DIR
-XEN_PAGING_DIR
 XEN_LOCK_DIR
 INITD_DIR
 SHAREDIR
@@ -4558,9 +4557,6 @@ esac
 printf "%s\n" "#define XEN_LOCK_DIR \"$XEN_LOCK_DIR\"" >>confdefs.h
 
 
-XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
-
-
 XEN_DUMP_DIR=$xen_dumpdir_path
 
 
tools/hotplug/common/hotplugpath.sh.in +0 -1
index 1036b884b804..d8e257170605 100644
@@ -9,7 +9,6 @@ XEN_CONFIG_DIR="@XEN_CONFIG_DIR@"
 XEN_SCRIPT_DIR="@XEN_SCRIPT_DIR@"
 XEN_LOCK_DIR="@XEN_LOCK_DIR@"
 XEN_RUN_DIR="@XEN_RUN_DIR@"
-XEN_PAGING_DIR="@XEN_PAGING_DIR@"
 XEN_DUMP_DIR="@XEN_DUMP_DIR@"
 XEN_LOG_DIR="@XEN_LOG_DIR@"
 XEN_LIB_DIR="@XEN_LIB_DIR@"
tools/include/xenctrl.h +2 -18
index d5dbf69c8968..a46a6cfd42ac 100644
@@ -2012,22 +2012,6 @@ int xc_altp2m_get_vcpu_p2m_idx(xc_interface *handle, uint32_t domid,
 int xc_altp2m_set_visibility(xc_interface *handle, uint32_t domid,
                              uint16_t view_id, bool visible);
 
-/** 
- * Mem paging operations.
- * Paging is supported only on the x86 architecture in 64 bit mode, with
- * Hardware-Assisted Paging (i.e. Intel EPT, AMD NPT). Moreover, AMD NPT
- * support is considered experimental.
- */
-int xc_mem_paging_enable(xc_interface *xch, uint32_t domain_id, uint32_t *port);
-int xc_mem_paging_disable(xc_interface *xch, uint32_t domain_id);
-int xc_mem_paging_resume(xc_interface *xch, uint32_t domain_id);
-int xc_mem_paging_nominate(xc_interface *xch, uint32_t domain_id,
-                           uint64_t gfn);
-int xc_mem_paging_evict(xc_interface *xch, uint32_t domain_id, uint64_t gfn);
-int xc_mem_paging_prep(xc_interface *xch, uint32_t domain_id, uint64_t gfn);
-int xc_mem_paging_load(xc_interface *xch, uint32_t domain_id,
-                       uint64_t gfn, void *buffer);
-
 /** 
  * Access tracking operations.
  * Supported only on Intel EPT 64 bit processors.
@@ -2160,8 +2144,8 @@ int xc_memshr_control(xc_interface *xch,
  * ENOMEM happens when unsharing pages: a Copy-on-Write duplicate needs to be
  * allocated, and thus the out-of-memory error occurr.
  *
- * For complete examples on how to plumb a notification ring, look into
- * xenpaging or xen-access.
+ * For complete examples on how to plumb a notification ring, look at
+ * xen-access.
  *
  * On receipt of a notification, the helper should ensure there is memory
  * available to the domain before retrying.
tools/libs/ctrl/Makefile.common +0 -1
index 68137d42f2b5..c955f54743da 100644
@@ -18,7 +18,6 @@ OBJS-y       += xc_vm_event.o
 OBJS-y       += xc_vmtrace.o
 OBJS-y       += xc_version.o
 OBJS-y       += xc_monitor.o
-OBJS-y       += xc_mem_paging.o
 OBJS-y       += xc_mem_access.o
 OBJS-y       += xc_memshr.o
 OBJS-y       += xc_hcall_buf.o
tools/libs/ctrl/xc_mem_paging.c deleted +0 -130

130 lines not on this page · raw message

tools/xenpaging/Makefile deleted +0 -43

43 lines not on this page · raw message

tools/xenpaging/file_ops.c deleted +0 -71

71 lines not on this page · raw message

tools/xenpaging/file_ops.h deleted +0 -41

41 lines not on this page · raw message

tools/xenpaging/pagein.c deleted +0 -79

79 lines not on this page · raw message

tools/xenpaging/policy.h deleted +0 -48

48 lines not on this page · raw message

tools/xenpaging/policy_default.c deleted +0 -186

186 lines not on this page · raw message

tools/xenpaging/xenpaging.c deleted +0 -1084

1,084 lines not on this page · raw message

tools/xenpaging/xenpaging.h deleted +0 -152

152 lines not on this page · raw message

xen/arch/x86/hvm/Kconfig +0 -4
index f32bf5cbb73a..b02639d84964 100644
@@ -84,10 +84,6 @@ config VIRIDIAN
 
 	  If unsure, say Y.
 
-config MEM_PAGING
-	bool "Xen memory paging support (UNSUPPORTED)" if UNSUPPORTED
-	depends on VM_EVENT
-
 config MEM_SHARING
 	bool "Xen memory sharing support (UNSUPPORTED)" if UNSUPPORTED
 	depends on INTEL_VMX
xen/arch/x86/hvm/dm.c +0 -6
index 3b53471af0d9..1758f37ed5b0 100644
@@ -260,12 +260,6 @@ static int set_mem_type(struct domain *d,
         p2m_type_t ot;
 
         get_gfn_unshare(d, pfn, &ot);
-        if ( p2m_is_paging(ot) )
-        {
-            put_gfn(d, pfn);
-            p2m_mem_paging_populate(d, _gfn(pfn));
-            return -EAGAIN;
-        }
 
         if ( p2m_is_shared(ot) )
             rc = -EAGAIN;
xen/arch/x86/hvm/emulate.c +2 -7
index f3aae158e9f8..1abff57d2c32 100644
@@ -743,7 +743,6 @@ static void *hvmemul_map_linear_addr(
              */
             ASSERT_UNREACHABLE();
             /* fall through */
-        case HVMTRANS_gfn_paged_out:
         case HVMTRANS_gfn_shared:
             err = ERR_PTR(~X86EMUL_RETRY);
             goto out;
@@ -896,7 +895,7 @@ static int hvmemul_linear_to_phys(
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
     {
-        if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
+        if ( pfec & PFEC_page_shared )
             return X86EMUL_RETRY;
         *reps = 0;
         x86_emul_pagefault(pfec, addr, &hvmemul_ctxt->ctxt);
@@ -915,7 +914,7 @@ static int hvmemul_linear_to_phys(
         if ( (npfn == gfn_x(INVALID_GFN)) ||
              (npfn != (pfn + (reverse ? -i : i))) )
         {
-            if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
+            if ( pfec & PFEC_page_shared )
                 return X86EMUL_RETRY;
             done /= bytes_per_rep;
             if ( done == 0 )
@@ -1316,7 +1315,6 @@ static int linear_read(unsigned long addr, unsigned int bytes, void *p_data,
                                         hvmemul_ctxt, start,
                                         known_gla(addr, bytes, pfec));
 
-    case HVMTRANS_gfn_paged_out:
     case HVMTRANS_gfn_shared:
     case HVMTRANS_need_retry:
         return X86EMUL_RETRY;
@@ -1373,7 +1371,6 @@ static int linear_write(unsigned long addr, unsigned int bytes, void *p_data,
                                          hvmemul_ctxt, start,
                                          known_gla(addr, bytes, pfec));
 
-    case HVMTRANS_gfn_paged_out:
     case HVMTRANS_gfn_shared:
     case HVMTRANS_need_retry:
         return X86EMUL_RETRY;
@@ -2098,7 +2095,6 @@ static int cf_check hvmemul_rep_movs(
          */
         ASSERT_UNREACHABLE();
         /* fall through */
-    case HVMTRANS_gfn_paged_out:
     case HVMTRANS_gfn_shared:
         return X86EMUL_RETRY;
     case HVMTRANS_okay:
@@ -2218,7 +2214,6 @@ static int cf_check hvmemul_rep_stos(
              */
             ASSERT_UNREACHABLE();
             /* fall through */
-        case HVMTRANS_gfn_paged_out:
         case HVMTRANS_gfn_shared:
             return X86EMUL_RETRY;
         case HVMTRANS_okay:
xen/arch/x86/hvm/hvm.c +2 -19
index f759a397c557..ef8f7936d68e 100644
@@ -1813,7 +1813,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
     struct p2m_domain *p2m, *hostp2m;
-    int rc, fall_through = 0, paged = 0;
+    int rc, fall_through = 0;
     bool sharing_enomem = false;
     vm_event_request_t *req_ptr = NULL;
     bool sync = false;
@@ -2004,12 +2004,6 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         goto out_put_gfn;
     }
 
-#ifdef CONFIG_MEM_PAGING
-    /* Check if the page has been paged out */
-    if ( p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_out) )
-        paged = 1;
-#endif
-
 #ifdef CONFIG_MEM_SHARING
     /* Mem sharing: if still shared on write access then its enomem */
     if ( npfec.write_access && p2m_is_shared(p2mt) )
@@ -2063,8 +2057,6 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
      * sleep on event ring wait queues, and we must not hold
      * locks in such circumstance.
      */
-    if ( paged )
-        p2m_mem_paging_populate(currd, _gfn(gfn));
 
     if ( sharing_enomem )
     {
@@ -2823,7 +2815,7 @@ static void *hvm_map_entry(unsigned long va, bool *writable)
      */
     pfec = PFEC_page_present;
     gfn = paging_gva_to_gfn(current, va, &pfec);
-    if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
+    if ( pfec & PFEC_page_shared )
         goto fail;
 
     v = hvm_map_guest_frame_rw(gfn, 0, writable);
@@ -3258,9 +3250,6 @@ enum hvm_translation_result hvm_translate_get_page(
 
         if ( gfn_eq(gfn, INVALID_GFN) )
         {
-            if ( pfec & PFEC_page_paged )
-                return HVMTRANS_gfn_paged_out;
-
             if ( pfec & PFEC_page_shared )
                 return HVMTRANS_gfn_shared;
 
@@ -3294,12 +3283,6 @@ enum hvm_translation_result hvm_translate_get_page(
     if ( !page )
         return HVMTRANS_bad_gfn_to_mfn;
 
-    if ( p2m_is_paging(p2mt) )
-    {
-        put_page(page);
-        p2m_mem_paging_populate(v->domain, gfn);
-        return HVMTRANS_gfn_paged_out;
-    }
     if ( p2m_is_shared(p2mt) )
     {
         put_page(page);
xen/arch/x86/hvm/intercept.c +0 -2
index da22c386763e..639dee7f5c96 100644
@@ -137,7 +137,6 @@ int hvm_process_io_intercept(const struct hvm_io_handler *handler,
                     /* Drop the write as real hardware would. */
                     continue;
                 case HVMTRANS_bad_linear_to_gfn:
-                case HVMTRANS_gfn_paged_out:
                 case HVMTRANS_gfn_shared:
                 case HVMTRANS_need_retry:
                     ASSERT_UNREACHABLE();
@@ -170,7 +169,6 @@ int hvm_process_io_intercept(const struct hvm_io_handler *handler,
                     data = ~0;
                     break;
                 case HVMTRANS_bad_linear_to_gfn:
-                case HVMTRANS_gfn_paged_out:
                 case HVMTRANS_gfn_shared:
                 case HVMTRANS_need_retry:
                     ASSERT_UNREACHABLE();
xen/arch/x86/hvm/vmx/vvmx.c +0 -2
index e4cdfe55c18e..1d6a1f5ed258 100644
@@ -715,7 +715,6 @@ static void nvmx_update_apic_access_address(struct vcpu *v)
 
         apic_gpfn = get_vvmcs(v, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
         apic_pg = get_page_from_gfn(v->domain, apic_gpfn, &p2mt, P2M_ALLOC);
-        ASSERT(apic_pg && !p2m_is_paging(p2mt));
         __vmwrite(APIC_ACCESS_ADDR, page_to_maddr(apic_pg));
         put_page(apic_pg);
     }
@@ -736,7 +735,6 @@ static void nvmx_update_virtual_apic_address(struct vcpu *v)
 
         vapic_gpfn = get_vvmcs(v, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
         vapic_pg = get_page_from_gfn(v->domain, vapic_gpfn, &p2mt, P2M_ALLOC);
-        ASSERT(vapic_pg && !p2m_is_paging(p2mt));
         __vmwrite(VIRTUAL_APIC_PAGE_ADDR, page_to_maddr(vapic_pg));
         put_page(vapic_pg);
     }
xen/arch/x86/include/asm/hvm/support.h +0 -1
index 9e9fa6295567..0728d19ada38 100644
@@ -48,7 +48,6 @@ enum hvm_translation_result {
     HVMTRANS_bad_linear_to_gfn,
     HVMTRANS_bad_gfn_to_mfn,
     HVMTRANS_unhandleable,
-    HVMTRANS_gfn_paged_out,
     HVMTRANS_gfn_shared,
     HVMTRANS_need_retry,
 };
xen/arch/x86/include/asm/mem_paging.h deleted +0 -24
deleted file mode 100644
index 2c618925d01d..000000000000
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/******************************************************************************
- * include/asm-x86/mem_paging.h
- *
- * Memory paging support.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- */
-
-#ifndef __ASM_X86_MEM_PAGING_H__
-#define __ASM_X86_MEM_PAGING_H__
-
-int mem_paging_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_paging_op_t) arg);
-
-#endif /*__ASM_X86_MEM_PAGING_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
xen/arch/x86/include/asm/p2m.h +2 -37
index 3a5a5fd43c2a..2d2cd5f5e9e1 100644
@@ -60,9 +60,6 @@ typedef enum {
      * be used in 64-bit builds */
     p2m_grant_map_rw = 7,         /* Read/write grant mapping */
     p2m_grant_map_ro = 8,         /* Read-only grant mapping */
-    p2m_ram_paging_out = 9,       /* Memory that is being paged out */
-    p2m_ram_paged = 10,           /* Memory that has been paged out */
-    p2m_ram_paging_in = 11,       /* Memory that is being paged in */
     p2m_ram_shared = 12,          /* Shared or sharable memory */
     p2m_ram_broken = 13,          /* Broken page, access cause domain crash */
     p2m_map_foreign  = 14,        /* ram pages from foreign domain */
@@ -81,18 +78,13 @@ typedef unsigned int p2m_query_t;
 #define P2M_RAM_TYPES (p2m_to_mask(p2m_ram_rw)                \
                        | p2m_to_mask(p2m_ram_logdirty)        \
                        | p2m_to_mask(p2m_ram_ro)              \
-                       | p2m_to_mask(p2m_ram_paging_out)      \
-                       | p2m_to_mask(p2m_ram_paged)           \
-                       | p2m_to_mask(p2m_ram_paging_in)       \
                        | p2m_to_mask(p2m_ram_shared)          \
                        | p2m_to_mask(p2m_ioreq_server))
 
 /* Types that represent a physmap hole that is ok to replace with a shared
  * entry */
 #define P2M_HOLE_TYPES (p2m_to_mask(p2m_mmio_dm)        \
-                       | p2m_to_mask(p2m_invalid)       \
-                       | p2m_to_mask(p2m_ram_paging_in) \
-                       | p2m_to_mask(p2m_ram_paged))
+                       | p2m_to_mask(p2m_invalid))
 
 /* Grant mapping types, which map to a real machine frame in another
  * VM */
@@ -120,21 +112,6 @@ typedef unsigned int p2m_query_t;
 
 #define P2M_POD_TYPES (p2m_to_mask(p2m_populate_on_demand))
 
-/* Pageable types */
-#define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
-                            | p2m_to_mask(p2m_ram_logdirty) )
-
-#ifdef CONFIG_MEM_PAGING
-#define P2M_PAGING_TYPES (p2m_to_mask(p2m_ram_paging_out)        \
-                          | p2m_to_mask(p2m_ram_paged)           \
-                          | p2m_to_mask(p2m_ram_paging_in))
-
-#define P2M_PAGED_TYPES (p2m_to_mask(p2m_ram_paged))
-#else
-#define P2M_PAGING_TYPES 0
-#define P2M_PAGED_TYPES 0
-#endif
-
 /* Shared types */
 #ifdef CONFIG_MEM_SHARING
 /* XXX: Sharable types could include p2m_ram_ro too, but we would need to
@@ -154,8 +131,7 @@ typedef unsigned int p2m_query_t;
 
 /* Valid types not necessarily associated with a (valid) MFN. */
 #define P2M_INVALID_MFN_TYPES (P2M_POD_TYPES                  \
-                               | p2m_to_mask(p2m_mmio_direct) \
-                               | P2M_PAGING_TYPES)
+                               | p2m_to_mask(p2m_mmio_direct))
 
 /* Broken type: the frame backing this pfn has failed in hardware
  * and must not be touched. */
@@ -175,9 +151,6 @@ typedef unsigned int p2m_query_t;
    implementations, there's no way of synchronising against that. */
 #define p2m_is_valid(_t)    (p2m_to_mask(_t) & \
                              (P2M_RAM_TYPES | p2m_to_mask(p2m_mmio_direct)))
-#define p2m_is_pageable(_t) (p2m_to_mask(_t) & P2M_PAGEABLE_TYPES)
-#define p2m_is_paging(_t)   (p2m_to_mask(_t) & P2M_PAGING_TYPES)
-#define p2m_is_paged(_t)    (p2m_to_mask(_t) & P2M_PAGED_TYPES)
 #define p2m_is_sharable(_t) (p2m_to_mask(_t) & P2M_SHARABLE_TYPES)
 #define p2m_is_shared(_t)   (p2m_to_mask(_t) & P2M_SHARED_TYPES)
 #define p2m_is_special(_t)  (p2m_to_mask(_t) & P2M_SPECIAL_TYPES)
@@ -775,14 +748,6 @@ static inline int relinquish_p2m_mapping(struct domain *d)
 /* Modify p2m table for shared gfn */
 int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn);
 
-/* Tell xenpaging to drop a paged out frame */
-void p2m_mem_paging_drop_page(struct domain *d, gfn_t gfn, p2m_type_t p2mt);
-/* Start populating a paged out frame */
-void p2m_mem_paging_populate(struct domain *d, gfn_t gfn);
-/* Resume normal operation (in case a domain was paused) */
-struct vm_event_st;
-void p2m_mem_paging_resume(struct domain *d, struct vm_event_st *rsp);
-
 /*
  * Internal functions, only called by other p2m code
  */
xen/arch/x86/include/asm/processor.h +0 -1
index c37bd7a17658..ca401604d0d9 100644
@@ -41,7 +41,6 @@
 #define PFEC_shstk          (_AC(1,U) << 6)
 #define PFEC_arch_mask      (_AC(0xffff,U)) /* Architectural PFEC values. */
 /* Internally used only flags. */
-#define PFEC_page_paged     (1U<<16)
 #define PFEC_page_shared    (1U<<17)
 #define PFEC_implicit       (1U<<18) /* Pagewalk input for ldt/gdt/idt/tr accesses. */
 #define PFEC_synth_mask     (~PFEC_arch_mask) /* Synthetic PFEC values. */
xen/arch/x86/livepatch.c +0 -4
index be40f625d206..01062dde7c03 100644
@@ -43,10 +43,6 @@ int arch_livepatch_safety_check(void)
 #ifdef CONFIG_MEM_SHARING
         if ( has_active_waitqueue(d->vm_event_share) )
             goto fail;
-#endif
-#ifdef CONFIG_MEM_PAGING
-        if ( has_active_waitqueue(d->vm_event_paging) )
-            goto fail;
 #endif
         if ( has_active_waitqueue(d->vm_event_monitor) )
             goto fail;
xen/arch/x86/mm.c +2 -19
index b2b03da52b85..cbf955ee973b 100644
@@ -2183,17 +2183,6 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
 
             page = get_page_from_gfn(pg_dom, gfn_x(gfn), &p2mt, q);
 
-            if ( p2m_is_paged(p2mt) )
-            {
-                if ( page )
-                    put_page(page);
-                p2m_mem_paging_populate(pg_dom, gfn);
-                return -ENOENT;
-            }
-
-            if ( p2mt == p2m_ram_paging_in && !page )
-                return -ENOENT;
-
             /* Did our attempt to unshare fail? */
             if ( (q & P2M_UNSHARE) && p2m_is_shared(p2mt) )
             {
@@ -4110,14 +4099,8 @@ long do_mmu_update(
             {
                 if ( page )
                     put_page(page);
-                if ( p2m_is_paged(p2mt) )
-                {
-                    p2m_mem_paging_populate(pt_owner, _gfn(gmfn));
-                    rc = -ENOENT;
-                }
-                else
-                    gdprintk(XENLOG_WARNING,
-                             "Could not get page for normal update\n");
+                gdprintk(XENLOG_WARNING,
+                         "Could not get page for normal update\n");
                 break;
             }
 
xen/arch/x86/mm/Makefile +0 -1
index 960f6e840945..3fb2e53aeb4d 100644
@@ -5,7 +5,6 @@ obj-$(CONFIG_ALTP2M) += altp2m.o
 obj-$(CONFIG_HVM) += guest_walk_2.o guest_walk_3.o guest_walk_4.o
 obj-$(CONFIG_SHADOW_PAGING) += guest_walk_4.o
 obj-$(CONFIG_VM_EVENT) += mem_access.o
-obj-$(CONFIG_MEM_PAGING) += mem_paging.o
 obj-$(CONFIG_MEM_SHARING) += mem_sharing.o
 obj-$(CONFIG_HVM) += nested.o
 obj-$(CONFIG_HVM) += p2m.o
xen/arch/x86/mm/altp2m.c +1 -1
index 0bc9b9ad2f52..ac9f7437843b 100644
@@ -76,7 +76,7 @@ int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn)
      * pageable() predicate for this, due to it having the same properties
      * that we want.
      */
-    if ( !p2m_is_pageable(p2mt) || is_special_page(pg) )
+    if ( is_special_page(pg) )
     {
         rc = -EINVAL;
         goto err;
xen/arch/x86/mm/guest_walk.c +0 -9
index f48c3ef75f48..4ab1896fda28 100644
@@ -547,15 +547,6 @@ void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
     page = paging_mode_translate(p2m->domain)
            ? p2m_get_page_from_gfn(p2m, gfn, &p2mt, NULL, q)
            : get_page_from_gfn(p2m->domain, gfn_x(gfn), &p2mt, q);
-    if ( p2m_is_paging(p2mt) )
-    {
-        ASSERT(p2m_is_hostp2m(p2m));
-        if ( page )
-            put_page(page);
-        p2m_mem_paging_populate(p2m->domain, gfn);
-        *pfec = PFEC_page_paged;
-        return NULL;
-    }
     if ( p2m_is_shared(p2mt) )
     {
         if ( page )
xen/arch/x86/mm/hap/guest_walk.c +0 -16
index d1b7c5762c9e..5d85c97b0605 100644
@@ -48,15 +48,6 @@ unsigned long cf_check hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
     top_gfn = _gfn(cr3 >> PAGE_SHIFT);
     top_page = p2m_get_page_from_gfn(p2m, top_gfn, &p2mt, NULL,
                                      P2M_ALLOC | P2M_UNSHARE);
-    if ( p2m_is_paging(p2mt) )
-    {
-        ASSERT(p2m_is_hostp2m(p2m));
-        *pfec = PFEC_page_paged;
-        if ( top_page )
-            put_page(top_page);
-        p2m_mem_paging_populate(p2m->domain, gaddr_to_gfn(cr3));
-        return gfn_x(INVALID_GFN);
-    }
     if ( p2m_is_shared(p2mt) )
     {
         *pfec = PFEC_page_shared;
@@ -92,13 +83,6 @@ unsigned long cf_check hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
                                      P2M_ALLOC | P2M_UNSHARE);
         if ( page )
             put_page(page);
-        if ( p2m_is_paging(p2mt) )
-        {
-            ASSERT(p2m_is_hostp2m(p2m));
-            *pfec = PFEC_page_paged;
-            p2m_mem_paging_populate(p2m->domain, gfn);
-            return gfn_x(INVALID_GFN);
-        }
         if ( p2m_is_shared(p2mt) )
         {
             *pfec = PFEC_page_shared;
xen/arch/x86/mm/hap/nested_ept.c +0 -5
index d88d677825f1..f1d021725b09 100644
@@ -190,11 +190,6 @@ nept_walk_tables(struct vcpu *v, unsigned long l2ga, ept_walk_t *gw)
     goto out;
 
 map_err:
-    if ( rc == PFEC_page_paged )
-    {
-        ret = EPT_TRANSLATE_RETRY;
-        goto out;
-    }
     /* fall through to misconfig error */
 misconfig_err:
     ret =  EPT_TRANSLATE_MISCONFIG;
xen/arch/x86/mm/hap/nested_hap.c +1 -1
index 255fba7e1cac..681dc238156f 100644
@@ -126,7 +126,7 @@ static int nestedhap_walk_L0_p2m(
     if ( npfec.write_access && p2m_is_readonly(*p2mt) )
         goto out;
 
-    if ( p2m_is_paging(*p2mt) || p2m_is_shared(*p2mt) || !p2m_is_ram(*p2mt) )
+    if ( p2m_is_shared(*p2mt) || !p2m_is_ram(*p2mt) )
         goto out;
 
     if ( !mfn_valid(mfn) )
xen/arch/x86/mm/mem_paging.c deleted +0 -487

487 lines not on this page · raw message

xen/arch/x86/mm/mem_sharing.c +0 -30
index 5c7a0ff30e8b..d66027eeeb0f 100644
@@ -1198,36 +1198,6 @@ int add_to_physmap(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
         mem_sharing_gfn_destroy(spage, cd, gfn_info);
         put_page_and_type(spage);
     }
-    else
-    {
-#ifdef CONFIG_MEM_PAGING
-        /*
-         * There is a chance we're plugging a hole where a paged out
-         * page was.
-         */
-        if ( p2m_is_paging(cmfn_type) && (cmfn_type != p2m_ram_paging_out) )
-        {
-            atomic_dec(&cd->paged_pages);
-            /*
-             * Further, there is a chance this was a valid page.
-             * Don't leak it.
-             */
-            if ( mfn_valid(cmfn) )
-            {
-                struct page_info *cpage = mfn_to_page(cmfn);
-
-                if ( !get_page(cpage, cd) )
-                {
-                    domain_crash(cd);
-                    ret = -EOVERFLOW;
-                    goto err_unlock;
-                }
-                put_page_alloc_ref(cpage);
-                put_page(cpage);
-            }
-        }
-#endif
-    }
 
     atomic_inc(&nr_saved_mfns);
 
xen/arch/x86/mm/p2m-ept.c +0 -3
index dfdbfa0afec8..ea4c5729bcf2 100644
@@ -85,9 +85,6 @@ static void ept_p2m_type_to_flags(const struct p2m_domain *p2m,
         case p2m_invalid:
         case p2m_mmio_dm:
         case p2m_populate_on_demand:
-        case p2m_ram_paging_out:
-        case p2m_ram_paged:
-        case p2m_ram_paging_in:
         default:
             entry->r = entry->w = entry->x = 0;
             break;
xen/arch/x86/mm/p2m-pt.c +2 -5
index 5a6ce2f8bc2e..515ee9780e34 100644
@@ -64,9 +64,6 @@ static unsigned long p2m_type_to_flags(const struct p2m_domain *p2m,
     case p2m_invalid:
     case p2m_mmio_dm:
     case p2m_populate_on_demand:
-    case p2m_ram_paging_out:
-    case p2m_ram_paged:
-    case p2m_ram_paging_in:
     default:
         return flags | _PAGE_NX_BIT;
     case p2m_grant_map_ro:
@@ -910,7 +907,7 @@ p2m_pt_get_entry(struct p2m_domain *p2m, gfn_t gfn_,
 pod_retry_l1:
     flags = l1e_get_flags(*l1e);
     l1t = p2m_flags_to_type(flags);
-    if ( !(flags & _PAGE_PRESENT) && !p2m_is_paging(l1t) )
+    if ( !(flags & _PAGE_PRESENT) )
     {
         /* PoD: Try to populate */
         if ( p2m_is_pod(l1t) )
@@ -929,7 +926,7 @@ p2m_pt_get_entry(struct p2m_domain *p2m, gfn_t gfn_,
     *t = p2m_recalc_type(recalc || _needs_recalc(flags), l1t, p2m, gfn);
     unmap_domain_page(l1e);
 
-    ASSERT(mfn_valid(mfn) || !p2m_is_any_ram(*t) || p2m_is_paging(*t));
+    ASSERT(mfn_valid(mfn) || !p2m_is_any_ram(*t));
     return (p2m_is_valid(*t) || p2m_is_any_ram(*t)) ? mfn : INVALID_MFN;
 }
 
xen/arch/x86/mm/p2m.c +4 -11
index f5f9c0ac4513..c2804d39f9b1 100644
@@ -405,7 +405,7 @@ struct page_info *p2m_get_page_from_gfn(
             return page;
 
         /* Error path: not a suitable GFN at all */
-        if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_pod(*t) &&
+        if ( !p2m_is_ram(*t) && !p2m_is_pod(*t) &&
              !mem_sharing_is_fork(p2m->domain) )
             return NULL;
     }
@@ -697,7 +697,7 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
 
             return -EPERM;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

xen/arch/x86/mm/shadow/hvm.c +0 -1
index cf4862cbc9c2..9c46abffb7ba 100644

Lines of this file are not shown. View the raw message.

xen/arch/x86/msr.c +0 -6
index d10891dcfc86..7b62269f7839 100644

Lines of this file are not shown. View the raw message.

xen/arch/x86/x86_64/compat/mm.c +0 -6
index d54efaad21cd..fda4760989c7 100644

Lines of this file are not shown. View the raw message.

xen/arch/x86/x86_64/mm.c +0 -6
index 8eadab7933d0..282f35dcbd48 100644

Lines of this file are not shown. View the raw message.

xen/common/domain.c +0 -3
index bb9e210c2895..3c62672445ea 100644

Lines of this file are not shown. View the raw message.

xen/common/domctl.c +0 -3
index 93738931c575..3296d981f462 100644

Lines of this file are not shown. View the raw message.

xen/common/keyhandler.c +0 -6
index cb6df2823b00..7f2e72f0dda3 100644

Lines of this file are not shown. View the raw message.

xen/common/memory.c +2 -35
index 1ad4b51c5b02..b7dade262602 100644

Lines of this file are not shown. View the raw message.

xen/common/page_alloc.c +1 -2
index 2c4ff2c34c70..d74fc2aa9a30 100644

Lines of this file are not shown. View the raw message.

xen/common/vm_event.c +0 -83

83 lines not on this page · raw message

xen/drivers/passthrough/x86/iommu.c +0 -2
index 951f1f30b7ad..d9b1f5768393 100644

Lines of this file are not shown. View the raw message.

xen/include/public/memory.h +1 -1
index bd9fc37b5297..65ff524016d7 100644

Lines of this file are not shown. View the raw message.

xen/include/public/vm_event.h +1 -1
index 3a86f0e208f1..51581f96a76f 100644

Lines of this file are not shown. View the raw message.

xen/include/xen/sched.h +1 -17
index 00db1da12f21..ef60d4438b0c 100644

Lines of this file are not shown. View the raw message.

xen/include/xsm/dummy.h +0 -8
index b8fd7aeedd9e..68c6e81b70a8 100644

Lines of this file are not shown. View the raw message.

xen/include/xsm/xsm.h +0 -11
index cc32a6c09104..e9cfa0ada5fb 100644

Lines of this file are not shown. View the raw message.

xen/xsm/dummy.c +0 -4
index 244ef557528b..e35b6ae3dc33 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/hooks.c +0 -11
index 28522dcbd271..b0026f91c045 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/policy/access_vectors +0 -2
index bbb9c117ec4a..9d51a1d4f74b 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

base-commit: 2611377cf9c92b43b04a33810f03fa07bf8ba954

Signature · 1 line
2.39.5

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 19 lines · Andrew Cooper

This capability is experimental, has seen no development since 2011, and these days only gets edited to fix the build.

While it can be compiled out (of Xen at least), it is a maintenance burden on surrounding code that we'd prefer to stop paying.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Tamas K Lengyel <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Oleksii Kurochko <[email protected]>

Quoted 2 lines

Slightly RFC. I'm suspect I might be asked to split this up a bit, but if so, suggestions on where to draw the lines please.

tools, common, x86, xsm in (perhaps) this order? That would then also pretty much isolate who each one needs acks from.

Jan