From nobody Mon Sep 16 19:44:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1693923920; cv=none; d=zohomail.com; s=zohoarc; b=cafA8FkOy9qdVT+3GO5g+jvfj0ogT99/xR7aRGHCLAkdFOwC3t2be0Ao2hqJij5k9dwxNx1OPYAoOI7kEMLxtvqQIV73UYdjoJyhgOhSkfQFM5UgsZY3EmcscnBcLVoQmUthrBEQYesK29jq8erbtblIfBEavgna+CbeFAGGu1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693923920; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uAW6s5ro8Cbl6WCmzQnHglBhydFY72tBuk1tGZ8DzrU=; b=Wzq4wqypoEMdpi3EhO0gnrZt3iSV9clrnG2TPxB7YbEKjBEBIaIZb9vwXmpRuORQjNBe9jSnwn9Pr87B1a4BFOcqDArn/w7Trc9wNt82aYJbU+1kNrnIg/dkToxQlDNqQpxvlFThykcjgLRn7aGn37OKHVMZs3O9YMaGzlTFZ5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1693923920516838.597503608065; Tue, 5 Sep 2023 07:25:20 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-504-lxm3h4vgOsKjo1rCY3u3mQ-1; Tue, 05 Sep 2023 10:24:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B0C4280770A; Tue, 5 Sep 2023 14:24:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E918640C6CCC; Tue, 5 Sep 2023 14:24:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B0D6D1946595; Tue, 5 Sep 2023 14:24:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 618AE1946595 for ; Tue, 5 Sep 2023 14:24:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5435D1121319; Tue, 5 Sep 2023 14:24:30 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8A7A1012F13 for ; Tue, 5 Sep 2023 14:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693923919; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uAW6s5ro8Cbl6WCmzQnHglBhydFY72tBuk1tGZ8DzrU=; b=ahJIKbXkN6YMwEsoNz6K9Eh48hYP1dUtasFaT9tmk5fjC1MdQ85GzwnMzs4baB5nFqxRJ5 XyPpEsvKE9W3IahFUlBUgn81sMzcjDyNm24Ew8IUWWTbeAe76bDREc6gC51bMZ+/ZOTo92 vnNR5sLmKswR9hGSQkzWqIV4Wgqc+2k= X-MC-Unique: lxm3h4vgOsKjo1rCY3u3mQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/51] qemu: Always assume support for QEMU_CAPS_CPU_CACHE Date: Tue, 5 Sep 2023 16:23:34 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693923921363100001 Content-Type: text/plain; charset="utf-8" All supported qemu versions have this feature and it can't be compiled out. The logic is a bit more complex in this instance as the flag is asserted if: if (ARCH_IS_X86(qemuCaps->arch) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_CACHE); } Now QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION is available since qemu-2.8 but only on certain architectures, thus we need to keep the flag itself, but x86_64 is one of them. The flag can be also assumed as qemuValidateDomainDefCpu rejects any cache config on non-x86 arches. Remove any use of the capability and drop the impossible test cases. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 ++-- .../qemuxml2argvdata/cpu-cache-disable2.args | 32 ------------------- tests/qemuxml2argvdata/cpu-cache-disable2.xml | 20 ------------ .../cpu-cache-passthrough2.args | 32 ------------------- .../cpu-cache-passthrough2.xml | 20 ------------ tests/qemuxml2argvtest.c | 10 +++--- 6 files changed, 6 insertions(+), 114 deletions(-) delete mode 100644 tests/qemuxml2argvdata/cpu-cache-disable2.args delete mode 100644 tests/qemuxml2argvdata/cpu-cache-disable2.xml delete mode 100644 tests/qemuxml2argvdata/cpu-cache-passthrough2.args delete mode 100644 tests/qemuxml2argvdata/cpu-cache-passthrough2.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f7079c6920..a912ed064f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6560,12 +6560,10 @@ qemuBuildCpuCommandLine(virCommand *cmd, if (hostOff && (def->cpu->mode =3D=3D VIR_CPU_MODE_HOST_PASSTHROUGH || - def->cpu->mode =3D=3D VIR_CPU_MODE_MAXIMUM) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_CACHE)) + def->cpu->mode =3D=3D VIR_CPU_MODE_MAXIMUM)) virBufferAddLit(&buf, ",host-cache-info=3Doff"); - if (l3Off && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_CACHE)) + if (l3Off) virBufferAddLit(&buf, ",l3-cache=3Doff"); } diff --git a/tests/qemuxml2argvdata/cpu-cache-disable2.args b/tests/qemuxml= 2argvdata/cpu-cache-disable2.args deleted file mode 100644 index adfad725aa..0000000000 --- a/tests/qemuxml2argvdata/cpu-cache-disable2.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/var/lib/libvirt/qemu/domain--1-foo \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.local/share \ -XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.cache \ -XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.config \ -/usr/bin/qemu-system-x86_64 \ --name guest=3Dfoo,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/var/lib/libvirt/qemu/d= omain--1-foo/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel kvm \ --cpu host \ --m size=3D219136k \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/cpu-cache-disable2.xml b/tests/qemuxml2= argvdata/cpu-cache-disable2.xml deleted file mode 100644 index e6f39951ca..0000000000 --- a/tests/qemuxml2argvdata/cpu-cache-disable2.xml +++ /dev/null @@ -1,20 +0,0 @@ - - foo - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - - - - destroy - restart - destroy - - - diff --git a/tests/qemuxml2argvdata/cpu-cache-passthrough2.args b/tests/qem= uxml2argvdata/cpu-cache-passthrough2.args deleted file mode 100644 index 37b27e450a..0000000000 --- a/tests/qemuxml2argvdata/cpu-cache-passthrough2.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/var/lib/libvirt/qemu/domain--1-foo \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.local/share \ -XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.cache \ -XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.config \ -/usr/bin/qemu-system-x86_64 \ --name guest=3Dfoo,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/var/lib/libvirt/qemu/d= omain--1-foo/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel kvm \ --cpu host,host-cache-info=3Don \ --m size=3D219136k \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/cpu-cache-passthrough2.xml b/tests/qemu= xml2argvdata/cpu-cache-passthrough2.xml deleted file mode 100644 index 74846fdd31..0000000000 --- a/tests/qemuxml2argvdata/cpu-cache-passthrough2.xml +++ /dev/null @@ -1,20 +0,0 @@ - - foo - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - - - - destroy - restart - destroy - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8238dceed8..8afb2bf2be 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2521,12 +2521,10 @@ mymain(void) DO_TEST("cpu-check-default-partial", QEMU_CAPS_KVM); DO_TEST("cpu-check-default-partial2", QEMU_CAPS_KVM); - DO_TEST("cpu-cache-disable", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); - DO_TEST("cpu-cache-disable2", QEMU_CAPS_KVM); - DO_TEST("cpu-cache-disable3", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); - DO_TEST("cpu-cache-passthrough", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); - DO_TEST("cpu-cache-passthrough2", QEMU_CAPS_KVM); - DO_TEST("cpu-cache-emulate-l3", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); + DO_TEST("cpu-cache-disable", QEMU_CAPS_KVM); + DO_TEST("cpu-cache-disable3", QEMU_CAPS_KVM); + DO_TEST("cpu-cache-passthrough", QEMU_CAPS_KVM); + DO_TEST("cpu-cache-emulate-l3", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM); --=20 2.41.0