From nobody Mon Nov 25 04:59:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715251315461484.6806987738006; Thu, 9 May 2024 03:41:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.719175.1121767 (Exim 4.92) (envelope-from ) id 1s51DJ-0007As-GA; Thu, 09 May 2024 10:41:25 +0000 Received: by outflank-mailman (output) from mailman id 719175.1121767; Thu, 09 May 2024 10:41:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s51DJ-0007Al-Cl; Thu, 09 May 2024 10:41:25 +0000 Received: by outflank-mailman (input) for mailman id 719175; Thu, 09 May 2024 10:41: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 1s51DH-0007Af-PZ for xen-devel@lists.xenproject.org; Thu, 09 May 2024 10:41:23 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id acd2f3ea-0df0-11ef-b4bb-af5377834399; Thu, 09 May 2024 12:41:21 +0200 (CEST) Received: from LAPTOP-EFA9O91E.localdomain (host-79-60-221-62.business.telecomitalia.it [79.60.221.62]) by support.bugseng.com (Postfix) with ESMTPSA id 8AE014EE0737; Thu, 9 May 2024 12:41:20 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: acd2f3ea-0df0-11ef-b4bb-af5377834399 From: Alessandro Zucchelli To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Alessandro Zucchelli , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu Subject: [XEN PATCH v2] arm/mem_access: add conditional build of mem_access.c Date: Thu, 9 May 2024 12:39:53 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1715251316890100001 Content-Type: text/plain; charset="utf-8" In order to comply to MISRA C:2012 Rule 8.4 for ARM asm/mem_access.h in the case where MEM_ACCESS=3Dn stubs are needed to allow the conditional compilation of the users of this header. Signed-off-by: Alessandro Zucchelli --- Changes from v1: Reverted preprocessor conditional changes to xen/mem_access.h; added conditional build for xen/mem_access.c; provided stubs for asm/mem_access.h functions. --- xen/arch/arm/Makefile | 2 +- xen/arch/arm/include/asm/mem_access.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 7b1350e2ef..45dc29ea53 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -37,7 +37,7 @@ obj-$(CONFIG_IOREQ_SERVER) +=3D ioreq.o obj-y +=3D irq.o obj-y +=3D kernel.init.o obj-$(CONFIG_LIVEPATCH) +=3D livepatch.o -obj-y +=3D mem_access.o +obj-$(CONFIG_MEM_ACCESS) +=3D mem_access.o obj-y +=3D mm.o obj-y +=3D monitor.o obj-y +=3D p2m.o diff --git a/xen/arch/arm/include/asm/mem_access.h b/xen/arch/arm/include/a= sm/mem_access.h index 35ed0ad154..2f73172e39 100644 --- a/xen/arch/arm/include/asm/mem_access.h +++ b/xen/arch/arm/include/asm/mem_access.h @@ -17,6 +17,7 @@ #ifndef _ASM_ARM_MEM_ACCESS_H #define _ASM_ARM_MEM_ACCESS_H =20 +#include static inline bool p2m_mem_access_emulate_check(struct vcpu *v, const struct vm_event_st *rsp) @@ -35,12 +36,20 @@ static inline bool p2m_mem_access_sanity_check(struct d= omain *d) * Send mem event based on the access. Boolean return value indicates if t= rap * needs to be injected into guest. */ +#ifdef CONFIG_MEM_ACCESS bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec npf= ec); =20 struct page_info* p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag, const struct vcpu *v); +#else =20 +static inline bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const st= ruct npfec npfec) {return false;} + +static inline struct page_info* +p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag, + const struct vcpu *v) {return NULL;} +#endif /*CONFIG_MEM_ACCESS*/ #endif /* _ASM_ARM_MEM_ACCESS_H */ =20 /* --=20 2.25.1