From nobody Mon Dec 1 22:34:54 2025 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; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1764227437756208.7085776146838; Wed, 26 Nov 2025 23:10:37 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1173451.1498501 (Exim 4.92) (envelope-from ) id 1vOW94-0007su-6J; Thu, 27 Nov 2025 07:10:26 +0000 Received: by outflank-mailman (output) from mailman id 1173451.1498501; Thu, 27 Nov 2025 07:10:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vOW94-0007sn-3l; Thu, 27 Nov 2025 07:10:26 +0000 Received: by outflank-mailman (input) for mailman id 1173451; Thu, 27 Nov 2025 07:10:25 +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 1vOW93-0004TZ-9Q for xen-devel@lists.xenproject.org; Thu, 27 Nov 2025 07:10:25 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 24330961-cb60-11f0-980a-7dc792cee155; Thu, 27 Nov 2025 08:10:23 +0100 (CET) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3AF035BCC5; Thu, 27 Nov 2025 07:10:23 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D29E13EA63; Thu, 27 Nov 2025 07:10:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id EzUDMl75J2nvXQAAD6G6ig (envelope-from ); Thu, 27 Nov 2025 07:10:22 +0000 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: 24330961-cb60-11f0-980a-7dc792cee155 Authentication-Results: smtp-out2.suse.de; none From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Josh Poimboeuf , Peter Zijlstra , xen-devel@lists.xenproject.org Subject: [PATCH v4 16/21] x86/xen: Drop xen_cpu_ops Date: Thu, 27 Nov 2025 08:08:39 +0100 Message-ID: <20251127070844.21919-17-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251127070844.21919-1-jgross@suse.com> References: <20251127070844.21919-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLkdkdrsxe9hqhhs5ask8616i6)] X-Rspamd-Queue-Id: 3AF035BCC5 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-ZM-MESSAGEID: 1764227439832019200 Content-Type: text/plain; charset="utf-8" Instead of having a pre-filled array xen_cpu_ops for Xen PV paravirt functions, drop the array and assign each element individually. This is in preparation of reducing the paravirt include hell by splitting paravirt.h into multiple more fine grained header files, which will in turn require to split up the pv_ops vector as well. Dropping the pre-filled array makes life easier for objtool to detect missing initializers in multiple pv_ops_ arrays. Signed-off-by: Juergen Gross --- V2: - new patch --- arch/x86/xen/enlighten_pv.c | 82 +++++++++++++++---------------------- tools/objtool/check.c | 1 - 2 files changed, 33 insertions(+), 50 deletions(-) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 4806cc28d7ca..65df3a0d9cf3 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1212,54 +1212,6 @@ static const struct pv_info xen_info __initconst =3D= { .name =3D "Xen", }; =20 -static const typeof(pv_ops) xen_cpu_ops __initconst =3D { - .cpu =3D { - .cpuid =3D xen_cpuid, - - .set_debugreg =3D xen_set_debugreg, - .get_debugreg =3D xen_get_debugreg, - - .read_cr0 =3D xen_read_cr0, - .write_cr0 =3D xen_write_cr0, - - .write_cr4 =3D xen_write_cr4, - - .read_msr =3D xen_read_msr, - .write_msr =3D xen_write_msr, - - .read_msr_safe =3D xen_read_msr_safe, - .write_msr_safe =3D xen_write_msr_safe, - - .read_pmc =3D xen_read_pmc, - - .load_tr_desc =3D paravirt_nop, - .set_ldt =3D xen_set_ldt, - .load_gdt =3D xen_load_gdt, - .load_idt =3D xen_load_idt, - .load_tls =3D xen_load_tls, - .load_gs_index =3D xen_load_gs_index, - - .alloc_ldt =3D xen_alloc_ldt, - .free_ldt =3D xen_free_ldt, - - .store_tr =3D xen_store_tr, - - .write_ldt_entry =3D xen_write_ldt_entry, - .write_gdt_entry =3D xen_write_gdt_entry, - .write_idt_entry =3D xen_write_idt_entry, - .load_sp0 =3D xen_load_sp0, - -#ifdef CONFIG_X86_IOPL_IOPERM - .invalidate_io_bitmap =3D xen_invalidate_io_bitmap, - .update_io_bitmap =3D xen_update_io_bitmap, -#endif - .io_delay =3D xen_io_delay, - - .start_context_switch =3D xen_start_context_switch, - .end_context_switch =3D xen_end_context_switch, - }, -}; - static void xen_restart(char *msg) { xen_reboot(SHUTDOWN_reboot); @@ -1411,7 +1363,39 @@ asmlinkage __visible void __init xen_start_kernel(st= ruct start_info *si) =20 /* Install Xen paravirt ops */ pv_info =3D xen_info; - pv_ops.cpu =3D xen_cpu_ops.cpu; + + pv_ops.cpu.cpuid =3D xen_cpuid; + pv_ops.cpu.set_debugreg =3D xen_set_debugreg; + pv_ops.cpu.get_debugreg =3D xen_get_debugreg; + pv_ops.cpu.read_cr0 =3D xen_read_cr0; + pv_ops.cpu.write_cr0 =3D xen_write_cr0; + pv_ops.cpu.write_cr4 =3D xen_write_cr4; + pv_ops.cpu.read_msr =3D xen_read_msr; + pv_ops.cpu.write_msr =3D xen_write_msr; + pv_ops.cpu.read_msr_safe =3D xen_read_msr_safe; + pv_ops.cpu.write_msr_safe =3D xen_write_msr_safe; + pv_ops.cpu.read_pmc =3D xen_read_pmc; + pv_ops.cpu.load_tr_desc =3D paravirt_nop; + pv_ops.cpu.set_ldt =3D xen_set_ldt; + pv_ops.cpu.load_gdt =3D xen_load_gdt; + pv_ops.cpu.load_idt =3D xen_load_idt; + pv_ops.cpu.load_tls =3D xen_load_tls; + pv_ops.cpu.load_gs_index =3D xen_load_gs_index; + pv_ops.cpu.alloc_ldt =3D xen_alloc_ldt; + pv_ops.cpu.free_ldt =3D xen_free_ldt; + pv_ops.cpu.store_tr =3D xen_store_tr; + pv_ops.cpu.write_ldt_entry =3D xen_write_ldt_entry; + pv_ops.cpu.write_gdt_entry =3D xen_write_gdt_entry; + pv_ops.cpu.write_idt_entry =3D xen_write_idt_entry; + pv_ops.cpu.load_sp0 =3D xen_load_sp0; +#ifdef CONFIG_X86_IOPL_IOPERM + pv_ops.cpu.invalidate_io_bitmap =3D xen_invalidate_io_bitmap; + pv_ops.cpu.update_io_bitmap =3D xen_update_io_bitmap; +#endif + pv_ops.cpu.io_delay =3D xen_io_delay; + pv_ops.cpu.start_context_switch =3D xen_start_context_switch; + pv_ops.cpu.end_context_switch =3D xen_end_context_switch; + xen_init_irq_ops(); =20 /* diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3fd551c080ee..5c00bca8dc11 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -593,7 +593,6 @@ static int init_pv_ops(struct objtool_file *file) { static const char *pv_ops_tables[] =3D { "pv_ops", - "xen_cpu_ops", "xen_mmu_ops", NULL, }; --=20 2.51.0