From nobody Fri May 17 15:02:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671322097; cv=none; d=zohomail.com; s=zohoarc; b=nxXYFNn8yMI3hs+4cxPP23QOOJMy9/CpIBMvB+dcbx+8ZDSvDd1ao+M3D7pR8FuCr1FU26Ee3uSpSyLRh81W4Ntkh2cx32oy9hDwC/xCaaSd+nwQG0ufwsrd0dMtJGhHxPAUbZ2/otIivC1f1Kl1HuL7S22WahF+TCtlRDNGKIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671322097; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=l9lbTFd1mcD6R3iKvDYN90sQlYkqt7eTwm6+gS8Z4XU=; b=hTLZ+6D3wKKFpeUXi6QI2XZK8qaONFWt/mHIl7aVn3lDNMCKx+h5vk5KnBPAA71IMYSvRdrQYWJjkpfR8zVfqVVCTggbAYoW7Dl1zTA+qSR7TnM4fK/udqxfG04s4W+wTVPmm2mCfIygZyCESdt2elzvhpnU08Q6xmuGes3kp/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671322097812119.80168885145838; Sat, 17 Dec 2022 16:08:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6hD3-0008Ee-P2; Sat, 17 Dec 2022 19:07:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6hCm-0008CV-V7 for qemu-devel@nongnu.org; Sat, 17 Dec 2022 19:07:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6hCk-0001sm-Mk for qemu-devel@nongnu.org; Sat, 17 Dec 2022 19:07:00 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-140-ia-bUiSrMBahMje8AIwQGw-1; Sat, 17 Dec 2022 19:06:56 -0500 Received: by mail-ed1-f72.google.com with SMTP id j11-20020aa7c40b000000b0046b45e2ff83so4088345edq.12 for ; Sat, 17 Dec 2022 16:06:56 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:e3ec:5559:7c5c:1928]) by smtp.gmail.com with ESMTPSA id v21-20020a170906b01500b007ae1e528390sm2509734ejy.163.2022.12.17.16.06.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 16:06:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671322018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l9lbTFd1mcD6R3iKvDYN90sQlYkqt7eTwm6+gS8Z4XU=; b=W8802xgO2T3rjbd7J42ayoQ2gInkWqQ0G54Up6lrZGi989zSKN2iw4IWfTF8M17O0xSVoM rXMAFMsa0ImW1DYanMCT/2po9W5z/28/UxywvtpohTWVq5StNWGi6fdTdXaoeRlro1f3Eg iEcvt9ZmoYas9H8eTmrPXX8hVKF4ChI= X-MC-Unique: ia-bUiSrMBahMje8AIwQGw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l9lbTFd1mcD6R3iKvDYN90sQlYkqt7eTwm6+gS8Z4XU=; b=bHtAVJvjnuD6cR3rZei9Ejio0P8X744EDQmOud54NpibYrOD9mZb1O8UcUHhatOw8r 9UWh00+5emF3NMKAo/P0LpPAv79z8tHGvy/nW0lvEPIWzRX1HacvaZ5d8kL+LbSVuOmW 0zz/yAYKzYvw4UXsh9obKezOT6ZZYsFK7IJgo9ldVV76IrXHlwL9SpuL2sBqnDToYbJy i/DsuI5h0g7X5kKuRdOLteIdKulDajRXGmUYavbRbgIkGwPUgLk29XxRu7SzxXdbcOC3 LawZevbuGS7Zdi/Z6H3orr6UiI0zaMgsqcHdaD+MolwjeTOkcovjSWDBlfJ+HEz2kWDn /45A== X-Gm-Message-State: ANoB5pkaFAG5W7TjHa/1rxPrcMCNixGVBbpap8NoKqjZiLpUZD+FYoam Ge1v/cSJBdqFmGIOFGuEvcngcqBKTqO5AQPYVubYM9M6PbtcU3zXo/pCPfPq9CIaNRQWdUEl1EB ws+G4XxOZK8dfWmM6kiG8GyBroQeY/DeIibNSFd3K72yrWZ980hb3+4YoDR42Uckvp0o= X-Received: by 2002:a05:6402:3644:b0:461:2288:6808 with SMTP id em4-20020a056402364400b0046122886808mr33360199edb.21.1671322014573; Sat, 17 Dec 2022 16:06:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7U65OPq3JD9bf2hA91SrDYzxm9+uUugc/W8Oa/sIFzMaW9+nb5aLvUnR20skPX5Me7ng73pA== X-Received: by 2002:a05:6402:3644:b0:461:2288:6808 with SMTP id em4-20020a056402364400b0046122886808mr33360188edb.21.1671322014196; Sat, 17 Dec 2022 16:06:54 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] KVM: remove support for kernel-irqchip=off Date: Sun, 18 Dec 2022 01:06:46 +0100 Message-Id: <20221218000649.686882-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671322098762100001 Content-Type: text/plain; charset="utf-8" -machine kernel-irqchip=3Doff is broken for many guest OSes; kernel-irqchip= =3Dsplit is the replacement that works, so remove the deprecated support for the for= mer. Signed-off-by: Paolo Bonzini --- docs/about/deprecated.rst | 7 ------- docs/about/removed-features.rst | 7 +++++++ hw/i386/amd_iommu.c | 2 +- hw/i386/intel_iommu.c | 4 ++-- include/hw/i386/apic_internal.h | 2 +- target/i386/cpu-sysemu.c | 15 +++++++++++---- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index b28f50b22fa9..f1575a52cb4d 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -58,13 +58,6 @@ and will cause a warning. The replacement for the ``nodelay`` short-form boolean option is ``nodelay= =3Don`` rather than ``delay=3Doff``. =20 -Userspace local APIC with KVM (x86, since 6.0) -'''''''''''''''''''''''''''''''''''''''''''''' - -Using ``-M kernel-irqchip=3Doff`` with x86 machine types that include a lo= cal -APIC is deprecated. The ``split`` setting is supported, as is using -``-M kernel-irqchip=3Doff`` with the ISA PC machine type. - hexadecimal sizes with scaling multipliers (since 6.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 91c9dce6d6e0..76c2178cd39e 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -625,6 +625,13 @@ MIPS "Trap-and-Emulate" KVM support (removed in 8.0) The MIPS "Trap-and-Emulate" KVM host and guest support was removed from Linux in 2021, and is not supported anymore by QEMU either. =20 +Userspace local APIC with KVM (x86, removed 8.0) +'''''''''''''''''''''''''''''''''''''''''''''''' + +``-M kernel-irqchip=3Doff`` cannot be used on KVM if the CPU model includes +a local APIC. The ``split`` setting is supported, as is using ``-M +kernel-irqchip=3Doff`` when the CPU does not have a local APIC. + System emulator machines ------------------------ =20 diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 725f69095b9e..bcd016f5c5a5 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1368,7 +1368,7 @@ static MemTxResult amdvi_mem_ir_write(void *opaque, h= waddr addr, return MEMTX_ERROR; } =20 - apic_get_class()->send_msi(&to); + apic_get_class(NULL)->send_msi(&to); =20 trace_amdvi_mem_ir_write(to.address, to.data); return MEMTX_OK; diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index a08ee85edf2a..98a5c304a7d7 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -396,7 +396,7 @@ static void vtd_generate_interrupt(IntelIOMMUState *s, = hwaddr mesg_addr_reg, =20 trace_vtd_irq_generate(msi.address, msi.data); =20 - apic_get_class()->send_msi(&msi); + apic_get_class(NULL)->send_msi(&msi); } =20 /* Generate a fault event to software via MSI if conditions are met. @@ -3529,7 +3529,7 @@ static MemTxResult vtd_mem_ir_write(void *opaque, hwa= ddr addr, return MEMTX_ERROR; } =20 - apic_get_class()->send_msi(&to); + apic_get_class(NULL)->send_msi(&to); =20 return MEMTX_OK; } diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_interna= l.h index c175e7e71816..968b6648b3a4 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -226,6 +226,6 @@ static inline int apic_get_bit(uint32_t *tab, int index) return !!(tab[i] & mask); } =20 -APICCommonClass *apic_get_class(void); +APICCommonClass *apic_get_class(Error **errp); =20 #endif /* QEMU_APIC_INTERNAL_H */ diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c index fc97213a73cf..28115edf44f7 100644 --- a/target/i386/cpu-sysemu.c +++ b/target/i386/cpu-sysemu.c @@ -247,12 +247,16 @@ void x86_cpu_machine_reset_cb(void *opaque) cpu_reset(CPU(cpu)); } =20 -APICCommonClass *apic_get_class(void) +APICCommonClass *apic_get_class(Error **errp) { const char *apic_type =3D "apic"; =20 /* TODO: in-kernel irqchip for hvf */ - if (kvm_apic_in_kernel()) { + if (kvm_enabled()) { + if (!kvm_apic_in_kernel()) { + error_setg(errp, "KVM does not support userspace APIC"); + return NULL; + } apic_type =3D "kvm-apic"; } else if (xen_enabled()) { apic_type =3D "xen-apic"; @@ -266,10 +270,13 @@ APICCommonClass *apic_get_class(void) void x86_cpu_apic_create(X86CPU *cpu, Error **errp) { APICCommonState *apic; - ObjectClass *apic_class =3D OBJECT_CLASS(apic_get_class()); + APICCommonClass *apic_class =3D apic_get_class(errp); =20 - cpu->apic_state =3D DEVICE(object_new_with_class(apic_class)); + if (!apic_class) { + return; + } =20 + cpu->apic_state =3D DEVICE(object_new_with_class(OBJECT_CLASS(apic_cla= ss))); object_property_add_child(OBJECT(cpu), "lapic", OBJECT(cpu->apic_state)); object_unref(OBJECT(cpu->apic_state)); --=20 2.38.1