From nobody Sun Feb 8 07:57:52 2026 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 1706866743115861.1644522314597; Fri, 2 Feb 2024 01:39:03 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674920.1050094 (Exim 4.92) (envelope-from ) id 1rVq0P-0005vv-Ra; Fri, 02 Feb 2024 09:38:41 +0000 Received: by outflank-mailman (output) from mailman id 674920.1050094; Fri, 02 Feb 2024 09:38:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0P-0005vk-Nm; Fri, 02 Feb 2024 09:38:41 +0000 Received: by outflank-mailman (input) for mailman id 674920; Fri, 02 Feb 2024 09:38:40 +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 1rVq0O-0005sE-Ax for xen-devel@lists.xenproject.org; Fri, 02 Feb 2024 09:38:40 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d7913475-c1ae-11ee-98f5-efadbce2ee36; Fri, 02 Feb 2024 10:38:38 +0100 (CET) Received: from beta.station (net-188-218-67-100.cust.vodafonedsl.it [188.218.67.100]) by support.bugseng.com (Postfix) with ESMTPSA id A36D54EE073A; Fri, 2 Feb 2024 10:38:36 +0100 (CET) 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: d7913475-c1ae-11ee-98f5-efadbce2ee36 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Simone Ballarin , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Wei Liu , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Dario Faggioli , Maria Celeste Cesario Subject: [PATCH v3 1/4] xen: add SAF deviation for debugging and logging effects Date: Fri, 2 Feb 2024 10:37:44 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706866745576100001 Content-Type: text/plain; charset="utf-8" Rule 13.1: Initializer lists shall not contain persistent side effects Effects caused by debug/logging macros and functions (like ASSERT, __bad_at= omic_size, LOG, etc ...) that crash execution or produce logs are not dangerous in ini= tializer lists. The evaluation order in abnormal conditions is not relevant. Evaluat= ion order of logging effects is always safe. Function hvm_get_guest_tsc_fixed (indirectly) performs different side effec= ts. For example it calls hvm_get_guest_time_fixed that contains an ASSERT and c= alls to spin_lock and spin_unlock. These side effects are not dangerous: they can be executed regardless of the initializer list evaluation order This patch deviates violations using SAF commits caused by debug/logging ma= cros and functions. Asm volatile statements in initializer lists that do not perform any persis= tent side effect are safe: this patch deviates violations caused by uses of the curre= nt macro (that contains an asm volatile) in initializer lists. No functional changes. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario --- Changes in v3: - change commit prefix from xen/arm to xen - specify where saf-3-safe comments are applied in guestcopy.c - reword SAF text Changes in v2: New patch based on the discussion for "xen/arm: address violations of MISRA= C:2012 Rule 13.1". --- docs/misra/safe.json | 16 ++++++++++++++++ xen/arch/arm/device.c | 1 + xen/arch/arm/guestcopy.c | 16 ++++++++++++---- xen/arch/x86/hvm/hvm.c | 1 + xen/common/sched/core.c | 3 +++ 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/misra/safe.json b/docs/misra/safe.json index 952324f85c..5539e8dfda 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -28,6 +28,22 @@ }, { "id": "SAF-3-safe", + "analyser": { + "eclair": "MC3R1.R13.1" + }, + "name": "MC3R1.R13.1: effects for debugging and logging", + "text": "Effects for debugging and loggings reasons that crash= execution or produce logs are allowed in initializer lists. The evaluation= order in abnormal conditions is not relevant." + }, + { + "id": "SAF-4-safe", + "analyser": { + "eclair": "MC3R1.R13.1" + }, + "name": "MC3R1.R13.1: volatile asm statements that do not perf= orm any persistent side effect", + "text": "Volatile asm statement in an initializer list that do= es not perform persistent side effects is safe." + }, + { + "id": "SAF-5-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 1f631d3274..fa331f164d 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -331,6 +331,7 @@ int handle_device(struct domain *d, struct dt_device_no= de *dev, p2m_type_t p2mt, .p2mt =3D p2mt, .skip_mapping =3D !own_device || (is_pci_passthrough_enabled() && + /* SAF-3-safe effects for debugging/logging reason= s are safe */ (device_get_class(dev) =3D=3D DEVICE_PCI_HOSTBRIDG= E)), .iomem_ranges =3D iomem_ranges, .irq_ranges =3D irq_ranges diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index 6716b03561..b75538252a 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -110,26 +110,34 @@ static unsigned long copy_guest(void *buf, uint64_t a= ddr, unsigned int len, unsigned long raw_copy_to_guest(void *to, const void *from, unsigned int l= en) { return copy_guest((void *)from, (vaddr_t)to, len, - GVA_INFO(current), COPY_to_guest | COPY_linear); + /* SAF-4-safe No persistent side effects */ + GVA_INFO(current), + COPY_to_guest | COPY_linear); } =20 unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from, unsigned int len) { - return copy_guest((void *)from, (vaddr_t)to, len, GVA_INFO(current), + return copy_guest((void *)from, (vaddr_t)to, len, + /* SAF-4-safe No persistent side effects */ + GVA_INFO(current), COPY_to_guest | COPY_flush_dcache | COPY_linear); } =20 unsigned long raw_clear_guest(void *to, unsigned int len) { - return copy_guest(NULL, (vaddr_t)to, len, GVA_INFO(current), + return copy_guest(NULL, (vaddr_t)to, len, + /* SAF-4-safe No persistent side effects */ + GVA_INFO(current), COPY_to_guest | COPY_linear); } =20 unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned int len) { - return copy_guest(to, (vaddr_t)from, len, GVA_INFO(current), + return copy_guest(to, (vaddr_t)from, len, + /* SAF-4-safe No persistent side effects */ + GVA_INFO(current), COPY_from_guest | COPY_linear); } =20 diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index e3bd9157d7..38af437634 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -800,6 +800,7 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, h= vm_domain_context_t *h) { struct segment_register seg; struct hvm_hw_cpu ctxt =3D { + /* SAF-3-safe effects for debugging/logging reasons are safe */ .tsc =3D hvm_get_guest_tsc_fixed(v, v->domain->arch.hvm.sync_tsc), .msr_tsc_aux =3D v->arch.msrs->tsc_aux, .rax =3D v->arch.user_regs.rax, diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index d177c675c8..9e973fcf31 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -1521,6 +1521,7 @@ long vcpu_yield(void) =20 SCHED_STAT_CRANK(vcpu_yield); =20 + /* SAF-4-safe No persistent side effects */ TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id= ); raise_softirq(SCHEDULE_SOFTIRQ); return 0; @@ -1899,6 +1900,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) if ( copy_from_guest(&sched_shutdown, arg, 1) ) break; =20 + /* SAF-4-safe No persistent side effects */ TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->domain_id, current->vcpu_id, sched_shutdown.reason); @@ -1916,6 +1918,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) if ( copy_from_guest(&sched_shutdown, arg, 1) ) break; =20 + /* SAF-4-safe No persistent side effects */ TRACE_3D(TRC_SCHED_SHUTDOWN_CODE, d->domain_id, current->vcpu_id, sched_shutdown.reason); =20 --=20 2.40.0 From nobody Sun Feb 8 07:57:52 2026 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 1706866746143498.4170187201711; Fri, 2 Feb 2024 01:39:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674921.1050104 (Exim 4.92) (envelope-from ) id 1rVq0Q-00063N-9W; Fri, 02 Feb 2024 09:38:42 +0000 Received: by outflank-mailman (output) from mailman id 674921.1050104; Fri, 02 Feb 2024 09:38:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0Q-000631-0Z; Fri, 02 Feb 2024 09:38:42 +0000 Received: by outflank-mailman (input) for mailman id 674921; Fri, 02 Feb 2024 09:38:41 +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 1rVq0P-0005sE-4a for xen-devel@lists.xenproject.org; Fri, 02 Feb 2024 09:38:41 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d86c3a85-c1ae-11ee-98f5-efadbce2ee36; Fri, 02 Feb 2024 10:38:39 +0100 (CET) Received: from beta.station (net-188-218-67-100.cust.vodafonedsl.it [188.218.67.100]) by support.bugseng.com (Postfix) with ESMTPSA id 2BA274EE073C; Fri, 2 Feb 2024 10:38:38 +0100 (CET) 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: d86c3a85-c1ae-11ee-98f5-efadbce2ee36 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Simone Ballarin , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Wei Liu , Maria Celeste Cesario Subject: [PATCH v3 2/4] xen/ns16550: address violations of MISRA C:2012 Rule 13.1 Date: Fri, 2 Feb 2024 10:37:45 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706866747355100003 Content-Type: text/plain; charset="utf-8" Rule 13.1: Initializer lists shall not contain persistent side effects The assignment operation in: .irq =3D rc =3D uart->irq, is a persistent side effect in a struct initializer list. This patch assigns rc separately outside the structure. No functional change. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario --- Changes in v3: - add assignment of rc; - use rc as controlling expression in the following if-statement; - change prefix from xen to xen/ns16550. Changes in v2: - avoid assignment of rc; - drop changes in vcpu_yield(void). --- xen/drivers/char/ns16550.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index afe3d514b9..97bf098534 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -441,10 +441,12 @@ static void __init cf_check ns16550_init_postirq(stru= ct serial_port *port) struct msi_info msi =3D { .sbdf =3D PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1], uart->ps_bdf[2]), - .irq =3D rc =3D uart->irq, + .irq =3D uart->irq, .entry_nr =3D 1 }; =20 + rc =3D uart->irq; + if ( rc > 0 ) { struct msi_desc *msi_desc =3D NULL; --=20 2.40.0 From nobody Sun Feb 8 07:57:52 2026 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 1706866740423205.37940711479484; Fri, 2 Feb 2024 01:39:00 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674922.1050120 (Exim 4.92) (envelope-from ) id 1rVq0S-0006Zo-Bj; Fri, 02 Feb 2024 09:38:44 +0000 Received: by outflank-mailman (output) from mailman id 674922.1050120; Fri, 02 Feb 2024 09:38:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0S-0006Zf-7d; Fri, 02 Feb 2024 09:38:44 +0000 Received: by outflank-mailman (input) for mailman id 674922; Fri, 02 Feb 2024 09:38:43 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0R-0006GX-3x for xen-devel@lists.xenproject.org; Fri, 02 Feb 2024 09:38:43 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d8f2270f-c1ae-11ee-8a43-1f161083a0e0; Fri, 02 Feb 2024 10:38:41 +0100 (CET) Received: from beta.station (net-188-218-67-100.cust.vodafonedsl.it [188.218.67.100]) by support.bugseng.com (Postfix) with ESMTPSA id 97E9E4EE073D; Fri, 2 Feb 2024 10:38:39 +0100 (CET) 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: d8f2270f-c1ae-11ee-8a43-1f161083a0e0 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Simone Ballarin , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH v3 3/4] xen/x86: address violations of MISRA C:2012 Rule 13.1 Date: Fri, 2 Feb 2024 10:37:46 +0100 Message-Id: <7e54cfeaffea70f567d248779c092c4005e93a36.1706700228.git.maria.celeste.cesario@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706866741860100001 Content-Type: text/plain; charset="utf-8" Rule 13.1: Initializer lists shall not contain persistent side effects This patch moves expressions with side-effects into new variables before the initializer lists. No functional changes. Signed-off-by: Simone Ballarin --- xen/arch/x86/io_apic.c | 9 ++++++--- xen/arch/x86/mpparse.c | 3 ++- xen/arch/x86/setup.c | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index b48a642465..4a6ab85689 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2559,9 +2559,12 @@ integer_param("max_gsi_irqs", max_gsi_irqs); =20 static __init bool bad_ioapic_register(unsigned int idx) { - union IO_APIC_reg_00 reg_00 =3D { .raw =3D io_apic_read(idx, 0) }; - union IO_APIC_reg_01 reg_01 =3D { .raw =3D io_apic_read(idx, 1) }; - union IO_APIC_reg_02 reg_02 =3D { .raw =3D io_apic_read(idx, 2) }; + uint32_t reg_00_raw =3D io_apic_read(idx, 0); + uint32_t reg_01_raw =3D io_apic_read(idx, 1); + uint32_t reg_02_raw =3D io_apic_read(idx, 2); + union IO_APIC_reg_00 reg_00 =3D { .raw =3D reg_00_raw }; + union IO_APIC_reg_01 reg_01 =3D { .raw =3D reg_01_raw }; + union IO_APIC_reg_02 reg_02 =3D { .raw =3D reg_02_raw }; =20 if ( reg_00.raw =3D=3D -1 && reg_01.raw =3D=3D -1 && reg_02.raw =3D=3D= -1 ) { diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index d8ccab2449..81a819403b 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -798,11 +798,12 @@ void __init mp_register_lapic_address ( =20 int mp_register_lapic(u32 id, bool enabled, bool hotplug) { + u32 apic =3D apic_read(APIC_LVR); struct mpc_config_processor processor =3D { .mpc_type =3D MP_PROCESSOR, /* Note: We don't fill in fields not consumed anywhere. */ .mpc_apicid =3D id, - .mpc_apicver =3D GET_APIC_VERSION(apic_read(APIC_LVR)), + .mpc_apicver =3D GET_APIC_VERSION(apic), .mpc_cpuflag =3D (enabled ? CPU_ENABLED : 0) | (id =3D=3D boot_cpu_physical_apicid ? CPU_BOOTPROCESSOR : 0), diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index ee682dd136..886031d86a 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -885,13 +885,14 @@ static struct domain *__init create_dom0(const module= _t *image, { static char __initdata cmdline[MAX_GUEST_CMDLINE]; =20 + unsigned int max_vcpus =3D dom0_max_vcpus(); struct xen_domctl_createdomain dom0_cfg =3D { .flags =3D IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity = : 0, .max_evtchn_port =3D -1, .max_grant_frames =3D -1, .max_maptrack_frames =3D -1, .grant_opts =3D XEN_DOMCTL_GRANT_version(opt_gnttab_max_version), - .max_vcpus =3D dom0_max_vcpus(), + .max_vcpus =3D max_vcpus, .arch =3D { .misc_flags =3D opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0, }, --=20 2.40.0 From nobody Sun Feb 8 07:57:52 2026 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 1706866746892980.5387165436811; Fri, 2 Feb 2024 01:39:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674923.1050130 (Exim 4.92) (envelope-from ) id 1rVq0T-0006q2-If; Fri, 02 Feb 2024 09:38:45 +0000 Received: by outflank-mailman (output) from mailman id 674923.1050130; Fri, 02 Feb 2024 09:38:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0T-0006pt-EO; Fri, 02 Feb 2024 09:38:45 +0000 Received: by outflank-mailman (input) for mailman id 674923; Fri, 02 Feb 2024 09:38:43 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVq0R-0006GX-Hb for xen-devel@lists.xenproject.org; Fri, 02 Feb 2024 09:38:43 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d962f27c-c1ae-11ee-8a43-1f161083a0e0; Fri, 02 Feb 2024 10:38:41 +0100 (CET) Received: from beta.station (net-188-218-67-100.cust.vodafonedsl.it [188.218.67.100]) by support.bugseng.com (Postfix) with ESMTPSA id 5D9C64EE073E; Fri, 2 Feb 2024 10:38:40 +0100 (CET) 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: d962f27c-c1ae-11ee-8a43-1f161083a0e0 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Maria Celeste Cesario , Simone Ballarin , Doug Goldstein , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Wei Liu Subject: [PATCH v3 4/4] eclair: add and manage properties Date: Fri, 2 Feb 2024 10:37:47 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706866747433100005 Content-Type: text/plain; charset="utf-8" From: Maria Celeste Cesario Add JSON file containing properties. Add rst file containing explanation on how to update properties.json. Add instruction to eclair_analysis/prepare.sh to parse the JSON file. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin --- .../eclair_analysis/ECLAIR/analysis.ecl | 1 + automation/eclair_analysis/prepare.sh | 2 + docs/properties.json | 841 ++++++++++++++++++ docs/properties.rst | 58 ++ 4 files changed, 902 insertions(+) create mode 100644 docs/properties.json create mode 100644 docs/properties.rst diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/ec= lair_analysis/ECLAIR/analysis.ecl index a604582da3..684c5b0b39 100644 --- a/automation/eclair_analysis/ECLAIR/analysis.ecl +++ b/automation/eclair_analysis/ECLAIR/analysis.ecl @@ -30,6 +30,7 @@ if(not(scheduled_analysis), -eval_file=3Ddeviations.ecl -eval_file=3Dcall_properties.ecl -eval_file=3Dtagging.ecl +-eval_file=3Dproperties.ecl -eval_file=3Dconcat(set,".ecl") =20 -doc=3D"Hide reports in external code." diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_anal= ysis/prepare.sh index fe9d16e48e..47b2a2f32a 100755 --- a/automation/eclair_analysis/prepare.sh +++ b/automation/eclair_analysis/prepare.sh @@ -43,4 +43,6 @@ fi make -f "${script_dir}/Makefile.prepare" prepare # Translate the /* SAF-n-safe */ comments into ECLAIR CBTs scripts/xen-analysis.py --run-eclair --no-build --no-clean + # Translate function-properties.json into ECLAIR properties + python3 ${script_dir}/propertyparser.py ) diff --git a/docs/properties.json b/docs/properties.json new file mode 100644 index 0000000000..74058297b5 --- /dev/null +++ b/docs/properties.json @@ -0,0 +1,841 @@ +{ + "version": "1.0", + "content": [ + { + "type": "function", + "value": "^printk.*$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^debugtrace_printk.*$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^panic.*$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^domain_crash$", + "properties":{ + "pointee_write": "2..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^(g?d|mm_)?printk$", + "properties":{ + "pointee_write": "2..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^guest_bug_on_failed$", + "properties":{ + "pointee_write": "1=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^spin_lock_init_prof$", + "properties":{ + "pointee_write": "2=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^sched_test_func$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^dev_(info|warn)$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^PAGING_DEBUG$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^ACPI_(WARNING|ERROR|INFO)$", + "properties":{ + "pointee_write": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^fdt_get_property_by_offset_.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^read_atomic_size.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^device_tree_get_reg.*$", + "properties":{ + "pointee_write": "4..=3Dalways", + "pointee_read": "4..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^dt_get_range.*$", + "properties":{ + "pointee_write": "3..=3Dalways", + "pointee_read": "3..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^parse_static_mem_prop.*$", + "properties":{ + "pointee_write": "2..=3Dalways", + "pointee_read": "2..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^get_ttbr_and_gran_64bit.*$", + "properties":{ + "pointee_write": "1..2=3Dalways", + "pointee_read": "1..2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^hvm_emulate_init_once.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^__vmread.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^hvm_pci_decode_addr.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^vpci_mmcfg_decode_addr.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^x86emul_decode.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^unmap_grant_ref.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^arm_smmu_cmdq_build_cmd.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^pci_size_mem_bar.*$", + "properties":{ + "pointee_write": "4=3Dalways", + "pointee_read": "4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^_hvm_read_entry.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^hvm_map_guest_frame_rw.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^guest_cpuid.*$", + "properties":{ + "pointee_write": "4=3Dalways", + "pointee_read": "4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^epte_get_entry_emt.*$", + "properties":{ + "pointee_write": "5=3Dalways", + "pointee_read": "5=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^mcheck_mca_logout.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^set_field_in_reg_u32.*$", + "properties":{ + "pointee_write": "5=3Dalways", + "pointee_read": "5=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^alloc_affinity_masks.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^xasprintf.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^find_non_smt.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^call_rcu.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^getdomaininfo.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^MAPPING_(INSERT|SEARCH)\\(.*$", + "properties":{ + "pointee_write": "2..=3Dalways", + "pointee_read": "2..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^FormatDec.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^FormatHex.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^p2m_get_ioreq_server.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^elf_memset_unchecked.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^set_iommu_pte_present.*$", + "properties":{ + "pointee_write": "7=3Dalways", + "pointee_read": "7=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^clear_iommu_pte_present.*$", + "properties":{ + "pointee_write": "4=3Dalways", + "pointee_read": "4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^vcpu_runstate_get.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^va_start.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^sgi_target_init.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^get_hw_residencies.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^x86_cpu_policy_to_featureset.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^simple_strtou?ll?\\(.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^msi_compose_msg.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^print_tainted.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^get_hvm_registers.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^x86_insn_modrm.*$", + "properties":{ + "pointee_write": "2..3=3Dalways", + "pointee_read": "2..3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^cpuid_count_leaf.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^rcu_lock_remote_domain_by_id.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^cpuid_count.*$", + "properties":{ + "pointee_write": "3..=3Dalways", + "pointee_read": "3..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^.*efi_boot_mem_unused.*$", + "properties":{ + "pointee_write": "1..=3Dalways", + "pointee_read": "1..=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^collect_time_info.*$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^setup_xstate_comp.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^map_domain_gfn.*$", + "properties":{ + "pointee_read": "5=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^fdt_getprop.*$", + "properties":{ + "pointee_read": "4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^fdt_get_name.*$", + "properties":{ + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^fdt_get_property.*$", + "properties":{ + "pointee_read": "4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^pci_get_host_bridge_segment.*$", + "properties":{ + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^dt_get_property.*$", + "properties":{ + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^dt_property_read_u32.*$", + "properties":{ + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^dt_device_get_paddr.*$", + "properties":{ + "pointee_read": "3..4=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^get_evtchn_dt_property.*$", + "properties":{ + "pointee_write": "2..3=3Dmaybe", + "pointee_read": "2..3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^setup_chosen_node.*$", + "properties":{ + "pointee_write": "2..3=3Dmaybe", + "pointee_read": "2..3=3Dnever", + "taken": "" + } + }, + { + "type": "function", + "value": "^queue_remove_raw.*$", + "properties":{ + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^memset$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^va_start$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^memcmp$", + "properties":{ + "pointee_write": "1..2=3Dnever", + "taken": "" + } + }, + { + "type": "macro", + "value": "^memcpy$", + "properties":{ + "pointee_write": "1=3Dalways&&2..=3Dnever", + "pointee_read": "1=3Dnever&&2..=3Dalways", + "taken": "" + } + }, + { + "type": "function", + "value": "^get_cpu_info.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^pdx_to_pfn.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^is_pci_passthrough_enabled.*$", + "properties":{ + "attribute": "const" + } + }, + { + "type": "function", + "value": "^get_cycles.*$", + "properties":{ + "attribute": "noeffect" + } + }, + { + "type": "function", + "value": "^msi_gflags.*$", + "properties":{ + "attribute": "const" + } + }, + { + "type": "function", + "value": "^hvm_save_size.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^cpu_has.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^boot_cpu_has.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^get_cpu_info.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "type": "function", + "value": "^put_pte_flags.*$", + "properties":{ + "attribute": "const" + } + }, + { + "type": "function", + "value": "^is_pv_cpu.*$", + "properties":{ + "attribute": "pure" + } + }, + { + "description": "Property inferred as a consequence of the semanti= cs of device_tree_get_reg", + "type": "function", + "value": "^acquire_static_memory_bank.*$", + "properties":{ + "pointee_write": "4..=3Dalways", + "pointee_read": "4..=3Dnever", + "taken": "" + } + }, + { + "description": "Property inferred as a consequence of the semanti= cs of dt_set_cell", + "type": "function", + "value": "^set_interrupt.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description":"Property inferred as a consequence of the semantic= s of __p2m_get_mem_access", + "type": "function", + "value": "^p2m_get_mem_access.*$", + "properties":{ + "pointee_write": "3=3Dalways", + "pointee_read": "3=3Dnever", + "taken": "" + } + }, + { + "description": "This function has alternative definitions with pr= ops {write=3Dalways,read=3Dnever} and {write=3Dnever,read=3Dnever}", + "type": "function", + "value": "^alloc_cpumask_var.*$", + "properties":{ + "pointee_write": "1=3Dmaybe", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description": "Property inferred as a consequence of the semanti= cs of alloc_cpumask_var", + "type": "function", + "value": "^xenctl_bitmap_to_cpumask.*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description": "The call to bitmap_and causes the pointee of dstp= to be always written", + "type": "function", + "value": "^cpumask_(and|andnot|clear|copy|complement).*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description": "The call to bitmap_and causes the pointee of dstp= to be always written", + "type": "function", + "value": "^bitmap_(andnot|complement|fill).*$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description": "The .*copy_(to|from).* helpers all have a memcpy-= like expectation that the destination is a copy of the source. Furthermore,= their uses do initialize the involved variables as needed by futher uses i= n the caller.", + "type": "macro", + "value": "^(__)?(raw_)?copy_from_(paddr|guest|compat)(_offset)?$", + "properties":{ + "pointee_write": "1=3Dalways", + "pointee_read": "1=3Dnever", + "taken": "" + } + }, + { + "description":"The .*copy_(to|from).* helpers all have a memcpy-l= ike expectation that the destination is a copy of the source. Furthermore, = their uses do initialize the involved variables as needed by futher uses in= the caller.", + "type": "macro", + "value": "^(__)?copy_to_(guest|compat)(_offset)?$", + "properties":{ + "pointee_write": "2=3Dalways", + "pointee_read": "2=3Dnever", + "taken": "" + } + }, + { + "description": "Functions generated by build_atomic_read cannot b= e considered pure since the input pointer is volatile, but they do not prod= uce any persistent side effect.", + "type": "function", + "value": "^read_u(8|16|32|64|int)_atomic.*$", + "properties":{ + "attribute": "noeffect" + } + }, + { + "description": "Functions generated by TYPE_SAFE are const.", + "type": "function", + "value": "^(mfn|gfn|pfn)_x\\(.*$", + "properties":{ + "attribute": "const" + } + }, + { + "description": "Functions generated by TYPE_SAFE are const.", + "type": "function", + "value": "^_(mfn|gfn|pfn)\\(.*$", + "properties":{ + "attribute": "const" + } + } + ] +} diff --git a/docs/properties.rst b/docs/properties.rst new file mode 100644 index 0000000000..790f1ede1e --- /dev/null +++ b/docs/properties.rst @@ -0,0 +1,58 @@ +.. SPDX-License-Identifier: CC-BY-4.0 + +Properties list for Xen +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Some functions and macros are found to have properties relevant to=20 +the Xen codebase. For this reason, the file docs/properties.json=20 +contains all the needed properties. + +Here is an example of the properties.json file:: + + { + "version": "1.0", + "content": [ + { + "description": "" + "type": "function", // required + "value:": "^printk*.$", // required + "properties":{ + "pointee_write": "1..2=3Dnever", + "pointee_read": "", + "taken": "" + "attribute": "" + } + } + ] + } + +Here is an explanation of the fields inside an object of the "content" arr= ay: + + - description: a brief description of why the properties apply + - type: this is the kind of the element called: it may be either ``macro`= ` or ``function`` + - value: must be a regex, starting with ^ and ending with $ and matching = function fully=20 + qualified name or macro name. + - properties: a list of properties applied to said function. + Possible values are: + + - pointee_write: indicate the write use for call arguments that corres= pond to + parameters whose pointee types are non-const + - pointee_read: indicate the read use for call arguments that correspo= nd to + parameters whose pointee types are non-const + - taken: indicates that the specified address arguments may be stored = in objects + that persist after the function has ceased to exist (excluding the r= eturned value); + address arguments not listed are never taken + - attribute: attributes a function may have. Possible values are pure,= const and noeffect. + + pointee_read and pointee_write use a specific kind of argument, structu= red as pointee_arg=3Drw: + + - pointee_arg: argument index for callee. Index 0 refers to the return= value, + the indices of the arguments start from 1. It can be either a single= value or a range. + - rw: a value that's either always, maybe or never + =20 + - always: for pointee_read: argument pointee is expected to be full= y initialized at function enter, + for pointee_write: argument pointee is fully initialized at funct= ion exit + - maybe: for pointee_read: argument pointee may be expected to be i= nitialized at function enter, + for pointee_write: argument pointee may be written by function bo= dy + - never: for pointee_read: argument pointee is not expected to be r= ead in the functions's body, + for pointee_write: argument pointee is never written by function = body --=20 2.40.0