From patchwork Tue Mar 11 10:23:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 14011463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3B5CC282EC for ; Tue, 11 Mar 2025 10:23:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.907695.1314893 (Exim 4.92) (envelope-from ) id 1trwld-0003ZW-Gx; Tue, 11 Mar 2025 10:23:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 907695.1314893; Tue, 11 Mar 2025 10:23:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwld-0003ZP-E1; Tue, 11 Mar 2025 10:23:21 +0000 Received: by outflank-mailman (input) for mailman id 907695; Tue, 11 Mar 2025 10:23:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwlc-0003ZJ-6o for xen-devel@lists.xenproject.org; Tue, 11 Mar 2025 10:23:20 +0000 Received: from fforwardh-b1-smtp.messagingengine.com (fforwardh-b1-smtp.messagingengine.com [202.12.124.196]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d8ecf136-fe62-11ef-9898-31a8f345e629; Tue, 11 Mar 2025 11:23:17 +0100 (CET) Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfforwardh.stl.internal (Postfix) with ESMTP id 5421317400CD; Tue, 11 Mar 2025 06:23:16 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-08.internal (MEProxy); Tue, 11 Mar 2025 06:23:16 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Mar 2025 06:23:14 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d8ecf136-fe62-11ef-9898-31a8f345e629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741688596; x=1741774996; bh=7 rZNXPtFKuxuEpNDlqaH+Iks33wV303f2LhEdINzY0s=; b=oAmIq8RYGT20jdjK6 GZCW6MEzkqolMEoRBPE28bXXRy3vPFIQa1aDd0B+JVlz7FBr+4PW2SCX/tfzjxQn QkdjsfOk1BApP7E0DiN9IL8x4OTzQUS/yZTuD/plBx4+/pLwvmL/nbYdWW9ekiJ2 4b7blz35ko27c9qOoMDgnEcWkLAA0PM+Z2+PDgm3WK+hqqmCkAaP8QkXRMTo1rjh 2nec6YTuEu37iKyfXov+VJe8PSnmifYiOvNGwXiJe9T3RPRsJ1QV3nRe1B2nwahi xWvrxRLBl0o0eo/loN+zLfx7zPDNNbtMU+MxLWfZpN1ZCXh+yHja4WfK5a78YxlF tN6Bw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdduleekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrih hksegvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueev gfduheevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihht vgdpnhgspghrtghpthhtohepvddupdhmohguvgepshhmthhpohhuthdprhgtphhtthhope igvghnqdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdprhgtphht thhopehsvghrghhihigpkhhisghrihhksegvphgrmhdrtghomhdprhgtphhtthhopegtrg hrughovgestggrrhguohgvrdgtohhmpdhrtghpthhtoheprghnughrvgifrdgtohhophgv rhefsegtihhtrhhigidrtghomhdprhgtphhtthhopegrnhhthhhonhihrdhpvghrrghrug esvhgrthgvshdrthgvtghhpdhrtghpthhtohepmhhitghhrghlrdhorhiivghlsegrmhgu rdgtohhmpdhrtghpthhtohepjhgsvghulhhitghhsehsuhhsvgdrtghomhdprhgtphhtth hopehjuhhlihgvnhesgigvnhdrohhrghdprhgtphhtthhopehrohhgvghrrdhprghusegt ihhtrhhigidrtghomh X-ME-Proxy: Feedback-ID: i5e0dcf66:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Doug Goldstein , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Bertrand Marquis , Volodymyr Babchuk , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Shawn Anastasio , Alistair Francis , Bob Eshleman , Connor Davis , Oleksii Kurochko , "Daniel P. Smith" , Stefano Stabellini Subject: [PATCH v3 1/3] xen: kconfig: rename MEM_ACCESS -> VM_EVENT Date: Tue, 11 Mar 2025 12:23:12 +0200 Message-Id: <8d35ec8373b65bca2fe471eac7a17cb2a98db3fc.1741687645.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Use more generic CONFIG_VM_EVENT name throughout Xen code instead of CONFIG_MEM_ACCESS. This reflects the fact that vm_event is a higher level feature, with mem_access & monitor depending on it. CC: Jan Beulich Suggested-by: Tamas K Lengyel Acked-by: Tamas K Lengyel Signed-off-by: Sergiy Kibrik --- changes in v3: - squash with automation patch - tags & minor addition of blanks --- automation/gitlab-ci/build.yaml | 2 +- xen/arch/arm/Makefile | 2 +- xen/arch/arm/configs/tiny64_defconfig | 2 +- xen/arch/arm/include/asm/mem_access.h | 4 ++-- xen/arch/ppc/configs/ppc64_defconfig | 2 +- xen/arch/riscv/configs/tiny64_defconfig | 2 +- xen/arch/x86/mm/Makefile | 2 +- xen/common/Kconfig | 2 +- xen/common/Makefile | 2 +- xen/common/domctl.c | 2 +- xen/include/xen/mem_access.h | 6 +++--- xen/include/xsm/dummy.h | 2 +- xen/include/xsm/xsm.h | 4 ++-- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index 034d6d9c3a..b6383c4fc8 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -744,7 +744,7 @@ debian-12-riscv64-gcc: CONFIG_EXPERT=y CONFIG_GRANT_TABLE=n CONFIG_LIVEPATCH=n - CONFIG_MEM_ACCESS=n + CONFIG_VM_EVENT=n CONFIG_QEMU_PLATFORM=y CONFIG_XSM=n diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index fb0948f067..3bd5125e64 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -38,7 +38,7 @@ obj-y += irq.o obj-y += kernel.init.o obj-$(CONFIG_LIVEPATCH) += livepatch.o obj-$(CONFIG_LLC_COLORING) += llc-coloring.o -obj-$(CONFIG_MEM_ACCESS) += mem_access.o +obj-$(CONFIG_VM_EVENT) += mem_access.o obj-y += mm.o obj-y += monitor.o obj-y += p2m.o diff --git a/xen/arch/arm/configs/tiny64_defconfig b/xen/arch/arm/configs/tiny64_defconfig index cc6d93f2f8..469a1eb9f9 100644 --- a/xen/arch/arm/configs/tiny64_defconfig +++ b/xen/arch/arm/configs/tiny64_defconfig @@ -5,7 +5,7 @@ CONFIG_ARM=y # Architecture Features # # CONFIG_GICV3 is not set -# CONFIG_MEM_ACCESS is not set +# CONFIG_VM_EVENT is not set # CONFIG_SBSA_VUART_CONSOLE is not set # diff --git a/xen/arch/arm/include/asm/mem_access.h b/xen/arch/arm/include/asm/mem_access.h index abac8032fc..d42f28e8b7 100644 --- a/xen/arch/arm/include/asm/mem_access.h +++ b/xen/arch/arm/include/asm/mem_access.h @@ -37,7 +37,7 @@ static inline bool p2m_mem_access_sanity_check(struct domain *d) * Send mem event based on the access. Boolean return value indicates if trap * needs to be injected into guest. */ -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec npfec); struct page_info* @@ -58,7 +58,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag, return NULL; } -#endif /*CONFIG_MEM_ACCESS*/ +#endif /* CONFIG_VM_EVENT */ #endif /* _ASM_ARM_MEM_ACCESS_H */ /* diff --git a/xen/arch/ppc/configs/ppc64_defconfig b/xen/arch/ppc/configs/ppc64_defconfig index 4924d881a2..d6aaf772e7 100644 --- a/xen/arch/ppc/configs/ppc64_defconfig +++ b/xen/arch/ppc/configs/ppc64_defconfig @@ -1,6 +1,6 @@ # CONFIG_GRANT_TABLE is not set # CONFIG_SPECULATIVE_HARDEN_ARRAY is not set -# CONFIG_MEM_ACCESS is not set +# CONFIG_VM_EVENT is not set CONFIG_PPC64=y CONFIG_DEBUG=y diff --git a/xen/arch/riscv/configs/tiny64_defconfig b/xen/arch/riscv/configs/tiny64_defconfig index bb3ae26a44..2399f7b918 100644 --- a/xen/arch/riscv/configs/tiny64_defconfig +++ b/xen/arch/riscv/configs/tiny64_defconfig @@ -1,6 +1,6 @@ # CONFIG_BOOT_TIME_CPUPOOLS is not set # CONFIG_GRANT_TABLE is not set -# CONFIG_MEM_ACCESS is not set +# CONFIG_VM_EVENT is not set # CONFIG_COVERAGE is not set # CONFIG_LIVEPATCH is not set # CONFIG_XSM is not set diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile index 0345388359..960f6e8409 100644 --- a/xen/arch/x86/mm/Makefile +++ b/xen/arch/x86/mm/Makefile @@ -4,7 +4,7 @@ obj-$(CONFIG_HVM) += hap/ 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_MEM_ACCESS) += mem_access.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 diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 6166327f4d..a6aa2c5c14 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -92,7 +92,7 @@ config HAS_VMAP config MEM_ACCESS_ALWAYS_ON bool -config MEM_ACCESS +config VM_EVENT def_bool MEM_ACCESS_ALWAYS_ON prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON depends on HVM diff --git a/xen/common/Makefile b/xen/common/Makefile index cba3b32733..b71d4b3efa 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -26,7 +26,7 @@ obj-$(CONFIG_KEXEC) += kexec.o obj-$(CONFIG_KEXEC) += kimage.o obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o obj-$(CONFIG_LLC_COLORING) += llc-coloring.o -obj-$(CONFIG_MEM_ACCESS) += mem_access.o +obj-$(CONFIG_VM_EVENT) += mem_access.o obj-y += memory.o obj-y += multicall.o obj-y += notifier.o diff --git a/xen/common/domctl.c b/xen/common/domctl.c index b897ca8723..bfe2e1f9f0 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -809,7 +809,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) copyback = true; break; -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT case XEN_DOMCTL_set_access_required: if ( unlikely(current->domain == d) ) /* no domain_pause() */ ret = -EPERM; diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h index 2231341b5d..4de651038d 100644 --- a/xen/include/xen/mem_access.h +++ b/xen/include/xen/mem_access.h @@ -33,7 +33,7 @@ */ struct vm_event_st; -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT #include #endif @@ -99,7 +99,7 @@ long p2m_set_mem_access_multi(struct domain *d, int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t *access, unsigned int altp2m_idx); -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT int mem_access_memop(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(xen_mem_access_op_t) arg); #else @@ -109,7 +109,7 @@ int mem_access_memop(unsigned long cmd, { return -ENOSYS; } -#endif /* CONFIG_MEM_ACCESS */ +#endif /* CONFIG_VM_EVENT */ #endif /* _XEN_MEM_ACCESS_H */ diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index a8d06de6b0..9227205fcd 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -647,7 +647,7 @@ static XSM_INLINE int cf_check xsm_vm_event_control( return xsm_default_action(action, current->domain, d); } -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d) { XSM_ASSERT_ACTION(XSM_DM_PRIV); diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 8c33b055fc..24acc16125 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -153,7 +153,7 @@ struct xsm_ops { int (*vm_event_control)(struct domain *d, int mode, int op); -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT int (*mem_access)(struct domain *d); #endif @@ -637,7 +637,7 @@ static inline int xsm_vm_event_control( return alternative_call(xsm_ops.vm_event_control, d, mode, op); } -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT static inline int xsm_mem_access(xsm_default_t def, struct domain *d) { return alternative_call(xsm_ops.mem_access, d); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index ce6fbdc6c5..93fbfc43cc 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -111,7 +111,7 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = { .vm_event_control = xsm_vm_event_control, -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT .mem_access = xsm_mem_access, #endif diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 389707a164..6a53487ea4 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1362,7 +1362,7 @@ static int cf_check flask_vm_event_control(struct domain *d, int mode, int op) return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__VM_EVENT); } -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT static int cf_check flask_mem_access(struct domain *d) { return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MEM_ACCESS); @@ -1955,7 +1955,7 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = { .vm_event_control = flask_vm_event_control, -#ifdef CONFIG_MEM_ACCESS +#ifdef CONFIG_VM_EVENT .mem_access = flask_mem_access, #endif From patchwork Tue Mar 11 10:25:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 14011472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBA0AC282EC for ; Tue, 11 Mar 2025 10:26:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.907727.1314983 (Exim 4.92) (envelope-from ) id 1trwnc-0006lG-Ct; Tue, 11 Mar 2025 10:25:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 907727.1314983; Tue, 11 Mar 2025 10:25:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwnc-0006l5-9D; Tue, 11 Mar 2025 10:25:24 +0000 Received: by outflank-mailman (input) for mailman id 907727; Tue, 11 Mar 2025 10:25:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwna-0004A4-VP for xen-devel@lists.xenproject.org; Tue, 11 Mar 2025 10:25:22 +0000 Received: from fforwardh-b1-smtp.messagingengine.com (fforwardh-b1-smtp.messagingengine.com [202.12.124.196]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 227941d7-fe63-11ef-9898-31a8f345e629; Tue, 11 Mar 2025 11:25:21 +0100 (CET) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfforwardh.stl.internal (Postfix) with ESMTP id 1C0421740202; Tue, 11 Mar 2025 06:25:20 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-10.internal (MEProxy); Tue, 11 Mar 2025 06:25:20 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Mar 2025 06:25:18 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 227941d7-fe63-11ef-9898-31a8f345e629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741688719; x=1741775119; bh=8 gtu3M66RCphGMRnb9LvcGgL3tCIvFU0NSfbGCgNSNk=; b=u8SNWHU6Yy8xgjpQ2 vewv/lW60El1BSUgR2ilmhjELEPFKAk0JiPe5H5uh1tZkZqST2l5Md5d4m6LMziA UvQQo3qb5lQ0A/z0ty13YOlcTMjpoAPCJx00/InKXwIg8mntHdiYp2wxLvOfGso7 mY0lzDNJpZTpqoYvEWwbKFIWIjyeQXx5cxqhhelzo98aCJ2kOKMt1Kct8V4jDMNJ 12FsTuVnyV4Fh2K0McslFGjvU0MfiKE//k2pQUcaxkjUazjnihlxhPEZl4pzajZ+ VsvQSGGiVq358dsYL93Tb3k8vN7ZoPonChqtdG3dJqjL5Vb/Q4aBE8YBUGYchMLJ gMuHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdduleekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrih hksegvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueev gfduheevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihht vgdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgi gvnhdquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthht ohepshgvrhhgihihpghkihgsrhhikhesvghprghmrdgtohhmpdhrtghpthhtohepjhgsvg hulhhitghhsehsuhhsvgdrtghomhdprhgtphhtthhopegrnhgurhgvfidrtghoohhpvghr feestghithhrihigrdgtohhmpdhrtghpthhtoheprhhoghgvrhdrphgruhestghithhrih igrdgtohhmpdhrtghpthhtohepshhsthgrsggvlhhlihhniheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i5fdb7c23:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v3 2/3] x86:monitor: control monitor.c build with CONFIG_VM_EVENT option Date: Tue, 11 Mar 2025 12:25:17 +0200 Message-Id: <6acad259a83b09544b2ac7cec0bfc5dd5e434fb0.1741687645.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Replace more general CONFIG_HVM option with CONFIG_VM_EVENT which is more relevant and specific to monitoring. This is only to clarify at build level to which subsystem this file belongs. No functional change here, as VM_EVENT depends on HVM. Acked-by: Jan Beulich Signed-off-by: Sergiy Kibrik --- xen/arch/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index c763f80b0b..f59c9665fd 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -49,7 +49,7 @@ obj-$(CONFIG_PV) += ioport_emulate.o obj-y += irq.o obj-$(CONFIG_KEXEC) += machine_kexec.o obj-y += mm.o x86_64/mm.o -obj-$(CONFIG_HVM) += monitor.o +obj-$(CONFIG_VM_EVENT) += monitor.o obj-y += mpparse.o obj-y += nmi.o obj-y += numa.o From patchwork Tue Mar 11 10:27:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 14011476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F3C6C282EC for ; Tue, 11 Mar 2025 10:27:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.907763.1314993 (Exim 4.92) (envelope-from ) id 1trwpb-0000an-RA; Tue, 11 Mar 2025 10:27:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 907763.1314993; Tue, 11 Mar 2025 10:27:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwpb-0000ac-Ma; Tue, 11 Mar 2025 10:27:27 +0000 Received: by outflank-mailman (input) for mailman id 907763; Tue, 11 Mar 2025 10:27:27 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1trwpa-0000aF-Un for xen-devel@lists.xenproject.org; Tue, 11 Mar 2025 10:27:26 +0000 Received: from fforwardh-b1-smtp.messagingengine.com (fforwardh-b1-smtp.messagingengine.com [202.12.124.196]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6c2b999a-fe63-11ef-9898-31a8f345e629; Tue, 11 Mar 2025 11:27:24 +0100 (CET) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfforwardh.stl.internal (Postfix) with ESMTP id 5DABE174026E; Tue, 11 Mar 2025 06:27:23 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-11.internal (MEProxy); Tue, 11 Mar 2025 06:27:23 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Mar 2025 06:27:22 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c2b999a-fe63-11ef-9898-31a8f345e629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741688843; x=1741775243; bh=G Dnll3y+gmMLSLaE30GCig0th50OGyuwuf+2w72YSio=; b=lr1xUqHPG5mG1c5/j zaXC0j1WhgoFWaC1wRkKzFbNOd9CXCnTgylI8BFj29ZN97D+pdtwSpMdSz14axdR /6SSPyX4SiPMwAAjQvxOTb05PZGEslokf7mDW5U/GwS/ICJ7bAVLMnKJfNbuRZxa VTR9LS0rkDrvZbjjD6v1l5nZ1nnY2ybBfLXLNfP7rdsHwn1Xrcpucka+hEsQEKIi MaVYqCx58AfjsKsaSfpEWkV88M52t53B5qurXucu6yIH0GeYfYyUCi+1ixz8lxL4 Vag6uwJ8WTk8v4DJ4sHnaZOc5UY5tF2Hzd2Aj8w4ZHg9h8keIT5xcvd93O6A54Zj S5bLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdduleelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrih hksegvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueev gfduheevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihht vgdpnhgspghrtghpthhtohepudeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhope igvghnqdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdprhgtphht thhopehsthgvfhgrnhhordhsthgrsggvlhhlihhnihesrghmugdrtghomhdprhgtphhtth hopehjuhhlihgvnhesgigvnhdrohhrghdprhgtphhtthhopegsvghrthhrrghnugdrmhgr rhhquhhishesrghrmhdrtghomhdprhgtphhtthhopehmihgthhgrlhdrohhriigvlhesrg hmugdrtghomhdprhgtphhtthhopehvohhlohguhihmhihrpggsrggstghhuhhksegvphgr mhdrtghomhdprhgtphhtthhopegrnhgurhgvfidrtghoohhpvghrfeestghithhrihigrd gtohhmpdhrtghpthhtoheprghnthhhohhnhidrphgvrhgrrhgusehvrghtvghsrdhtvggt hhdprhgtphhtthhopehrohhgvghrrdhprghusegtihhtrhhigidrtghomh X-ME-Proxy: Feedback-ID: id5edb69a:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Jan Beulich , Tamas K Lengyel , Ayan Kumar Halder , Sergiy Kibrik Subject: [PATCH v3 3/3] xen: mem_access: conditionally compile vm_event.c & monitor.c Date: Tue, 11 Mar 2025 12:27:20 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 From: Stefano Stabellini Extend coverage of CONFIG_VM_EVENT option and make the build of VM events and monitoring support optional. Also make MEM_PAGING option depend on VM_EVENT to document that mem_paging is relying on vm_event. This is to reduce code size on Arm when this option isn't enabled. CC: Jan Beulich CC: Tamas K Lengyel Reviewed-by: Ayan Kumar Halder Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik --- changes in v3: - add dependency MEM_PAGING -> VM_EVENT - monitor_domctl() stub returns -EOPNOTSUPP changes in v2: - rename CONFIG_MEM_ACCESS -> CONFIG_VM_EVENT - tags --- xen/arch/arm/Makefile | 4 ++-- xen/arch/arm/vsmc.c | 3 ++- xen/arch/x86/Kconfig | 2 +- xen/common/Makefile | 4 ++-- xen/include/xen/monitor.h | 9 +++++++++ xen/include/xen/vm_event.h | 14 +++++++++++--- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 3bd5125e64..4837ad467a 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -40,7 +40,7 @@ obj-$(CONFIG_LIVEPATCH) += livepatch.o obj-$(CONFIG_LLC_COLORING) += llc-coloring.o obj-$(CONFIG_VM_EVENT) += mem_access.o obj-y += mm.o -obj-y += monitor.o +obj-$(CONFIG_VM_EVENT) += monitor.o obj-y += p2m.o obj-y += platform.o obj-y += platform_hypercall.o @@ -66,7 +66,7 @@ obj-$(CONFIG_VGICV2) += vgic-v2.o obj-$(CONFIG_GICV3) += vgic-v3.o obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o endif -obj-y += vm_event.o +obj-$(CONFIG_VM_EVENT) += vm_event.o obj-y += vtimer.o obj-$(CONFIG_SBSA_VUART_CONSOLE) += vpl011.o obj-y += vsmc.o diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index e253865b6c..6081f14ed0 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -330,7 +330,8 @@ void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr) } /* If monitor is enabled, let it handle the call. */ - if ( current->domain->arch.monitor.privileged_call_enabled ) + if ( IS_ENABLED(CONFIG_VM_EVENT) && + current->domain->arch.monitor.privileged_call_enabled ) rc = monitor_smc(); if ( rc == 1 ) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 6e41bc0fb4..f086799594 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -350,7 +350,7 @@ endif config MEM_PAGING bool "Xen memory paging support (UNSUPPORTED)" if UNSUPPORTED - depends on HVM + depends on HVM && VM_EVENT config MEM_SHARING bool "Xen memory sharing support (UNSUPPORTED)" if UNSUPPORTED diff --git a/xen/common/Makefile b/xen/common/Makefile index b71d4b3efa..ac23120d7d 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -54,7 +54,7 @@ obj-y += timer.o obj-$(CONFIG_TRACEBUFFER) += trace.o obj-y += version.o obj-y += virtual_region.o -obj-y += vm_event.o +obj-$(CONFIG_VM_EVENT) += vm_event.o obj-$(CONFIG_HAS_VMAP) += vmap.o obj-y += vsprintf.o obj-y += wait.o @@ -68,7 +68,7 @@ obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o xlat.o ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y += domctl.o -obj-y += monitor.o +obj-$(CONFIG_VM_EVENT) += monitor.o obj-y += sysctl.o endif diff --git a/xen/include/xen/monitor.h b/xen/include/xen/monitor.h index 713d54f7c1..634b6cd2a1 100644 --- a/xen/include/xen/monitor.h +++ b/xen/include/xen/monitor.h @@ -27,8 +27,17 @@ struct domain; struct xen_domctl_monitor_op; +#ifdef CONFIG_VM_EVENT int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop); void monitor_guest_request(void); +#else +static inline int monitor_domctl(struct domain *d, + struct xen_domctl_monitor_op *mop) +{ + return -EOPNOTSUPP; +} +static inline void monitor_guest_request(void) {} +#endif int monitor_traps(struct vcpu *v, bool sync, vm_event_request_t *req); diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h index 9a86358b42..268c85fc4f 100644 --- a/xen/include/xen/vm_event.h +++ b/xen/include/xen/vm_event.h @@ -50,9 +50,6 @@ struct vm_event_domain unsigned int last_vcpu_wake_up; }; -/* Clean up on domain destruction */ -void vm_event_cleanup(struct domain *d); - /* Returns whether a ring has been set up */ bool vm_event_check_ring(struct vm_event_domain *ved); @@ -88,7 +85,18 @@ void vm_event_cancel_slot(struct domain *d, struct vm_event_domain *ved); void vm_event_put_request(struct domain *d, struct vm_event_domain *ved, vm_event_request_t *req); +#ifdef CONFIG_VM_EVENT +/* Clean up on domain destruction */ +void vm_event_cleanup(struct domain *d); int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec); +#else +static inline void vm_event_cleanup(struct domain *d) {} +static inline int vm_event_domctl(struct domain *d, + struct xen_domctl_vm_event_op *vec) +{ + return -EINVAL; +} +#endif void vm_event_vcpu_pause(struct vcpu *v); void vm_event_vcpu_unpause(struct vcpu *v);