From nobody Mon Feb 9 20:35:38 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; dkim=pass; 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1637932102; cv=none; d=zohomail.com; s=zohoarc; b=hAvU8VgB2r8sSRkmRBRED9/obe1klrzrC39vfd5k8YQc/oJSfeMxxriSKXTfnCx0Cd9ZInoTtYofq1qByCP6YmU+dTFVCBiAhyZGQYeYR1wu68wP/q+tiEJ6ETrRLXugsugnu2Dtm0y9hg7yX7+/Yt9G4rATBWNtDsZ0EdAuH8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637932102; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NlCUvalgU7eB7GjLqqsbJjozlKRC2Q8OZ84C2MoFpdc=; b=fJLW91WgqjUqzeQ3Em4T6K8FTe9NWH1fD8vsWUzagS6XUDCJNb5skApjBeQ4UQZnK855h01a7tgrjTbSSvhgL/ogRs8Vu97TwxaWCawao1LnKlYgmTSq7en/pG99/X2hEj/MKK2nKY0Ap/FtrQEmg4B9fE4UwrIcboPNAiwjTFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1637932102529412.9031700051444; Fri, 26 Nov 2021 05:08:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.232864.404053 (Exim 4.92) (envelope-from ) id 1mqaxJ-0008Fp-Ao; Fri, 26 Nov 2021 13:07:57 +0000 Received: by outflank-mailman (output) from mailman id 232864.404053; Fri, 26 Nov 2021 13:07:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqaxI-0008Dp-Oa; Fri, 26 Nov 2021 13:07:56 +0000 Received: by outflank-mailman (input) for mailman id 232864; Fri, 26 Nov 2021 13:07:54 +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 1mqauu-0003W9-Cn for xen-devel@lists.xenproject.org; Fri, 26 Nov 2021 13:05:28 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 846e797f-4eb9-11ec-a9d2-d9f7a1cc8784; Fri, 26 Nov 2021 14:05:24 +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: 846e797f-4eb9-11ec-a9d2-d9f7a1cc8784 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637931924; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZfAMQ5gXNhkyy/7pM7nDOvtvjRuJe/w57bbDaSOyQrI=; b=Xrhqk4IdtcCx7hQ2kuQgiOcp5q9htQRUZeH2QtI2JQQqk2z1XSFWmStm k8c6bIy5H4PhQTh6PO+qyCJObS5VJorR1iT0A232ah6NViqc3aXUtIq37 D0RVSnPwOeb6MkRrddbjvzCw2IfMvzaiS0VInXC/hLyzAU/fRZYkPitVw M=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: BQqAQ9/QWNhbiSN8W9Di7v7gSxwhnlTH8wsxI5qXFyyLu8cQ5dyHiscix5irSI4vDRRJAgEvU5 Icymn2Za8wlxSt7KMxRJv0+a8Q9c7kzG1tc0/8NMye4rV42rgdre29CnnI9FU2LGsPWf+nj+AR P24nxgELA5P4xnYWV3Ysd9yS8UZwalnH09ft99bmXYHLmgM9QUj7Q62Boh05shRWCjgWFPNeFU b2jyJxSty2JMpAhQQfr48Y0kP+JPfsm/lPkhDKSS9krctkJbMsByK5ZTvsF5KSkJc2pAmEyPHy iN8ywxG8tfP/SaZGtjelHaxR X-SBRS: 5.1 X-MesageID: 59064012 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:aZ/j5qtW/DuLyak5AcGCRRXefOfnVJtZMUV32f8akzHdYApBsoF/q tZmKW6OPfzYMGWkf4h+bY3gp0wG75SEzt41G1E5+Sg2RCoU+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHhJZS5LwbZj29cx24bhWWthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ Nplj769EyFzG6z1mcsTAxRgEBxOF/MB5+qSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DFYUToHx/ixreCu4rW8vrSKTW/95Imjw3g6iiGN6DN pJHNWI2NnwsZTVDMHpOVpQ8u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HdrOrdr: A9a23:L3TuBq0wT24uS1Hjva+F0QqjBIokLtp133Aq2lEZdPRUGvb3qy nIpoVj6faUskd2ZJhOo7C90cW7LU80sKQFhLX5Xo3SOzUO2lHYT72KhLGKq1aLdhEWtNQtsZ uIG5IOcOEYZmIasS+V2maF+q4bsbu6zJw= X-IronPort-AV: E=Sophos;i="5.87,266,1631592000"; d="scan'208";a="59064012" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 33/65] x86/apic: Annotate fnptr targets Date: Fri, 26 Nov 2021 12:34:14 +0000 Message-ID: <20211126123446.32324-34-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20211126123446.32324-1-andrew.cooper3@citrix.com> References: <20211126123446.32324-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1637932103910100005 Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/genapic/bigsmp.c | 4 ++-- xen/arch/x86/genapic/delivery.c | 12 ++++++------ xen/arch/x86/genapic/x2apic.c | 16 ++++++++++------ xen/arch/x86/smp.c | 6 +++--- xen/include/asm-x86/genapic.h | 18 +++++++++--------- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c index b9d976e8abf2..2000383ab0bf 100644 --- a/xen/arch/x86/genapic/bigsmp.c +++ b/xen/arch/x86/genapic/bigsmp.c @@ -10,7 +10,7 @@ #include #include =20 -static __init int force_bigsmp(const struct dmi_system_id *d) +static int __init cf_check force_bigsmp(const struct dmi_system_id *d) { printk(KERN_NOTICE "%s detected: force use of apic=3Dbigsmp\n", d->ident); def_to_bigsmp =3D true; @@ -27,7 +27,7 @@ static const struct dmi_system_id __initconstrel bigsmp_d= mi_table[] =3D { }; =20 =20 -static __init int probe_bigsmp(void) +static int __init cf_check probe_bigsmp(void) {=20 /* * We don't implement cluster mode, so force use of diff --git a/xen/arch/x86/genapic/delivery.c b/xen/arch/x86/genapic/deliver= y.c index 548c33f282dd..d1f99bf6834a 100644 --- a/xen/arch/x86/genapic/delivery.c +++ b/xen/arch/x86/genapic/delivery.c @@ -9,7 +9,7 @@ * LOGICAL FLAT DELIVERY MODE (multicast via bitmask to <=3D 8 logical API= C IDs). */ =20 -void init_apic_ldr_flat(void) +void cf_check init_apic_ldr_flat(void) { unsigned long val; =20 @@ -19,12 +19,12 @@ void init_apic_ldr_flat(void) apic_write(APIC_LDR, val); } =20 -const cpumask_t *vector_allocation_cpumask_flat(int cpu) +const cpumask_t *cf_check vector_allocation_cpumask_flat(int cpu) { return &cpu_online_map; }=20 =20 -unsigned int cpu_mask_to_apicid_flat(const cpumask_t *cpumask) +unsigned int cf_check cpu_mask_to_apicid_flat(const cpumask_t *cpumask) { return cpumask_bits(cpumask)[0]&0xFF; } @@ -33,17 +33,17 @@ unsigned int cpu_mask_to_apicid_flat(const cpumask_t *c= pumask) * PHYSICAL DELIVERY MODE (unicast to physical APIC IDs). */ =20 -void init_apic_ldr_phys(void) +void cf_check init_apic_ldr_phys(void) { /* We only deliver in phys mode - no setup needed. */ } =20 -const cpumask_t *vector_allocation_cpumask_phys(int cpu) +const cpumask_t *cf_check vector_allocation_cpumask_phys(int cpu) { return cpumask_of(cpu); } =20 -unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask) +unsigned int cf_check cpu_mask_to_apicid_phys(const cpumask_t *cpumask) { /* As we are using single CPU as destination, pick only one CPU here */ return cpu_physical_id(cpumask_any(cpumask)); diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c index bd44bb753995..de5032f2020a 100644 --- a/xen/arch/x86/genapic/x2apic.c +++ b/xen/arch/x86/genapic/x2apic.c @@ -38,7 +38,7 @@ static inline u32 x2apic_cluster(unsigned int cpu) return per_cpu(cpu_2_logical_apicid, cpu) >> 16; } =20 -static void init_apic_ldr_x2apic_cluster(void) +static void cf_check init_apic_ldr_x2apic_cluster(void) { unsigned int cpu, this_cpu =3D smp_processor_id(); =20 @@ -74,12 +74,14 @@ static void init_apic_ldr_x2apic_cluster(void) cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu)); } =20 -static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(int cpu) +static const cpumask_t *cf_check vector_allocation_cpumask_x2apic_cluster( + int cpu) { return per_cpu(cluster_cpus, cpu); } =20 -static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t *cpu= mask) +static unsigned int cf_check cpu_mask_to_apicid_x2apic_cluster( + const cpumask_t *cpumask) { unsigned int cpu =3D cpumask_any(cpumask); unsigned int dest =3D per_cpu(cpu_2_logical_apicid, cpu); @@ -92,12 +94,13 @@ static unsigned int cpu_mask_to_apicid_x2apic_cluster(c= onst cpumask_t *cpumask) return dest; } =20 -static void send_IPI_self_x2apic(uint8_t vector) +static void cf_check send_IPI_self_x2apic(uint8_t vector) { apic_wrmsr(APIC_SELF_IPI, vector); } =20 -static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector) +static void cf_check send_IPI_mask_x2apic_phys( + const cpumask_t *cpumask, int vector) { unsigned int cpu; unsigned long flags; @@ -130,7 +133,8 @@ static void send_IPI_mask_x2apic_phys(const cpumask_t *= cpumask, int vector) local_irq_restore(flags); } =20 -static void send_IPI_mask_x2apic_cluster(const cpumask_t *cpumask, int vec= tor) +static void cf_check send_IPI_mask_x2apic_cluster( + const cpumask_t *cpumask, int vector) { unsigned int cpu =3D smp_processor_id(); cpumask_t *ipimask =3D per_cpu(scratch_mask, cpu); diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index 33748e629a21..0a02086966c0 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -161,13 +161,13 @@ void send_IPI_self(int vector) * The following functions deal with sending IPIs between CPUs. */ =20 -void send_IPI_self_legacy(uint8_t vector) +void cf_check send_IPI_self_legacy(uint8_t vector) { /* NMI continuation handling relies on using a shorthand here. */ send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); } =20 -void send_IPI_mask_flat(const cpumask_t *cpumask, int vector) +void cf_check send_IPI_mask_flat(const cpumask_t *cpumask, int vector) { unsigned long mask =3D cpumask_bits(cpumask)[0]; unsigned long cfg; @@ -204,7 +204,7 @@ void send_IPI_mask_flat(const cpumask_t *cpumask, int v= ector) local_irq_restore(flags); } =20 -void send_IPI_mask_phys(const cpumask_t *mask, int vector) +void cf_check send_IPI_mask_phys(const cpumask_t *mask, int vector) { unsigned long cfg, flags; unsigned int query_cpu; diff --git a/xen/include/asm-x86/genapic.h b/xen/include/asm-x86/genapic.h index 51a65d3e0f0c..beeaddf19daa 100644 --- a/xen/include/asm-x86/genapic.h +++ b/xen/include/asm-x86/genapic.h @@ -39,12 +39,12 @@ extern struct genapic genapic; extern const struct genapic apic_default; extern const struct genapic apic_bigsmp; =20 -void send_IPI_self_legacy(uint8_t vector); +void cf_check send_IPI_self_legacy(uint8_t vector); =20 -void init_apic_ldr_flat(void); -unsigned int cpu_mask_to_apicid_flat(const cpumask_t *cpumask); -void send_IPI_mask_flat(const cpumask_t *mask, int vector); -const cpumask_t *vector_allocation_cpumask_flat(int cpu); +void cf_check init_apic_ldr_flat(void); +unsigned int cf_check cpu_mask_to_apicid_flat(const cpumask_t *cpumask); +void cf_check send_IPI_mask_flat(const cpumask_t *mask, int vector); +const cpumask_t *cf_check vector_allocation_cpumask_flat(int cpu); #define GENAPIC_FLAT \ .int_delivery_mode =3D dest_LowestPrio, \ .int_dest_mode =3D 1 /* logical delivery */, \ @@ -54,10 +54,10 @@ const cpumask_t *vector_allocation_cpumask_flat(int cpu= ); .send_IPI_mask =3D send_IPI_mask_flat, \ .send_IPI_self =3D send_IPI_self_legacy =20 -void init_apic_ldr_phys(void); -unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask); -void send_IPI_mask_phys(const cpumask_t *mask, int vector); -const cpumask_t *vector_allocation_cpumask_phys(int cpu); +void cf_check init_apic_ldr_phys(void); +unsigned int cf_check cpu_mask_to_apicid_phys(const cpumask_t *cpumask); +void cf_check send_IPI_mask_phys(const cpumask_t *mask, int vector); +const cpumask_t *cf_check vector_allocation_cpumask_phys(int cpu); #define GENAPIC_PHYS \ .int_delivery_mode =3D dest_Fixed, \ .int_dest_mode =3D 0 /* physical delivery */, \ --=20 2.11.0