From nobody Mon Feb 9 19:07:45 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=none dis=none) header.from=sony.com ARC-Seal: i=1; a=rsa-sha256; t=1770026268; cv=none; d=zohomail.com; s=zohoarc; b=E3LwnCVkWNay3F0KvFSiuezLx6h4ipZxevc39p9OR41OmoNVZ7ZSTtoy7htkY7Czhpr1MAcBkAlKBmfQG90Bmo/21mkzlGk47zV3jgVfF6b2gJRtNwXlv2fY7kfgYzqmW1E/ZAre14G7TADSxtHUcoC+uV77RUxHWi8HvP5DaIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770026268; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UGbV0HlypAsqDyqCwF4KKZshjhbYqkotn40a85H3Q7U=; b=XDAamUSpROEsvbSM0rWGvfmfC4Bt9hK0FSDswsr6TTTCRsQmstp+Wiy99ewKcPy+Sox8HzYez+JdjSDWSB31RVJsRLytYjaMU2wp7XAJac4ghesqXEKbWYQUnYfMaVLvEjgx6AqhIo0rOuV5X/aaRMwlkCzbOauuqTYjQo0ow9k= 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1770026268043350.9631019656499; Mon, 2 Feb 2026 01:57:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1218463.1527212 (Exim 4.92) (envelope-from ) id 1vmqgU-0001eN-6u; Mon, 02 Feb 2026 09:57:30 +0000 Received: by outflank-mailman (output) from mailman id 1218463.1527212; Mon, 02 Feb 2026 09:57:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vmqgU-0001cy-08; Mon, 02 Feb 2026 09:57:30 +0000 Received: by outflank-mailman (input) for mailman id 1218463; Mon, 02 Feb 2026 09:52:05 +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 1vmqbE-0001Il-Va for xen-devel@lists.xenproject.org; Mon, 02 Feb 2026 09:52:04 +0000 Received: from jpms-ob01.noc.sony.co.jp (jpms-ob01.noc.sony.co.jp [2001:cf8:ace:41::4]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d2cc2a73-001c-11f1-9ccf-f158ae23cfc8; Mon, 02 Feb 2026 10:52:02 +0100 (CET) Received: from unknown (HELO jpmta-ob1.noc.sony.co.jp) ([IPv6:2001:cf8:0:6e7::6]) by jpms-ob01.noc.sony.co.jp with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2026 18:51:38 +0900 Received: from unknown (HELO [127.0.1.1]) ([IPv6:2001:cf8:1:573:0:dddd:6b3e:119e]) by jpmta-ob1.noc.sony.co.jp with ESMTP; 02 Feb 2026 18:51:38 +0900 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: d2cc2a73-001c-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; s=s1jp; t=1770025922; x=1801561922; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=UGbV0HlypAsqDyqCwF4KKZshjhbYqkotn40a85H3Q7U=; b=Fsk8atP8nOli3A/kdU1FTFujNMxydunfy/0QabsYe7jNJhGm6H88rUTl inKAlL/r973SUJg9eT/QLvQ6XUQ5Z1zzVR3WfUx82Bh/+OVteJj5i9c0c i9g8QYmd1M2Fj6GWZ0zQGLNBVz7vA8wVOPX0KiVqO3vhAXRtayG1s6aam JyXxACjk15x5b0CeL9dCyap3V5e5y9+P4V5uVk2lZ9ONogp1rfsnTlbDL nFVA8cTmEmXDW5zHMNTWZ8HLFoZDQMYuHpAsQWRS6QQZHtlDkpL+jif+G i+LoAuD8joUkr/+y1Qm+QfGxsdGCUdd3H8PsWEFMyX0QDGANlaggsztfq w==; X-IronPort-AV: E=Sophos;i="6.21,268,1763391600"; d="scan'208";a="607384938" From: Shashank Balaji Date: Mon, 02 Feb 2026 18:51:04 +0900 Subject: [PATCH 3/3] x86/virt: rename x2apic_available to x2apic_without_ir_available MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-x2apic-fix-v1-3-71c8f488a88b@sony.com> References: <20260202-x2apic-fix-v1-0-71c8f488a88b@sony.com> In-Reply-To: <20260202-x2apic-fix-v1-0-71c8f488a88b@sony.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Suresh Siddha , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Ajay Kaher , Alexey Makhalov , Broadcom internal kernel review list , Jan Kiszka , Paolo Bonzini , Vitaly Kuznetsov , Juergen Gross , Boris Ostrovsky Cc: Ingo Molnar , linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, jailhouse-dev@googlegroups.com, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Rahul Bukte , Shashank Balaji , Daniel Palmer , Tim Bird X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8661; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=40ywH2ksTo16iKGC5c7aKcdzHSb3M0fEznHdLx5ChZY=; b=owGbwMvMwCU2bX1+URVTXyjjabUkhsyG4pV73BSkW2t+bFj8lP/axHMSXQ/nLg+dcOZBrWq1l IycyNnlHaUsDGJcDLJiiiylStW/9q4IWtJz5rUizBxWJpAhDFycAjAR/UqGn4xiaRxyy02Nn4be 9Xesdnx9Matg+r2d2y7WH5tzzWHmuTSG/4lN6178i2r5JLaG8/tKKYYCxeYn2uGibz7WxSq6yev mMAAA X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=75227BFABDA852A48CCCEB2196AF6F727A028E55 X-ZohoMail-DKIM: pass (identity @sony.com) X-ZM-MESSAGEID: 1770026271105158500 No functional change. x86_init.hyper.x2apic_available is used only in try_to_enable_x2apic to che= ck if x2apic needs to be disabled if interrupt remapping support isn't present. B= ut the name x2apic_available doesn't reflect that usage. This is what x2apic_available is set to for various hypervisors: acrn boot_cpu_has(X86_FEATURE_X2APIC) mshyperv boot_cpu_has(X86_FEATURE_X2APIC) xen boot_cpu_has(X86_FEATURE_X2APIC) or false vmware vmware_legacy_x2apic_available kvm kvm_cpuid_base() !=3D 0 jailhouse x2apic_enabled() bhyve true default false Bare metal and vmware correctly check if x2apic is available without interr= upt remapping. The rest of them check if x2apic is enabled/supported, and kvm j= ust checks if the kernel is running on kvm. The other hypervisors may have to h= ave their checks audited. Also fix the backwards pr_info message printed on disabling x2apic because = of lack of irq remapping support. Compile tested with all the hypervisor guest support enabled. Co-developed-by: Rahul Bukte Signed-off-by: Rahul Bukte Signed-off-by: Shashank Balaji --- arch/x86/include/asm/x86_init.h | 4 ++-- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/cpu/acrn.c | 2 +- arch/x86/kernel/cpu/bhyve.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 2 +- arch/x86/kernel/cpu/vmware.c | 2 +- arch/x86/kernel/jailhouse.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/x86_init.c | 12 ++++++------ arch/x86/xen/enlighten_hvm.c | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_ini= t.h index 6c8a6ead84f6..b270d9eed755 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -116,7 +116,7 @@ struct x86_init_pci { * struct x86_hyper_init - x86 hypervisor init functions * @init_platform: platform setup * @guest_late_init: guest late init - * @x2apic_available: X2APIC detection + * @x2apic_without_ir_available: is x2apic available without irq remap? * @msi_ext_dest_id: MSI supports 15-bit APIC IDs * @init_mem_mapping: setup early mappings during init_mem_mapping() * @init_after_bootmem: guest init after boot allocator is finished @@ -124,7 +124,7 @@ struct x86_init_pci { struct x86_hyper_init { void (*init_platform)(void); void (*guest_late_init)(void); - bool (*x2apic_available)(void); + bool (*x2apic_without_ir_available)(void); bool (*msi_ext_dest_id)(void); void (*init_mem_mapping)(void); void (*init_after_bootmem)(void); diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index cc64d61f82cf..8820b631f8a2 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1836,8 +1836,8 @@ static __init void try_to_enable_x2apic(int remap_mod= e) * Using X2APIC without IR is not architecturally supported * on bare metal but may be supported in guests. */ - if (!x86_init.hyper.x2apic_available()) { - pr_info("x2apic: IRQ remapping doesn't support X2APIC mode\n"); + if (!x86_init.hyper.x2apic_without_ir_available()) { + pr_info("x2apic: Not supported without IRQ remapping\n"); x2apic_disable(); return; } diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c index 2c5b51aad91a..9204b98d4786 100644 --- a/arch/x86/kernel/cpu/acrn.c +++ b/arch/x86/kernel/cpu/acrn.c @@ -77,5 +77,5 @@ const __initconst struct hypervisor_x86 x86_hyper_acrn = =3D { .detect =3D acrn_detect, .type =3D X86_HYPER_ACRN, .init.init_platform =3D acrn_init_platform, - .init.x2apic_available =3D acrn_x2apic_available, + .init.x2apic_without_ir_available =3D acrn_x2apic_available, }; diff --git a/arch/x86/kernel/cpu/bhyve.c b/arch/x86/kernel/cpu/bhyve.c index f1a8ca3dd1ed..91a90a7459ce 100644 --- a/arch/x86/kernel/cpu/bhyve.c +++ b/arch/x86/kernel/cpu/bhyve.c @@ -61,6 +61,6 @@ const struct hypervisor_x86 x86_hyper_bhyve __refconst = =3D { .name =3D "Bhyve", .detect =3D bhyve_detect, .init.init_platform =3D x86_init_noop, - .init.x2apic_available =3D bhyve_x2apic_available, + .init.x2apic_without_ir_available =3D bhyve_x2apic_available, .init.msi_ext_dest_id =3D bhyve_ext_dest_id, }; diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 579fb2c64cfd..61458855094a 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -760,7 +760,7 @@ const __initconst struct hypervisor_x86 x86_hyper_ms_hy= perv =3D { .name =3D "Microsoft Hyper-V", .detect =3D ms_hyperv_platform, .type =3D X86_HYPER_MS_HYPERV, - .init.x2apic_available =3D ms_hyperv_x2apic_available, + .init.x2apic_without_ir_available =3D ms_hyperv_x2apic_available, .init.msi_ext_dest_id =3D ms_hyperv_msi_ext_dest_id, .init.init_platform =3D ms_hyperv_init_platform, .init.guest_late_init =3D ms_hyperv_late_init, diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index cb3f900c46fc..46d325818797 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -585,7 +585,7 @@ const __initconst struct hypervisor_x86 x86_hyper_vmwar= e =3D { .detect =3D vmware_platform, .type =3D X86_HYPER_VMWARE, .init.init_platform =3D vmware_platform_setup, - .init.x2apic_available =3D vmware_legacy_x2apic_available, + .init.x2apic_without_ir_available =3D vmware_legacy_x2apic_available, #ifdef CONFIG_AMD_MEM_ENCRYPT .runtime.sev_es_hcall_prepare =3D vmware_sev_es_hcall_prepare, .runtime.sev_es_hcall_finish =3D vmware_sev_es_hcall_finish, diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c index 9e9a591a5fec..84a0bbe15989 100644 --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -291,6 +291,6 @@ const struct hypervisor_x86 x86_hyper_jailhouse __refco= nst =3D { .name =3D "Jailhouse", .detect =3D jailhouse_detect, .init.init_platform =3D jailhouse_init_platform, - .init.x2apic_available =3D jailhouse_x2apic_available, + .init.x2apic_without_ir_available =3D jailhouse_x2apic_available, .ignore_nopv =3D true, }; diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 37dc8465e0f5..709eba87d58e 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1042,7 +1042,7 @@ const __initconst struct hypervisor_x86 x86_hyper_kvm= =3D { .detect =3D kvm_detect, .type =3D X86_HYPER_KVM, .init.guest_late_init =3D kvm_guest_init, - .init.x2apic_available =3D kvm_para_available, + .init.x2apic_without_ir_available =3D kvm_para_available, .init.msi_ext_dest_id =3D kvm_msi_ext_dest_id, .init.init_platform =3D kvm_init_platform, #if defined(CONFIG_AMD_MEM_ENCRYPT) diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index ebefb77c37bb..9ddf8c901ac6 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -112,12 +112,12 @@ struct x86_init_ops x86_init __initdata =3D { }, =20 .hyper =3D { - .init_platform =3D x86_init_noop, - .guest_late_init =3D x86_init_noop, - .x2apic_available =3D bool_x86_init_noop, - .msi_ext_dest_id =3D bool_x86_init_noop, - .init_mem_mapping =3D x86_init_noop, - .init_after_bootmem =3D x86_init_noop, + .init_platform =3D x86_init_noop, + .guest_late_init =3D x86_init_noop, + .x2apic_without_ir_available =3D bool_x86_init_noop, + .msi_ext_dest_id =3D bool_x86_init_noop, + .init_mem_mapping =3D x86_init_noop, + .init_after_bootmem =3D x86_init_noop, }, =20 .acpi =3D { diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index fe57ff85d004..42f3d21f313d 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -311,7 +311,7 @@ static uint32_t __init xen_platform_hvm(void) * detect PVH and panic there. */ h->init_platform =3D x86_init_noop; - h->x2apic_available =3D bool_x86_init_noop; + h->x2apic_without_ir_available =3D bool_x86_init_noop; h->init_mem_mapping =3D x86_init_noop; h->init_after_bootmem =3D x86_init_noop; h->guest_late_init =3D xen_hvm_guest_late_init; @@ -325,7 +325,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata =3D { .detect =3D xen_platform_hvm, .type =3D X86_HYPER_XEN_HVM, .init.init_platform =3D xen_hvm_guest_init, - .init.x2apic_available =3D xen_x2apic_available, + .init.x2apic_without_ir_available =3D xen_x2apic_available, .init.init_mem_mapping =3D xen_hvm_init_mem_mapping, .init.guest_late_init =3D xen_hvm_guest_late_init, .init.msi_ext_dest_id =3D msi_ext_dest_id, --=20 2.43.0