From nobody Mon Feb 9 10:57:46 2026 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=1606896869; cv=none; d=zohomail.com; s=zohoarc; b=EL8jGxejTsrGJTlh+zoj0AnLt4ctJCXkCyfFYZorptqe/dNHGJIAw8HWwk/ykcLqRsU+Hu3lzdwmEM4leVHe4sGDC4tNOE3z1kSa9ST63d1L1DuW0Rkb2tiYCvvABVZKKZac8hTOhCJ/kKgbQ132w+fLqNcPL4Hh41yiq1hTEgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896869; 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=nAxOtOxEPNTxDE74odT2222Bo+Aoav0OWXThU1kmKt4=; b=XZmfZWNBd5JRGKTs/9TrlFcbjhYZKJKstxSqTwxPzeW9530ih40ly2MgBY3b6uDHDXU8WIiALUq9koU/3uWd0k+XHYsDEBIbHunf7I7gKwgRksy+EDyfiR7XXm2VNJjKkRZ8FpoTCuCND6nW2Qbaa58149rXXirCBHTMKa1KySk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896869266195.9118008907776; Wed, 2 Dec 2020 00:14:29 -0800 (PST) Received: from localhost ([::1]:50312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNHP-0008Go-4H for importer@patchew.org; Wed, 02 Dec 2020 03:14:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC7-0002Pj-D8 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC4-0003ZH-94 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:59 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-iTg2wgV6O5CRd0mbnlt5VA-1; Wed, 02 Dec 2020 03:08:51 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE63E185E489 for ; Wed, 2 Dec 2020 08:08:50 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA15C10013BD for ; Wed, 2 Dec 2020 08:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896535; 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: in-reply-to:in-reply-to:references:references; bh=nAxOtOxEPNTxDE74odT2222Bo+Aoav0OWXThU1kmKt4=; b=JWhEUwLvbDXsGM6flZfEW79RmqPcGavqjSmCWCedc1WApYb+FnMtZMbLMGB7g6CThoWt0h mVHytUIpXvmViFUo0iECYLUEYJ/wil8LP18BRUyfVZRAR+WAPOb6N5tAAHvWuzOvxB+nnN JqyFv9B7P60sFlzHbwMr1WsT9je4JxI= X-MC-Unique: iTg2wgV6O5CRd0mbnlt5VA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 001/113] target/i386: fix operand order for PDEP and PEXT Date: Wed, 2 Dec 2020 03:06:57 -0500 Message-Id: <20201202080849.4125477-2-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For PDEP and PEXT, the mask is provided in the memory (mod+r/m) operand, and therefore is loaded in s->T0 by gen_ldst_modrm. The source is provided in the second source operand (VEX.vvvv) and therefore is loaded in s->T1. Fix the order in which they are passed to the helpers. Reported-by: Lenard Szolnoki Analyzed-by: Lenard Szolnoki Fixes: https://bugs.launchpad.net/qemu/+bug/1605123 Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 8 +++---- tests/tcg/i386/Makefile.target | 3 +++ tests/tcg/i386/test-i386-bmi2.c | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 tests/tcg/i386/test-i386-bmi2.c diff --git a/target/i386/translate.c b/target/i386/translate.c index 4c57307e42..e8f5f5803a 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -3936,14 +3936,14 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, } ot =3D mo_64_32(s->dflag); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); - /* Note that by zero-extending the mask operand, we + /* Note that by zero-extending the source operand, we automatically handle zero-extending the result. */ if (ot =3D=3D MO_64) { tcg_gen_mov_tl(s->T1, cpu_regs[s->vex_v]); } else { tcg_gen_ext32u_tl(s->T1, cpu_regs[s->vex_v]); } - gen_helper_pdep(cpu_regs[reg], s->T0, s->T1); + gen_helper_pdep(cpu_regs[reg], s->T1, s->T0); break; =20 case 0x2f5: /* pext Gy, By, Ey */ @@ -3954,14 +3954,14 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, } ot =3D mo_64_32(s->dflag); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); - /* Note that by zero-extending the mask operand, we + /* Note that by zero-extending the source operand, we automatically handle zero-extending the result. */ if (ot =3D=3D MO_64) { tcg_gen_mov_tl(s->T1, cpu_regs[s->vex_v]); } else { tcg_gen_ext32u_tl(s->T1, cpu_regs[s->vex_v]); } - gen_helper_pext(cpu_regs[reg], s->T0, s->T1); + gen_helper_pext(cpu_regs[reg], s->T1, s->T0); break; =20 case 0x1f6: /* adcx Gy, Ey */ diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index a66232a67d..ad187cb2c9 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -18,6 +18,9 @@ test-i386-pcmpistri: CFLAGS +=3D -msse4.2 run-test-i386-pcmpistri: QEMU_OPTS +=3D -cpu max run-plugin-test-i386-pcmpistri-%: QEMU_OPTS +=3D -cpu max =20 +run-test-i386-bmi2: QEMU_OPTS +=3D -cpu max +run-plugin-test-i386-bmi2-%: QEMU_OPTS +=3D -cpu max + # # hello-i386 is a barebones app # diff --git a/tests/tcg/i386/test-i386-bmi2.c b/tests/tcg/i386/test-i386-bmi= 2.c new file mode 100644 index 0000000000..d80a859565 --- /dev/null +++ b/tests/tcg/i386/test-i386-bmi2.c @@ -0,0 +1,39 @@ +/* See if various BMI2 instructions give expected results */ +#include +#include + +int main(int argc, char *argv[]) { + uint64_t ehlo =3D 0x202020204f4c4845ull; + uint64_t mask =3D 0xa080800302020001ull; + uint64_t result64; + uint32_t result32; + + /* 64 bits */ + asm volatile ("pextq %2, %1, %0" : "=3Dr"(result64) : "r"(ehlo), "m"= (mask)); + assert(result64 =3D=3D 133); + + asm volatile ("pdepq %2, %1, %0" : "=3Dr"(result64) : "r"(result64),= "m"(mask)); + assert(result64 =3D=3D (ehlo & mask)); + + asm volatile ("pextq %2, %1, %0" : "=3Dr"(result64) : "r"(-1ull), "m= "(mask)); + assert(result64 =3D=3D 511); /* mask has 9 bits set */ + + asm volatile ("pdepq %2, %1, %0" : "=3Dr"(result64) : "r"(-1ull), "m= "(mask)); + assert(result64 =3D=3D mask); + + /* 32 bits */ + asm volatile ("pextl %2, %k1, %k0" : "=3Dr"(result32) : "r"(ehlo), "= m"(mask)); + assert(result32 =3D=3D 5); + + asm volatile ("pdepl %2, %k1, %k0" : "=3Dr"(result32) : "r"(result32= ), "m"(mask)); + assert(result32 =3D=3D (uint32_t)(ehlo & mask)); + + asm volatile ("pextl %2, %k1, %k0" : "=3Dr"(result32) : "r"(-1ull), = "m"(mask)); + assert(result32 =3D=3D 7); /* mask has 3 bits set */ + + asm volatile ("pdepl %2, %k1, %k0" : "=3Dr"(result32) : "r"(-1ull), = "m"(mask)); + assert(result32 =3D=3D (uint32_t)mask); + + return 0; +} + --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896708; cv=none; d=zohomail.com; s=zohoarc; b=chqP9la4/glFDvwpgLe/Q6oshjpv/JBdsVICNr0UDvPZ4Ik79fTH82mfTzuDYFN19tY9ShM1JsIcm6nbcdzodaMNFFo/kSKp7edErzIZUAtvsjTzE+sM5nfxEIr26mwOH4N+YdAHhV6fCpoKRp25jwZgs8+NBaCIDx/hQBI/9IA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896708; 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=qh1pgLbZYNKFAQQ52d/foidqc28d8nhtKPsJsy26rY4=; b=aKaDnDsOZkUU6nc2Luu2T03lI4+5T4nlWJPPNVrG3LsZztjlY1DNf4qwCOm9hqs5GAhWLITcZJd18T8Hk5fGpA6CGfZh1TOi1ezIIKmLZXAkv0EKY2yI0U+fj6ADPH7m36gy06HXDxKFb3vMG99VUi+WTR+dj3f7mpyJrQzt6Zw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896708797372.59077037247675; Wed, 2 Dec 2020 00:11:48 -0800 (PST) Received: from localhost ([::1]:41600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNEp-0004hV-MK for importer@patchew.org; Wed, 02 Dec 2020 03:11:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC5-0002Ol-P3 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC3-0003Yy-M1 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-xO0QE1yPNBul0N_kV0ZKkg-1; Wed, 02 Dec 2020 03:08:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AA5B1006C81 for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15FE910013BD for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896534; 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: in-reply-to:in-reply-to:references:references; bh=qh1pgLbZYNKFAQQ52d/foidqc28d8nhtKPsJsy26rY4=; b=T0JEO9JdR9LI6in2WBaOyW2ZTq46aN7Yn6ytRDKJTL4Bi8gwRCObcIu3c4SohkspGuuc+o 0oaRAkEBS6LmAlAAu18JxRBwMnPoX7i3Su7e1RJ86TYDuAjKTLTwb2S5KfMc9Sl8B8kmxx E8jDVoONm1KkYV7uDo/bktoQbpTyHnA= X-MC-Unique: xO0QE1yPNBul0N_kV0ZKkg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 002/113] target/i386: Support up to 32768 CPUs without IRQ remapping Date: Wed, 2 Dec 2020 03:06:58 -0500 Message-Id: <20201202080849.4125477-3-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: David Woodhouse The IOAPIC has an 'Extended Destination ID' field in its RTE, which maps to bits 11-4 of the MSI address. Since those address bits fall within a given 4KiB page they were historically non-trivial to use on real hardware. The Intel IOMMU uses the lowest bit to indicate a remappable format MSI, and then the remaining 7 bits are part of the index. Where the remappable format bit isn't set, we can actually use the other seven to allow external (IOAPIC and MSI) interrupts to reach up to 32768 CPUs instead of just the 255 permitted on bare metal. Signed-off-by: David Woodhouse Message-Id: <78097f9218300e63e751e077a0a5ca029b56ba46.camel@infradead.org> Signed-off-by: Paolo Bonzini --- hw/i386/kvm/apic.c | 7 ++ hw/i386/pc.c | 16 ++--- include/standard-headers/asm-x86/kvm_para.h | 1 + target/i386/cpu.c | 5 +- target/i386/kvm.c | 74 +++++++++++++++------ target/i386/kvm_i386.h | 2 + 6 files changed, 75 insertions(+), 30 deletions(-) diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c index dd29906061..b226b674e8 100644 --- a/hw/i386/kvm/apic.c +++ b/hw/i386/kvm/apic.c @@ -183,6 +183,13 @@ static void kvm_send_msi(MSIMessage *msg) { int ret; =20 + /* + * The message has already passed through interrupt remapping if enabl= ed, + * but the legacy extended destination ID in low bits still needs to be + * handled. + */ + msg->address =3D kvm_swizzle_msi_ext_dest_id(msg->address); + ret =3D kvm_irqchip_send_msi(kvm_state, *msg); if (ret < 0) { fprintf(stderr, "KVM: injection failed, MSI lost (%s)\n", diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 17b514d1da..544db900d3 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -99,6 +99,7 @@ =20 GlobalProperty pc_compat_5_1[] =3D { { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, + { TYPE_X86_CPU, "kvm-msi-ext-dest-id", "off" }, }; const size_t pc_compat_5_1_len =3D G_N_ELEMENTS(pc_compat_5_1); =20 @@ -807,17 +808,12 @@ void pc_machine_done(Notifier *notifier, void *data) fw_cfg_modify_i16(x86ms->fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); } =20 - if (x86ms->apic_id_limit > 255 && !xen_enabled()) { - IntelIOMMUState *iommu =3D INTEL_IOMMU_DEVICE(x86_iommu_get_defaul= t()); =20 - if (!iommu || !x86_iommu_ir_supported(X86_IOMMU_DEVICE(iommu)) || - iommu->intr_eim !=3D ON_OFF_AUTO_ON) { - error_report("current -smp configuration requires " - "Extended Interrupt Mode enabled. " - "You can add an IOMMU using: " - "-device intel-iommu,intremap=3Don,eim=3Don"); - exit(EXIT_FAILURE); - } + if (x86ms->apic_id_limit > 255 && !xen_enabled() && + !kvm_irqchip_in_kernel()) { + error_report("current -smp configuration requires kernel " + "irqchip support."); + exit(EXIT_FAILURE); } } =20 diff --git a/include/standard-headers/asm-x86/kvm_para.h b/include/standard= -headers/asm-x86/kvm_para.h index 07877d3295..215d01b4ec 100644 --- a/include/standard-headers/asm-x86/kvm_para.h +++ b/include/standard-headers/asm-x86/kvm_para.h @@ -32,6 +32,7 @@ #define KVM_FEATURE_POLL_CONTROL 12 #define KVM_FEATURE_PV_SCHED_YIELD 13 #define KVM_FEATURE_ASYNC_PF_INT 14 +#define KVM_FEATURE_MSI_EXT_DEST_ID 15 =20 #define KVM_HINTS_REALTIME 0 =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5a8c96072e..b90ed05897 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -799,7 +799,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS]= =3D { "kvmclock", "kvm-nopiodelay", "kvm-mmu", "kvmclock", "kvm-asyncpf", "kvm-steal-time", "kvm-pv-eoi", "kvm-pv-unhalt", NULL, "kvm-pv-tlb-flush", NULL, "kvm-pv-ipi", - "kvm-poll-control", "kvm-pv-sched-yield", "kvm-asyncpf-int", N= ULL, + "kvm-poll-control", "kvm-pv-sched-yield", "kvm-asyncpf-int", "= kvm-msi-ext-dest-id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "kvmclock-stable-bit", NULL, NULL, NULL, @@ -4114,6 +4114,7 @@ static PropValue kvm_default_props[] =3D { { "kvm-pv-eoi", "on" }, { "kvmclock-stable-bit", "on" }, { "x2apic", "on" }, + { "kvm-msi-ext-dest-id", "off" }, { "acpi", "off" }, { "monitor", "off" }, { "svm", "off" }, @@ -5140,6 +5141,8 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUMod= el *model) if (kvm_enabled()) { if (!kvm_irqchip_in_kernel()) { x86_cpu_change_kvm_default("x2apic", "off"); + } else if (kvm_irqchip_is_split() && kvm_enable_x2apic()) { + x86_cpu_change_kvm_default("kvm-msi-ext-dest-id", "on"); } =20 x86_cpu_apply_props(cpu, kvm_default_props); diff --git a/target/i386/kvm.c b/target/i386/kvm.c index a2934dda02..4531c50656 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -416,6 +416,9 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint= 32_t function, if (!kvm_irqchip_in_kernel()) { ret &=3D ~(1U << KVM_FEATURE_PV_UNHALT); } + if (kvm_irqchip_is_split()) { + ret |=3D 1U << KVM_FEATURE_MSI_EXT_DEST_ID; + } } else if (function =3D=3D KVM_CPUID_FEATURES && reg =3D=3D R_EDX) { ret |=3D 1U << KVM_HINTS_REALTIME; } @@ -4589,38 +4592,71 @@ int kvm_arch_irqchip_create(KVMState *s) } } =20 +uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address) +{ + CPUX86State *env =3D &X86_CPU(first_cpu)->env; + uint64_t ext_id; + + if (!first_cpu || + !(env->features[FEAT_KVM] & (1 << KVM_FEATURE_MSI_EXT_DEST_ID)= )) { + return address; + } + + /* + * If the remappable format bit is set, or the upper bits are + * already set in address_hi, or the low extended bits aren't + * there anyway, do nothing. + */ + ext_id =3D address & (0xff << MSI_ADDR_DEST_IDX_SHIFT); + if (!ext_id || (ext_id & (1 << MSI_ADDR_DEST_IDX_SHIFT)) || + (address >> 32)) + return address; + + address &=3D ~ext_id; + address |=3D ext_id << 35; + return address; +} + int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, uint64_t address, uint32_t data, PCIDevice *d= ev) { X86IOMMUState *iommu =3D x86_iommu_get_default(); =20 if (iommu) { - int ret; - MSIMessage src, dst; X86IOMMUClass *class =3D X86_IOMMU_DEVICE_GET_CLASS(iommu); =20 - if (!class->int_remap) { - return 0; - } + if (class->int_remap) { + int ret; + MSIMessage src, dst; =20 - src.address =3D route->u.msi.address_hi; - src.address <<=3D VTD_MSI_ADDR_HI_SHIFT; - src.address |=3D route->u.msi.address_lo; - src.data =3D route->u.msi.data; + src.address =3D route->u.msi.address_hi; + src.address <<=3D VTD_MSI_ADDR_HI_SHIFT; + src.address |=3D route->u.msi.address_lo; + src.data =3D route->u.msi.data; =20 - ret =3D class->int_remap(iommu, &src, &dst, dev ? \ - pci_requester_id(dev) : \ - X86_IOMMU_SID_INVALID); - if (ret) { - trace_kvm_x86_fixup_msi_error(route->gsi); - return 1; - } + ret =3D class->int_remap(iommu, &src, &dst, dev ? \ + pci_requester_id(dev) : \ + X86_IOMMU_SID_INVALID); + if (ret) { + trace_kvm_x86_fixup_msi_error(route->gsi); + return 1; + } + + /* + * Handled untranslated compatibilty format interrupt with + * extended destination ID in the low bits 11-5. */ + dst.address =3D kvm_swizzle_msi_ext_dest_id(dst.address); =20 - route->u.msi.address_hi =3D dst.address >> VTD_MSI_ADDR_HI_SHIFT; - route->u.msi.address_lo =3D dst.address & VTD_MSI_ADDR_LO_MASK; - route->u.msi.data =3D dst.data; + route->u.msi.address_hi =3D dst.address >> VTD_MSI_ADDR_HI_SHI= FT; + route->u.msi.address_lo =3D dst.address & VTD_MSI_ADDR_LO_MASK; + route->u.msi.data =3D dst.data; + return 0; + } } =20 + address =3D kvm_swizzle_msi_ext_dest_id(address); + route->u.msi.address_hi =3D address >> VTD_MSI_ADDR_HI_SHIFT; + route->u.msi.address_lo =3D address & VTD_MSI_ADDR_LO_MASK; return 0; } =20 diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index a4a619cebb..dc72508389 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -48,4 +48,6 @@ bool kvm_has_waitpkg(void); =20 bool kvm_hv_vpindex_settable(void); =20 +uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address); + #endif --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896707; cv=none; d=zohomail.com; s=zohoarc; b=DpJHzEplHdbNIBvbPdayTy1bAsMbh2gR3w7PSpAm4VANOxT09wSQLfYA9++hq/j27s4kWNg87kS2vWBczDbFpmLbf9OzAJI9SaDKdm2yrytLgWAPqoRHz39axjAUYJ2tJH7EfvKCXV7DYAoF1PF+0c6DqVyR8wNiudtaXAFawis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896707; 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=6L3C5VmH/yEj3gFyYIERhtGdgIC1jmMOPDs35NrC1mc=; b=BcEKtUNUrJDw5whWgfcpUUVd83mrT853bJ0jyIIQP+L9baP0f3pSvyXX8dV0B4hf3bS81Hbul64DeqME5WRSMkIH4PrImyaZu5YlGS6eoeNlCDw02OSFordib/Bbzrl+tSZAnyZCUw5PHcghaZhAM7dcGybZzCQISRPqqBm0Axc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896707384753.1464880463368; Wed, 2 Dec 2020 00:11:47 -0800 (PST) Received: from localhost ([::1]:41452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNEo-0004d4-00 for importer@patchew.org; Wed, 02 Dec 2020 03:11:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC4-0002Od-UU for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC3-0003Yt-74 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:56 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-5tFkyzG5OJqfS8wRP8E04Q-1; Wed, 02 Dec 2020 03:08:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99DAE5708A for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6594110013BD for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896534; 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: in-reply-to:in-reply-to:references:references; bh=6L3C5VmH/yEj3gFyYIERhtGdgIC1jmMOPDs35NrC1mc=; b=KVjHeT25oDQolc/c6WEeuFO7D/Q8qK7nl93wyi78ijbkJVAo6clSQ18Bc10PwDH3P+dy/j C0VKc7U6qdQgIn6oxscOvE4M541WRG/8qz48txJ8nCZ00cfgC+dZSBbwOkUW57TMlJo7Qd B1QTZPpZJUc0zQbjehuuIt24CUoanak= X-MC-Unique: 5tFkyzG5OJqfS8wRP8E04Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 003/113] target/i386: seg_helper: Correct segement selector nullification in the RET/IRET helper Date: Wed, 2 Dec 2020 03:06:59 -0500 Message-Id: <20201202080849.4125477-4-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Bin Meng Per the SDM, when returning to outer privilege level, for segment registers (ES, FS, GS, and DS) if the check fails, the segment selector becomes null, but QEMU clears the base/limit/flags as well as nullifying the segment selector, which should be a spec violation. Real hardware seems to be compliant with the spec, at least on one Coffee Lake board I tested. Signed-off-by: Bin Meng Message-Id: <1605261378-77971-1-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Paolo Bonzini --- target/i386/seg_helper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 09b6554660..e6ffa1f018 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -2108,7 +2108,10 @@ static inline void validate_seg(CPUX86State *env, in= t seg_reg, int cpl) if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) { /* data or non conforming code segment */ if (dpl < cpl) { - cpu_x86_load_seg_cache(env, seg_reg, 0, 0, 0, 0); + cpu_x86_load_seg_cache(env, seg_reg, 0, + env->segs[seg_reg].base, + env->segs[seg_reg].limit, + env->segs[seg_reg].flags & ~DESC_P_MASK= ); } } } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897035; cv=none; d=zohomail.com; s=zohoarc; b=NBA6p4vyJ9dZihCqxYBggrtBwh6LRZSRYhDCY+bHE48Ct9zOUhXFu/js36Rf+oEVmrRlX+7QdVrXiemOFMYY6+7ZcJO54oCKua6SfWeORgNkJaF2YjWDxm2OKdEnHVEiuKFNuFyqfLXJbAYSLjZRXItEfLNShmfQeaZD+yywOqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897035; 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=+LpCbRfhUGl9rIWa5QP0bNWz8U8C84+G4L60FjY3CEg=; b=JzVkmsrQnNJUSzmCF+I3qMKrifaNcUdzeplOeso7QBqsojNEys+Y0xg//kH+7JqjBN7US9evoBlSC3Ly6Spe+/4O+sa/ZqbTWdQjgfqt+uAvivDv1ixG3DQYeuX3MLwUftbCubqfKA8qUyX85QNjq6rdwd9WEY9VVLScnK1so8Y= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897035255247.92282475237857; Wed, 2 Dec 2020 00:17:15 -0800 (PST) Received: from localhost ([::1]:58432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNK6-0003Gc-0D for importer@patchew.org; Wed, 02 Dec 2020 03:17:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC8-0002RD-9J for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC3-0003Yz-Mh for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:00 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-cAaV3nyZNlqrjdVZO2mmug-1; Wed, 02 Dec 2020 03:08:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAB4E5708B for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63C810013BD for ; Wed, 2 Dec 2020 08:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896534; 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: in-reply-to:in-reply-to:references:references; bh=+LpCbRfhUGl9rIWa5QP0bNWz8U8C84+G4L60FjY3CEg=; b=M7csxlTBY62atrcizUP4MtuHYbLFO7uTAnOMH1UkJUntwHWUSUQBufrrjNZINgJ7NtbGNc lRlkZukpwTuDxsWvJMxJ5+5M+PJTQmPCgAE9Ogz7MNnt35wiswRHIEQBdOTl14OOUzRUHV 2rKQtyb9fd00E/62LIfhPmsuNlqkuBU= X-MC-Unique: cAaV3nyZNlqrjdVZO2mmug-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 004/113] WHPX: support for the kernel-irqchip on/off Date: Wed, 2 Dec 2020 03:07:00 -0500 Message-Id: <20201202080849.4125477-5-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Sunil Muthuswamy This patch adds support the kernel-irqchip option for WHPX with on or off value. 'split' value is not supported for the option. The option only works for the latest version of Windows (ones that are coming out on Insiders). The change maintains backward compatibility on older version of Windows where this option is not supported. Signed-off-by: Sunil Muthuswamy Message-Id: Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + hw/i386/x86.c | 6 +- include/sysemu/whpx.h | 22 +++ softmmu/cpus.c | 3 +- softmmu/vl.c | 8 +- target/i386/cpu.c | 3 + target/i386/meson.build | 1 + target/i386/whp-dispatch.h | 9 +- target/i386/whpx-all.c | 291 ++++++++++++++++++++++++++++++++----- target/i386/whpx-apic.c | 274 ++++++++++++++++++++++++++++++++++ 10 files changed, 578 insertions(+), 40 deletions(-) create mode 100644 target/i386/whpx-apic.c diff --git a/MAINTAINERS b/MAINTAINERS index 68bc160f41..15113505b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -452,6 +452,7 @@ WHPX CPUs M: Sunil Muthuswamy S: Supported F: target/i386/whpx-all.c +F: target/i386/whpx-apic.c F: target/i386/whpx-cpus.c F: target/i386/whp-dispatch.h F: accel/stubs/whpx-stub.c diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 5944fc44ed..6d5c1432f2 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -31,6 +31,7 @@ #include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" #include "sysemu/qtest.h" +#include "sysemu/whpx.h" #include "sysemu/numa.h" #include "sysemu/replay.h" #include "sysemu/sysemu.h" @@ -532,7 +533,8 @@ static void pic_irq_request(void *opaque, int irq, int = level) X86CPU *cpu =3D X86_CPU(cs); =20 trace_x86_pic_interrupt(irq, level); - if (cpu->apic_state && !kvm_irqchip_in_kernel()) { + if (cpu->apic_state && !kvm_irqchip_in_kernel() && + !whpx_apic_in_platform()) { CPU_FOREACH(cs) { cpu =3D X86_CPU(cs); if (apic_accept_pic_intr(cpu->apic_state)) { @@ -558,7 +560,7 @@ int cpu_get_pic_interrupt(CPUX86State *env) X86CPU *cpu =3D env_archcpu(env); int intno; =20 - if (!kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_in_kernel() && !whpx_apic_in_platform()) { intno =3D apic_get_interrupt(cpu->apic_state); if (intno >=3D 0) { return intno; diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h index 59edf13742..9346fd92e9 100644 --- a/include/sysemu/whpx.h +++ b/include/sysemu/whpx.h @@ -15,11 +15,33 @@ =20 #ifdef CONFIG_WHPX =20 +#include "whp-dispatch.h" + +struct whpx_state { + uint64_t mem_quota; + WHV_PARTITION_HANDLE partition; + bool kernel_irqchip_allowed; + bool kernel_irqchip_required; + bool apic_in_platform; +}; + +struct whpx_lapic_state { + struct { + uint32_t data; + uint32_t padding[3]; + } fields[256]; +}; + +extern struct whpx_state whpx_global; int whpx_enabled(void); =20 +void whpx_apic_get(DeviceState *s); +#define whpx_apic_in_platform() (whpx_global.apic_in_platform) + #else /* CONFIG_WHPX */ =20 #define whpx_enabled() (0) +#define whpx_apic_in_platform() (0) =20 #endif /* CONFIG_WHPX */ =20 diff --git a/softmmu/cpus.c b/softmmu/cpus.c index e46ac68ad0..1dc20b9dc3 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -41,6 +41,7 @@ #include "sysemu/replay.h" #include "sysemu/runstate.h" #include "sysemu/cpu-timers.h" +#include "sysemu/whpx.h" #include "hw/boards.h" #include "hw/hw.h" =20 @@ -88,7 +89,7 @@ bool cpu_thread_is_idle(CPUState *cpu) return true; } if (!cpu->halted || cpu_has_work(cpu) || - kvm_halt_in_kernel()) { + kvm_halt_in_kernel() || whpx_apic_in_platform()) { return false; } return true; diff --git a/softmmu/vl.c b/softmmu/vl.c index e6e0ad5a92..bbe65d3742 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2501,11 +2501,15 @@ static int machine_set_property(void *opaque, object_register_sugar_prop(ACCEL_CLASS_NAME("xen"), qom_name, valu= e); return 0; } - if (g_str_equal(qom_name, "kvm-shadow-mem") || - g_str_equal(qom_name, "kernel-irqchip")) { + if (g_str_equal(qom_name, "kvm-shadow-mem")) { object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), qom_name, valu= e); return 0; } + if (g_str_equal(qom_name, "kernel-irqchip")) { + object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), qom_name, valu= e); + object_register_sugar_prop(ACCEL_CLASS_NAME("whpx"), qom_name, val= ue); + return 0; + } =20 return object_parse_property_opt(opaque, name, value, "type", errp); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b90ed05897..af48e3f79e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -30,6 +30,7 @@ #include "sysemu/hvf.h" #include "sysemu/cpus.h" #include "sysemu/xen.h" +#include "sysemu/whpx.h" #include "kvm_i386.h" #include "sev_i386.h" =20 @@ -6148,6 +6149,8 @@ APICCommonClass *apic_get_class(void) apic_type =3D "kvm-apic"; } else if (xen_enabled()) { apic_type =3D "xen-apic"; + } else if (whpx_apic_in_platform()) { + apic_type =3D "whpx-apic"; } =20 return APIC_COMMON_CLASS(object_class_by_name(apic_type)); diff --git a/target/i386/meson.build b/target/i386/meson.build index a1a02f3e99..fc3ee80386 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -33,6 +33,7 @@ i386_softmmu_ss.add(when: 'CONFIG_KVM', if_true: files('k= vm.c')) i386_softmmu_ss.add(when: 'CONFIG_WHPX', if_true: files( 'whpx-all.c', 'whpx-cpus.c', + 'whpx-apic.c', )) i386_softmmu_ss.add(when: 'CONFIG_HAX', if_true: files( 'hax-all.c', diff --git a/target/i386/whp-dispatch.h b/target/i386/whp-dispatch.h index b18aba20ed..cef5d848bd 100644 --- a/target/i386/whp-dispatch.h +++ b/target/i386/whp-dispatch.h @@ -30,6 +30,14 @@ */ #define LIST_WINHVPLATFORM_FUNCTIONS_SUPPLEMENTAL(X) \ X(HRESULT, WHvSuspendPartitionTime, (WHV_PARTITION_HANDLE Partition)) \ + X(HRESULT, WHvRequestInterrupt, (WHV_PARTITION_HANDLE Partition, \ + WHV_INTERRUPT_CONTROL* Interrupt, UINT32 InterruptControlSize)) \ + X(HRESULT, WHvGetVirtualProcessorInterruptControllerState2, \ + (WHV_PARTITION_HANDLE Partition, UINT32 VpIndex, PVOID State, \ + UINT32 StateSize, UINT32* WrittenSize)) \ + X(HRESULT, WHvSetVirtualProcessorInterruptControllerState2, \ + (WHV_PARTITION_HANDLE Partition, UINT32 VpIndex, PVOID State, \ + UINT32 StateSize)) \ =20 #define LIST_WINHVEMULATION_FUNCTIONS(X) \ X(HRESULT, WHvEmulatorCreateEmulator, (const WHV_EMULATOR_CALLBACKS* Cal= lbacks, WHV_EMULATOR_HANDLE* Emulator)) \ @@ -37,7 +45,6 @@ X(HRESULT, WHvEmulatorTryIoEmulation, (WHV_EMULATOR_HANDLE Emulator, VOI= D* Context, const WHV_VP_EXIT_CONTEXT* VpContext, const WHV_X64_IO_PORT_ACC= ESS_CONTEXT* IoInstructionContext, WHV_EMULATOR_STATUS* EmulatorReturnStatu= s)) \ X(HRESULT, WHvEmulatorTryMmioEmulation, (WHV_EMULATOR_HANDLE Emulator, V= OID* Context, const WHV_VP_EXIT_CONTEXT* VpContext, const WHV_MEMORY_ACCESS= _CONTEXT* MmioInstructionContext, WHV_EMULATOR_STATUS* EmulatorReturnStatus= )) \ =20 - #define WHP_DEFINE_TYPE(return_type, function_name, signature) \ typedef return_type (WINAPI *function_name ## _t) signature; =20 diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index f4f3e33eac..3b824fc9d7 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -19,10 +19,15 @@ #include "sysemu/runstate.h" #include "qemu/main-loop.h" #include "hw/boards.h" +#include "hw/i386/ioapic.h" +#include "hw/i386/apic_internal.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-types-common.h" +#include "qapi/qapi-visit-common.h" #include "migration/blocker.h" #include "whp-dispatch.h" +#include =20 #include "whpx-cpus.h" =20 @@ -31,11 +36,6 @@ =20 #define HYPERV_APIC_BUS_FREQUENCY (200000000ULL) =20 -struct whpx_state { - uint64_t mem_quota; - WHV_PARTITION_HANDLE partition; -}; - static const WHV_REGISTER_NAME whpx_register_names[] =3D { =20 /* X64 General purpose registers */ @@ -152,6 +152,7 @@ struct whpx_vcpu { WHV_EMULATOR_HANDLE emulator; bool window_registered; bool interruptable; + bool ready_for_pic_interrupt; uint64_t tpr; uint64_t apic_base; bool interruption_pending; @@ -163,7 +164,7 @@ struct whpx_vcpu { static bool whpx_allowed; static bool whp_dispatch_initialized; static HMODULE hWinHvPlatform, hWinHvEmulation; - +static uint32_t max_vcpu_index; struct whpx_state whpx_global; struct WHPDispatch whp_dispatch; =20 @@ -599,6 +600,10 @@ static void whpx_get_registers(CPUState *cpu) =20 assert(idx =3D=3D RTL_NUMBER_OF(whpx_register_names)); =20 + if (whpx_apic_in_platform()) { + whpx_apic_get(x86_cpu->apic_state); + } + return; } =20 @@ -820,26 +825,42 @@ static void whpx_vcpu_pre_run(CPUState *cpu) } =20 /* Get pending hard interruption or replay one that was overwritten */ - if (!vcpu->interruption_pending && - vcpu->interruptable && (env->eflags & IF_MASK)) { - assert(!new_int.InterruptionPending); - if (cpu->interrupt_request & CPU_INTERRUPT_HARD) { - cpu->interrupt_request &=3D ~CPU_INTERRUPT_HARD; - irq =3D cpu_get_pic_interrupt(env); - if (irq >=3D 0) { - new_int.InterruptionType =3D WHvX64PendingInterrupt; - new_int.InterruptionPending =3D 1; - new_int.InterruptionVector =3D irq; + if (!whpx_apic_in_platform()) { + if (!vcpu->interruption_pending && + vcpu->interruptable && (env->eflags & IF_MASK)) { + assert(!new_int.InterruptionPending); + if (cpu->interrupt_request & CPU_INTERRUPT_HARD) { + cpu->interrupt_request &=3D ~CPU_INTERRUPT_HARD; + irq =3D cpu_get_pic_interrupt(env); + if (irq >=3D 0) { + new_int.InterruptionType =3D WHvX64PendingInterrupt; + new_int.InterruptionPending =3D 1; + new_int.InterruptionVector =3D irq; + } } } - } =20 - /* Setup interrupt state if new one was prepared */ - if (new_int.InterruptionPending) { - reg_values[reg_count].PendingInterruption =3D new_int; - reg_names[reg_count] =3D WHvRegisterPendingInterruption; - reg_count +=3D 1; - } + /* Setup interrupt state if new one was prepared */ + if (new_int.InterruptionPending) { + reg_values[reg_count].PendingInterruption =3D new_int; + reg_names[reg_count] =3D WHvRegisterPendingInterruption; + reg_count +=3D 1; + } + } else if (vcpu->ready_for_pic_interrupt && + (cpu->interrupt_request & CPU_INTERRUPT_HARD)) { + cpu->interrupt_request &=3D ~CPU_INTERRUPT_HARD; + irq =3D cpu_get_pic_interrupt(env); + if (irq >=3D 0) { + reg_names[reg_count] =3D WHvRegisterPendingEvent; + reg_values[reg_count].ExtIntEvent =3D (WHV_X64_PENDING_EXT_INT= _EVENT) + { + .EventPending =3D 1, + .EventType =3D WHvX64PendingEventExtInt, + .Vector =3D irq, + }; + reg_count +=3D 1; + } + } =20 /* Sync the TPR to the CR8 if was modified during the intercept */ tpr =3D cpu_get_apic_tpr(x86_cpu->apic_state); @@ -854,14 +875,17 @@ static void whpx_vcpu_pre_run(CPUState *cpu) /* Update the state of the interrupt delivery notification */ if (!vcpu->window_registered && cpu->interrupt_request & CPU_INTERRUPT_HARD) { - reg_values[reg_count].DeliverabilityNotifications.InterruptNotific= ation - =3D 1; + reg_values[reg_count].DeliverabilityNotifications =3D + (WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER) { + .InterruptNotification =3D 1 + }; vcpu->window_registered =3D 1; reg_names[reg_count] =3D WHvX64RegisterDeliverabilityNotifications; reg_count +=3D 1; } =20 qemu_mutex_unlock_iothread(); + vcpu->ready_for_pic_interrupt =3D false; =20 if (reg_count) { hr =3D whp_dispatch.WHvSetVirtualProcessorRegisters( @@ -948,7 +972,7 @@ static int whpx_vcpu_run(CPUState *cpu) int ret; =20 whpx_vcpu_process_async_events(cpu); - if (cpu->halted) { + if (cpu->halted && !whpx_apic_in_platform()) { cpu->exception_index =3D EXCP_HLT; qatomic_set(&cpu->exit_request, false); return 0; @@ -992,14 +1016,114 @@ static int whpx_vcpu_run(CPUState *cpu) break; =20 case WHvRunVpExitReasonX64InterruptWindow: + vcpu->ready_for_pic_interrupt =3D 1; vcpu->window_registered =3D 0; ret =3D 0; break; =20 + case WHvRunVpExitReasonX64ApicEoi: + assert(whpx_apic_in_platform()); + ioapic_eoi_broadcast(vcpu->exit_ctx.ApicEoi.InterruptVector); + break; + case WHvRunVpExitReasonX64Halt: ret =3D whpx_handle_halt(cpu); break; =20 + case WHvRunVpExitReasonX64ApicInitSipiTrap: { + WHV_INTERRUPT_CONTROL ipi =3D {0}; + uint64_t icr =3D vcpu->exit_ctx.ApicInitSipi.ApicIcr; + uint32_t delivery_mode =3D + (icr & APIC_ICR_DELIV_MOD) >> APIC_ICR_DELIV_MOD_SHIFT; + int dest_shorthand =3D + (icr & APIC_ICR_DEST_SHORT) >> APIC_ICR_DEST_SHORT_SHIFT; + bool broadcast =3D false; + bool include_self =3D false; + uint32_t i; + + /* We only registered for INIT and SIPI exits. */ + if ((delivery_mode !=3D APIC_DM_INIT) && + (delivery_mode !=3D APIC_DM_SIPI)) { + error_report( + "WHPX: Unexpected APIC exit that is not a INIT or SIPI= "); + break; + } + + if (delivery_mode =3D=3D APIC_DM_INIT) { + ipi.Type =3D WHvX64InterruptTypeInit; + } else { + ipi.Type =3D WHvX64InterruptTypeSipi; + } + + ipi.DestinationMode =3D + ((icr & APIC_ICR_DEST_MOD) >> APIC_ICR_DEST_MOD_SHIFT) ? + WHvX64InterruptDestinationModeLogical : + WHvX64InterruptDestinationModePhysical; + + ipi.TriggerMode =3D + ((icr & APIC_ICR_TRIGGER_MOD) >> APIC_ICR_TRIGGER_MOD_SHIF= T) ? + WHvX64InterruptTriggerModeLevel : + WHvX64InterruptTriggerModeEdge; + + ipi.Vector =3D icr & APIC_VECTOR_MASK; + switch (dest_shorthand) { + /* no shorthand. Bits 56-63 contain the destination. */ + case 0: + ipi.Destination =3D (icr >> 56) & APIC_VECTOR_MASK; + hr =3D whp_dispatch.WHvRequestInterrupt(whpx->partition, + &ipi, sizeof(ipi)); + if (FAILED(hr)) { + error_report("WHPX: Failed to request interrupt hr=3D= %08lx", + hr); + } + + break; + + /* self */ + case 1: + include_self =3D true; + break; + + /* broadcast, including self */ + case 2: + broadcast =3D true; + include_self =3D true; + break; + + /* broadcast, excluding self */ + case 3: + broadcast =3D true; + break; + } + + if (!broadcast && !include_self) { + break; + } + + for (i =3D 0; i <=3D max_vcpu_index; i++) { + if (i =3D=3D cpu->cpu_index && !include_self) { + continue; + } + + /* + * Assuming that APIC Ids are identity mapped since + * WHvX64RegisterApicId & WHvX64RegisterInitialApicId regi= sters + * are not handled yet and the hypervisor doesn't allow the + * guest to modify the APIC ID. + */ + ipi.Destination =3D i; + hr =3D whp_dispatch.WHvRequestInterrupt(whpx->partition, + &ipi, sizeof(ipi)); + if (FAILED(hr)) { + error_report( + "WHPX: Failed to request SIPI for %d, hr=3D%08lx", + i, hr); + } + } + + break; + } + case WHvRunVpExitReasonCanceled: cpu->exception_index =3D EXCP_INTERRUPT; ret =3D 1; @@ -1314,6 +1438,7 @@ int whpx_init_vcpu(CPUState *cpu) vcpu->interruptable =3D true; cpu->vcpu_dirty =3D true; cpu->hax_vcpu =3D (struct hax_vcpu_state *)vcpu; + max_vcpu_index =3D max(max_vcpu_index, cpu->cpu_index); qemu_add_vm_change_state_handler(whpx_cpu_update_state, cpu->env_ptr); =20 return 0; @@ -1549,6 +1674,43 @@ error: return false; } =20 +static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + struct whpx_state *whpx =3D &whpx_global; + OnOffSplit mode; + + if (!visit_type_OnOffSplit(v, name, &mode, errp)) { + return; + } + + switch (mode) { + case ON_OFF_SPLIT_ON: + whpx->kernel_irqchip_allowed =3D true; + whpx->kernel_irqchip_required =3D true; + break; + + case ON_OFF_SPLIT_OFF: + whpx->kernel_irqchip_allowed =3D false; + whpx->kernel_irqchip_required =3D false; + break; + + case ON_OFF_SPLIT_SPLIT: + error_setg(errp, "WHPX: split irqchip currently not supported"); + error_append_hint(errp, + "Try without kernel-irqchip or with kernel-irqchip=3Don|off"); + break; + + default: + /* + * The value was checked in visit_type_OnOffSplit() above. If + * we get here, then something is wrong in QEMU. + */ + abort(); + } +} + /* * Partition support */ @@ -1562,6 +1724,7 @@ static int whpx_accel_init(MachineState *ms) UINT32 whpx_cap_size; WHV_PARTITION_PROPERTY prop; UINT32 cpuidExitList[] =3D {1, 0x80000001}; + WHV_CAPABILITY_FEATURES features =3D {0}; =20 whpx =3D &whpx_global; =20 @@ -1570,7 +1733,6 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 - memset(whpx, 0, sizeof(struct whpx_state)); whpx->mem_quota =3D ms->ram_size; =20 hr =3D whp_dispatch.WHvGetCapability( @@ -1582,6 +1744,14 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 + hr =3D whp_dispatch.WHvGetCapability( + WHvCapabilityCodeFeatures, &features, sizeof(features), NULL); + if (FAILED(hr)) { + error_report("WHPX: Failed to query capabilities, hr=3D%08lx", hr); + ret =3D -EINVAL; + goto error; + } + hr =3D whp_dispatch.WHvCreatePartition(&whpx->partition); if (FAILED(hr)) { error_report("WHPX: Failed to create partition, hr=3D%08lx", hr); @@ -1604,18 +1774,55 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 + /* + * Error out if WHP doesn't support apic emulation and user is requiri= ng + * it. + */ + if (whpx->kernel_irqchip_required && (!features.LocalApicEmulation || + !whp_dispatch.WHvSetVirtualProcessorInterruptControllerState2)= ) { + error_report("WHPX: kernel irqchip requested, but unavailable. " + "Try without kernel-irqchip or with kernel-irqchip=3Doff"); + ret =3D -EINVAL; + goto error; + } + + if (whpx->kernel_irqchip_allowed && features.LocalApicEmulation && + whp_dispatch.WHvSetVirtualProcessorInterruptControllerState2) { + WHV_X64_LOCAL_APIC_EMULATION_MODE mode =3D + WHvX64LocalApicEmulationModeXApic; + printf("WHPX: setting APIC emulation mode in the hypervisor\n"); + hr =3D whp_dispatch.WHvSetPartitionProperty( + whpx->partition, + WHvPartitionPropertyCodeLocalApicEmulationMode, + &mode, + sizeof(mode)); + if (FAILED(hr)) { + error_report("WHPX: Failed to enable kernel irqchip hr=3D%08lx= ", hr); + if (whpx->kernel_irqchip_required) { + error_report("WHPX: kernel irqchip requested, but unavaila= ble"); + ret =3D -EINVAL; + goto error; + } + } else { + whpx->apic_in_platform =3D true; + } + } + + /* Register for MSR and CPUID exits */ memset(&prop, 0, sizeof(WHV_PARTITION_PROPERTY)); prop.ExtendedVmExits.X64MsrExit =3D 1; prop.ExtendedVmExits.X64CpuidExit =3D 1; - hr =3D whp_dispatch.WHvSetPartitionProperty( - whpx->partition, - WHvPartitionPropertyCodeExtendedVmExits, - &prop, - sizeof(WHV_PARTITION_PROPERTY)); + if (whpx_apic_in_platform()) { + prop.ExtendedVmExits.X64ApicInitSipiExitTrap =3D 1; + } =20 + hr =3D whp_dispatch.WHvSetPartitionProperty( + whpx->partition, + WHvPartitionPropertyCodeExtendedVmExits, + &prop, + sizeof(WHV_PARTITION_PROPERTY)); if (FAILED(hr)) { - error_report("WHPX: Failed to enable partition extended X64MsrExit= and" - " X64CpuidExit hr=3D%08lx", hr); + error_report("WHPX: Failed to enable MSR & CPUIDexit, hr=3D%08lx",= hr); ret =3D -EINVAL; goto error; } @@ -1668,11 +1875,27 @@ static void whpx_accel_class_init(ObjectClass *oc, = void *data) ac->name =3D "WHPX"; ac->init_machine =3D whpx_accel_init; ac->allowed =3D &whpx_allowed; + + object_class_property_add(oc, "kernel-irqchip", "on|off|split", + NULL, whpx_set_kernel_irqchip, + NULL, NULL); + object_class_property_set_description(oc, "kernel-irqchip", + "Configure WHPX in-kernel irqchip"); +} + +static void whpx_accel_instance_init(Object *obj) +{ + struct whpx_state *whpx =3D &whpx_global; + + memset(whpx, 0, sizeof(struct whpx_state)); + /* Turn on kernel-irqchip, by default */ + whpx->kernel_irqchip_allowed =3D true; } =20 static const TypeInfo whpx_accel_type =3D { .name =3D ACCEL_CLASS_NAME("whpx"), .parent =3D TYPE_ACCEL, + .instance_init =3D whpx_accel_instance_init, .class_init =3D whpx_accel_class_init, }; =20 diff --git a/target/i386/whpx-apic.c b/target/i386/whpx-apic.c new file mode 100644 index 0000000000..b127a3cb8a --- /dev/null +++ b/target/i386/whpx-apic.c @@ -0,0 +1,274 @@ +/* + * WHPX platform APIC support + * + * Copyright (c) 2011 Siemens AG + * + * Authors: + * Jan Kiszka + * John Starks + * + * This work is licensed under the terms of the GNU GPL version 2. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "hw/i386/apic_internal.h" +#include "hw/i386/apic-msidef.h" +#include "hw/pci/msi.h" +#include "sysemu/hw_accel.h" +#include "sysemu/whpx.h" +#include "whp-dispatch.h" + +static void whpx_put_apic_state(APICCommonState *s, + struct whpx_lapic_state *kapic) +{ + int i; + + memset(kapic, 0, sizeof(*kapic)); + kapic->fields[0x2].data =3D s->id << 24; + kapic->fields[0x3].data =3D s->version | ((APIC_LVT_NB - 1) << 16); + kapic->fields[0x8].data =3D s->tpr; + kapic->fields[0xd].data =3D s->log_dest << 24; + kapic->fields[0xe].data =3D s->dest_mode << 28 | 0x0fffffff; + kapic->fields[0xf].data =3D s->spurious_vec; + for (i =3D 0; i < 8; i++) { + kapic->fields[0x10 + i].data =3D s->isr[i]; + kapic->fields[0x18 + i].data =3D s->tmr[i]; + kapic->fields[0x20 + i].data =3D s->irr[i]; + } + + kapic->fields[0x28].data =3D s->esr; + kapic->fields[0x30].data =3D s->icr[0]; + kapic->fields[0x31].data =3D s->icr[1]; + for (i =3D 0; i < APIC_LVT_NB; i++) { + kapic->fields[0x32 + i].data =3D s->lvt[i]; + } + + kapic->fields[0x38].data =3D s->initial_count; + kapic->fields[0x3e].data =3D s->divide_conf; +} + +static void whpx_get_apic_state(APICCommonState *s, + struct whpx_lapic_state *kapic) +{ + int i, v; + + s->id =3D kapic->fields[0x2].data >> 24; + s->tpr =3D kapic->fields[0x8].data; + s->arb_id =3D kapic->fields[0x9].data; + s->log_dest =3D kapic->fields[0xd].data >> 24; + s->dest_mode =3D kapic->fields[0xe].data >> 28; + s->spurious_vec =3D kapic->fields[0xf].data; + for (i =3D 0; i < 8; i++) { + s->isr[i] =3D kapic->fields[0x10 + i].data; + s->tmr[i] =3D kapic->fields[0x18 + i].data; + s->irr[i] =3D kapic->fields[0x20 + i].data; + } + + s->esr =3D kapic->fields[0x28].data; + s->icr[0] =3D kapic->fields[0x30].data; + s->icr[1] =3D kapic->fields[0x31].data; + for (i =3D 0; i < APIC_LVT_NB; i++) { + s->lvt[i] =3D kapic->fields[0x32 + i].data; + } + + s->initial_count =3D kapic->fields[0x38].data; + s->divide_conf =3D kapic->fields[0x3e].data; + + v =3D (s->divide_conf & 3) | ((s->divide_conf >> 1) & 4); + s->count_shift =3D (v + 1) & 7; + + s->initial_count_load_time =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + apic_next_timer(s, s->initial_count_load_time); +} + +static void whpx_apic_set_base(APICCommonState *s, uint64_t val) +{ + s->apicbase =3D val; +} + +static void whpx_put_apic_base(CPUState *cpu, uint64_t val) +{ + HRESULT hr; + WHV_REGISTER_VALUE reg_value =3D {.Reg64 =3D val}; + WHV_REGISTER_NAME reg_name =3D WHvX64RegisterApicBase; + + hr =3D whp_dispatch.WHvSetVirtualProcessorRegisters( + whpx_global.partition, + cpu->cpu_index, + ®_name, 1, + ®_value); + + if (FAILED(hr)) { + error_report("WHPX: Failed to set MSR APIC base, hr=3D%08lx", hr); + } +} + +static void whpx_apic_set_tpr(APICCommonState *s, uint8_t val) +{ + s->tpr =3D val; +} + +static uint8_t whpx_apic_get_tpr(APICCommonState *s) +{ + return s->tpr; +} + +static void whpx_apic_vapic_base_update(APICCommonState *s) +{ + /* not implemented yet */ +} + +static void whpx_apic_put(CPUState *cs, run_on_cpu_data data) +{ + APICCommonState *s =3D data.host_ptr; + struct whpx_lapic_state kapic; + HRESULT hr; + + whpx_put_apic_base(CPU(s->cpu), s->apicbase); + whpx_put_apic_state(s, &kapic); + + hr =3D whp_dispatch.WHvSetVirtualProcessorInterruptControllerState2( + whpx_global.partition, + cs->cpu_index, + &kapic, + sizeof(kapic)); + if (FAILED(hr)) { + fprintf(stderr, + "WHvSetVirtualProcessorInterruptControllerState failed: %08lx\= n", + hr); + + abort(); + } +} + +void whpx_apic_get(DeviceState *dev) +{ + APICCommonState *s =3D APIC_COMMON(dev); + CPUState *cpu =3D CPU(s->cpu); + struct whpx_lapic_state kapic; + + HRESULT hr =3D whp_dispatch.WHvGetVirtualProcessorInterruptControllerS= tate2( + whpx_global.partition, + cpu->cpu_index, + &kapic, + sizeof(kapic), + NULL); + if (FAILED(hr)) { + fprintf(stderr, + "WHvSetVirtualProcessorInterruptControllerState failed: %08lx\= n", + hr); + + abort(); + } + + whpx_get_apic_state(s, &kapic); +} + +static void whpx_apic_post_load(APICCommonState *s) +{ + run_on_cpu(CPU(s->cpu), whpx_apic_put, RUN_ON_CPU_HOST_PTR(s)); +} + +static void whpx_apic_external_nmi(APICCommonState *s) +{ +} + +static void whpx_send_msi(MSIMessage *msg) +{ + uint64_t addr =3D msg->address; + uint32_t data =3D msg->data; + uint8_t dest =3D (addr & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SH= IFT; + uint8_t vector =3D (data & MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SH= IFT; + uint8_t dest_mode =3D (addr >> MSI_ADDR_DEST_MODE_SHIFT) & 0x1; + uint8_t trigger_mode =3D (data >> MSI_DATA_TRIGGER_SHIFT) & 0x1; + uint8_t delivery =3D (data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x7; + + WHV_INTERRUPT_CONTROL interrupt =3D { + /* Values correspond to delivery modes */ + .Type =3D delivery, + .DestinationMode =3D dest_mode ? + WHvX64InterruptDestinationModeLogical : + WHvX64InterruptDestinationModePhysical, + + .TriggerMode =3D trigger_mode ? + WHvX64InterruptTriggerModeLevel : WHvX64InterruptTriggerModeEd= ge, + .Reserved =3D 0, + .Vector =3D vector, + .Destination =3D dest, + }; + HRESULT hr =3D whp_dispatch.WHvRequestInterrupt(whpx_global.partition, + &interrupt, sizeof(interrupt)); + if (FAILED(hr)) { + fprintf(stderr, "whpx: injection failed, MSI (%llx, %x) delivery: = %d, " + "dest_mode: %d, trigger mode: %d, vector: %d, lost (%08lx)= \n", + addr, data, delivery, dest_mode, trigger_mode, vector, hr); + } +} + +static uint64_t whpx_apic_mem_read(void *opaque, hwaddr addr, + unsigned size) +{ + return ~(uint64_t)0; +} + +static void whpx_apic_mem_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + MSIMessage msg =3D { .address =3D addr, .data =3D data }; + whpx_send_msi(&msg); +} + +static const MemoryRegionOps whpx_apic_io_ops =3D { + .read =3D whpx_apic_mem_read, + .write =3D whpx_apic_mem_write, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +static void whpx_apic_reset(APICCommonState *s) +{ + /* Not used by WHPX. */ + s->wait_for_sipi =3D 0; + + run_on_cpu(CPU(s->cpu), whpx_apic_put, RUN_ON_CPU_HOST_PTR(s)); +} + +static void whpx_apic_realize(DeviceState *dev, Error **errp) +{ + APICCommonState *s =3D APIC_COMMON(dev); + + memory_region_init_io(&s->io_memory, OBJECT(s), &whpx_apic_io_ops, s, + "whpx-apic-msi", APIC_SPACE_SIZE); + + msi_nonbroken =3D true; +} + +static void whpx_apic_class_init(ObjectClass *klass, void *data) +{ + APICCommonClass *k =3D APIC_COMMON_CLASS(klass); + + k->realize =3D whpx_apic_realize; + k->reset =3D whpx_apic_reset; + k->set_base =3D whpx_apic_set_base; + k->set_tpr =3D whpx_apic_set_tpr; + k->get_tpr =3D whpx_apic_get_tpr; + k->post_load =3D whpx_apic_post_load; + k->vapic_base_update =3D whpx_apic_vapic_base_update; + k->external_nmi =3D whpx_apic_external_nmi; + k->send_msi =3D whpx_send_msi; +} + +static const TypeInfo whpx_apic_info =3D { + .name =3D "whpx-apic", + .parent =3D TYPE_APIC_COMMON, + .instance_size =3D sizeof(APICCommonState), + .class_init =3D whpx_apic_class_init, +}; + +static void whpx_apic_register_types(void) +{ + type_register_static(&whpx_apic_info); +} + +type_init(whpx_apic_register_types) --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896864; cv=none; d=zohomail.com; s=zohoarc; b=D2Es99a4TuFfBWoDQv9jAoKRNlzTWpK09Txmr00XzwJGuMtwCVNOTfeW4hk56e9NDQJpg7U6WNGrIZ57PsKeWwxOy/yc7n/sLyvAXPyisOhKCTNpbdq2jHmeSTsqHOOD1RdNpFmJ4VhCTwt/tomRBoZWmHz/Iq74KunNNuRyGUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896864; 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=jgMSdwv+KpLRu+SlkYTogPl41A+HpD3MDuNLcuamfm0=; b=N4EzeIwAUV22SHTsxVvQh6JZn3I6wLoP72FXQjlo4vZiqVasGEjQi31TqvD98PIlfgeCaD3itsRWv+O69QAIeKAw+RDuLUEbRprIgN+hv8+eXQAG0lgv7BVh6ExW5U1ags/gNc2JD3V5IUsLwVCXxy/22v/SgLq8eVZqI969R18= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896864078654.3226189792412; Wed, 2 Dec 2020 00:14:24 -0800 (PST) Received: from localhost ([::1]:49878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNHK-00086B-Jp for importer@patchew.org; Wed, 02 Dec 2020 03:14:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC6-0002Os-9Y for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC3-0003Z0-Mu for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:58 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-RjIZHs3cN7ied454ATR8rA-1; Wed, 02 Dec 2020 03:08:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 475C78558EF for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12A8010013BD for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896534; 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: in-reply-to:in-reply-to:references:references; bh=jgMSdwv+KpLRu+SlkYTogPl41A+HpD3MDuNLcuamfm0=; b=gxjIOYEIlF6olZ8kFK0jpuLbnBf1fjrX5tJASzTU9hQNIWvhINPSRbs4knMvpdOct/FwpR npWF/7kMGV6KYeCK902Ky9gR/MgxTeaSCrZLju7OlXCcDUVcxrDWSa0LjjAVYn0PhWZn2A DKaurwNeY5kWOCM4GlEn11gjiYC2BFY= X-MC-Unique: RjIZHs3cN7ied454ATR8rA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 005/113] docs/devel/loads-stores: Add regexp for DMA functions Date: Wed, 2 Dec 2020 03:07:01 -0500 Message-Id: <20201202080849.4125477-6-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- docs/devel/loads-stores.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index 59c1225391..ee43f5dfee 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -483,6 +483,8 @@ make sure our existing code is doing things correctly. =20 Regexes for git grep - ``\`` + - ``\`` + - ``\`` =20 ``pci_dma_*`` and ``{ld,st}*_pci_dma`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897214; cv=none; d=zohomail.com; s=zohoarc; b=F/BS8SDbHPGFa5mbdrKE5UgDrfQCzIipNOwoYLcIbuw2xJxBWMaW4P2dUpbYm7c//wN1/FL16TftmlMuvvovCB9Gtdo/KWNlVp+Nq+ZB6Bzw0NQpSl0sR1vpB0ZU6BjE4QiRRa9nAGCIj/ASeGwfICYTAS2kLN6p+Ar7bpCZcOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897214; 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=EGP7D0TUJZWXFD3aozvOAKCBKUzC/cXbsNCEGsT4pRM=; b=hRlw2hQYBSZcNWaXeC0uulU0ZIjHrY61m0ksZLD8W9TGJba3fINHbd1qQ4qVy17Kn9i9UXplYAr/ujuxkvnhY79I+iLmp297c5k7vbx5nkbbkZmDsXz3myFKznJbnN5g19+2g6EAWTMb5kg6ofIrDmQRAoO6ZCY7riQRGU5Ox28= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897214844474.41969660096515; Wed, 2 Dec 2020 00:20:14 -0800 (PST) Received: from localhost ([::1]:38850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNMz-0006tq-Qf for importer@patchew.org; Wed, 02 Dec 2020 03:20:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0002XM-G9 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC3-0003Z4-NY for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-Ed0LP3Y-PgaRaCPVnzqk3A-1; Wed, 02 Dec 2020 03:08:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 975C75708C for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62E9810013BD for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896535; 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: in-reply-to:in-reply-to:references:references; bh=EGP7D0TUJZWXFD3aozvOAKCBKUzC/cXbsNCEGsT4pRM=; b=DMpFe4URCQxxxVzrMRbPFTnOIIMRSCuPFBFBW8FRmYZyMZSKVGxA+eGUH+8IORZfI9YSGb cOG25Aw60k0T8RSz4vQGc5lQy2wF5FmyfoAGaY+yoB8uTe5LfnxmVNT7cgfJrI0sKteNm6 KUfu+v0lPPIxQSAWxJ12N4yUhoFzqiU= X-MC-Unique: Ed0LP3Y-PgaRaCPVnzqk3A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 006/113] qom: eliminate identical functions Date: Wed, 2 Dec 2020 03:07:02 -0500 Message-Id: <20201202080849.4125477-7-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Most property release functions in qom/object.c only free the opaque value. Combine all of them into a single function. Signed-off-by: Paolo Bonzini --- qom/object.c | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/qom/object.c b/qom/object.c index 1065355233..75a78c9343 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2174,11 +2174,10 @@ static void property_set_str(Object *obj, Visitor *= v, const char *name, g_free(value); } =20 -static void property_release_str(Object *obj, const char *name, - void *opaque) +static void property_release_data(Object *obj, const char *name, + void *opaque) { - StringProperty *prop =3D opaque; - g_free(prop); + g_free(opaque); } =20 ObjectProperty * @@ -2194,7 +2193,7 @@ object_property_add_str(Object *obj, const char *name, return object_property_add(obj, name, "string", get ? property_get_str : NULL, set ? property_set_str : NULL, - property_release_str, + property_release_data, prop); } =20 @@ -2251,13 +2250,6 @@ static void property_set_bool(Object *obj, Visitor *= v, const char *name, prop->set(obj, value, errp); } =20 -static void property_release_bool(Object *obj, const char *name, - void *opaque) -{ - BoolProperty *prop =3D opaque; - g_free(prop); -} - ObjectProperty * object_property_add_bool(Object *obj, const char *name, bool (*get)(Object *, Error **), @@ -2271,7 +2263,7 @@ object_property_add_bool(Object *obj, const char *nam= e, return object_property_add(obj, name, "bool", get ? property_get_bool : NULL, set ? property_set_bool : NULL, - property_release_bool, + property_release_data, prop); } =20 @@ -2320,13 +2312,6 @@ static void property_set_enum(Object *obj, Visitor *= v, const char *name, prop->set(obj, value, errp); } =20 -static void property_release_enum(Object *obj, const char *name, - void *opaque) -{ - EnumProperty *prop =3D opaque; - g_free(prop); -} - ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, @@ -2343,7 +2328,7 @@ object_property_add_enum(Object *obj, const char *nam= e, return object_property_add(obj, name, typename, get ? property_get_enum : NULL, set ? property_set_enum : NULL, - property_release_enum, + property_release_data, prop); } =20 @@ -2410,13 +2395,6 @@ out_end: visit_end_struct(v, NULL); } =20 -static void property_release_tm(Object *obj, const char *name, - void *opaque) -{ - TMProperty *prop =3D opaque; - g_free(prop); -} - ObjectProperty * object_property_add_tm(Object *obj, const char *name, void (*get)(Object *, struct tm *, Error **)) @@ -2427,7 +2405,7 @@ object_property_add_tm(Object *obj, const char *name, =20 return object_property_add(obj, name, "struct tm", get ? property_get_tm : NULL, NULL, - property_release_tm, + property_release_data, prop); } =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896866; cv=none; d=zohomail.com; s=zohoarc; b=Pf3NQp9iJGIKgQ/Z8HE0tSLuQBMarIsQLAtZUW6ltKdEHlw6CyBDssIjrhuuNz0GI5JVWueiF36CRnUGVEjbV+ysdS4tLjZFwhxBuCvyoMn0TcpmT0e1IgDf9vdn00FxxDpByUA6yYGp34b20hXS957RWorbprXvce55MhE96Lw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896866; 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=w2LH23/xArIxpJl7ZtYpv/7B6/RO5ym80DOZz4brbi8=; b=TONYNHgOxioHX6kxGCFwsKvWJhHZQHnTxnfoY2zN7krD2NAOoGEyTirAnzvT5tJ+RCxVFb0uecejW4TXU6JgCaGN9pMQ/POOgxJXUKyklPvHzwymRVlrZQZJhIQg6G7NgYDWCGWu9EcsDY73QT0iPSybj+x4RLAnFcsZRBRk2sM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896866720677.082293219821; Wed, 2 Dec 2020 00:14:26 -0800 (PST) Received: from localhost ([::1]:50218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNHN-0008EX-KE for importer@patchew.org; Wed, 02 Dec 2020 03:14:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC9-0002TO-HK for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC4-0003ZM-FZ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:01 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-A4sgLo49My2LAitZpAZkfA-1; Wed, 02 Dec 2020 03:08:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E63681006C82 for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B27F610013BD for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896535; 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: in-reply-to:in-reply-to:references:references; bh=w2LH23/xArIxpJl7ZtYpv/7B6/RO5ym80DOZz4brbi8=; b=R4InDjssvuIjuBi/JsmP9k1Xi+swUvKGHEzNBAg69xR7GVSXt3sgOv5ly1IvQWKqEd65wI 2IVMlOybJ4vsPe0UG2xDwM72GBwmObtvZLWZ9t/+LWtKtiiMxPLRFNOJWB9kMW+mPFh8cE KBgfQgXYLDgIAE87M7VsjAjfvG1mFDg= X-MC-Unique: A4sgLo49My2LAitZpAZkfA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 007/113] dma: Document address_space_map/address_space_unmap() prototypes Date: Wed, 2 Dec 2020 03:07:03 -0500 Message-Id: <20201202080849.4125477-8-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Add documentation based on address_space_map / address_space_unmap. Reviewed-by: Richard Henderson Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dma.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 80c5bc3e02..c6e12b4c24 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -1,7 +1,7 @@ /* * DMA helper functions * - * Copyright (c) 2009 Red Hat + * Copyright (c) 2009, 2020 Red Hat * * This work is licensed under the terms of the GNU General Public License * (GNU GPL), version 2 or later. @@ -125,6 +125,19 @@ static inline int dma_memory_write(AddressSpace *as, d= ma_addr_t addr, =20 int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_= t len); =20 +/** + * address_space_map: Map a physical memory region into a host virtual add= ress. + * + * May map a subset of the requested range, given by and returned in @plen. + * May return %NULL and set *@plen to zero(0), if resources needed to perf= orm + * the mapping are exhausted. + * Use only for reads OR writes - not for read-modify-write operations. + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @len: pointer to length of buffer; updated on return + * @dir: indicates the transfer direction + */ static inline void *dma_memory_map(AddressSpace *as, dma_addr_t addr, dma_addr_t *len, DMADirection dir) @@ -138,6 +151,20 @@ static inline void *dma_memory_map(AddressSpace *as, return p; } =20 +/** + * address_space_unmap: Unmaps a memory region previously mapped + * by dma_memory_map() + * + * Will also mark the memory as dirty if @dir =3D=3D %DMA_DIRECTION_FROM_D= EVICE. + * @access_len gives the amount of memory that was actually read or written + * by the caller. + * + * @as: #AddressSpace used + * @buffer: host pointer as returned by address_space_map() + * @len: buffer length as returned by address_space_map() + * @dir: indicates the transfer direction + * @access_len: amount of data actually transferred + */ static inline void dma_memory_unmap(AddressSpace *as, void *buffer, dma_addr_t len, DMADirection dir, dma_addr_t access_le= n) --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896711; cv=none; d=zohomail.com; s=zohoarc; b=Eoyej3uGUNFaVl7YZV9nGYPdO1InMZGnChaeq3cLR3eq8PfslxESeCdhHXq7DTGEsswaClY5Bay91wgy7hqMajTXrT/MnrQcJcIUYLqrIEledqHAwwxCwb6bM4rwZrBLTwVk0qa8bQa3MuvhZ1gUyEYP1MKl+5NKnAyvHXACoQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896711; 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=v8PALb00Zd2/H2U2mdRZ/xj/msCDT1iGPKd8DVpLsg0=; b=PQrCT8n/jByPuOQMTOgUJF7V6OPwvM1VePs2P+sg8KY9ZgU81YkNOvMruww25MaNoPVAFcADAv1pyLZgJ+CFGi1RurpXYwaUmeZ1PudcfnL8CgQh9aMUZM6UqCIvniiMvZQqmgPSMzLSjccn2MfsY3MC2kmOCopaKwJ/yUbMfD4= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896711303129.24890382876515; Wed, 2 Dec 2020 00:11:51 -0800 (PST) Received: from localhost ([::1]:41828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNEs-0004nO-3t for importer@patchew.org; Wed, 02 Dec 2020 03:11:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC7-0002QE-Mo for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC4-0003ZJ-Dq for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:08:59 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-240-qfnDuV6lMvuaRDylmHIwbw-1; Wed, 02 Dec 2020 03:08:54 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42D558558F0 for ; Wed, 2 Dec 2020 08:08:53 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E0CB10013BD for ; Wed, 2 Dec 2020 08:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896535; 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: in-reply-to:in-reply-to:references:references; bh=v8PALb00Zd2/H2U2mdRZ/xj/msCDT1iGPKd8DVpLsg0=; b=T/jbI/BVxuUOwEaaKKV75J4yxBCN1tnIlrcIQ1gqgdpcI1CgQLhW9tXbPUWlzA7wslu+EH oTnYYqsH3iEWrFXMIU9qtcGcVtwXDwv8u6zpZJ0s+JgEjV5fqqFN42Q62/cjRVwSruw1ce 1pQVicm4I2ToWbZ//pQ8JX09wZ0pxfQ= X-MC-Unique: qfnDuV6lMvuaRDylmHIwbw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 008/113] dma: Let dma_memory_set() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:04 -0500 Message-Id: <20201202080849.4125477-9-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 address_space_write() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dma.h | 15 ++++++++++++++- softmmu/dma-helpers.c | 7 ++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index c6e12b4c24..37cd9f1121 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -123,7 +123,20 @@ static inline int dma_memory_write(AddressSpace *as, d= ma_addr_t addr, DMA_DIRECTION_FROM_DEVICE); } =20 -int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_= t len); +/** + * dma_memory_set: Fill memory with a constant byte from DMA controller. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @c: constant byte to fill the memory + * @len: the number of bytes to fill with the constant byte + */ +MemTxResult dma_memory_set(AddressSpace *as, dma_addr_t addr, + uint8_t c, dma_addr_t len); =20 /** * address_space_map: Map a physical memory region into a host virtual add= ress. diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c index 03c92e0cc6..29001b5459 100644 --- a/softmmu/dma-helpers.c +++ b/softmmu/dma-helpers.c @@ -1,7 +1,7 @@ /* * DMA helper functions * - * Copyright (c) 2009 Red Hat + * Copyright (c) 2009,2020 Red Hat * * This work is licensed under the terms of the GNU General Public License * (GNU GPL), version 2 or later. @@ -18,14 +18,15 @@ =20 /* #define DEBUG_IOMMU */ =20 -int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_= t len) +MemTxResult dma_memory_set(AddressSpace *as, dma_addr_t addr, + uint8_t c, dma_addr_t len) { dma_barrier(as, DMA_DIRECTION_FROM_DEVICE); =20 #define FILLBUF_SIZE 512 uint8_t fillbuf[FILLBUF_SIZE]; int l; - bool error =3D false; + MemTxResult error =3D MEMTX_OK; =20 memset(fillbuf, c, FILLBUF_SIZE); while (len > 0) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896711; cv=none; d=zohomail.com; s=zohoarc; b=ixeL1btQfSWQPZL1tlseOWXnRcBC9WifLEtq4zT+6TMSPvvqq64gonyzm5GjIbiZRoTkJjVpBkBLARb5fH0DZqskAf9JtX2D9ejKBOTR4JJHeYFzSW1FXbJFIyCo2gErZL5gQPZVjuvnLDb+9Enotrl6+qkkES/ESMmneD9DkvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896711; 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=3E6dmaS037b/bSSBjbFSYQXI+/YdmZDp4gDJgM5wkPc=; b=ao6nb2JtJBbdayGABL3Tyvz81v3/lnp0nMqv9WoWy7JLl8VeKFst8D7W8+DL89dHyQtn4yDYNLIxu3nD2r/SpTF3ZePb+2x71JjzDpWuXhTSBINh7LsrULceWPmrx44gTDb/N0mu1B0vH7QWpdeC0xS2w1aHUI+myfRklB/xw+c= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896711313330.8699395250285; Wed, 2 Dec 2020 00:11:51 -0800 (PST) Received: from localhost ([::1]:41820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNEs-0004nD-2S for importer@patchew.org; Wed, 02 Dec 2020 03:11:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNC9-0002Sw-6l for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC4-0003ZO-Jw for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:00 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-V5aDzgbOPi6hdEHFP5I97w-1; Wed, 02 Dec 2020 03:08:54 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 926721006C81 for ; Wed, 2 Dec 2020 08:08:53 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E1B210013BD for ; Wed, 2 Dec 2020 08:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896535; 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: in-reply-to:in-reply-to:references:references; bh=3E6dmaS037b/bSSBjbFSYQXI+/YdmZDp4gDJgM5wkPc=; b=hGguuf1tXW3v1UUQFdVmX3b5TN8DRggPMXLzanxt1Q2GfTkSOfOn8JmpQf6o7S5Pi3hDEE ONl67qmPtH0a7+2eMH3RRNPyZhQZjj3edcxbPqRi8bhxGwA3NE4VdjdqPEKn81S9+3dRIv mxisuTaUvXGlmkD1axJ9Vbu7nZk8RCI= X-MC-Unique: V5aDzgbOPi6hdEHFP5I97w-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 009/113] dma: Let dma_memory_rw() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:05 -0500 Message-Id: <20201202080849.4125477-10-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 address_space_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dma.h | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 37cd9f1121..04687d8825 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -80,12 +80,13 @@ static inline bool dma_memory_valid(AddressSpace *as, MEMTXATTRS_UNSPECIFIED); } =20 -static inline int dma_memory_rw_relaxed(AddressSpace *as, dma_addr_t addr, - void *buf, dma_addr_t len, - DMADirection dir) +static inline MemTxResult dma_memory_rw_relaxed(AddressSpace *as, + dma_addr_t addr, + void *buf, dma_addr_t len, + DMADirection dir) { - return (bool)address_space_rw(as, addr, MEMTXATTRS_UNSPECIFIED, - buf, len, dir =3D=3D DMA_DIRECTION_FROM_= DEVICE); + return address_space_rw(as, addr, MEMTXATTRS_UNSPECIFIED, + buf, len, dir =3D=3D DMA_DIRECTION_FROM_DEVICE= ); } =20 static inline int dma_memory_read_relaxed(AddressSpace *as, dma_addr_t add= r, @@ -101,9 +102,22 @@ static inline int dma_memory_write_relaxed(AddressSpac= e *as, dma_addr_t addr, DMA_DIRECTION_FROM_DEVICE); } =20 -static inline int dma_memory_rw(AddressSpace *as, dma_addr_t addr, - void *buf, dma_addr_t len, - DMADirection dir) +/** + * dma_memory_rw: Read from or write to an address space from DMA controll= er. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @buf: buffer with the data transferred + * @len: the number of bytes to read or write + * @dir: indicates the transfer direction + */ +static inline MemTxResult dma_memory_rw(AddressSpace *as, dma_addr_t addr, + void *buf, dma_addr_t len, + DMADirection dir) { dma_barrier(as, dir); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897365; cv=none; d=zohomail.com; s=zohoarc; b=TL77bDHrUKKGtkPHbK/qh+esYcBLPUcYT3Q70PHLQuLqJPyS97mODkY1F1oSNjODXZRmFG2+WkYTvROYDpNo1S8wTWx2ywS+iUbcLUpZTnNDRaPcpF957+H/G4pi++c8C4+/U7C0D6fiR5mdaASCJTrdkh6CIzrn1KtLHmT85vQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897365; 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=iSQM4TycOU/aZ/A6V6wM4WejKUtcydIgnuYHCLvPHu0=; b=NCncm4IA2cjfQfh8EkOnlGpiT0BymfeR7IXpvqWlhQZJb/Z7alNTDcWA4NJtz+7p3ajlXIv6mAKZZHnRZvhwwjIJ2LPysaL3oYifhQIVWz4V7+PVsWzKTzbbuCZqgNkxZ3Ak8YuMMz9yUBtkk273ZDbykzK/ldvqBbmpWkZP4mg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160689736543532.44257952534599; Wed, 2 Dec 2020 00:22:45 -0800 (PST) Received: from localhost ([::1]:46708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNPQ-0001r8-7m for importer@patchew.org; Wed, 02 Dec 2020 03:22:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0002Ww-Ac for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC6-0003ar-LI for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:02 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-mMFdmw89NDG2CmphFEDgZQ-1; Wed, 02 Dec 2020 03:08:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A360480364D for ; Wed, 2 Dec 2020 08:08:54 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F6625D9C6 for ; Wed, 2 Dec 2020 08:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896538; 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: in-reply-to:in-reply-to:references:references; bh=iSQM4TycOU/aZ/A6V6wM4WejKUtcydIgnuYHCLvPHu0=; b=duzcYjSdztCjIIkQw5Q1Rw/+xfKNlnYzfjh9PZYNpuIvQrTQWKSBzsF+zgUd/6ZWkVb+8N DhWL85e5ROcYSCYGniTfMuwPriVeQcFZ6zqZazWs7PkqgfWmpEr3cP/qVaGpdU/9T5FxuL TZ/A+qF45I76OS5bfZd8gwiKIRHA+uQ= X-MC-Unique: mMFdmw89NDG2CmphFEDgZQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 010/113] dma: Let dma_memory_read() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:06 -0500 Message-Id: <20201202080849.4125477-11-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 dma_memory_rw_relaxed() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dma.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 04687d8825..df170047eb 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -89,8 +89,9 @@ static inline MemTxResult dma_memory_rw_relaxed(AddressSp= ace *as, buf, len, dir =3D=3D DMA_DIRECTION_FROM_DEVICE= ); } =20 -static inline int dma_memory_read_relaxed(AddressSpace *as, dma_addr_t add= r, - void *buf, dma_addr_t len) +static inline MemTxResult dma_memory_read_relaxed(AddressSpace *as, + dma_addr_t addr, + void *buf, dma_addr_t le= n) { return dma_memory_rw_relaxed(as, addr, buf, len, DMA_DIRECTION_TO_DEVI= CE); } @@ -124,8 +125,20 @@ static inline MemTxResult dma_memory_rw(AddressSpace *= as, dma_addr_t addr, return dma_memory_rw_relaxed(as, addr, buf, len, dir); } =20 -static inline int dma_memory_read(AddressSpace *as, dma_addr_t addr, - void *buf, dma_addr_t len) +/** + * dma_memory_read: Read from an address space from DMA controller. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). Called within RCU critical section. + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @buf: buffer with the data transferred + * @len: length of the data transferred + */ +static inline MemTxResult dma_memory_read(AddressSpace *as, dma_addr_t add= r, + void *buf, dma_addr_t len) { return dma_memory_rw(as, addr, buf, len, DMA_DIRECTION_TO_DEVICE); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606896865; cv=none; d=zohomail.com; s=zohoarc; b=FQ+3S+L+Z10TLVr+tucDzCoKFgbUhIEX9gW8TlPIglkps37w0uCrsZV0dtjkFp7cv1CvOh2+GkaTEUVCWzOJbSsFGAcQ+4Ws2obfANhAG5hT/uABM8QtV3RNJVF8XGjZ48igAeIC0MW8BTDI1FVCZaLJKqiKaJwTxrjxPNHbiRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606896865; 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=rTVoi29gC74acpeb2au0S7K7q6DLOyKwhDxRZ40SR7Q=; b=UMIVu46T9likHkExGg/Ei2z9S4HJ+NWKlf8OHEUIImiBAUma3Mndsu9MwfaP5RgIlwN7QBLinqQ/TDIwifVRbWsjcUWWI8QcBAITYHirFJc78dYoRCXyxSDSziFcwT4HxgPeGBkvVHnrukL5ImQW/ICugBUOmi8bHl0fEZSx9cY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606896865248710.8116875398277; Wed, 2 Dec 2020 00:14:25 -0800 (PST) Received: from localhost ([::1]:50086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNHM-0008BK-5Q for importer@patchew.org; Wed, 02 Dec 2020 03:14:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCA-0002Vq-RQ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54251) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC6-0003aQ-1M for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:02 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-JtaeM4p5Mh-YSd2U4mFl_Q-1; Wed, 02 Dec 2020 03:08:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1E0C185E486 for ; Wed, 2 Dec 2020 08:08:54 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE7595D9C6 for ; Wed, 2 Dec 2020 08:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896537; 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: in-reply-to:in-reply-to:references:references; bh=rTVoi29gC74acpeb2au0S7K7q6DLOyKwhDxRZ40SR7Q=; b=DpY2JzGPdTHWXeDV8uGXzT49N4brCfKbB3wDUJl4ZgMHZPOi4QGdtPn4bmlyClQr4khQ1e boWfQk00skxFk2M76bcWCdGuMU1MII2fGuatGf5LkPncaWSEFGnlC3vKEj5+C8h7G7fbTH /TE/KmKbiFCkVQH6mxfMFoKJYhbUT7g= X-MC-Unique: JtaeM4p5Mh-YSd2U4mFl_Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 011/113] dma: Let dma_memory_write() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:07 -0500 Message-Id: <20201202080849.4125477-12-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 dma_memory_rw_relaxed() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-8-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dma.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index df170047eb..a052f7bca3 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -96,8 +96,10 @@ static inline MemTxResult dma_memory_read_relaxed(Addres= sSpace *as, return dma_memory_rw_relaxed(as, addr, buf, len, DMA_DIRECTION_TO_DEVI= CE); } =20 -static inline int dma_memory_write_relaxed(AddressSpace *as, dma_addr_t ad= dr, - const void *buf, dma_addr_t len) +static inline MemTxResult dma_memory_write_relaxed(AddressSpace *as, + dma_addr_t addr, + const void *buf, + dma_addr_t len) { return dma_memory_rw_relaxed(as, addr, (void *)buf, len, DMA_DIRECTION_FROM_DEVICE); @@ -143,8 +145,20 @@ static inline MemTxResult dma_memory_read(AddressSpace= *as, dma_addr_t addr, return dma_memory_rw(as, addr, buf, len, DMA_DIRECTION_TO_DEVICE); } =20 -static inline int dma_memory_write(AddressSpace *as, dma_addr_t addr, - const void *buf, dma_addr_t len) +/** + * address_space_write: Write to address space from DMA controller. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @buf: buffer with the data transferred + * @len: the number of bytes to write + */ +static inline MemTxResult dma_memory_write(AddressSpace *as, dma_addr_t ad= dr, + const void *buf, dma_addr_t len) { return dma_memory_rw(as, addr, (void *)buf, len, DMA_DIRECTION_FROM_DEVICE); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897206; cv=none; d=zohomail.com; s=zohoarc; b=HNbl1SjojZ4zgzlKhtuIgm1QEGHcbb0qUhAz087xwukc5GG1DwAOdrPnYVFr7imO+x6zvU1u1cvmHp17wV23wygQVcedFz5AdvNUrIV2b5Jxwa0O5dDmHoi653skGM+WZlwQept+cFtLEre5Zm3BUT0ETFIBYc6/DK6+P1ZBy5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897206; 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=qSw/XPdn0uogh4Yg5yt/5D+j2vX84J5WVXGjVYlsiQA=; b=VwcaZutW+1AJi/JYPPvXOmwvMweR3kW54bUnkpKaJMOkchCJvcCxYupYkh2D8vX2YXa0KNP0u9TrDsZiljSeXZCweIhBQHASo8SY6r9sWaZlHhw/f3wVTSaZzLehSziFDBtH1AMVZE8Db2ycP2F1+AvfB/h9q7Lcwt4ZBblaFUc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897206149671.0635048031297; Wed, 2 Dec 2020 00:20:06 -0800 (PST) Received: from localhost ([::1]:38546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNMq-0006jy-QY for importer@patchew.org; Wed, 02 Dec 2020 03:20:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0002WJ-0t for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC6-0003an-KM for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:02 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-WoeiqyxZNb-hcUBSTVMBbw-1; Wed, 02 Dec 2020 03:08:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C6BC1074641 for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 192105D9C6 for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896537; 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: in-reply-to:in-reply-to:references:references; bh=qSw/XPdn0uogh4Yg5yt/5D+j2vX84J5WVXGjVYlsiQA=; b=TnNhpP4vhyRLi1caH5L0Je7Jn/5QfZ2AH1ZHUI7K6ZtuIUihNGAVzxnitHVIEOl8ySY5R+ kebqSQWACssho986Wmqf5wzloQ3kXk811o/8wVpKLToYVVqLrXbD8dM2Fk4IyqIG8fiuz7 B/XZ2cY/k8pvizZSMsCVTgAkG0VkOUg= X-MC-Unique: WoeiqyxZNb-hcUBSTVMBbw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 012/113] pci: Let pci_dma_rw() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:08 -0500 Message-Id: <20201202080849.4125477-13-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 dma_memory_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Li Qiang Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/pci/pci.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 72ce649eee..37ffd73708 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -781,8 +781,22 @@ static inline AddressSpace *pci_get_address_space(PCID= evice *dev) return &dev->bus_master_as; } =20 -static inline int pci_dma_rw(PCIDevice *dev, dma_addr_t addr, - void *buf, dma_addr_t len, DMADirection dir) +/** + * pci_dma_rw: Read from or write to an address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: the number of bytes to read or write + * @dir: indicates the transfer direction + */ +static inline MemTxResult pci_dma_rw(PCIDevice *dev, dma_addr_t addr, + void *buf, dma_addr_t len, + DMADirection dir) { return dma_memory_rw(pci_get_address_space(dev), addr, buf, len, dir); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897090; cv=none; d=zohomail.com; s=zohoarc; b=D22tNKLnWBdUrLGYj/nBBqLyohDn0GMoPBXoQWMCdYCwT86j82h86634i/XqwkK8lu81UR/+FfY22PsN4br6Ngqleho3AS813NILsPyMsJeZucCNJHp/qHwfAKx4hAIJO4AXJCj5S7WLeq8zVmJ/KU7LqNVc4ovemK+SOlhU9Qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897090; 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=KnVKXazOKZtzkqfDSO0i8ILeR1uurigLABfT0Bf0yXU=; b=ksG+EsrNIryAGDEgIPsjWtByt3bWJxjuW8K4aQ56WHwPVKCFbBsWrWk5k5LS1v0f92gHt1EZU+C48yrXIt/3D7JHq9ye549AmClzrVlQ41DwyvaQzE/JIoLQ5dtlaWVc47+RiiaHvOLkWDqHVpyyBXoBK4iWw5LGQ1xIjklGFd8= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897090391609.7261748562066; Wed, 2 Dec 2020 00:18:10 -0800 (PST) Received: from localhost ([::1]:33496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNKz-0004aA-52 for importer@patchew.org; Wed, 02 Dec 2020 03:18:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0002YN-St for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC6-0003av-Qb for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-DhMXokChNM6b353JeJsK5A-1; Wed, 02 Dec 2020 03:08:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B95D185E48D for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 680015D9C6 for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896538; 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: in-reply-to:in-reply-to:references:references; bh=KnVKXazOKZtzkqfDSO0i8ILeR1uurigLABfT0Bf0yXU=; b=bxF0ZVxcI7VPp5thL/pSiWxRthzkWDQKZGvhA5zGjBG+ce8pbIgvozADNgEBnnziY5popU IaZAB2txh46YV8q1M9wsXh0UdGYqf1YOI6J3r2/exZ+f62bT/RrM424aVfx1eQginA+i8B vKojXomhDent49afAO6Asss7dnYdPDI= X-MC-Unique: DhMXokChNM6b353JeJsK5A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 013/113] pci: Let pci_dma_read() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:09 -0500 Message-Id: <20201202080849.4125477-14-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 pci_dma_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Li Qiang Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/pci/pci.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 37ffd73708..a2de236eeb 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -801,8 +801,20 @@ static inline MemTxResult pci_dma_rw(PCIDevice *dev, d= ma_addr_t addr, return dma_memory_rw(pci_get_address_space(dev), addr, buf, len, dir); } =20 -static inline int pci_dma_read(PCIDevice *dev, dma_addr_t addr, - void *buf, dma_addr_t len) +/** + * pci_dma_read: Read from an address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). Called within RCU critical section. + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: length of the data transferred + */ +static inline MemTxResult pci_dma_read(PCIDevice *dev, dma_addr_t addr, + void *buf, dma_addr_t len) { return pci_dma_rw(dev, addr, buf, len, DMA_DIRECTION_TO_DEVICE); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897284; cv=none; d=zohomail.com; s=zohoarc; b=ZVT1ljOVPH6vsYjD9TGIaBEuhjQahufW5i243e4lW5gnQ1PuLX/mnzsfEqEBNbA8ehJJZXqJecfQLSdbI+YTku+Z6cKlhQmbBNJsasteI6iXvwAhxUtNqUeUd9vlKA4HK/wkQksUDq7G4ZJUxlYdkhScPieV4eXb0cjg9iTcQxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897284; 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=8+cUB7OodCQRiZm0/4C8hQJdS3iJ6+mtcYRXeajhZjE=; b=kK2lO4cHFxWtBjBezXlbtStP5FZzaKgZFIhzSjX9XrDnBEWigGAnEh1f3gjDGUmOI4A7OrFUpoN9HaHTzuvFWx+ih33CawmZbUgH9vl5I6CkVHIBBLkIlKYvxBnlV0pjTJSoYrlZaIqBwK49S+c2t8Fi37Gy+C7OgqhewG6kT9k= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897284720323.55364219508954; Wed, 2 Dec 2020 00:21:24 -0800 (PST) Received: from localhost ([::1]:41764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNO7-0008ER-Kl for importer@patchew.org; Wed, 02 Dec 2020 03:21:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCC-0002Zq-Et for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC7-0003b2-4N for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:04 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-574-V-fCl2beOaq5NhdhqxMOmg-1; Wed, 02 Dec 2020 03:08:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9D921074642 for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B71115D9C6 for ; Wed, 2 Dec 2020 08:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896538; 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: in-reply-to:in-reply-to:references:references; bh=8+cUB7OodCQRiZm0/4C8hQJdS3iJ6+mtcYRXeajhZjE=; b=XnoP0urqOT/QdnxaQ4dTInjZetE6TD4PN8FE/k2t763u/3BMlZDVBdrwYlClhoEK2PrcZW tC9e8+0g2C7ZhXe9nReoJlnQuJcCeeIVqwSoMhVBo40eXs4CeqjYFUyk/lnzlPw7TOy8Da s9maWszi3hdHCZ/IcayJMvZ0Zlj+50I= X-MC-Unique: V-fCl2beOaq5NhdhqxMOmg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 014/113] pci: Let pci_dma_write() propagate MemTxResult Date: Wed, 2 Dec 2020 03:07:10 -0500 Message-Id: <20201202080849.4125477-15-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 pci_dma_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Li Qiang Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201023151923.3243652-11-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/pci/pci.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index a2de236eeb..259f9c992d 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -819,8 +819,20 @@ static inline MemTxResult pci_dma_read(PCIDevice *dev,= dma_addr_t addr, return pci_dma_rw(dev, addr, buf, len, DMA_DIRECTION_TO_DEVICE); } =20 -static inline int pci_dma_write(PCIDevice *dev, dma_addr_t addr, - const void *buf, dma_addr_t len) +/** + * pci_dma_write: Write to address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: the number of bytes to write + */ +static inline MemTxResult pci_dma_write(PCIDevice *dev, dma_addr_t addr, + const void *buf, dma_addr_t len) { return pci_dma_rw(dev, addr, (void *) buf, len, DMA_DIRECTION_FROM_DEV= ICE); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897370; cv=none; d=zohomail.com; s=zohoarc; b=Qv/kXp4nObN47hLj+WOqBZQdBnamki7i1PI97zJXbqIiNtE6qSQR7G/XVl2O3Ly02g3/9QOcVL9RKFPcIF2Llds+ktXiGtw62D0uO3zw7COTKP/M7ClpdlqqmT/uSXU9Md6C7RP3YodvxQudN5vLB5q5hwtWdCT6ds00RdxFrIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897370; 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=Vb6NI7DKqvwU0V2c2FIb3FoQFv8qL9Rrv9Mjf3ju3ds=; b=ngfwTREOag8u49cikbFhpotB5mKuvsHpaa64Xk+d8sw/gVB1myzlIAWzejYEh/8aGbUjpD/SPoT6MS80lpWVAdKCt4S8VfAZFMfwNLR4/0pnqhCJsyuDPql8OUslQDZ2z4LwcGGkp/xfeMlGDIeg29SLsJ4wp4Mb3jc4JoicMGI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897370189115.30077639882859; Wed, 2 Dec 2020 00:22:50 -0800 (PST) Received: from localhost ([::1]:47224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNPV-00024f-0i for importer@patchew.org; Wed, 02 Dec 2020 03:22:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCD-0002cH-DM for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC8-0003bl-7V for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-viJCwdtcOfmY9wkrbNoR2g-1; Wed, 02 Dec 2020 03:08:57 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C6F71074645 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1210D5D9C6 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896539; 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: in-reply-to:in-reply-to:references:references; bh=Vb6NI7DKqvwU0V2c2FIb3FoQFv8qL9Rrv9Mjf3ju3ds=; b=PibE+JIS7IWmP2QpVeOZ658Z++15mgTHHbEO3spTXMKMBkG78bWW1X9/7lvrxBkLe5qN7Y 8rbL08aOfAhzlmfKCtPIYSE39dBRCNCG/ZkFzImAhnvx9JZ38PXZB7/VtlVVW5MvhdYxAO JEGA9Ws4jhjj33AVqDf19/NthwW+vDU= X-MC-Unique: viJCwdtcOfmY9wkrbNoR2g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 015/113] hw/ssi/aspeed_smc: Rename 'max_slaves' variable as 'max_peripherals' Date: Wed, 2 Dec 2020 03:07:11 -0500 Message-Id: <20201202080849.4125477-16-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 In order to use inclusive terminology, rename max_slaves as max_peripherals. Patch generated using: $ sed -i s/slave/peripheral/ \ hw/ssi/aspeed_smc.c include/hw/ssi/aspeed_smc.h One line in aspeed_smc_read() has been manually tweaked to pass checkpatch. Reviewed-by: Thomas Huth Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012124955.3409127-2-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/ssi/aspeed_smc.c | 53 +++++++++++++++++++------------------ include/hw/ssi/aspeed_smc.h | 2 +- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 795784e5f3..2780cac71d 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -181,7 +181,7 @@ #define SNOOP_START 0x0 =20 /* - * Default segments mapping addresses and size for each slave per + * Default segments mapping addresses and size for each peripheral per * controller. These can be changed when board is initialized with the * Segment Address Registers. */ @@ -259,7 +259,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 1, + .max_peripherals =3D 1, .segments =3D aspeed_segments_legacy, .flash_window_base =3D ASPEED_SOC_SMC_FLASH_BASE, .flash_window_size =3D 0x6000000, @@ -275,7 +275,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 5, + .max_peripherals =3D 5, .segments =3D aspeed_segments_fmc, .flash_window_base =3D ASPEED_SOC_FMC_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -293,7 +293,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_SPI_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D SPI_CONF_ENABLE_W0, - .max_slaves =3D 1, + .max_peripherals =3D 1, .segments =3D aspeed_segments_spi, .flash_window_base =3D ASPEED_SOC_SPI_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -309,7 +309,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 3, + .max_peripherals =3D 3, .segments =3D aspeed_segments_ast2500_fmc, .flash_window_base =3D ASPEED_SOC_FMC_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -327,7 +327,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 2, + .max_peripherals =3D 2, .segments =3D aspeed_segments_ast2500_spi1, .flash_window_base =3D ASPEED_SOC_SPI_FLASH_BASE, .flash_window_size =3D 0x8000000, @@ -343,7 +343,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 2, + .max_peripherals =3D 2, .segments =3D aspeed_segments_ast2500_spi2, .flash_window_base =3D ASPEED_SOC_SPI2_FLASH_BASE, .flash_window_size =3D 0x8000000, @@ -359,7 +359,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 1, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 3, + .max_peripherals =3D 3, .segments =3D aspeed_segments_ast2600_fmc, .flash_window_base =3D ASPEED26_SOC_FMC_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -377,7 +377,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 2, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 2, + .max_peripherals =3D 2, .segments =3D aspeed_segments_ast2600_spi1, .flash_window_base =3D ASPEED26_SOC_SPI_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -395,7 +395,7 @@ static const AspeedSMCController controllers[] =3D { .r_timings =3D R_TIMINGS, .nregs_timings =3D 3, .conf_enable_w0 =3D CONF_ENABLE_W0, - .max_slaves =3D 3, + .max_peripherals =3D 3, .segments =3D aspeed_segments_ast2600_spi2, .flash_window_base =3D ASPEED26_SOC_SPI2_FLASH_BASE, .flash_window_size =3D 0x10000000, @@ -410,7 +410,7 @@ static const AspeedSMCController controllers[] =3D { =20 /* * The Segment Registers of the AST2400 and AST2500 have a 8MB - * unit. The address range of a flash SPI slave is encoded with + * unit. The address range of a flash SPI peripheral is encoded with * absolute addresses which should be part of the overall controller * window. */ @@ -432,7 +432,7 @@ static void aspeed_smc_reg_to_segment(const AspeedSMCSt= ate *s, =20 /* * The Segment Registers of the AST2600 have a 1MB unit. The address - * range of a flash SPI slave is encoded with offsets in the overall + * range of a flash SPI peripheral is encoded with offsets in the overall * controller window. The previous SoC AST2400 and AST2500 used * absolute addresses. Only bits [27:20] are relevant and the end * address is an upper bound limit. @@ -476,7 +476,7 @@ static bool aspeed_smc_flash_overlap(const AspeedSMCSta= te *s, AspeedSegments seg; int i; =20 - for (i =3D 0; i < s->ctrl->max_slaves; i++) { + for (i =3D 0; i < s->ctrl->max_peripherals; i++) { if (i =3D=3D cs) { continue; } @@ -537,7 +537,7 @@ static void aspeed_smc_flash_set_segment(AspeedSMCState= *s, int cs, */ if ((s->ctrl->segments =3D=3D aspeed_segments_ast2500_spi1 || s->ctrl->segments =3D=3D aspeed_segments_ast2500_spi2) && - cs =3D=3D s->ctrl->max_slaves && + cs =3D=3D s->ctrl->max_peripherals && seg.addr + seg.size !=3D s->ctrl->segments[cs].addr + s->ctrl->segments[cs].size) { qemu_log_mask(LOG_GUEST_ERROR, @@ -941,14 +941,14 @@ static void aspeed_smc_reset(DeviceState *d) =20 memset(s->regs, 0, sizeof s->regs); =20 - /* Unselect all slaves */ + /* Unselect all peripherals */ for (i =3D 0; i < s->num_cs; ++i) { s->regs[s->r_ctrl0 + i] |=3D CTRL_CE_STOP_ACTIVE; qemu_set_irq(s->cs_lines[i], true); } =20 /* setup the default segment register values and regions for all */ - for (i =3D 0; i < s->ctrl->max_slaves; ++i) { + for (i =3D 0; i < s->ctrl->max_peripherals; ++i) { aspeed_smc_flash_set_segment_region(s, i, s->ctrl->segment_to_reg(s, &s->ctrl->segments[i])); } @@ -995,8 +995,9 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr ad= dr, unsigned int size) (s->ctrl->has_dma && addr =3D=3D R_DMA_DRAM_ADDR) || (s->ctrl->has_dma && addr =3D=3D R_DMA_LEN) || (s->ctrl->has_dma && addr =3D=3D R_DMA_CHECKSUM) || - (addr >=3D R_SEG_ADDR0 && addr < R_SEG_ADDR0 + s->ctrl->max_slaves= ) || - (addr >=3D s->r_ctrl0 && addr < s->r_ctrl0 + s->ctrl->max_slaves))= { + (addr >=3D R_SEG_ADDR0 && + addr < R_SEG_ADDR0 + s->ctrl->max_peripherals) || + (addr >=3D s->r_ctrl0 && addr < s->r_ctrl0 + s->ctrl->max_peripher= als)) { =20 trace_aspeed_smc_read(addr, size, s->regs[addr]); =20 @@ -1270,7 +1271,7 @@ static void aspeed_smc_write(void *opaque, hwaddr add= r, uint64_t data, int cs =3D addr - s->r_ctrl0; aspeed_smc_flash_update_ctrl(&s->flashes[cs], value); } else if (addr >=3D R_SEG_ADDR0 && - addr < R_SEG_ADDR0 + s->ctrl->max_slaves) { + addr < R_SEG_ADDR0 + s->ctrl->max_peripherals) { int cs =3D addr - R_SEG_ADDR0; =20 if (value !=3D s->regs[R_SEG_ADDR0 + cs]) { @@ -1341,10 +1342,10 @@ static void aspeed_smc_realize(DeviceState *dev, Er= ror **errp) s->conf_enable_w0 =3D s->ctrl->conf_enable_w0; =20 /* Enforce some real HW limits */ - if (s->num_cs > s->ctrl->max_slaves) { + if (s->num_cs > s->ctrl->max_peripherals) { qemu_log_mask(LOG_GUEST_ERROR, "%s: num_cs cannot exceed: %d\n", - __func__, s->ctrl->max_slaves); - s->num_cs =3D s->ctrl->max_slaves; + __func__, s->ctrl->max_peripherals); + s->num_cs =3D s->ctrl->max_peripherals; } =20 /* DMA irq. Keep it first for the initialization in the SoC */ @@ -1352,7 +1353,7 @@ static void aspeed_smc_realize(DeviceState *dev, Erro= r **errp) =20 s->spi =3D ssi_create_bus(dev, "spi"); =20 - /* Setup cs_lines for slaves */ + /* Setup cs_lines for peripherals */ s->cs_lines =3D g_new0(qemu_irq, s->num_cs); =20 for (i =3D 0; i < s->num_cs; ++i) { @@ -1376,16 +1377,16 @@ static void aspeed_smc_realize(DeviceState *dev, Er= ror **errp) s->ctrl->flash_window_size); sysbus_init_mmio(sbd, &s->mmio_flash); =20 - s->flashes =3D g_new0(AspeedSMCFlash, s->ctrl->max_slaves); + s->flashes =3D g_new0(AspeedSMCFlash, s->ctrl->max_peripherals); =20 /* - * Let's create a sub memory region for each possible slave. All + * Let's create a sub memory region for each possible peripheral. All * have a configurable memory segment in the overall flash mapping * window of the controller but, there is not necessarily a flash * module behind to handle the memory accesses. This depends on * the board configuration. */ - for (i =3D 0; i < s->ctrl->max_slaves; ++i) { + for (i =3D 0; i < s->ctrl->max_peripherals; ++i) { AspeedSMCFlash *fl =3D &s->flashes[i]; =20 snprintf(name, sizeof(name), "%s.%d", s->ctrl->name, i); diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 3dd354b52e..16c03fe64f 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -43,7 +43,7 @@ typedef struct AspeedSMCController { uint8_t r_timings; uint8_t nregs_timings; uint8_t conf_enable_w0; - uint8_t max_slaves; + uint8_t max_peripherals; const AspeedSegments *segments; hwaddr flash_window_base; uint32_t flash_window_size; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897653; cv=none; d=zohomail.com; s=zohoarc; b=AHPaFSRcyBsQqDkNcFWILRK/aiaYkeDaeSPMSUb8LypkTOJQJsl0wIvgxApcDa8JAF4PGUsK434R/0T0wA9RDb7sZ4XayB7OJOowcb6yQJK8CcaRd5L5GCDP+fPbffXWzE29+Foy8t5SUDUCGAAkumgAzV8X/BZasgjiJ5JFmTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897653; 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=8Q/MQ+Ntyc6dcfpNs+OQsVO2nBRfCw5LnAgTVEhalio=; b=MDAMkXgpA5HzjOH9ElG0W466ph5142LLfzoUES7LaTv7w06Y6wGlhKSNCLtupnsYZx1jTh41L6ZkcgWJEfQBMDJUDyaivt6MhHSXrwqKfc7QE3skDjehtLuD2iuG87jsCK9fRWmyySM9TOtI38h9tK5dkBqVKz+BRa3MWq8WlvU= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160689765310931.750096335886496; Wed, 2 Dec 2020 00:27:33 -0800 (PST) Received: from localhost ([::1]:58522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNU4-0006s1-0n for importer@patchew.org; Wed, 02 Dec 2020 03:27:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0002fA-Qt for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC8-0003bh-5g for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:06 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-14-PmOlTWvmPWuMbNh5NLv1yw-1; Wed, 02 Dec 2020 03:08:57 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95190803651 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 617C45D9C6 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896539; 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: in-reply-to:in-reply-to:references:references; bh=8Q/MQ+Ntyc6dcfpNs+OQsVO2nBRfCw5LnAgTVEhalio=; b=QLSyvNVZBdEOLPwyi6zwCYfi5TTRdUF2H8snkQb+/1JrZ3lvV3CIhpJe3RwCNEgHo04DXG CcIx86XZOHWIEckl1zJg8aZTIGoe1dqR+8zIeCPEiIJA/fG/tne9CrksGvSlLFRqj64UNZ ux+7py9ucbTlyK/0zXNwCOIhPxrZmRE= X-MC-Unique: PmOlTWvmPWuMbNh5NLv1yw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 016/113] hw/ssi: Update coding style to make checkpatch.pl happy Date: Wed, 2 Dec 2020 03:07:12 -0500 Message-Id: <20201202080849.4125477-17-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 To make the next commit easier to review, clean this code first. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012124955.3409127-3-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- include/hw/ssi/ssi.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index fe3028c39d..c15548425a 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -1,12 +1,14 @@ /* QEMU Synchronous Serial Interface support. */ =20 -/* In principle SSI is a point-point interface. As such the qemu - implementation has a single slave device on a "bus". - However it is fairly common for boards to have multiple slaves - connected to a single master, and select devices with an external - chip select. This is implemented in qemu by having an explicit mux dev= ice. - It is assumed that master and slave are both using the same transfer wi= dth. - */ +/* + * In principle SSI is a point-point interface. As such the qemu + * implementation has a single slave device on a "bus". + * However it is fairly common for boards to have multiple slaves + * connected to a single master, and select devices with an external + * chip select. This is implemented in qemu by having an explicit mux dev= ice. + * It is assumed that master and slave are both using the same transfer + * width. + */ =20 #ifndef QEMU_SSI_H #define QEMU_SSI_H --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897366; cv=none; d=zohomail.com; s=zohoarc; b=U31/Rap2KAyVoAK3cncFg6llTnfkG0h68ZwKvGQ6IQTD8qpEA7dw4ldGr6GFmjKDFq/1NbZ90GC+0lHkz3jzSOZiCBKov/rjn1RC59aZYyEEA957mKz0EdeJrKuqtaKfFEwMzrj/usRm9XuMw6guhEyHAcxrDXbNS9zhYi8VSPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897366; 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=bI8a2OBVzGYdsJFXtWb+6HvhcHEQ5Pjf3gQPWHifR/U=; b=i250fIGWSQG3VnXOPzQBJk6asWwswfjH3ki1zzh0BfY7gMjIJeoHQ3NMOigihkCeniyIkE1CEak/i3B5r9gP2nrMq+qve1RaBPnvC5bS3xoh/NUsyh8d9V3GRC5clwZhEUMDmr4uE61/epptcNrmN0cNeVB7PPfotBcRJt+AihU= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897366776686.0490821169886; Wed, 2 Dec 2020 00:22:46 -0800 (PST) Received: from localhost ([::1]:46784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNPR-0001tV-EN for importer@patchew.org; Wed, 02 Dec 2020 03:22:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0002pB-If for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCA-0003da-AW for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-G-8gDOIZOe6DP9PNt514eQ-1; Wed, 02 Dec 2020 03:08:57 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5F091006C82 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B21545D9C6 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896541; 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: in-reply-to:in-reply-to:references:references; bh=bI8a2OBVzGYdsJFXtWb+6HvhcHEQ5Pjf3gQPWHifR/U=; b=FHDw27dt3rRwD8EqjMvjOiSM8D7I+NjF07xKERnvhcAl+Y9yQHUejypuFhUmNZqtL56tf8 0dKKLixJNVpJlfrexgDLzQiysD/b+LpbxKgUVJuzReNpZcYSl+Udg0hPPVWw/FqRtu6laR KUrkceOay5V20HEzCejstQ8e7xGXZ4I= X-MC-Unique: G-8gDOIZOe6DP9PNt514eQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 017/113] hw/ssi: Rename SSI 'slave' as 'peripheral' Date: Wed, 2 Dec 2020 03:07:13 -0500 Message-Id: <20201202080849.4125477-18-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 In order to use inclusive terminology, rename SSI 'slave' as 'peripheral', following the specification resolution: https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/ Patch created mechanically using: $ sed -i s/SSISlave/SSIPeripheral/ $(git grep -l SSISlave) $ sed -i s/SSI_SLAVE/SSI_PERIPHERAL/ $(git grep -l SSI_SLAVE) $ sed -i s/ssi-slave/ssi-peripheral/ $(git grep -l ssi-slave) $ sed -i s/ssi_slave/ssi_peripheral/ $(git grep -l ssi_slave) $ sed -i s/ssi_create_slave/ssi_create_peripheral/ \ $(git grep -l ssi_create_slave) Then in VMStateDescription vmstate_ssi_peripheral we restored the "SSISlave" migration stream name (to avoid breaking migration). Finally the following files have been manually tweaked: - hw/ssi/pl022.c - hw/ssi/xilinx_spips.c Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012124955.3409127-4-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/arm/spitz.c | 32 +++++++++++++------------- hw/arm/stellaris.c | 4 ++-- hw/arm/tosa.c | 12 +++++----- hw/arm/z2.c | 14 ++++++------ hw/block/m25p80.c | 14 ++++++------ hw/display/ads7846.c | 12 +++++----- hw/display/ssd0323.c | 12 +++++----- hw/misc/max111x.c | 18 +++++++-------- hw/sd/ssi-sd.c | 12 +++++----- hw/ssi/pl022.c | 2 +- hw/ssi/ssi.c | 48 +++++++++++++++++++-------------------- hw/ssi/xilinx_spips.c | 7 +++--- include/hw/misc/max111x.h | 2 +- include/hw/ssi/ssi.h | 46 ++++++++++++++++++------------------- 14 files changed, 118 insertions(+), 117 deletions(-) diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 772662f149..6b3bf9828b 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -578,7 +578,7 @@ static void spitz_keyboard_realize(DeviceState *dev, Er= ror **errp) OBJECT_DECLARE_SIMPLE_TYPE(SpitzLCDTG, SPITZ_LCDTG) =20 struct SpitzLCDTG { - SSISlave ssidev; + SSIPeripheral ssidev; uint32_t bl_intensity; uint32_t bl_power; }; @@ -612,7 +612,7 @@ static inline void spitz_bl_power(void *opaque, int lin= e, int level) spitz_bl_update(s); } =20 -static uint32_t spitz_lcdtg_transfer(SSISlave *dev, uint32_t value) +static uint32_t spitz_lcdtg_transfer(SSIPeripheral *dev, uint32_t value) { SpitzLCDTG *s =3D SPITZ_LCDTG(dev); int addr; @@ -641,7 +641,7 @@ static uint32_t spitz_lcdtg_transfer(SSISlave *dev, uin= t32_t value) return 0; } =20 -static void spitz_lcdtg_realize(SSISlave *ssi, Error **errp) +static void spitz_lcdtg_realize(SSIPeripheral *ssi, Error **errp) { SpitzLCDTG *s =3D SPITZ_LCDTG(ssi); DeviceState *dev =3D DEVICE(s); @@ -667,12 +667,12 @@ OBJECT_DECLARE_SIMPLE_TYPE(CorgiSSPState, CORGI_SSP) =20 /* "Demux" the signal based on current chipselect */ struct CorgiSSPState { - SSISlave ssidev; + SSIPeripheral ssidev; SSIBus *bus[3]; uint32_t enable[3]; }; =20 -static uint32_t corgi_ssp_transfer(SSISlave *dev, uint32_t value) +static uint32_t corgi_ssp_transfer(SSIPeripheral *dev, uint32_t value) { CorgiSSPState *s =3D CORGI_SSP(dev); int i; @@ -700,7 +700,7 @@ static void corgi_ssp_gpio_cs(void *opaque, int line, i= nt level) #define SPITZ_BATTERY_VOLT 0xd0 /* About 4.0V */ #define SPITZ_CHARGEON_ACIN 0x80 /* About 5.0V */ =20 -static void corgi_ssp_realize(SSISlave *d, Error **errp) +static void corgi_ssp_realize(SSIPeripheral *d, Error **errp) { DeviceState *dev =3D DEVICE(d); CorgiSSPState *s =3D CORGI_SSP(d); @@ -715,14 +715,14 @@ static void spitz_ssp_attach(SpitzMachineState *sms) { void *bus; =20 - sms->mux =3D ssi_create_slave(sms->mpu->ssp[CORGI_SSP_PORT - 1], - TYPE_CORGI_SSP); + sms->mux =3D ssi_create_peripheral(sms->mpu->ssp[CORGI_SSP_PORT - 1], + TYPE_CORGI_SSP); =20 bus =3D qdev_get_child_bus(sms->mux, "ssi0"); - sms->lcdtg =3D ssi_create_slave(bus, TYPE_SPITZ_LCDTG); + sms->lcdtg =3D ssi_create_peripheral(bus, TYPE_SPITZ_LCDTG); =20 bus =3D qdev_get_child_bus(sms->mux, "ssi1"); - sms->ads7846 =3D ssi_create_slave(bus, "ads7846"); + sms->ads7846 =3D ssi_create_peripheral(bus, "ads7846"); qdev_connect_gpio_out(sms->ads7846, 0, qdev_get_gpio_in(sms->mpu->gpio, SPITZ_GPIO_TP_I= NT)); =20 @@ -1204,7 +1204,7 @@ static const VMStateDescription vmstate_corgi_ssp_reg= s =3D { .version_id =3D 2, .minimum_version_id =3D 2, .fields =3D (VMStateField[]) { - VMSTATE_SSI_SLAVE(ssidev, CorgiSSPState), + VMSTATE_SSI_PERIPHERAL(ssidev, CorgiSSPState), VMSTATE_UINT32_ARRAY(enable, CorgiSSPState, 3), VMSTATE_END_OF_LIST(), } @@ -1213,7 +1213,7 @@ static const VMStateDescription vmstate_corgi_ssp_reg= s =3D { static void corgi_ssp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D corgi_ssp_realize; k->transfer =3D corgi_ssp_transfer; @@ -1222,7 +1222,7 @@ static void corgi_ssp_class_init(ObjectClass *klass, = void *data) =20 static const TypeInfo corgi_ssp_info =3D { .name =3D TYPE_CORGI_SSP, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(CorgiSSPState), .class_init =3D corgi_ssp_class_init, }; @@ -1232,7 +1232,7 @@ static const VMStateDescription vmstate_spitz_lcdtg_r= egs =3D { .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_SSI_SLAVE(ssidev, SpitzLCDTG), + VMSTATE_SSI_PERIPHERAL(ssidev, SpitzLCDTG), VMSTATE_UINT32(bl_intensity, SpitzLCDTG), VMSTATE_UINT32(bl_power, SpitzLCDTG), VMSTATE_END_OF_LIST(), @@ -1242,7 +1242,7 @@ static const VMStateDescription vmstate_spitz_lcdtg_r= egs =3D { static void spitz_lcdtg_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D spitz_lcdtg_realize; k->transfer =3D spitz_lcdtg_transfer; @@ -1251,7 +1251,7 @@ static void spitz_lcdtg_class_init(ObjectClass *klass= , void *data) =20 static const TypeInfo spitz_lcdtg_info =3D { .name =3D TYPE_SPITZ_LCDTG, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(SpitzLCDTG), .class_init =3D spitz_lcdtg_class_init, }; diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 1237f5af02..652823195b 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1397,8 +1397,8 @@ static void stellaris_init(MachineState *ms, stellari= s_board_info *board) */ bus =3D qdev_get_child_bus(dev, "ssi"); =20 - sddev =3D ssi_create_slave(bus, "ssi-sd"); - ssddev =3D ssi_create_slave(bus, "ssd0323"); + sddev =3D ssi_create_peripheral(bus, "ssi-sd"); + ssddev =3D ssi_create_peripheral(bus, "ssd0323"); gpio_out[GPIO_D][0] =3D qemu_irq_split( qdev_get_gpio_in_named(sddev, SSI_GPIO_CS, 0), qdev_get_gpio_in_named(ssddev, SSI_GPIO_CS, 0)); diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 66b244aeff..d5a6763cf9 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -148,13 +148,13 @@ static void tosa_gpio_setup(PXA2xxState *cpu, qemu_irq_raise(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_USB_IN)); } =20 -static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value) +static uint32_t tosa_ssp_tansfer(SSIPeripheral *dev, uint32_t value) { fprintf(stderr, "TG: %u %02x\n", value >> 5, value & 0x1f); return 0; } =20 -static void tosa_ssp_realize(SSISlave *dev, Error **errp) +static void tosa_ssp_realize(SSIPeripheral *dev, Error **errp) { /* Nothing to do. */ } @@ -225,7 +225,7 @@ static void tosa_tg_init(PXA2xxState *cpu) { I2CBus *bus =3D pxa2xx_i2c_bus(cpu->i2c[0]); i2c_slave_create_simple(bus, TYPE_TOSA_DAC, DAC_BASE); - ssi_create_slave(cpu->ssp[1], "tosa-ssp"); + ssi_create_peripheral(cpu->ssp[1], "tosa-ssp"); } =20 =20 @@ -292,7 +292,7 @@ static const TypeInfo tosa_dac_info =3D { =20 static void tosa_ssp_class_init(ObjectClass *klass, void *data) { - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D tosa_ssp_realize; k->transfer =3D tosa_ssp_tansfer; @@ -300,8 +300,8 @@ static void tosa_ssp_class_init(ObjectClass *klass, voi= d *data) =20 static const TypeInfo tosa_ssp_info =3D { .name =3D "tosa-ssp", - .parent =3D TYPE_SSI_SLAVE, - .instance_size =3D sizeof(SSISlave), + .parent =3D TYPE_SSI_PERIPHERAL, + .instance_size =3D sizeof(SSIPeripheral), .class_init =3D tosa_ssp_class_init, }; =20 diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 4fc5699dae..308c4da956 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -104,7 +104,7 @@ static struct arm_boot_info z2_binfo =3D { #define Z2_GPIO_LCD_CS 88 =20 struct ZipitLCD { - SSISlave ssidev; + SSIPeripheral ssidev; int32_t selected; int32_t enabled; uint8_t buf[3]; @@ -115,7 +115,7 @@ struct ZipitLCD { #define TYPE_ZIPIT_LCD "zipit-lcd" OBJECT_DECLARE_SIMPLE_TYPE(ZipitLCD, ZIPIT_LCD) =20 -static uint32_t zipit_lcd_transfer(SSISlave *dev, uint32_t value) +static uint32_t zipit_lcd_transfer(SSIPeripheral *dev, uint32_t value) { ZipitLCD *z =3D ZIPIT_LCD(dev); uint16_t val; @@ -155,7 +155,7 @@ static void z2_lcd_cs(void *opaque, int line, int level) z2_lcd->selected =3D !level; } =20 -static void zipit_lcd_realize(SSISlave *dev, Error **errp) +static void zipit_lcd_realize(SSIPeripheral *dev, Error **errp) { ZipitLCD *z =3D ZIPIT_LCD(dev); z->selected =3D 0; @@ -168,7 +168,7 @@ static VMStateDescription vmstate_zipit_lcd_state =3D { .version_id =3D 2, .minimum_version_id =3D 2, .fields =3D (VMStateField[]) { - VMSTATE_SSI_SLAVE(ssidev, ZipitLCD), + VMSTATE_SSI_PERIPHERAL(ssidev, ZipitLCD), VMSTATE_INT32(selected, ZipitLCD), VMSTATE_INT32(enabled, ZipitLCD), VMSTATE_BUFFER(buf, ZipitLCD), @@ -181,7 +181,7 @@ static VMStateDescription vmstate_zipit_lcd_state =3D { static void zipit_lcd_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D zipit_lcd_realize; k->transfer =3D zipit_lcd_transfer; @@ -190,7 +190,7 @@ static void zipit_lcd_class_init(ObjectClass *klass, vo= id *data) =20 static const TypeInfo zipit_lcd_info =3D { .name =3D TYPE_ZIPIT_LCD, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(ZipitLCD), .class_init =3D zipit_lcd_class_init, }; @@ -329,7 +329,7 @@ static void z2_init(MachineState *machine) =20 type_register_static(&zipit_lcd_info); type_register_static(&aer915_info); - z2_lcd =3D ssi_create_slave(mpu->ssp[1], TYPE_ZIPIT_LCD); + z2_lcd =3D ssi_create_peripheral(mpu->ssp[1], TYPE_ZIPIT_LCD); bus =3D pxa2xx_i2c_bus(mpu->i2c[0]); i2c_slave_create_simple(bus, TYPE_AER915, 0x55); wm =3D DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0x1b)); diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 483925f57a..d09a811767 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -416,7 +416,7 @@ typedef enum { #define M25P80_INTERNAL_DATA_BUFFER_SZ 16 =20 struct Flash { - SSISlave parent_obj; + SSIPeripheral parent_obj; =20 BlockBackend *blk; =20 @@ -458,7 +458,7 @@ struct Flash { }; =20 struct M25P80Class { - SSISlaveClass parent_class; + SSIPeripheralClass parent_class; FlashPartInfo *pi; }; =20 @@ -1170,7 +1170,7 @@ static void decode_new_cmd(Flash *s, uint32_t value) } } =20 -static int m25p80_cs(SSISlave *ss, bool select) +static int m25p80_cs(SSIPeripheral *ss, bool select) { Flash *s =3D M25P80(ss); =20 @@ -1190,7 +1190,7 @@ static int m25p80_cs(SSISlave *ss, bool select) return 0; } =20 -static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx) +static uint32_t m25p80_transfer8(SSIPeripheral *ss, uint32_t tx) { Flash *s =3D M25P80(ss); uint32_t r =3D 0; @@ -1265,7 +1265,7 @@ static uint32_t m25p80_transfer8(SSISlave *ss, uint32= _t tx) return r; } =20 -static void m25p80_realize(SSISlave *ss, Error **errp) +static void m25p80_realize(SSIPeripheral *ss, Error **errp) { Flash *s =3D M25P80(ss); M25P80Class *mc =3D M25P80_GET_CLASS(s); @@ -1386,7 +1386,7 @@ static const VMStateDescription vmstate_m25p80 =3D { static void m25p80_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); M25P80Class *mc =3D M25P80_CLASS(klass); =20 k->realize =3D m25p80_realize; @@ -1401,7 +1401,7 @@ static void m25p80_class_init(ObjectClass *klass, voi= d *data) =20 static const TypeInfo m25p80_info =3D { .name =3D TYPE_M25P80, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(Flash), .class_size =3D sizeof(M25P80Class), .abstract =3D true, diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c index cb3a431cfd..1d4e04a2dc 100644 --- a/hw/display/ads7846.c +++ b/hw/display/ads7846.c @@ -19,7 +19,7 @@ #include "qom/object.h" =20 struct ADS7846State { - SSISlave ssidev; + SSIPeripheral ssidev; qemu_irq interrupt; =20 int input[8]; @@ -63,7 +63,7 @@ static void ads7846_int_update(ADS7846State *s) qemu_set_irq(s->interrupt, s->pressure =3D=3D 0); } =20 -static uint32_t ads7846_transfer(SSISlave *dev, uint32_t value) +static uint32_t ads7846_transfer(SSIPeripheral *dev, uint32_t value) { ADS7846State *s =3D ADS7846(dev); =20 @@ -131,7 +131,7 @@ static const VMStateDescription vmstate_ads7846 =3D { .minimum_version_id =3D 1, .post_load =3D ads7856_post_load, .fields =3D (VMStateField[]) { - VMSTATE_SSI_SLAVE(ssidev, ADS7846State), + VMSTATE_SSI_PERIPHERAL(ssidev, ADS7846State), VMSTATE_INT32_ARRAY(input, ADS7846State, 8), VMSTATE_INT32(noise, ADS7846State), VMSTATE_INT32(cycle, ADS7846State), @@ -140,7 +140,7 @@ static const VMStateDescription vmstate_ads7846 =3D { } }; =20 -static void ads7846_realize(SSISlave *d, Error **errp) +static void ads7846_realize(SSIPeripheral *d, Error **errp) { DeviceState *dev =3D DEVICE(d); ADS7846State *s =3D ADS7846(d); @@ -164,7 +164,7 @@ static void ads7846_realize(SSISlave *d, Error **errp) static void ads7846_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D ads7846_realize; k->transfer =3D ads7846_transfer; @@ -173,7 +173,7 @@ static void ads7846_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo ads7846_info =3D { .name =3D TYPE_ADS7846, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(ADS7846State), .class_init =3D ads7846_class_init, }; diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c index cbfd21dfd5..ab229d32b7 100644 --- a/hw/display/ssd0323.c +++ b/hw/display/ssd0323.c @@ -49,7 +49,7 @@ enum ssd0323_mode }; =20 struct ssd0323_state { - SSISlave ssidev; + SSIPeripheral ssidev; QemuConsole *con; =20 uint32_t cmd_len; @@ -71,7 +71,7 @@ struct ssd0323_state { OBJECT_DECLARE_SIMPLE_TYPE(ssd0323_state, SSD0323) =20 =20 -static uint32_t ssd0323_transfer(SSISlave *dev, uint32_t data) +static uint32_t ssd0323_transfer(SSIPeripheral *dev, uint32_t data) { ssd0323_state *s =3D SSD0323(dev); =20 @@ -338,7 +338,7 @@ static const VMStateDescription vmstate_ssd0323 =3D { VMSTATE_INT32(remap, ssd0323_state), VMSTATE_UINT32(mode, ssd0323_state), VMSTATE_BUFFER(framebuffer, ssd0323_state), - VMSTATE_SSI_SLAVE(ssidev, ssd0323_state), + VMSTATE_SSI_PERIPHERAL(ssidev, ssd0323_state), VMSTATE_END_OF_LIST() } }; @@ -348,7 +348,7 @@ static const GraphicHwOps ssd0323_ops =3D { .gfx_update =3D ssd0323_update_display, }; =20 -static void ssd0323_realize(SSISlave *d, Error **errp) +static void ssd0323_realize(SSIPeripheral *d, Error **errp) { DeviceState *dev =3D DEVICE(d); ssd0323_state *s =3D SSD0323(d); @@ -364,7 +364,7 @@ static void ssd0323_realize(SSISlave *d, Error **errp) static void ssd0323_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D ssd0323_realize; k->transfer =3D ssd0323_transfer; @@ -375,7 +375,7 @@ static void ssd0323_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo ssd0323_info =3D { .name =3D TYPE_SSD0323, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(ssd0323_state), .class_init =3D ssd0323_class_init, }; diff --git a/hw/misc/max111x.c b/hw/misc/max111x.c index eae0f9b598..1b3234a519 100644 --- a/hw/misc/max111x.c +++ b/hw/misc/max111x.c @@ -85,7 +85,7 @@ static void max111x_write(MAX111xState *s, uint32_t value) qemu_irq_raise(s->interrupt); } =20 -static uint32_t max111x_transfer(SSISlave *dev, uint32_t value) +static uint32_t max111x_transfer(SSIPeripheral *dev, uint32_t value) { MAX111xState *s =3D MAX_111X(dev); max111x_write(s, value); @@ -97,7 +97,7 @@ static const VMStateDescription vmstate_max111x =3D { .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_SSI_SLAVE(parent_obj, MAX111xState), + VMSTATE_SSI_PERIPHERAL(parent_obj, MAX111xState), VMSTATE_UINT8(tb1, MAX111xState), VMSTATE_UINT8(rb2, MAX111xState), VMSTATE_UINT8(rb3, MAX111xState), @@ -117,7 +117,7 @@ static void max111x_input_set(void *opaque, int line, i= nt value) s->input[line] =3D value; } =20 -static int max111x_init(SSISlave *d, int inputs) +static int max111x_init(SSIPeripheral *d, int inputs) { DeviceState *dev =3D DEVICE(d); MAX111xState *s =3D MAX_111X(dev); @@ -130,12 +130,12 @@ static int max111x_init(SSISlave *d, int inputs) return 0; } =20 -static void max1110_realize(SSISlave *dev, Error **errp) +static void max1110_realize(SSIPeripheral *dev, Error **errp) { max111x_init(dev, 8); } =20 -static void max1111_realize(SSISlave *dev, Error **errp) +static void max1111_realize(SSIPeripheral *dev, Error **errp) { max111x_init(dev, 4); } @@ -179,7 +179,7 @@ static Property max1111_properties[] =3D { =20 static void max111x_class_init(ObjectClass *klass, void *data) { - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 k->transfer =3D max111x_transfer; @@ -190,7 +190,7 @@ static void max111x_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo max111x_info =3D { .name =3D TYPE_MAX_111X, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(MAX111xState), .class_init =3D max111x_class_init, .abstract =3D true, @@ -198,7 +198,7 @@ static const TypeInfo max111x_info =3D { =20 static void max1110_class_init(ObjectClass *klass, void *data) { - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 k->realize =3D max1110_realize; @@ -213,7 +213,7 @@ static const TypeInfo max1110_info =3D { =20 static void max1111_class_init(ObjectClass *klass, void *data) { - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 k->realize =3D max1111_realize; diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 14c8e04a89..9a75e0095c 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -42,7 +42,7 @@ typedef enum { } ssi_sd_mode; =20 struct ssi_sd_state { - SSISlave ssidev; + SSIPeripheral ssidev; uint32_t mode; int cmd; uint8_t cmdarg[4]; @@ -73,7 +73,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ssi_sd_state, SSI_SD) #define SSI_SDR_ADDRESS_ERROR 0x2000 #define SSI_SDR_PARAMETER_ERROR 0x4000 =20 -static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val) +static uint32_t ssi_sd_transfer(SSIPeripheral *dev, uint32_t val) { ssi_sd_state *s =3D SSI_SD(dev); =20 @@ -235,12 +235,12 @@ static const VMStateDescription vmstate_ssi_sd =3D { VMSTATE_INT32(arglen, ssi_sd_state), VMSTATE_INT32(response_pos, ssi_sd_state), VMSTATE_INT32(stopping, ssi_sd_state), - VMSTATE_SSI_SLAVE(ssidev, ssi_sd_state), + VMSTATE_SSI_PERIPHERAL(ssidev, ssi_sd_state), VMSTATE_END_OF_LIST() } }; =20 -static void ssi_sd_realize(SSISlave *d, Error **errp) +static void ssi_sd_realize(SSIPeripheral *d, Error **errp) { ERRP_GUARD(); ssi_sd_state *s =3D SSI_SD(d); @@ -291,7 +291,7 @@ static void ssi_sd_reset(DeviceState *dev) static void ssi_sd_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SSISlaveClass *k =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); =20 k->realize =3D ssi_sd_realize; k->transfer =3D ssi_sd_transfer; @@ -304,7 +304,7 @@ static void ssi_sd_class_init(ObjectClass *klass, void = *data) =20 static const TypeInfo ssi_sd_info =3D { .name =3D TYPE_SSI_SD, - .parent =3D TYPE_SSI_SLAVE, + .parent =3D TYPE_SSI_PERIPHERAL, .instance_size =3D sizeof(ssi_sd_state), .class_init =3D ssi_sd_class_init, }; diff --git a/hw/ssi/pl022.c b/hw/ssi/pl022.c index cade2e92a8..8954ffebb1 100644 --- a/hw/ssi/pl022.c +++ b/hw/ssi/pl022.c @@ -174,7 +174,7 @@ static void pl022_write(void *opaque, hwaddr offset, s->cr1 =3D value; if ((s->cr1 & (PL022_CR1_MS | PL022_CR1_SSE)) =3D=3D (PL022_CR1_MS | PL022_CR1_SSE)) { - BADF("SPI slave mode not implemented\n"); + BADF("SPI peripheral mode not implemented\n"); } pl022_xfer(s); break; diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index 4278d0e444..e5d7ce9523 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -34,11 +34,11 @@ static const TypeInfo ssi_bus_info =3D { =20 static void ssi_cs_default(void *opaque, int n, int level) { - SSISlave *s =3D SSI_SLAVE(opaque); + SSIPeripheral *s =3D SSI_PERIPHERAL(opaque); bool cs =3D !!level; assert(n =3D=3D 0); if (s->cs !=3D cs) { - SSISlaveClass *ssc =3D SSI_SLAVE_GET_CLASS(s); + SSIPeripheralClass *ssc =3D SSI_PERIPHERAL_GET_CLASS(s); if (ssc->set_cs) { ssc->set_cs(s, cs); } @@ -46,9 +46,9 @@ static void ssi_cs_default(void *opaque, int n, int level) s->cs =3D cs; } =20 -static uint32_t ssi_transfer_raw_default(SSISlave *dev, uint32_t val) +static uint32_t ssi_transfer_raw_default(SSIPeripheral *dev, uint32_t val) { - SSISlaveClass *ssc =3D SSI_SLAVE_GET_CLASS(dev); + SSIPeripheralClass *ssc =3D SSI_PERIPHERAL_GET_CLASS(dev); =20 if ((dev->cs && ssc->cs_polarity =3D=3D SSI_CS_HIGH) || (!dev->cs && ssc->cs_polarity =3D=3D SSI_CS_LOW) || @@ -58,10 +58,10 @@ static uint32_t ssi_transfer_raw_default(SSISlave *dev,= uint32_t val) return 0; } =20 -static void ssi_slave_realize(DeviceState *dev, Error **errp) +static void ssi_peripheral_realize(DeviceState *dev, Error **errp) { - SSISlave *s =3D SSI_SLAVE(dev); - SSISlaveClass *ssc =3D SSI_SLAVE_GET_CLASS(s); + SSIPeripheral *s =3D SSI_PERIPHERAL(dev); + SSIPeripheralClass *ssc =3D SSI_PERIPHERAL_GET_CLASS(s); =20 if (ssc->transfer_raw =3D=3D ssi_transfer_raw_default && ssc->cs_polarity !=3D SSI_CS_NONE) { @@ -71,23 +71,23 @@ static void ssi_slave_realize(DeviceState *dev, Error *= *errp) ssc->realize(s, errp); } =20 -static void ssi_slave_class_init(ObjectClass *klass, void *data) +static void ssi_peripheral_class_init(ObjectClass *klass, void *data) { - SSISlaveClass *ssc =3D SSI_SLAVE_CLASS(klass); + SSIPeripheralClass *ssc =3D SSI_PERIPHERAL_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - dc->realize =3D ssi_slave_realize; + dc->realize =3D ssi_peripheral_realize; dc->bus_type =3D TYPE_SSI_BUS; if (!ssc->transfer_raw) { ssc->transfer_raw =3D ssi_transfer_raw_default; } } =20 -static const TypeInfo ssi_slave_info =3D { - .name =3D TYPE_SSI_SLAVE, +static const TypeInfo ssi_peripheral_info =3D { + .name =3D TYPE_SSI_PERIPHERAL, .parent =3D TYPE_DEVICE, - .class_init =3D ssi_slave_class_init, - .class_size =3D sizeof(SSISlaveClass), + .class_init =3D ssi_peripheral_class_init, + .class_size =3D sizeof(SSIPeripheralClass), .abstract =3D true, }; =20 @@ -96,7 +96,7 @@ bool ssi_realize_and_unref(DeviceState *dev, SSIBus *bus,= Error **errp) return qdev_realize_and_unref(dev, &bus->parent_obj, errp); } =20 -DeviceState *ssi_create_slave(SSIBus *bus, const char *name) +DeviceState *ssi_create_peripheral(SSIBus *bus, const char *name) { DeviceState *dev =3D qdev_new(name); =20 @@ -115,32 +115,32 @@ uint32_t ssi_transfer(SSIBus *bus, uint32_t val) { BusState *b =3D BUS(bus); BusChild *kid; - SSISlaveClass *ssc; + SSIPeripheralClass *ssc; uint32_t r =3D 0; =20 QTAILQ_FOREACH(kid, &b->children, sibling) { - SSISlave *slave =3D SSI_SLAVE(kid->child); - ssc =3D SSI_SLAVE_GET_CLASS(slave); - r |=3D ssc->transfer_raw(slave, val); + SSIPeripheral *peripheral =3D SSI_PERIPHERAL(kid->child); + ssc =3D SSI_PERIPHERAL_GET_CLASS(peripheral); + r |=3D ssc->transfer_raw(peripheral, val); } =20 return r; } =20 -const VMStateDescription vmstate_ssi_slave =3D { +const VMStateDescription vmstate_ssi_peripheral =3D { .name =3D "SSISlave", .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_BOOL(cs, SSISlave), + VMSTATE_BOOL(cs, SSIPeripheral), VMSTATE_END_OF_LIST() } }; =20 -static void ssi_slave_register_types(void) +static void ssi_peripheral_register_types(void) { type_register_static(&ssi_bus_info); - type_register_static(&ssi_slave_info); + type_register_static(&ssi_peripheral_info); } =20 -type_init(ssi_slave_register_types) +type_init(ssi_peripheral_register_types) diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index b9371dbf8d..dd8df9daf4 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -236,7 +236,8 @@ static void xilinx_spips_update_cs(XilinxSPIPS *s, int = field) if (old_state !=3D new_state) { s->cs_lines_state[i] =3D new_state; s->rx_discard =3D ARRAY_FIELD_EX32(s->regs, CMND, RX_DISCARD); - DB_PRINT_L(1, "%sselecting slave %d\n", new_state ? "" : "de",= i); + DB_PRINT_L(1, "%sselecting peripheral %d\n", + new_state ? "" : "de", i); } qemu_set_irq(s->cs_lines[i], !new_state); } @@ -1154,7 +1155,7 @@ static void lqspi_load_cache(void *opaque, hwaddr add= r) int i; int flash_addr =3D ((addr & ~(LQSPI_CACHE_SIZE - 1)) / num_effective_busses(s)); - int slave =3D flash_addr >> LQSPI_ADDRESS_BITS; + int peripheral =3D flash_addr >> LQSPI_ADDRESS_BITS; int cache_entry =3D 0; uint32_t u_page_save =3D s->regs[R_LQSPI_STS] & ~LQSPI_CFG_U_PAGE; =20 @@ -1162,7 +1163,7 @@ static void lqspi_load_cache(void *opaque, hwaddr add= r) addr > q->lqspi_cached_addr + LQSPI_CACHE_SIZE - 4) { xilinx_qspips_invalidate_mmio_ptr(q); s->regs[R_LQSPI_STS] &=3D ~LQSPI_CFG_U_PAGE; - s->regs[R_LQSPI_STS] |=3D slave ? LQSPI_CFG_U_PAGE : 0; + s->regs[R_LQSPI_STS] |=3D peripheral ? LQSPI_CFG_U_PAGE : 0; =20 DB_PRINT_L(0, "config reg status: %08x\n", s->regs[R_LQSPI_CFG]); =20 diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h index 606cf1e0a2..beff59c815 100644 --- a/include/hw/misc/max111x.h +++ b/include/hw/misc/max111x.h @@ -33,7 +33,7 @@ * be lowered once it has been asserted. */ struct MAX111xState { - SSISlave parent_obj; + SSIPeripheral parent_obj; =20 qemu_irq interrupt; /* Values of inputs at system reset (settable by QOM property) */ diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index c15548425a..f411858ab0 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -2,11 +2,11 @@ =20 /* * In principle SSI is a point-point interface. As such the qemu - * implementation has a single slave device on a "bus". - * However it is fairly common for boards to have multiple slaves + * implementation has a single peripheral on a "bus". + * However it is fairly common for boards to have multiple peripherals * connected to a single master, and select devices with an external * chip select. This is implemented in qemu by having an explicit mux dev= ice. - * It is assumed that master and slave are both using the same transfer + * It is assumed that master and peripheral are both using the same transf= er * width. */ =20 @@ -18,9 +18,9 @@ =20 typedef enum SSICSMode SSICSMode; =20 -#define TYPE_SSI_SLAVE "ssi-slave" -OBJECT_DECLARE_TYPE(SSISlave, SSISlaveClass, - SSI_SLAVE) +#define TYPE_SSI_PERIPHERAL "ssi-peripheral" +OBJECT_DECLARE_TYPE(SSIPeripheral, SSIPeripheralClass, + SSI_PERIPHERAL) =20 #define SSI_GPIO_CS "ssi-gpio-cs" =20 @@ -30,21 +30,21 @@ enum SSICSMode { SSI_CS_HIGH, }; =20 -/* Slave devices. */ -struct SSISlaveClass { +/* Peripherals. */ +struct SSIPeripheralClass { DeviceClass parent_class; =20 - void (*realize)(SSISlave *dev, Error **errp); + void (*realize)(SSIPeripheral *dev, Error **errp); =20 /* if you have standard or no CS behaviour, just override transfer. * This is called when the device cs is active (true by default). */ - uint32_t (*transfer)(SSISlave *dev, uint32_t val); + uint32_t (*transfer)(SSIPeripheral *dev, uint32_t val); /* called when the CS line changes. Optional, devices only need to imp= lement * this if they have side effects associated with the cs line (beyond * tristating the txrx lines). */ - int (*set_cs)(SSISlave *dev, bool select); + int (*set_cs)(SSIPeripheral *dev, bool select); /* define whether or not CS exists and is active low/high */ SSICSMode cs_polarity; =20 @@ -53,30 +53,30 @@ struct SSISlaveClass { * cs_polarity are unused if this is overwritten. Transfer_raw will * always be called for the device for every txrx access to the parent= bus */ - uint32_t (*transfer_raw)(SSISlave *dev, uint32_t val); + uint32_t (*transfer_raw)(SSIPeripheral *dev, uint32_t val); }; =20 -struct SSISlave { +struct SSIPeripheral { DeviceState parent_obj; =20 /* Chip select state */ bool cs; }; =20 -extern const VMStateDescription vmstate_ssi_slave; +extern const VMStateDescription vmstate_ssi_peripheral; =20 -#define VMSTATE_SSI_SLAVE(_field, _state) { \ +#define VMSTATE_SSI_PERIPHERAL(_field, _state) { \ .name =3D (stringify(_field)), \ - .size =3D sizeof(SSISlave), \ - .vmsd =3D &vmstate_ssi_slave, \ + .size =3D sizeof(SSIPeripheral), \ + .vmsd =3D &vmstate_ssi_peripheral, \ .flags =3D VMS_STRUCT, \ - .offset =3D vmstate_offset_value(_state, _field, SSISlave), \ + .offset =3D vmstate_offset_value(_state, _field, SSIPeripheral), \ } =20 -DeviceState *ssi_create_slave(SSIBus *bus, const char *name); +DeviceState *ssi_create_peripheral(SSIBus *bus, const char *name); /** - * ssi_realize_and_unref: realize and unref an SSI slave device - * @dev: SSI slave device to realize + * ssi_realize_and_unref: realize and unref an SSI peripheral + * @dev: SSI peripheral to realize * @bus: SSI bus to put it on * @errp: error pointer * @@ -87,10 +87,10 @@ DeviceState *ssi_create_slave(SSIBus *bus, const char *= name); * This function is useful if you have created @dev via qdev_new() * (which takes a reference to the device it returns to you), so that * you can set properties on it before realizing it. If you don't need - * to set properties then ssi_create_slave() is probably better (as it + * to set properties then ssi_create_peripheral() is probably better (as it * does the create, init and realize in one step). * - * If you are embedding the SSI slave into another QOM device and + * If you are embedding the SSI peripheral into another QOM device and * initialized it via some variant on object_initialize_child() then * do not use this function, because that family of functions arrange * for the only reference to the child device to be held by the parent --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897566; cv=none; d=zohomail.com; s=zohoarc; b=cGMmCIv//4rV2RcBDr7/0BSiovQfgWURRAxeCAXwyjireSy2w0X81PLKppIfsiyAobmzXtbOQYvgQMEnfDrlrTxMv9A46Jg62LA3mkT8cyYHXs5syfemQ3347SZT2jiftTFGDoqM6NFrgdu8rluG3fBmpBALGtXHpe3kFcEbmbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897566; 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=DK3EIciZtVrRaH9+199/U0VTPd8qnV1yWpeYRRu5FgU=; b=S/EUxkPuhoIrpaI8PWvglNgbL115FEddsqRYpmwHEowj4dKTmeVZa2AIYkjIfkwxqYV6BHXBiwiR043wgYr0bATjT3Cx8rlJsRV6IaepDlSEliWOarNHVtsuJhpVoGRqMKVNSVCr5D5tXpzfhqysPVLrBkse9Q0D+lKP01SvAvs= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897566498789.3101643897473; Wed, 2 Dec 2020 00:26:06 -0800 (PST) Received: from localhost ([::1]:55294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNSf-0005Ra-1j for importer@patchew.org; Wed, 02 Dec 2020 03:26:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0002dN-2G for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC8-0003bq-Fo for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-IHFNpkn2NryoBjCwboZkmw-1; Wed, 02 Dec 2020 03:08:58 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41CA61074641 for ; Wed, 2 Dec 2020 08:08:57 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E0E75D9C6 for ; Wed, 2 Dec 2020 08:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896539; 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: in-reply-to:in-reply-to:references:references; bh=DK3EIciZtVrRaH9+199/U0VTPd8qnV1yWpeYRRu5FgU=; b=f058FMhnTFVpBLza6HOqp+to/3w4segP1xjcDt9aOzZ4yKMGUzFAdQukD4m7NUDTOCAGH+ gnP9P/p86LUOz0RfLqc9vgJl0jXssvQuMqCxxgDN8wd5CfjQp5Y2Q1pwJAcBpZ9qMVTOLb aZ/d71lJf7uUp4ZXlaY2Pr83TAqK9+o= X-MC-Unique: IHFNpkn2NryoBjCwboZkmw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 018/113] hw/core/stream: Rename StreamSlave as StreamSink Date: Wed, 2 Dec 2020 03:07:14 -0500 Message-Id: <20201202080849.4125477-19-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 In order to use inclusive terminology, rename 'slave stream' as 'sink stream'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paolo Bonzini Reviewed-by: Edgar E. Iglesias Message-Id: <20200910070131.435543-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/stream.c | 20 ++++++++--------- hw/dma/xilinx_axidma.c | 32 +++++++++++++-------------- hw/net/xilinx_axienet.c | 20 ++++++++--------- hw/ssi/xilinx_spips.c | 2 +- include/hw/ssi/xilinx_spips.h | 2 +- include/hw/stream.h | 41 +++++++++++++++++------------------ 6 files changed, 58 insertions(+), 59 deletions(-) diff --git a/hw/core/stream.c b/hw/core/stream.c index a65ad1208d..19477d0f2d 100644 --- a/hw/core/stream.c +++ b/hw/core/stream.c @@ -3,32 +3,32 @@ #include "qemu/module.h" =20 size_t -stream_push(StreamSlave *sink, uint8_t *buf, size_t len, bool eop) +stream_push(StreamSink *sink, uint8_t *buf, size_t len, bool eop) { - StreamSlaveClass *k =3D STREAM_SLAVE_GET_CLASS(sink); + StreamSinkClass *k =3D STREAM_SINK_GET_CLASS(sink); =20 return k->push(sink, buf, len, eop); } =20 bool -stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify, +stream_can_push(StreamSink *sink, StreamCanPushNotifyFn notify, void *notify_opaque) { - StreamSlaveClass *k =3D STREAM_SLAVE_GET_CLASS(sink); + StreamSinkClass *k =3D STREAM_SINK_GET_CLASS(sink); =20 return k->can_push ? k->can_push(sink, notify, notify_opaque) : true; } =20 -static const TypeInfo stream_slave_info =3D { - .name =3D TYPE_STREAM_SLAVE, +static const TypeInfo stream_sink_info =3D { + .name =3D TYPE_STREAM_SINK, .parent =3D TYPE_INTERFACE, - .class_size =3D sizeof(StreamSlaveClass), + .class_size =3D sizeof(StreamSinkClass), }; =20 =20 -static void stream_slave_register_types(void) +static void stream_sink_register_types(void) { - type_register_static(&stream_slave_info); + type_register_static(&stream_sink_info); } =20 -type_init(stream_slave_register_types) +type_init(stream_sink_register_types) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 0a7f5acb4b..306da46699 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -128,8 +128,8 @@ struct XilinxAXIDMA { AddressSpace as; =20 uint32_t freqhz; - StreamSlave *tx_data_dev; - StreamSlave *tx_control_dev; + StreamSink *tx_data_dev; + StreamSink *tx_control_dev; XilinxAXIDMAStreamSlave rx_data_dev; XilinxAXIDMAStreamSlave rx_control_dev; =20 @@ -261,8 +261,8 @@ static void stream_complete(struct Stream *s) ptimer_transaction_commit(s->ptimer); } =20 -static void stream_process_mem2s(struct Stream *s, StreamSlave *tx_data_de= v, - StreamSlave *tx_control_dev) +static void stream_process_mem2s(struct Stream *s, StreamSink *tx_data_dev, + StreamSink *tx_control_dev) { uint32_t prev_d; uint32_t txlen; @@ -384,7 +384,7 @@ static void xilinx_axidma_reset(DeviceState *dev) } =20 static size_t -xilinx_axidma_control_stream_push(StreamSlave *obj, unsigned char *buf, +xilinx_axidma_control_stream_push(StreamSink *obj, unsigned char *buf, size_t len, bool eop) { XilinxAXIDMAStreamSlave *cs =3D XILINX_AXI_DMA_CONTROL_STREAM(obj); @@ -400,7 +400,7 @@ xilinx_axidma_control_stream_push(StreamSlave *obj, uns= igned char *buf, } =20 static bool -xilinx_axidma_data_stream_can_push(StreamSlave *obj, +xilinx_axidma_data_stream_can_push(StreamSink *obj, StreamCanPushNotifyFn notify, void *notify_opaque) { @@ -417,7 +417,7 @@ xilinx_axidma_data_stream_can_push(StreamSlave *obj, } =20 static size_t -xilinx_axidma_data_stream_push(StreamSlave *obj, unsigned char *buf, size_= t len, +xilinx_axidma_data_stream_push(StreamSink *obj, unsigned char *buf, size_t= len, bool eop) { XilinxAXIDMAStreamSlave *ds =3D XILINX_AXI_DMA_DATA_STREAM(obj); @@ -588,9 +588,9 @@ static void xilinx_axidma_init(Object *obj) static Property axidma_properties[] =3D { DEFINE_PROP_UINT32("freqhz", XilinxAXIDMA, freqhz, 50000000), DEFINE_PROP_LINK("axistream-connected", XilinxAXIDMA, - tx_data_dev, TYPE_STREAM_SLAVE, StreamSlave *), + tx_data_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_LINK("axistream-control-connected", XilinxAXIDMA, - tx_control_dev, TYPE_STREAM_SLAVE, StreamSlave *), + tx_control_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -603,21 +603,21 @@ static void axidma_class_init(ObjectClass *klass, voi= d *data) device_class_set_props(dc, axidma_properties); } =20 -static StreamSlaveClass xilinx_axidma_data_stream_class =3D { +static StreamSinkClass xilinx_axidma_data_stream_class =3D { .push =3D xilinx_axidma_data_stream_push, .can_push =3D xilinx_axidma_data_stream_can_push, }; =20 -static StreamSlaveClass xilinx_axidma_control_stream_class =3D { +static StreamSinkClass xilinx_axidma_control_stream_class =3D { .push =3D xilinx_axidma_control_stream_push, }; =20 static void xilinx_axidma_stream_class_init(ObjectClass *klass, void *data) { - StreamSlaveClass *ssc =3D STREAM_SLAVE_CLASS(klass); + StreamSinkClass *ssc =3D STREAM_SINK_CLASS(klass); =20 - ssc->push =3D ((StreamSlaveClass *)data)->push; - ssc->can_push =3D ((StreamSlaveClass *)data)->can_push; + ssc->push =3D ((StreamSinkClass *)data)->push; + ssc->can_push =3D ((StreamSinkClass *)data)->can_push; } =20 static const TypeInfo axidma_info =3D { @@ -635,7 +635,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = =3D { .class_init =3D xilinx_axidma_stream_class_init, .class_data =3D &xilinx_axidma_data_stream_class, .interfaces =3D (InterfaceInfo[]) { - { TYPE_STREAM_SLAVE }, + { TYPE_STREAM_SINK }, { } } }; @@ -647,7 +647,7 @@ static const TypeInfo xilinx_axidma_control_stream_info= =3D { .class_init =3D xilinx_axidma_stream_class_init, .class_data =3D &xilinx_axidma_control_stream_class, .interfaces =3D (InterfaceInfo[]) { - { TYPE_STREAM_SLAVE }, + { TYPE_STREAM_SINK }, { } } }; diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index f8cf5290e1..9bccbe9be3 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -320,8 +320,8 @@ struct XilinxAXIEnet { SysBusDevice busdev; MemoryRegion iomem; qemu_irq irq; - StreamSlave *tx_data_dev; - StreamSlave *tx_control_dev; + StreamSink *tx_data_dev; + StreamSink *tx_control_dev; XilinxAXIEnetStreamSlave rx_data_dev; XilinxAXIEnetStreamSlave rx_control_dev; NICState *nic; @@ -852,7 +852,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t= *buf, size_t size) } =20 static size_t -xilinx_axienet_control_stream_push(StreamSlave *obj, uint8_t *buf, size_t = len, +xilinx_axienet_control_stream_push(StreamSink *obj, uint8_t *buf, size_t l= en, bool eop) { int i; @@ -874,7 +874,7 @@ xilinx_axienet_control_stream_push(StreamSlave *obj, ui= nt8_t *buf, size_t len, } =20 static size_t -xilinx_axienet_data_stream_push(StreamSlave *obj, uint8_t *buf, size_t siz= e, +xilinx_axienet_data_stream_push(StreamSink *obj, uint8_t *buf, size_t size, bool eop) { XilinxAXIEnetStreamSlave *ds =3D XILINX_AXI_ENET_DATA_STREAM(obj); @@ -1002,9 +1002,9 @@ static Property xilinx_enet_properties[] =3D { DEFINE_PROP_UINT32("txmem", XilinxAXIEnet, c_txmem, 0x1000), DEFINE_NIC_PROPERTIES(XilinxAXIEnet, conf), DEFINE_PROP_LINK("axistream-connected", XilinxAXIEnet, - tx_data_dev, TYPE_STREAM_SLAVE, StreamSlave *), + tx_data_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_LINK("axistream-control-connected", XilinxAXIEnet, - tx_control_dev, TYPE_STREAM_SLAVE, StreamSlave *), + tx_control_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -1020,14 +1020,14 @@ static void xilinx_enet_class_init(ObjectClass *kla= ss, void *data) static void xilinx_enet_control_stream_class_init(ObjectClass *klass, void *data) { - StreamSlaveClass *ssc =3D STREAM_SLAVE_CLASS(klass); + StreamSinkClass *ssc =3D STREAM_SINK_CLASS(klass); =20 ssc->push =3D xilinx_axienet_control_stream_push; } =20 static void xilinx_enet_data_stream_class_init(ObjectClass *klass, void *d= ata) { - StreamSlaveClass *ssc =3D STREAM_SLAVE_CLASS(klass); + StreamSinkClass *ssc =3D STREAM_SINK_CLASS(klass); =20 ssc->push =3D xilinx_axienet_data_stream_push; } @@ -1046,7 +1046,7 @@ static const TypeInfo xilinx_enet_data_stream_info = =3D { .instance_size =3D sizeof(XilinxAXIEnetStreamSlave), .class_init =3D xilinx_enet_data_stream_class_init, .interfaces =3D (InterfaceInfo[]) { - { TYPE_STREAM_SLAVE }, + { TYPE_STREAM_SINK }, { } } }; @@ -1057,7 +1057,7 @@ static const TypeInfo xilinx_enet_control_stream_info= =3D { .instance_size =3D sizeof(XilinxAXIEnetStreamSlave), .class_init =3D xilinx_enet_control_stream_class_init, .interfaces =3D (InterfaceInfo[]) { - { TYPE_STREAM_SLAVE }, + { TYPE_STREAM_SINK }, { } } }; diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index dd8df9daf4..a897034601 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -1354,7 +1354,7 @@ static void xlnx_zynqmp_qspips_init(Object *obj) { XlnxZynqMPQSPIPS *rq =3D XLNX_ZYNQMP_QSPIPS(obj); =20 - object_property_add_link(obj, "stream-connected-dma", TYPE_STREAM_SLAV= E, + object_property_add_link(obj, "stream-connected-dma", TYPE_STREAM_SINK, (Object **)&rq->dma, object_property_allow_set_link, OBJ_PROP_LINK_STRONG); diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index b96de21b34..3eae73480e 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -99,7 +99,7 @@ typedef struct XilinxQSPIPS XilinxQSPIPS; struct XlnxZynqMPQSPIPS { XilinxQSPIPS parent_obj; =20 - StreamSlave *dma; + StreamSink *dma; int gqspi_irqline; =20 uint32_t regs[XLNX_ZYNQMP_SPIPS_R_MAX]; diff --git a/include/hw/stream.h b/include/hw/stream.h index e39d5a5b55..f166facb09 100644 --- a/include/hw/stream.h +++ b/include/hw/stream.h @@ -3,51 +3,50 @@ =20 #include "qom/object.h" =20 -/* stream slave. Used until qdev provides a generic way. */ -#define TYPE_STREAM_SLAVE "stream-slave" +#define TYPE_STREAM_SINK "stream-sink" =20 -typedef struct StreamSlaveClass StreamSlaveClass; -DECLARE_CLASS_CHECKERS(StreamSlaveClass, STREAM_SLAVE, - TYPE_STREAM_SLAVE) -#define STREAM_SLAVE(obj) \ - INTERFACE_CHECK(StreamSlave, (obj), TYPE_STREAM_SLAVE) +typedef struct StreamSinkClass StreamSinkClass; +DECLARE_CLASS_CHECKERS(StreamSinkClass, STREAM_SINK, + TYPE_STREAM_SINK) +#define STREAM_SINK(obj) \ + INTERFACE_CHECK(StreamSink, (obj), TYPE_STREAM_SINK) =20 -typedef struct StreamSlave StreamSlave; +typedef struct StreamSink StreamSink; =20 typedef void (*StreamCanPushNotifyFn)(void *opaque); =20 -struct StreamSlaveClass { +struct StreamSinkClass { InterfaceClass parent; /** - * can push - determine if a stream slave is capable of accepting at l= east + * can push - determine if a stream sink is capable of accepting at le= ast * one byte of data. Returns false if cannot accept. If not implemente= d, the - * slave is assumed to always be capable of receiving. - * @notify: Optional callback that the slave will call when the slave = is + * sink is assumed to always be capable of receiving. + * @notify: Optional callback that the sink will call when the sink is * capable of receiving again. Only called if false is returned. * @notify_opaque: opaque data to pass to notify call. */ - bool (*can_push)(StreamSlave *obj, StreamCanPushNotifyFn notify, + bool (*can_push)(StreamSink *obj, StreamCanPushNotifyFn notify, void *notify_opaque); /** - * push - push data to a Stream slave. The number of bytes pushed is - * returned. If the slave short returns, the master must wait before t= rying - * again, the slave may continue to just return 0 waiting for the vm t= ime to + * push - push data to a Stream sink. The number of bytes pushed is + * returned. If the sink short returns, the master must wait before tr= ying + * again, the sink may continue to just return 0 waiting for the vm ti= me to * advance. The can_push() function can be used to trap the point in t= ime - * where the slave is ready to receive again, otherwise polling on a Q= EMU + * where the sink is ready to receive again, otherwise polling on a QE= MU * timer will work. - * @obj: Stream slave to push to + * @obj: Stream sink to push to * @buf: Data to write * @len: Maximum number of bytes to write * @eop: End of packet flag */ - size_t (*push)(StreamSlave *obj, unsigned char *buf, size_t len, bool = eop); + size_t (*push)(StreamSink *obj, unsigned char *buf, size_t len, bool e= op); }; =20 size_t -stream_push(StreamSlave *sink, uint8_t *buf, size_t len, bool eop); +stream_push(StreamSink *sink, uint8_t *buf, size_t len, bool eop); =20 bool -stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify, +stream_can_push(StreamSink *sink, StreamCanPushNotifyFn notify, void *notify_opaque); =20 =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897444; cv=none; d=zohomail.com; s=zohoarc; b=OypiQax/4UEVSYW2HTHeAp7fzSMg/heiB+raNXrXr9+0U8gLD47f0lr4b+45KPNWosu2DGNaZLmuZksIHQWXCyKyAjQGFxNdhWadgiE+CxAg01M33x8cKFUfdkcADJkdoaXvzK0XDmZ+fUcKv3U0BXY1hCbBqiKy9qynluf8HS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897444; 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=gWs2M5k9MSBHbsukGasGcnZzCIKnS2VFmg41YjLrWf0=; b=PBXiyqLNHE/NebwzwN0MIHZwR0DRzJjzSxusTwm5OFmFstNwhGJFzJN5qmaDxJGcxqI/DcyP6Moyz+zqk0B80MJOXsRtQJ14vuipfAmAcfWRJ0ddtZqQLZvyCLjvH8WhmNnqlciFQzRpLU38OSpoxBtVVNaxAO/Qoqerw3uXgCc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897444016886.0805278787706; Wed, 2 Dec 2020 00:24:04 -0800 (PST) Received: from localhost ([::1]:50018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNQg-0003E8-VZ for importer@patchew.org; Wed, 02 Dec 2020 03:24:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCD-0002ce-Ja for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC8-0003cQ-TP for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-ihp7_tPiNIGw9fPNTPjKvg-1; Wed, 02 Dec 2020 03:08:58 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90D775708E for ; Wed, 2 Dec 2020 08:08:57 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E1035D9C6 for ; Wed, 2 Dec 2020 08:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896540; 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: in-reply-to:in-reply-to:references:references; bh=gWs2M5k9MSBHbsukGasGcnZzCIKnS2VFmg41YjLrWf0=; b=L31NQidJtpRLabOeSBCK1jkN4IX5pkAPkGLb0Rpf0uhxRPSXGec8y4GoVONgb3PshQpAV9 nafq3BY8OLTFZWZHI00TVOU52IfSUYy/4yy9MnIHrvIowxX36g6YftvwOsn0nCfY+CDE2C +B0HMjo6UkiDCLZKy7rLfa7ADqXyx5s= X-MC-Unique: ihp7_tPiNIGw9fPNTPjKvg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 019/113] hw/dma/xilinx_axidma: Rename StreamSlave as StreamSink Date: Wed, 2 Dec 2020 03:07:15 -0500 Message-Id: <20201202080849.4125477-20-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 In order to use inclusive terminology, rename 'slave stream' as 'sink stream'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paolo Bonzini Reviewed-by: Edgar E. Iglesias Message-Id: <20200910070131.435543-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/dma/xilinx_axidma.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 306da46699..bc383f53cc 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -45,11 +45,11 @@ =20 OBJECT_DECLARE_SIMPLE_TYPE(XilinxAXIDMA, XILINX_AXI_DMA) =20 -typedef struct XilinxAXIDMAStreamSlave XilinxAXIDMAStreamSlave; -DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSlave, XILINX_AXI_DMA_DATA_STRE= AM, +typedef struct XilinxAXIDMAStreamSink XilinxAXIDMAStreamSink; +DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSink, XILINX_AXI_DMA_DATA_STREA= M, TYPE_XILINX_AXI_DMA_DATA_STREAM) =20 -DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSlave, XILINX_AXI_DMA_CONTROL_S= TREAM, +DECLARE_INSTANCE_CHECKER(XilinxAXIDMAStreamSink, XILINX_AXI_DMA_CONTROL_ST= REAM, TYPE_XILINX_AXI_DMA_CONTROL_STREAM) =20 #define R_DMACR (0x00 / 4) @@ -115,7 +115,7 @@ struct Stream { unsigned char txbuf[16 * 1024]; }; =20 -struct XilinxAXIDMAStreamSlave { +struct XilinxAXIDMAStreamSink { Object parent; =20 struct XilinxAXIDMA *dma; @@ -130,8 +130,8 @@ struct XilinxAXIDMA { uint32_t freqhz; StreamSink *tx_data_dev; StreamSink *tx_control_dev; - XilinxAXIDMAStreamSlave rx_data_dev; - XilinxAXIDMAStreamSlave rx_control_dev; + XilinxAXIDMAStreamSink rx_data_dev; + XilinxAXIDMAStreamSink rx_control_dev; =20 struct Stream streams[2]; =20 @@ -387,7 +387,7 @@ static size_t xilinx_axidma_control_stream_push(StreamSink *obj, unsigned char *buf, size_t len, bool eop) { - XilinxAXIDMAStreamSlave *cs =3D XILINX_AXI_DMA_CONTROL_STREAM(obj); + XilinxAXIDMAStreamSink *cs =3D XILINX_AXI_DMA_CONTROL_STREAM(obj); struct Stream *s =3D &cs->dma->streams[1]; =20 if (len !=3D CONTROL_PAYLOAD_SIZE) { @@ -404,7 +404,7 @@ xilinx_axidma_data_stream_can_push(StreamSink *obj, StreamCanPushNotifyFn notify, void *notify_opaque) { - XilinxAXIDMAStreamSlave *ds =3D XILINX_AXI_DMA_DATA_STREAM(obj); + XilinxAXIDMAStreamSink *ds =3D XILINX_AXI_DMA_DATA_STREAM(obj); struct Stream *s =3D &ds->dma->streams[1]; =20 if (!stream_running(s) || stream_idle(s)) { @@ -420,7 +420,7 @@ static size_t xilinx_axidma_data_stream_push(StreamSink *obj, unsigned char *buf, size_t= len, bool eop) { - XilinxAXIDMAStreamSlave *ds =3D XILINX_AXI_DMA_DATA_STREAM(obj); + XilinxAXIDMAStreamSink *ds =3D XILINX_AXI_DMA_DATA_STREAM(obj); struct Stream *s =3D &ds->dma->streams[1]; size_t ret; =20 @@ -531,8 +531,8 @@ static const MemoryRegionOps axidma_ops =3D { static void xilinx_axidma_realize(DeviceState *dev, Error **errp) { XilinxAXIDMA *s =3D XILINX_AXI_DMA(dev); - XilinxAXIDMAStreamSlave *ds =3D XILINX_AXI_DMA_DATA_STREAM(&s->rx_data= _dev); - XilinxAXIDMAStreamSlave *cs =3D XILINX_AXI_DMA_CONTROL_STREAM( + XilinxAXIDMAStreamSink *ds =3D XILINX_AXI_DMA_DATA_STREAM(&s->rx_data_= dev); + XilinxAXIDMAStreamSink *cs =3D XILINX_AXI_DMA_CONTROL_STREAM( &s->rx_control= _dev); int i; =20 @@ -631,7 +631,7 @@ static const TypeInfo axidma_info =3D { static const TypeInfo xilinx_axidma_data_stream_info =3D { .name =3D TYPE_XILINX_AXI_DMA_DATA_STREAM, .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(XilinxAXIDMAStreamSlave), + .instance_size =3D sizeof(XilinxAXIDMAStreamSink), .class_init =3D xilinx_axidma_stream_class_init, .class_data =3D &xilinx_axidma_data_stream_class, .interfaces =3D (InterfaceInfo[]) { @@ -643,7 +643,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = =3D { static const TypeInfo xilinx_axidma_control_stream_info =3D { .name =3D TYPE_XILINX_AXI_DMA_CONTROL_STREAM, .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(XilinxAXIDMAStreamSlave), + .instance_size =3D sizeof(XilinxAXIDMAStreamSink), .class_init =3D xilinx_axidma_stream_class_init, .class_data =3D &xilinx_axidma_control_stream_class, .interfaces =3D (InterfaceInfo[]) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897720; cv=none; d=zohomail.com; s=zohoarc; b=iYUrX99Z0WNNnvoosaweR6qI07L23DFyb4VZsNoS5YM6QJWUPe61VcnfrRENggHiWv9bxc1ZqEhwaHgGAIxYivWt17YtyFHkpSbbYeKyeW5TPqOxLq3sR2BPsD2UEAn/vOt/wIYaVszfnOtyKw/OwHILid234C8roHkWlHBseMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897720; 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=2MXjDOXHDIyBqwYCJpRrsniTCCq9tpSl6Jq6PfcwZO4=; b=U/hYnGa3wef1LoExwn60/xcd3iSRF4p67Y8oOri35Iq121QqvYSqnJDnfVqTNxghhvMx1d+7r1oIOWokerq78c2tOm148N2fHDkL6v+g+IEByOaGEprf39aG6R+EX1bT0jqzByO9PWQdltey7C5PufTed8GLXq9OXtj7xuwaNGc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897720078145.06252044247378; Wed, 2 Dec 2020 00:28:40 -0800 (PST) Received: from localhost ([::1]:35540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNV8-0000cg-Oy for importer@patchew.org; Wed, 02 Dec 2020 03:28:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0002dq-9C for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC9-0003cX-Fs for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:05 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-6J0Nxw3tOJSw1HfG4NdAIg-1; Wed, 02 Dec 2020 03:08:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25C2F1006C83 for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id E88125C1B4 for ; Wed, 2 Dec 2020 08:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896540; 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: in-reply-to:in-reply-to:references:references; bh=2MXjDOXHDIyBqwYCJpRrsniTCCq9tpSl6Jq6PfcwZO4=; b=e8bJqsBFPGExQkqKnfM1K2AsC9ghQVK0Ebp3b4o1O/bmw4kf/BZ3HNQoQY2cPUsZQnslmv hzQrbMm0MEWHQqGMrXcNH7KkSKnwH30eGnvsAfA3tFYUFgEGhcOvN3PMS4md7FKc6F/le5 1ikiLp7KlKWj0Uv1AIuOiosZDaGrH9o= X-MC-Unique: 6J0Nxw3tOJSw1HfG4NdAIg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 020/113] hw/net/xilinx_axienet: Rename StreamSlave as StreamSink Date: Wed, 2 Dec 2020 03:07:16 -0500 Message-Id: <20201202080849.4125477-21-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 In order to use inclusive terminology, rename 'slave stream' as 'sink stream'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paolo Bonzini Reviewed-by: Edgar E. Iglesias Message-Id: <20200910070131.435543-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/net/xilinx_axienet.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 9bccbe9be3..990ff3a1c2 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -45,11 +45,11 @@ =20 OBJECT_DECLARE_SIMPLE_TYPE(XilinxAXIEnet, XILINX_AXI_ENET) =20 -typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave; -DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_DATA_ST= REAM, +typedef struct XilinxAXIEnetStreamSink XilinxAXIEnetStreamSink; +DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSink, XILINX_AXI_ENET_DATA_STR= EAM, TYPE_XILINX_AXI_ENET_DATA_STREAM) =20 -DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_CONTROL= _STREAM, +DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSink, XILINX_AXI_ENET_CONTROL_= STREAM, TYPE_XILINX_AXI_ENET_CONTROL_STREAM) =20 /* Advertisement control register. */ @@ -310,7 +310,7 @@ struct TEMAC { }; =20 =20 -struct XilinxAXIEnetStreamSlave { +struct XilinxAXIEnetStreamSink { Object parent; =20 struct XilinxAXIEnet *enet; @@ -322,8 +322,8 @@ struct XilinxAXIEnet { qemu_irq irq; StreamSink *tx_data_dev; StreamSink *tx_control_dev; - XilinxAXIEnetStreamSlave rx_data_dev; - XilinxAXIEnetStreamSlave rx_control_dev; + XilinxAXIEnetStreamSink rx_data_dev; + XilinxAXIEnetStreamSink rx_control_dev; NICState *nic; NICConf conf; =20 @@ -856,7 +856,7 @@ xilinx_axienet_control_stream_push(StreamSink *obj, uin= t8_t *buf, size_t len, bool eop) { int i; - XilinxAXIEnetStreamSlave *cs =3D XILINX_AXI_ENET_CONTROL_STREAM(obj); + XilinxAXIEnetStreamSink *cs =3D XILINX_AXI_ENET_CONTROL_STREAM(obj); XilinxAXIEnet *s =3D cs->enet; =20 assert(eop); @@ -877,7 +877,7 @@ static size_t xilinx_axienet_data_stream_push(StreamSink *obj, uint8_t *buf, size_t size, bool eop) { - XilinxAXIEnetStreamSlave *ds =3D XILINX_AXI_ENET_DATA_STREAM(obj); + XilinxAXIEnetStreamSink *ds =3D XILINX_AXI_ENET_DATA_STREAM(obj); XilinxAXIEnet *s =3D ds->enet; =20 /* TX enable ? */ @@ -951,8 +951,8 @@ static NetClientInfo net_xilinx_enet_info =3D { static void xilinx_enet_realize(DeviceState *dev, Error **errp) { XilinxAXIEnet *s =3D XILINX_AXI_ENET(dev); - XilinxAXIEnetStreamSlave *ds =3D XILINX_AXI_ENET_DATA_STREAM(&s->rx_da= ta_dev); - XilinxAXIEnetStreamSlave *cs =3D XILINX_AXI_ENET_CONTROL_STREAM( + XilinxAXIEnetStreamSink *ds =3D XILINX_AXI_ENET_DATA_STREAM(&s->rx_dat= a_dev); + XilinxAXIEnetStreamSink *cs =3D XILINX_AXI_ENET_CONTROL_STREAM( &s->rx_control= _dev); =20 object_property_add_link(OBJECT(ds), "enet", "xlnx.axi-ethernet", @@ -1043,7 +1043,7 @@ static const TypeInfo xilinx_enet_info =3D { static const TypeInfo xilinx_enet_data_stream_info =3D { .name =3D TYPE_XILINX_AXI_ENET_DATA_STREAM, .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(XilinxAXIEnetStreamSlave), + .instance_size =3D sizeof(XilinxAXIEnetStreamSink), .class_init =3D xilinx_enet_data_stream_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_STREAM_SINK }, @@ -1054,7 +1054,7 @@ static const TypeInfo xilinx_enet_data_stream_info = =3D { static const TypeInfo xilinx_enet_control_stream_info =3D { .name =3D TYPE_XILINX_AXI_ENET_CONTROL_STREAM, .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(XilinxAXIEnetStreamSlave), + .instance_size =3D sizeof(XilinxAXIEnetStreamSink), .class_init =3D xilinx_enet_control_stream_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_STREAM_SINK }, --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897569; cv=none; d=zohomail.com; s=zohoarc; b=camgF/2F7zzNfGwbVEDGzGsWGnj3NxPmAg5/dP7tUd2mS2+4n+vHmXTyZkbw0TAVJ/dGppAjeiJSjwRVQ8Ddb8i/Wnhl+51ISzZS2TIZpFAT6PapopjmB8F6NFppfGJbSzaLYPLeh2fnX7q2YXzRmZxGPk9HXHLIvAezHWRB/Qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897569; 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=Hc2sUJNPHxm3+YyKaEs1U6FlSeXyT0qB03hKc1hWp/o=; b=dokXjs1tZIoorNnOtl/Skl3k7BR8iB6z7IyW/j+8YCNgORBJKOWPPAe9VvsPY5x4IUmcx4gh04sNCvPlePNO9ylzFzb/FFmQnFcBDY8CArJIFuLev2uWXHODA6e0qyEdNEa75O+DX+unRXI0eC+mhbqpcHMFF09/l25ejclA0lI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897569229492.02039200757486; Wed, 2 Dec 2020 00:26:09 -0800 (PST) Received: from localhost ([::1]:55644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNSi-0005bB-5v for importer@patchew.org; Wed, 02 Dec 2020 03:26:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCF-0002gm-Bm for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNC9-0003ce-NN for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-JtxKvuEiPteQY91AclHt-g-1; Wed, 02 Dec 2020 03:08:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7206B8558EF for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 405A65C1B4 for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896541; 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: in-reply-to:in-reply-to:references:references; bh=Hc2sUJNPHxm3+YyKaEs1U6FlSeXyT0qB03hKc1hWp/o=; b=VYoTps3eqzdRiPJxlWLNjQm7sj2kJCf1I6fj6FDIM6Vw9GEjTVaTegTphXKGLuD3W/aqDs QcoCj9e0hOzwtuv6vmt6X73BEeguAwA0xlomfCf8AZ94oUP2x4bVseoYOCfkGwqMZrwTFa uZILUfl/SGdtyeMtgnZ0VpRvKVAfkgA= X-MC-Unique: JtxKvuEiPteQY91AclHt-g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 021/113] alpha: remove bios_name Date: Wed, 2 Dec 2020 03:07:17 -0500 Message-Id: <20201202080849.4125477-22-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Richard Henderson Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201026143028.3034018-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/alpha/dp264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 4d24518d1d..c4d407a9f1 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -107,7 +107,7 @@ static void clipper_init(MachineState *machine) but one explicitly written for the emulation, we might as well load it directly from and ELF image. */ palcode_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, - bios_name ? bios_name : "palcode-clipper"); + machine->firmware ?: "palcode-clippe= r"); if (palcode_filename =3D=3D NULL) { error_report("no palcode provided"); exit(1); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897807; cv=none; d=zohomail.com; s=zohoarc; b=Rg/qbFOKP2CQ6JGjq5SQFDez8VytTS/LY4zuPioiR5nWO2sx27cBh9Iugi3wLE1UbQQQDGrvMi1aurfMFUWaXICARl+Yw8pFh3axYifmiK18EmkTgotlqfPkVK+yj+IkmMk4Qr9PY+Gq/rHYNLK0rkUeJjFLzsAwJeqgEA80iyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897807; 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=7v1c1Y/CO/FVC9XD/b7GDAnIOXuSob78kEqFGJQZL7c=; b=R3YMjVt4+hWX/2tddTOIvJADFzMGvUBoIvza43JWFp8+f5vkscj+iuQ+ipQDIBCJBt7Mmjdkgsk1quqOFATQ3E2SNpiZ4RwKBgRlINGVvykOH4+l1GYDND+ZO1ps1HmCd+gVnE2AtWn8vaWrwDZQYPMSR9NoF74zVXcXyo5X8dE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897807446582.7675255782642; Wed, 2 Dec 2020 00:30:07 -0800 (PST) Received: from localhost ([::1]:38772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNWY-0001xH-7N for importer@patchew.org; Wed, 02 Dec 2020 03:30:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0002k8-Mk for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCA-0003dD-0v for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-UkPxoZ5FPWG6y6Hwb_74TA-1; Wed, 02 Dec 2020 03:08:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE8018558E7 for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C5145C1B4 for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896541; 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: in-reply-to:in-reply-to:references:references; bh=7v1c1Y/CO/FVC9XD/b7GDAnIOXuSob78kEqFGJQZL7c=; b=T6+COZKEL130kjcaHyJlB3QCXemkCTCgKLgVTQCjaoam2hVn6CJ1ro9geBjrv4+HM8zfOg MjFRZ+mrOqVxl4N30l142ohaZorN7WIy5vareJVBeF1DWIBhBIoJkpZKAEbPXEMQbwT+I9 sMrF+AkbzogDCRwvbKN96/muQbOMpOA= X-MC-Unique: UkPxoZ5FPWG6y6Hwb_74TA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 022/113] arm: remove bios_name Date: Wed, 2 Dec 2020 03:07:18 -0500 Message-Id: <20201202080849.4125477-23-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Get the firmware name from the MachineState object. Cc: Peter Maydell Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/arm/cubieboard.c | 2 +- hw/arm/highbank.c | 8 ++++---- hw/arm/npcm7xx_boards.c | 5 +---- hw/arm/orangepi.c | 2 +- hw/arm/sbsa-ref.c | 2 ++ hw/arm/vexpress.c | 8 ++++---- hw/arm/virt.c | 2 ++ 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 1c6c792eb6..9d0d728180 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -40,7 +40,7 @@ static void cubieboard_init(MachineState *machine) DeviceState *carddev; =20 /* BIOS is not supported by this board */ - if (bios_name) { + if (machine->firmware) { error_report("BIOS not supported for this machine"); exit(1); } diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index f71087860d..fd3429720e 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -297,16 +297,16 @@ static void calxeda_init(MachineState *machine, enum = cxmachines machine_id) memory_region_init_ram(sysram, NULL, "highbank.sysram", 0x8000, &error_fatal); memory_region_add_subregion(sysmem, 0xfff88000, sysram); - if (bios_name !=3D NULL) { - sysboot_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name= ); + if (machine->firmware !=3D NULL) { + sysboot_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->= firmware); if (sysboot_filename !=3D NULL) { if (load_image_targphys(sysboot_filename, 0xfff88000, 0x8000) = < 0) { - error_report("Unable to load %s", bios_name); + error_report("Unable to load %s", machine->firmware); exit(1); } g_free(sysboot_filename); } else { - error_report("Unable to find %s", bios_name); + error_report("Unable to find %s", machine->firmware); exit(1); } } diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 79e2e2744c..9821013bc6 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -33,13 +33,10 @@ static const char npcm7xx_default_bootrom[] =3D "npcm7x= x_bootrom.bin"; =20 static void npcm7xx_load_bootrom(MachineState *machine, NPCM7xxState *soc) { + const char *bios_name =3D machine->firmware ?: npcm7xx_default_bootrom; g_autofree char *filename =3D NULL; int ret; =20 - if (!bios_name) { - bios_name =3D npcm7xx_default_bootrom; - } - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (!filename) { error_report("Could not find ROM image '%s'", bios_name); diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c index 17a568a2b4..d6306dfdda 100644 --- a/hw/arm/orangepi.c +++ b/hw/arm/orangepi.c @@ -41,7 +41,7 @@ static void orangepi_init(MachineState *machine) DeviceState *carddev; =20 /* BIOS is not supported by this board */ - if (bios_name) { + if (machine->firmware) { error_report("BIOS not supported for this machine"); exit(1); } diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 7d9e180c0d..c3a31f5b8b 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -301,6 +301,7 @@ static bool sbsa_firmware_init(SBSAMachineState *sms, MemoryRegion *sysmem, MemoryRegion *secure_sysmem) { + const char *bios_name; int i; BlockBackend *pflash_blk0; =20 @@ -314,6 +315,7 @@ static bool sbsa_firmware_init(SBSAMachineState *sms, =20 pflash_blk0 =3D pflash_cfi01_get_blk(sms->flash[0]); =20 + bios_name =3D MACHINE(sms)->firmware; if (bios_name) { char *fname; MemoryRegion *mr; diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 531f3a122a..1adb663d77 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -560,7 +560,7 @@ static void vexpress_common_init(MachineState *machine) /* * If a bios file was provided, attempt to map it into memory */ - if (bios_name) { + if (machine->firmware) { char *fn; int image_size; =20 @@ -570,16 +570,16 @@ static void vexpress_common_init(MachineState *machin= e) "but you cannot use both options at once"); exit(1); } - fn =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + fn =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware); if (!fn) { - error_report("Could not find ROM image '%s'", bios_name); + error_report("Could not find ROM image '%s'", machine->firmwar= e); exit(1); } image_size =3D load_image_targphys(fn, map[VE_NORFLASH0], VEXPRESS_FLASH_SIZE); g_free(fn); if (image_size < 0) { - error_report("Could not load ROM image '%s'", bios_name); + error_report("Could not load ROM image '%s'", machine->firmwar= e); exit(1); } } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 27dbeb549e..9c54eea585 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1047,6 +1047,7 @@ static bool virt_firmware_init(VirtMachineState *vms, MemoryRegion *secure_sysmem) { int i; + const char *bios_name; BlockBackend *pflash_blk0; =20 /* Map legacy -drive if=3Dpflash to machine properties */ @@ -1059,6 +1060,7 @@ static bool virt_firmware_init(VirtMachineState *vms, =20 pflash_blk0 =3D pflash_cfi01_get_blk(vms->flash[0]); =20 + bios_name =3D MACHINE(vms)->firmware; if (bios_name) { char *fname; MemoryRegion *mr; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897198; cv=none; d=zohomail.com; s=zohoarc; b=GUmoGn5jZU+rlR67OvyO2DIX8jjqqp1FvpNyc7EEVQMZcobKmui5eOz0A8IDswWTx6frH0z1G/IB9D0PjRsfokZPynusshlS0RCb//enJd1bB+5JdboIxTkFUoivIx5MR1IV+7g2oHaTK3nzW4V+EMXEHKhnN141N40pX1lYiRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897198; 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=1FGacRz1wwcbcO5MB2dhv5Li4SOEk6EK/lC/Lvo4d64=; b=CynQUbaItE1A+utfDnT7hnk/Gb/8i0o9pZMPJ282gRB/UZO8S1Vy4MLcfJ9nLaQp4t0EFjxdhkvqOgwCWilN7NNHdYzA62Re6qIqAMHsnRQPJBQnWVESrgfC9/UKs9oLsWjreoLlvQjZcjEbdeIgdBhBt3aXGGSD2BPdkc5Nu0g= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897198616791.8393276644694; Wed, 2 Dec 2020 00:19:58 -0800 (PST) Received: from localhost ([::1]:38338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNMj-0006cz-7B for importer@patchew.org; Wed, 02 Dec 2020 03:19:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0002ko-UZ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0003eF-Fy for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-_eXJ6j9YOraW6PrkOjB8gg-1; Wed, 02 Dec 2020 03:09:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14DDC1074641 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7F6A5C1B4 for ; Wed, 2 Dec 2020 08:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896542; 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: in-reply-to:in-reply-to:references:references; bh=1FGacRz1wwcbcO5MB2dhv5Li4SOEk6EK/lC/Lvo4d64=; b=c6dhBniu6Ux6fkTdnyDyWX783tfSucIrD4MFjYNZARdIF16yIiDLIVvmNUKnvDs+QYxYKy 8KSEWQjLAUbfxEyL3XskXpES5pIWujZgdXpvpr3ue2SOPJ9fjw0WE79+OI99ULSqxls7Ru 371wH0/b4QiYs9UyF4X+aVhptPJojGI= X-MC-Unique: _eXJ6j9YOraW6PrkOjB8gg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 023/113] hppa: remove bios_name Date: Wed, 2 Dec 2020 03:07:19 -0500 Message-Id: <20201202080849.4125477-24-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Richard Henderson Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201026143028.3034018-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/hppa/machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index d5164457ee..5e745d5ea9 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -213,8 +213,7 @@ static void machine_hppa_init(MachineState *machine) but one explicitly written for the emulation, we might as well load it directly from an ELF image. */ firmware_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, - bios_name ? bios_name : - "hppa-firmware.img"); + machine->firmware ?: "hppa-firmware= .img"); if (firmware_filename =3D=3D NULL) { error_report("no firmware provided"); exit(1); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897034; cv=none; d=zohomail.com; s=zohoarc; b=kb7eHrnKeOzP77t9YBJodC38ESr1yku0UqJ7IQ0wS8g/0Yi71A/0br2YOVFEbWnVxIQX8Cx3yQrnIXcR0M4S/Y0fqJdUW2CPCSobO2yf1ApzB18GFuYTWSJe/vXaAFvnf3xU3Khcwf5kvq+hmTR3HHnxjuHn4cs0MFQoZBy9Vr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897034; 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=fJNsc0uru4MYIxpz/WguOFYyNs1HGSX834CXTR2DuUU=; b=TnH8FpkcfnCP9OG9x77eiwgg7S8z/soiA1ZOSei6pKXMjcYRESEocZ22rwfPiItarxUG+R3xqacekEnE4zgJk+mZKFS+XI9jy6uqe3GIvnl5j3KVnQRRa21tGTW/2TDKr5LJ37Q/qw8kNPe3qZVtgg0cjG8AGO7gkIfjp0vZ+Zk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897034011427.9453040959461; Wed, 2 Dec 2020 00:17:14 -0800 (PST) Received: from localhost ([::1]:58398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNK4-0003Fe-Mk for importer@patchew.org; Wed, 02 Dec 2020 03:17:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCF-0002iA-V1 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCA-0003df-JH for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-JVQBH1V1OPWtU_tGDZU_TQ-1; Wed, 02 Dec 2020 03:09:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 758231006C81 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F5AF5C1B4 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896541; 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: in-reply-to:in-reply-to:references:references; bh=fJNsc0uru4MYIxpz/WguOFYyNs1HGSX834CXTR2DuUU=; b=jTaWbO/nKwn2YjEPK4LaGbJ3vLwm3UNbQcGRxGK/xZC0dvpFYZ/RvxpLkhQMt4tKwQbqHY MDwNb4zfeci6nA1bhbm4uVROueTxk+6q3enJVUX/lORRUUuoOk0BkOpt3Cu1rH892Xtjr6 U/AY4PAM7X0h6bVwKFIwGqxMRJVVAt8= X-MC-Unique: JVQBH1V1OPWtU_tGDZU_TQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 024/113] i386: remove bios_name Date: Wed, 2 Dec 2020 03:07:20 -0500 Message-Id: <20201202080849.4125477-25-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/microvm.c | 7 +++---- hw/i386/pc_sysfw.c | 4 ++-- hw/i386/x86.c | 10 ++++------ include/hw/i386/x86.h | 3 ++- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 5428448b70..6cda3014d6 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -154,6 +154,7 @@ static void create_gpex(MicrovmMachineState *mms) =20 static void microvm_devices_init(MicrovmMachineState *mms) { + const char *default_firmware; X86MachineState *x86ms =3D X86_MACHINE(mms); ISABus *isa_bus; ISADevice *rtc_state; @@ -259,12 +260,10 @@ static void microvm_devices_init(MicrovmMachineState = *mms) serial_hds_isa_init(isa_bus, 0, 1); } =20 - if (bios_name =3D=3D NULL) { - bios_name =3D x86_machine_is_acpi_enabled(x86ms) + default_firmware =3D x86_machine_is_acpi_enabled(x86ms) ? MICROVM_BIOS_FILENAME : MICROVM_QBOOT_FILENAME; - } - x86_bios_rom_init(get_system_memory(), true); + x86_bios_rom_init(MACHINE(mms), default_firmware, get_system_memory(),= true); } =20 static void microvm_memory_init(MicrovmMachineState *mms) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index b6c0822fe3..0187f0a934 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -222,7 +222,7 @@ void pc_system_firmware_init(PCMachineState *pcms, BlockBackend *pflash_blk[ARRAY_SIZE(pcms->flash)]; =20 if (!pcmc->pci_enabled) { - x86_bios_rom_init(rom_memory, true); + x86_bios_rom_init(MACHINE(pcms), "bios.bin", rom_memory, true); return; } =20 @@ -243,7 +243,7 @@ void pc_system_firmware_init(PCMachineState *pcms, =20 if (!pflash_blk[0]) { /* Machine property pflash0 not set, use ROM mode */ - x86_bios_rom_init(rom_memory, false); + x86_bios_rom_init(MACHINE(pcms), "bios.bin", rom_memory, false); } else { if (kvm_enabled() && !kvm_readonly_mem_enabled()) { /* diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 6d5c1432f2..54c9d0c019 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -55,8 +55,6 @@ #include CONFIG_DEVICES #include "kvm_i386.h" =20 -#define BIOS_FILENAME "bios.bin" - /* Physical Address of PVH entry point read from kernel ELF NOTE */ static size_t pvh_start_addr; =20 @@ -1053,17 +1051,17 @@ void x86_load_linux(X86MachineState *x86ms, nb_option_roms++; } =20 -void x86_bios_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) +void x86_bios_rom_init(MachineState *ms, const char *default_firmware, + MemoryRegion *rom_memory, bool isapc_ram_fw) { + const char *bios_name; char *filename; MemoryRegion *bios, *isa_bios; int bios_size, isa_bios_size; int ret; =20 /* BIOS load */ - if (bios_name =3D=3D NULL) { - bios_name =3D BIOS_FILENAME; - } + bios_name =3D ms->firmware ?: default_firmware; filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { bios_size =3D get_image_size(filename); diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 739fac5087..a8db6b1f24 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -101,7 +101,8 @@ void x86_cpu_unplug_request_cb(HotplugHandler *hotplug_= dev, void x86_cpu_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); =20 -void x86_bios_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw); +void x86_bios_rom_init(MachineState *ms, const char *default_firmware, + MemoryRegion *rom_memory, bool isapc_ram_fw); =20 void x86_load_linux(X86MachineState *x86ms, FWCfgState *fw_cfg, --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897969; cv=none; d=zohomail.com; s=zohoarc; b=HrUmW2VsTHHyaQe5YUZxijtE3EIlBoXBQbSAynfgp7nZJ9z2lcrLJSuFxVOIXk6CMAE4Suqcl6YSyiYQ47lHBFrohhqpxqdCdnePTn8/24oQXpbNH7RkSO1x8+J5SK00M8krmbmfkR/kbC4are2/VFf5UPOl7Gitb0teBX/uQN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897969; 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=AVtCW7vPGYWrKdACcEmuiSSET8kuiiK3Z7Syn4qLY6o=; b=k0pgspR+goQnTCNGWTcgLt9+Y3DlfvjnQAJLvc4iS3fGhP44XB1TC+DZbNrMvpo6PE9GqJ/eLWblRXM2CKgY7QPw7N+Mf+sIRhNuwraaBLn9sZ5NcuxH0MAx82529rT3iODgcisqDJ+jKFmNL6ZTH5apRq4BbCVuuh5N6dpkq9g= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897969081343.2406328509585; Wed, 2 Dec 2020 00:32:49 -0800 (PST) Received: from localhost ([::1]:44174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNZ9-0004Ld-UR for importer@patchew.org; Wed, 02 Dec 2020 03:32:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0002jA-As for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCA-0003dq-UT for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-JSGCQ_-GO4aQpRSzkicJmA-1; Wed, 02 Dec 2020 03:09:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD6A18558F0 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B05B5C1B4 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896542; 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: in-reply-to:in-reply-to:references:references; bh=AVtCW7vPGYWrKdACcEmuiSSET8kuiiK3Z7Syn4qLY6o=; b=bfh2e/TxD/kzNL7crJEIPLleFkX9ojqmTpumsRWd02o4JoIAGer29ej0IEv4kZhtnFP2cf ggULikNR2YZKiN1nfDuP4oj4LrOR0G4NGxW6XA+jG5Paxlwq/bg3vrYL8lddUgLTdec/3M FZeI15gD99fYvdy/n8Cfcncr+WMmHMo= X-MC-Unique: JSGCQ_-GO4aQpRSzkicJmA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 025/113] lm32: remove bios_name Date: Wed, 2 Dec 2020 03:07:21 -0500 Message-Id: <20201202080849.4125477-26-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Michael Walle Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/lm32/milkymist.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 9ef94883d5..93ca8bc2ac 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -108,6 +108,7 @@ static void milkymist_init(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + const char *bios_name =3D machine->firmware ?: BIOS_FILENAME; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; @@ -162,9 +163,6 @@ milkymist_init(MachineState *machine) } =20 /* load bios rom */ - if (bios_name =3D=3D NULL) { - bios_name =3D BIOS_FILENAME; - } bios_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); =20 if (bios_filename) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898056; cv=none; d=zohomail.com; s=zohoarc; b=jQiBXdAtCdhTMYGU8REtO9XMdlt4RZCIVSM7L66TdHXvnK8YOyWPbYHHKVFACLSiZWhjXSCOFgWJVPd44gBolvlw+NKxz2LvuZ/gTmxQck21PD7cTFw0PhOzI8qv/jWUKrtUvFNB1KsG5rqVIIS0MmCj9X3J1FRu1NceFoyCKrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898056; 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=9m2aTFzJ2ivBro39qwIClGgVjFJ3N9HXB+CInwnTWYE=; b=fuVkBoF/HtTA6tEmzEoUAXDCkJCrhvyHjFH6s2XA4UtVMj/QBhBiGXF95+dZbXjLn9N2hGQTNbpfZA8YIVzjFpKFnAWb22HRqhwkkeLfJ306cKQgdobjGcC5zevV3nAYMS66bfjnL97LCaBi1Qgkz5PjACIDyWGyRBUMXW1+k60= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898056127748.0883938102593; Wed, 2 Dec 2020 00:34:16 -0800 (PST) Received: from localhost ([::1]:47452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNaZ-0005nz-0Q for importer@patchew.org; Wed, 02 Dec 2020 03:34:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0002pd-Mj for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0003eK-KH for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-s_DSBUkTNOG6t6FSsCDtEA-1; Wed, 02 Dec 2020 03:09:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03B7980364D for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C67FB5C1B4 for ; Wed, 2 Dec 2020 08:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896542; 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: in-reply-to:in-reply-to:references:references; bh=9m2aTFzJ2ivBro39qwIClGgVjFJ3N9HXB+CInwnTWYE=; b=cn4fl6bOnDUMGmfWyg8G8+vEC7dCdwyePjCsagmtBZYI6UJ3po+NVkxMS09/UCi+HZThG4 1a6vAz3jSPrPt4RP24OKDqsJDA+7r4mOzZ26I9cGtyC+WKWTtrFPLiKguEbLQ3ft5lFeTg E6WNXRY0HxpALWUKih5GAzHCo/na7NY= X-MC-Unique: s_DSBUkTNOG6t6FSsCDtEA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 026/113] m68k: remove bios_name Date: Wed, 2 Dec 2020 03:07:22 -0500 Message-Id: <20201202080849.4125477-27-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Laurent Vivier Signed-off-by: Paolo Bonzini Acked-by: Laurent Vivier Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20201026143028.3034018-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/m68k/mcf5208.c | 10 +++++----- hw/m68k/next-cube.c | 4 +--- hw/m68k/q800.c | 4 +--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index d310a98e7b..7c8ca5ddf6 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -301,17 +301,17 @@ static void mcf5208evb_init(MachineState *machine) /* 0xfc0a8000 SDRAM controller. */ =20 /* Load firmware */ - if (bios_name) { + if (machine->firmware) { char *fn; uint8_t *ptr; =20 - fn =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + fn =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware); if (!fn) { - error_report("Could not find ROM image '%s'", bios_name); + error_report("Could not find ROM image '%s'", machine->firmwar= e); exit(1); } if (load_image_targphys(fn, 0x0, ROM_SIZE) < 8) { - error_report("Could not load ROM image '%s'", bios_name); + error_report("Could not load ROM image '%s'", machine->firmwar= e); exit(1); } g_free(fn); @@ -323,7 +323,7 @@ static void mcf5208evb_init(MachineState *machine) =20 /* Load kernel. */ if (!kernel_filename) { - if (qtest_enabled() || bios_name) { + if (qtest_enabled() || machine->firmware) { return; } error_report("Kernel image must be specified"); diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index e7045980b7..37bc35dfa4 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -868,6 +868,7 @@ static void next_cube_init(MachineState *machine) MemoryRegion *bmapm1 =3D g_new(MemoryRegion, 1); MemoryRegion *bmapm2 =3D g_new(MemoryRegion, 1); MemoryRegion *sysmem =3D get_system_memory(); + const char *bios_name =3D machine->firmware ?: ROM_FILE; NeXTState *ns =3D NEXT_MACHINE(machine); DeviceState *dev; =20 @@ -924,9 +925,6 @@ static void next_cube_init(MachineState *machine) sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x0200e000); =20 /* Load ROM here */ - if (bios_name =3D=3D NULL) { - bios_name =3D ROM_FILE; - } /* still not sure if the rom should also be mapped at 0x0*/ memory_region_init_rom(rom, NULL, "next.rom", 0x20000, &error_fatal); memory_region_add_subregion(sysmem, 0x01000000, rom); diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index ce4b47c3e3..6ebcddcfb2 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -167,6 +167,7 @@ static void q800_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *initrd_filename =3D machine->initrd_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; + const char *bios_name =3D machine->firmware ?: MACROM_FILENAME; hwaddr parameters_base; CPUState *cs; DeviceState *dev; @@ -400,9 +401,6 @@ static void q800_init(MachineState *machine) rom =3D g_malloc(sizeof(*rom)); memory_region_init_rom(rom, NULL, "m68k_mac.rom", MACROM_SIZE, &error_abort); - if (bios_name =3D=3D NULL) { - bios_name =3D MACROM_FILENAME; - } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); memory_region_add_subregion(get_system_memory(), MACROM_ADDR, rom); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898162; cv=none; d=zohomail.com; s=zohoarc; b=Wy/sQ6fRYRO//7htY5F1RCsxnQh62pnmWWtYW614sS752OmrJbObPgslhlmCdbGxKH4Vn5PSqCyNVvffp6vY9D9M37GO9YZ/5KKK/QEFRAIuCiD0mbGHdBLfE9U4CpSk6X3TRIRW7H0fyXzAjVwqLwu8mmxzC+g194L1b2mix9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898162; 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=TJLCl0xz0GsndYswkP7ps4+iWH/R5HlUojS29AhufSQ=; b=SSsRjzelHdhC43r5EJ0gz/eZA7SK3ZeHcb2r0yWGMsXZIE0ZI3A5FY7SiUsk71X5gI3bN7ezVtHGHyBy+aeiRzlLDGeTpuint13Eb164jMcb/XCatTlSD8CuUs3W5iTzLW9iqK9adwQ6TAhS7ZacZZOmjgjljTbrcDlYQlov5DY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898162285233.95086532564233; Wed, 2 Dec 2020 00:36:02 -0800 (PST) Received: from localhost ([::1]:55936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNcH-0000pS-5N for importer@patchew.org; Wed, 02 Dec 2020 03:36:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0002pu-VH for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0003eQ-Mm for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-37r4pgE3PzWw33yvEieJMQ-1; Wed, 02 Dec 2020 03:09:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FE94185E489 for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E7B35C1B4 for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896543; 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: in-reply-to:in-reply-to:references:references; bh=TJLCl0xz0GsndYswkP7ps4+iWH/R5HlUojS29AhufSQ=; b=KVtGzJM8Ea1VoTsPBGihhMXjh3h8Q0o2hUdFAd6M2lxCWdiAK7/WxL72oUucBJ9fFDovNh 4yVN2FURPI4tEZ9MaiuQozDqOrqDFtQkmzOhF6QqPnwZ8UzgEJNoMYi0QuRihI35T1cfmU snsbmYhRjRR2OeBMAdtZeUQ0CYi0V5A= X-MC-Unique: 37r4pgE3PzWw33yvEieJMQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 027/113] mips: remove bios_name Date: Wed, 2 Dec 2020 03:07:23 -0500 Message-Id: <20201202080849.4125477-28-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-9-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/mips/fuloong2e.c | 6 +++--- hw/mips/jazz.c | 6 +++--- hw/mips/malta.c | 6 +++--- hw/mips/mipssim.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index a9e0c2f8d3..25b679011f 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -338,7 +338,7 @@ static void mips_fuloong2e_init(MachineState *machine) write_bootloader(env, memory_region_get_ram_ptr(bios), kernel_entr= y); } else { filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, - bios_name ?: FULOONG_BIOSNAME); + machine->firmware ?: FULOONG_BIOSNAME); if (filename) { bios_size =3D load_image_targphys(filename, 0x1fc00000LL, BIOS_SIZE); @@ -348,8 +348,8 @@ static void mips_fuloong2e_init(MachineState *machine) } =20 if ((bios_size < 0 || bios_size > BIOS_SIZE) && - bios_name && !qtest_enabled()) { - error_report("Could not load MIPS bios '%s'", bios_name); + machine->firmware && !qtest_enabled()) { + error_report("Could not load MIPS bios '%s'", machine->firmwar= e); exit(1); } } diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 71448f72ac..aa95c6a3d3 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -218,7 +218,7 @@ static void mips_jazz_init(MachineState *machine, memory_region_add_subregion(address_space, 0xfff00000LL, bios2); =20 /* load the BIOS image. */ - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name ?: BIOS_FIL= ENAME); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: = BIOS_FILENAME); if (filename) { bios_size =3D load_image_targphys(filename, 0xfff00000LL, MAGNUM_BIOS_SIZE); @@ -227,8 +227,8 @@ static void mips_jazz_init(MachineState *machine, bios_size =3D -1; } if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) - && bios_name && !qtest_enabled()) { - error_report("Could not load MIPS bios '%s'", bios_name); + && machine->firmware && !qtest_enabled()) { + error_report("Could not load MIPS bios '%s'", machine->firmware); exit(1); } =20 diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9d1a3b50b7..ef369945d1 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1333,7 +1333,7 @@ void mips_malta_init(MachineState *machine) if (!dinfo) { /* Load a BIOS image. */ filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, - bios_name ?: BIOS_FILENAME); + machine->firmware ?: BIOS_FILENAME); if (filename) { bios_size =3D load_image_targphys(filename, FLASH_ADDRESS, BIOS_SIZE); @@ -1342,8 +1342,8 @@ void mips_malta_init(MachineState *machine) bios_size =3D -1; } if ((bios_size < 0 || bios_size > BIOS_SIZE) && - bios_name && !qtest_enabled()) { - error_report("Could not load MIPS bios '%s'", bios_name); + machine->firmware && !qtest_enabled()) { + error_report("Could not load MIPS bios '%s'", machine->fir= mware); exit(1); } } diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index aaa62a0f4b..cc9b0934b3 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -177,7 +177,7 @@ mips_mipssim_init(MachineState *machine) /* Map the BIOS / boot exception handler. */ memory_region_add_subregion(address_space_mem, 0x1fc00000LL, bios); /* Load a BIOS / boot exception handler image. */ - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name ?: BIOS_FIL= ENAME); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: = BIOS_FILENAME); if (filename) { bios_size =3D load_image_targphys(filename, 0x1fc00000LL, BIOS_SIZ= E); g_free(filename); @@ -185,9 +185,9 @@ mips_mipssim_init(MachineState *machine) bios_size =3D -1; } if ((bios_size < 0 || bios_size > BIOS_SIZE) && - bios_name && !qtest_enabled()) { + machine->firmware && !qtest_enabled()) { /* Bail out if we have neither a kernel image nor boot vector code= . */ - error_report("Could not load MIPS bios '%s'", bios_name); + error_report("Could not load MIPS bios '%s'", machine->firmware); exit(1); } else { /* We have a boot vector start address. */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897726; cv=none; d=zohomail.com; s=zohoarc; b=XrYbjZrTjr9SR0I2esfsPX2AOdXbIbjVqfLcIIBEnCFnnz+pQyT2w3fxY+bDbZh/O4ccXna9M9uMsJ9CFW2zcn+2Jv1TzgZEDzqCOdFK+jWLfeSL6nSJOeKvRgHx5ZOUDSeP3DaHB+bb1iJrn3v6N/LiuDQc8Y6y8KbK1xo4MNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897726; 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=4V/NA010i6tDizCWGrFCI8ez1i6GA84peZ6hiexDRHo=; b=jmB3+fqB/lj+GCt1xhPuSCW0/mZFVUMrlmq9CL1li2HAwGsuIIq7IFbLjYxtqFPBu+mIF9I83bu/qiB0IFjg09Cp5sNbRaiawM78iSZjl2Ua8rq+6U/LMeJq8Mci2ZCE7HbXbeDDRtLwj5AIBtQg3ijOdYmorPJMHWeO401Vt1Q= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897726384524.4230590733789; Wed, 2 Dec 2020 00:28:46 -0800 (PST) Received: from localhost ([::1]:35914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNVF-0000m0-9z for importer@patchew.org; Wed, 02 Dec 2020 03:28:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0002no-04 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCB-0003eW-U0 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-T7NEhU_3O0WHim0qldIW9w-1; Wed, 02 Dec 2020 03:09:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CE635708A for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A3A05C1B4 for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896543; 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: in-reply-to:in-reply-to:references:references; bh=4V/NA010i6tDizCWGrFCI8ez1i6GA84peZ6hiexDRHo=; b=YhQf6dZUayDwMMBh0+MkVLGuuLHsbTW94pKdtfW4Hx1zInUgz76Szo5NtW2hNq7KaS6hDW c30UkEUAcqu0+oSLS7aXf8Cl52KBd2m7rTMI5b6T7pspTV9JaFTMRzXlP7GmkMpfZ21BlF LZbHv3B4xF5gEPMmD0c7b1m2c3LnWf0= X-MC-Unique: T7NEhU_3O0WHim0qldIW9w-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 028/113] moxie: remove bios_name Date: Wed, 2 Dec 2020 03:07:24 -0500 Message-Id: <20201202080849.4125477-29-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-10-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/moxie/moxiesim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index a765e9f6be..d07d504c0d 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -133,9 +133,9 @@ static void moxiesim_init(MachineState *machine) loader_params.initrd_filename =3D initrd_filename; load_kernel(cpu, &loader_params); } - if (bios_name) { - if (load_image_targphys(bios_name, FIRMWARE_BASE, FIRMWARE_SIZE) <= 0) { - error_report("Failed to load firmware '%s'", bios_name); + if (machine->firmware) { + if (load_image_targphys(machine->firmware, FIRMWARE_BASE, FIRMWARE= _SIZE) < 0) { + error_report("Failed to load firmware '%s'", machine->firmware= ); } } =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898128; cv=none; d=zohomail.com; s=zohoarc; b=IFdqZH8PuLvwJ8rZDj7MqlAyzdJeRgpxHq5CtIk4+C2xTkkevLyO1tDp37ViSQqeNchnB1zh9Iz/hXZCBzo4yJsXbPywuJ4/mYjlIeYTkSeHdYXbaB2suhBGV08HHEjolytOvj8XT9HVrjHC6KCeD+pt+/hE+8UeOkDZ0jImoDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898128; 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=kQI7I0gG34Imiu7c+rei9Y5Qe+vOFaa9RX5lIPuz5dI=; b=T66ole1pLtY9R5eXCyZmT2gy+Frr/sKNsCPRUCIIVBoyAKENtidhankdMZqMs2Jy+65afJIRUpr6Rbuu57QcRWhyDA5L+EJbxHALZS5nM+Ih5DM8fv7JCfxOcZ9K0GzaU5GfHRIedDCu0nwRJIGy3c50wI26dX4SWqJMgsUtvjM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898128487222.11866553951506; Wed, 2 Dec 2020 00:35:28 -0800 (PST) Received: from localhost ([::1]:53012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNbi-00085J-FQ for importer@patchew.org; Wed, 02 Dec 2020 03:35:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCJ-0002sW-VX for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCC-0003eg-6w for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-crFlWO-cMnaRRChFucTegQ-1; Wed, 02 Dec 2020 03:09:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7ACA803650 for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B680F5C1B4 for ; Wed, 2 Dec 2020 08:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896543; 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: in-reply-to:in-reply-to:references:references; bh=kQI7I0gG34Imiu7c+rei9Y5Qe+vOFaa9RX5lIPuz5dI=; b=Wd8e7CP0gS3htkrLk4MoL8N6dnNh2g/0+TZUizBlKxEvBpCK7h6DFaWWtdnaWsv9JyihBj gTSevwcwwgTSbTzn7FzhL3HVyXCmg0cMBLSrDLbGzHRhDX9myLt0bguP8K5MbZzShoNOUv TCxKFjo9WIamaESuOMWuwTPPCtHIaOk= X-MC-Unique: crFlWO-cMnaRRChFucTegQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 029/113] ppc: remove bios_name Date: Wed, 2 Dec 2020 03:07:25 -0500 Message-Id: <20201202080849.4125477-30-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: David Gibson Signed-off-by: Paolo Bonzini Acked-by: David Gibson Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-11-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ppc/e500.c | 4 ++-- hw/ppc/mac_newworld.c | 4 +--- hw/ppc/mac_oldworld.c | 4 +--- hw/ppc/pnv.c | 5 +---- hw/ppc/ppc405_boards.c | 6 ++---- hw/ppc/prep.c | 4 +--- hw/ppc/spapr.c | 4 +--- 7 files changed, 9 insertions(+), 22 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ae39b9358e..153a74c98c 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -1035,7 +1035,7 @@ void ppce500_init(MachineState *machine) * -kernel to users but allows them to run through u-boot as well. */ kernel_as_payload =3D false; - if (bios_name =3D=3D NULL) { + if (machine->firmware =3D=3D NULL) { if (machine->kernel_filename) { payload_name =3D machine->kernel_filename; kernel_as_payload =3D true; @@ -1043,7 +1043,7 @@ void ppce500_init(MachineState *machine) payload_name =3D "u-boot.e500"; } } else { - payload_name =3D bios_name; + payload_name =3D machine->firmware; } =20 filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index f9a1cc8944..61c63819df 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -109,6 +109,7 @@ static void ppc_core99_reset(void *opaque) static void ppc_core99_init(MachineState *machine) { ram_addr_t ram_size =3D machine->ram_size; + const char *bios_name =3D machine->firmware ?: PROM_FILENAME; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; @@ -161,9 +162,6 @@ static void ppc_core99_init(MachineState *machine) &error_fatal); memory_region_add_subregion(get_system_memory(), PROM_BASE, bios); =20 - if (!bios_name) { - bios_name =3D PROM_FILENAME; - } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { /* Load OpenBIOS (ELF) */ diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 6c59aa5601..11623e8e67 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -83,6 +83,7 @@ static void ppc_heathrow_reset(void *opaque) static void ppc_heathrow_init(MachineState *machine) { ram_addr_t ram_size =3D machine->ram_size; + const char *bios_name =3D machine->firmware ?: PROM_FILENAME; const char *boot_device =3D machine->boot_order; PowerPCCPU *cpu =3D NULL; CPUPPCState *env =3D NULL; @@ -130,9 +131,6 @@ static void ppc_heathrow_init(MachineState *machine) &error_fatal); memory_region_add_subregion(get_system_memory(), PROM_BASE, bios); =20 - if (!bios_name) { - bios_name =3D PROM_FILENAME; - } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { /* Load OpenBIOS (ELF) */ diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 50ebd4a484..53a5121cab 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -713,6 +713,7 @@ static void pnv_chip_power10_pic_print_info(PnvChip *ch= ip, Monitor *mon) =20 static void pnv_init(MachineState *machine) { + const char *bios_name =3D machine->firmware ?: FW_FILE_NAME; PnvMachineState *pnv =3D PNV_MACHINE(machine); MachineClass *mc =3D MACHINE_GET_CLASS(machine); char *fw_filename; @@ -739,10 +740,6 @@ static void pnv_init(MachineState *machine) pnv->pnor =3D PNV_PNOR(dev); =20 /* load skiboot firmware */ - if (bios_name =3D=3D NULL) { - bios_name =3D FW_FILE_NAME; - } - fw_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (!fw_filename) { error_report("Could not find OPAL firmware '%s'", bios_name); diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index 4687715b15..c867e46330 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -141,6 +141,7 @@ static void ref405ep_fpga_init(MemoryRegion *sysmem, ui= nt32_t base) static void ref405ep_init(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + const char *bios_name =3D machine->firmware ?: BIOS_FILENAME; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; @@ -206,8 +207,6 @@ static void ref405ep_init(MachineState *machine) memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE, &error_fatal); =20 - if (bios_name =3D=3D NULL) - bios_name =3D BIOS_FILENAME; filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { bios_size =3D load_image_size(filename, @@ -425,6 +424,7 @@ static void taihu_cpld_init(MemoryRegion *sysmem, uint3= 2_t base) static void taihu_405ep_init(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + const char *bios_name =3D machine->firmware ?: BIOS_FILENAME; const char *kernel_filename =3D machine->kernel_filename; const char *initrd_filename =3D machine->initrd_filename; char *filename; @@ -475,8 +475,6 @@ static void taihu_405ep_init(MachineState *machine) } else #endif { - if (bios_name =3D=3D NULL) - bios_name =3D BIOS_FILENAME; bios =3D g_new(MemoryRegion, 1); memory_region_init_rom(bios, NULL, "taihu_405ep.bios", BIOS_SIZE, &error_fatal); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 4a0cb434a6..c6b9d1ddcb 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -237,6 +237,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, voi= d *opaque) =20 static void ibm_40p_init(MachineState *machine) { + const char *bios_name =3D machine->firmware ?: "openbios-ppc"; CPUPPCState *env =3D NULL; uint16_t cmos_checksum; PowerPCCPU *cpu; @@ -271,9 +272,6 @@ static void ibm_40p_init(MachineState *machine) =20 /* PCI host */ dev =3D qdev_new("raven-pcihost"); - if (!bios_name) { - bios_name =3D "openbios-ppc"; - } qdev_prop_set_string(dev, "bios-name", bios_name); qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE); pcihost =3D SYS_BUS_DEVICE(dev); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 12a012d9dd..cd8be98caf 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2657,6 +2657,7 @@ static void spapr_machine_init(MachineState *machine) SpaprMachineState *spapr =3D SPAPR_MACHINE(machine); SpaprMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(machine); MachineClass *mc =3D MACHINE_GET_CLASS(machine); + const char *bios_name =3D machine->firmware ?: FW_FILE_NAME; const char *kernel_filename =3D machine->kernel_filename; const char *initrd_filename =3D machine->initrd_filename; PCIHostState *phb; @@ -2980,9 +2981,6 @@ static void spapr_machine_init(MachineState *machine) } } =20 - if (bios_name =3D=3D NULL) { - bios_name =3D FW_FILE_NAME; - } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (!filename) { error_report("Could not find LPAR firmware '%s'", bios_name); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897979; cv=none; d=zohomail.com; s=zohoarc; b=OEEa1IYKAotycFWWTn4Cm0vquEgQEvVyzu2xnahjMdw2pBgrtGXeFZne6PfJStfQphKBE6zjN5XIJyHSjT1IvGN6JV9R8UpopSmbU9XHhI11el8qZFuBuaP7Z1SmyS+A5MD4xiSK1t26PHr5vKrb3C55FJqq0Tg8lFISWoeyv6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897979; 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=Zj3bcorcFbi3fuWKGyW/m3SOE4QmU2FoZcHULTZm/4A=; b=bQyXwLcaonljfxg0LwLqPLjtaLiqK9MnOBeKgsko/kcBHuo4c9nSfpgzw9CTz7kKRkfSs3GG4WsCiojCNSArCsdYTDpmz10JqLDR8nGkbredRH0WkMlhYRMPedBGBp+Ouv8KcVpGs5GQrG9mD/IPQdihr87zXpW1GoqZax4W7wI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897979382856.5399126659199; Wed, 2 Dec 2020 00:32:59 -0800 (PST) Received: from localhost ([::1]:44512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNZK-0004UX-4o for importer@patchew.org; Wed, 02 Dec 2020 03:32:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCJ-0002rZ-IG for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCC-0003eq-JT for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-z8rrQByuO-atxCa0eg5iAw-1; Wed, 02 Dec 2020 03:09:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 855541074642 for ; Wed, 2 Dec 2020 08:09:01 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50E7F60855 for ; Wed, 2 Dec 2020 08:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896543; 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: in-reply-to:in-reply-to:references:references; bh=Zj3bcorcFbi3fuWKGyW/m3SOE4QmU2FoZcHULTZm/4A=; b=GSVUs5PGuXZo/lrI5IMvtSRomf6mNlICbc+wGKSmugfp/twUvmaaBrdjYCRkm9FqInpCWn k5YUSz8td3sNvTclbC9S2n6nPBDQc6qFOz2GrkE+6SYfE6kGX0Avbe4FDjGjqO6fSEqQGp 1rDncSq8HQ8/CxhbqBW49z+OOFJ8MHo= X-MC-Unique: z8rrQByuO-atxCa0eg5iAw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 030/113] rx: move BIOS load from MCU to board Date: Wed, 2 Dec 2020 03:07:26 -0500 Message-Id: <20201202080849.4125477-31-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) The ROM loader state is global and not part of the MCU, and the BIOS is in machine->firmware. So just like the kernel case, load it in the board. Due to the ordering between CPU reset and ROM reset, the ROM has to be registered before the CPU is realized, otherwise the reset vector is loaded before the ROM is there. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- hw/rx/rx-gdbsim.c | 10 ++++++++++ hw/rx/rx62n.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index 285549c79b..b1d7c2488f 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -106,6 +106,16 @@ static void rx_gdbsim_init(MachineState *machine) rxc->xtal_freq_hz, &error_abort); object_property_set_bool(OBJECT(&s->mcu), "load-kernel", kernel_filename !=3D NULL, &error_abort); + + if (!kernel_filename) { + if (machine->firmware) { + rom_add_file_fixed(machine->firmware, RX62N_CFLASH_BASE, 0); + } else if (!qtest_enabled()) { + error_report("No bios or kernel specified"); + exit(1); + } + } + qdev_realize(DEVICE(&s->mcu), NULL, &error_abort); =20 /* Load kernel and dtb */ diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index 6eb4eea700..17ec73fc7b 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -245,15 +245,6 @@ static void rx62n_realize(DeviceState *dev, Error **er= rp) rxc->rom_flash_size, &error_abort); memory_region_add_subregion(s->sysmem, RX62N_CFLASH_BASE, &s->c_flash); =20 - if (!s->kernel) { - if (bios_name) { - rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0); - } else if (!qtest_enabled()) { - error_report("No bios or kernel specified"); - exit(1); - } - } - /* Initialize CPU */ object_initialize_child(OBJECT(s), "cpu", &s->cpu, TYPE_RX62N_CPU); qdev_realize(DEVICE(&s->cpu), NULL, &error_abort); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898286; cv=none; d=zohomail.com; s=zohoarc; b=TckOViea26AEEf6QSXCJkUdPzJV/mcX4sVeJjsgFYxpZdrd1VVuq5+NEKxRtvnBfhQ1hBwDceBErUV4gbI7p+sj66cU5SSahI5WlbTXlfKkABXi8hgRbFXLmydzL9S9eOA8w0YILU/q3MwCyjAYwnhemARk5s1EbpTkkfKhu4mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898286; 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=zruKG4VNxRusKyVaFsbFm3Pteb8Orofw2VWnDQqdy1o=; b=P+5Xxu2H3YH7Mq0egrHmonGpMxLAs/FWcEnwL5bqexojQfngWfzDJFIZQ8XPn4U0msMQ65czblhJ2XILlDmldiDuu90Bxrty5U+ioh3iCfQP4Uyr/XeE+NdkFfl22s4jVM0nRSg3/9mxUKnpXxAMBw3b2ZsC9T3FNTEjabXWnKA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898286538346.47850816504535; Wed, 2 Dec 2020 00:38:06 -0800 (PST) Received: from localhost ([::1]:33286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNeH-0003Hp-8o for importer@patchew.org; Wed, 02 Dec 2020 03:38:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCK-0002tJ-Dp for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCD-0003fc-Uv for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-oeAW8xI8NhSGUNp_N5UDTQ-1; Wed, 02 Dec 2020 03:09:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D4DF85708C for ; Wed, 2 Dec 2020 08:09:01 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A02A260855 for ; Wed, 2 Dec 2020 08:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896545; 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: in-reply-to:in-reply-to:references:references; bh=zruKG4VNxRusKyVaFsbFm3Pteb8Orofw2VWnDQqdy1o=; b=i+RcXC4UckYHygqB0q+E7ZCx+7gF+HJY+ts+/ptmBtKf9+bChegoKu8xy/nTDomUSwZp79 VZs7Yu3MJxrhzzvW76VGXx8bfd87yzoAneKRAFbIOMsgND5I4MdTG+oKPwoNFhs39owzWV sYaHuPPNsSaGCeG+5aHthH/yuPavGjw= X-MC-Unique: oeAW8xI8NhSGUNp_N5UDTQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 031/113] s390: remove bios_name Date: Wed, 2 Dec 2020 03:07:27 -0500 Message-Id: <20201202080849.4125477-32-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Thomas Huth Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Message-Id: <20201026143028.3034018-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/s390x/ipl.c | 8 ++------ hw/s390x/s390-virtio-ccw.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 3d2652d75a..61e8c967d3 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -128,11 +128,7 @@ static void s390_ipl_realize(DeviceState *dev, Error *= *errp) if (!ipl->kernel || ipl->enforce_bios) { uint64_t fwbase =3D (MIN(ram_size, 0x80000000U) - 0x200000) & ~0xf= fffUL; =20 - if (bios_name =3D=3D NULL) { - bios_name =3D ipl->firmware; - } - - bios_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + bios_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->firmwar= e); if (bios_filename =3D=3D NULL) { error_setg(errp, "could not find stage1 bootloader"); return; @@ -154,7 +150,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **= errp) g_free(bios_filename); =20 if (bios_size =3D=3D -1) { - error_setg(errp, "could not load bootloader '%s'", bios_name); + error_setg(errp, "could not load bootloader '%s'", ipl->firmwa= re); return; } =20 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4e140bbead..538229713a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -259,7 +259,8 @@ static void ccw_init(MachineState *machine) /* get a BUS */ css_bus =3D virtual_css_bus_init(); s390_init_ipl_dev(machine->kernel_filename, machine->kernel_cmdline, - machine->initrd_filename, "s390-ccw.img", + machine->initrd_filename, + machine->firmware ?: "s390-ccw.img", "s390-netboot.img", true); =20 dev =3D qdev_new(TYPE_S390_PCI_HOST_BRIDGE); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898124; cv=none; d=zohomail.com; s=zohoarc; b=HYwOoofrcabuLsYcWpMwlRvF0Tbm8p8za84jtZE8eqKmtwoFbhspaB+eFkIsQr2k54QsH3OkFl/ENyoNLtDrtHSr8lgGocxUBek/wBX2F9qKOoYaRfjhhrTxzIVJ31Rza/RPQQXj9ef9IZXX195dJuTdqZVmBpbx+PCQ7zcsopI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898124; 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=EjCStdknq4FEjbmN/Y/QLI+NE1a7K5RD0Yequ6vWOgo=; b=Ag/A2APEuT1+EYBZ6jFyUE/T108iF2j4pAUmyhXQ8+QWzhsHnzw+kxqjZjQ/RkKBBYPAFjRyiJRKbFFL0jCQBga9I8JT/UPG1mXMSkEQRynKfsedMb4Hmi6DNp9eerkrE5pn+jv0t3XY8ZkWZ9au0Rzxf9yaDUP5h++iH/tzacg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898124506593.5171095854801; Wed, 2 Dec 2020 00:35:24 -0800 (PST) Received: from localhost ([::1]:52814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNbe-00080d-7W for importer@patchew.org; Wed, 02 Dec 2020 03:35:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCK-0002u5-NJ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCD-0003f3-HR for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-83-IB95nDApPDWNfzd6Yk1yBA-1; Wed, 02 Dec 2020 03:09:03 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 304F7803651 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFDCD60855 for ; Wed, 2 Dec 2020 08:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896544; 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: in-reply-to:in-reply-to:references:references; bh=EjCStdknq4FEjbmN/Y/QLI+NE1a7K5RD0Yequ6vWOgo=; b=gpd0HnkiLSdliqkxv6St0ckmxzsE/xDCEHvUZNHWAS09RMniXxMqYaRaxrcvuIabwtTEOg ANrS3tS/x7ur3OIXKSdusnwXqWELxsqwf1B03AphAmoeAm0TNnWEObNaQNIPAWeWnobZ1K 6RuIrune+uuElRshR6C/DIKDuH/D3I4= X-MC-Unique: IB95nDApPDWNfzd6Yk1yBA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 032/113] sh4: remove bios_name Date: Wed, 2 Dec 2020 03:07:28 -0500 Message-Id: <20201202080849.4125477-33-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Yoshinori Sato Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201026143028.3034018-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/sh4/shix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c index f410c08883..d9a9fcbc59 100644 --- a/hw/sh4/shix.c +++ b/hw/sh4/shix.c @@ -49,6 +49,7 @@ static void shix_init(MachineState *machine) MemoryRegion *sysmem =3D get_system_memory(); MemoryRegion *rom =3D g_new(MemoryRegion, 1); MemoryRegion *sdram =3D g_new(MemoryRegion, 2); + const char *bios_name =3D machine->firmware ?: BIOS_FILENAME; =20 cpu =3D SUPERH_CPU(cpu_create(machine->cpu_type)); =20 @@ -63,8 +64,6 @@ static void shix_init(MachineState *machine) memory_region_add_subregion(sysmem, 0x0c000000, &sdram[1]); =20 /* Load BIOS in 0 (and access it through P2, 0xA0000000) */ - if (bios_name =3D=3D NULL) - bios_name =3D BIOS_FILENAME; ret =3D load_image_targphys(bios_name, 0, 0x4000); if (ret < 0 && !qtest_enabled()) { error_report("Could not load SHIX bios '%s'", bios_name); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898713; cv=none; d=zohomail.com; s=zohoarc; b=dD3aWYMBe8w2Ny108KEmOW42VID/nHw3C+qJveAqKWa1kNaUvBNdvaNRuhd7Ynv/eVAKHJtyO2fTq9scpQmJHZtaN4kXQEGXjqUspIpE75HHRk9N794f0XWNXAEWKfnvweWT6ObEgKLvd2HcYPAPFmDuG0rrVmjx1C3TD3L5c7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898713; 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=FDaGRo3dgsTxEgc/QbfWVuq4n0xSl83P7F90Kuojeyo=; b=JpbBDpOc5pQHq7KA01M6h5pCgLZsUuVtNjmBYMPVbz+oOx/oS6t5NX4/jNy8OyZt5ufC2wGNQlVFT052u152fmIwDLTWmh6wjrH4zfSCnWedRFXOH8LsCClHkYlFLutqZZPVTO56vvA+2icnsqfn+J3rHpJCvPFkZX8OsP9UyUc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16068987136921019.1876166641565; Wed, 2 Dec 2020 00:45:13 -0800 (PST) Received: from localhost ([::1]:58490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNl7-0005HU-Bv for importer@patchew.org; Wed, 02 Dec 2020 03:45:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCV-00030X-76 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0003gH-PP for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-lhbhHEvvNWCJBDgeNZHSmw-1; Wed, 02 Dec 2020 03:09:04 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8012C1006C83 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C05660855 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896546; 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: in-reply-to:in-reply-to:references:references; bh=FDaGRo3dgsTxEgc/QbfWVuq4n0xSl83P7F90Kuojeyo=; b=J7EzbjloGmQ4LA7Fm8X1HLZZ31DzrFxoNphg8weFNj6Da/Q2xSvUbhdu1spJuuXNwbwOgR A/A6xW9K152AVnmMkb2VVAww2tp1u7yZ+E/Dqqg5CM9/5JoBUl51h7FhyPPyhY65bL7gyM PuW4ilC8b4ZU+65lTu7sFpACIkZDnZw= X-MC-Unique: lhbhHEvvNWCJBDgeNZHSmw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 033/113] sparc: remove bios_name Date: Wed, 2 Dec 2020 03:07:29 -0500 Message-Id: <20201202080849.4125477-34-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Cc: Mark Cave-Ayland Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201026143028.3034018-15-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- hw/sparc/leon3.c | 4 +--- hw/sparc/sun4m.c | 2 +- hw/sparc64/sun4u.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index d40b7891f6..1c50b02f81 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -185,6 +185,7 @@ static void leon3_set_pil_in(void *opaque, int n, int l= evel) static void leon3_generic_hw_init(MachineState *machine) { ram_addr_t ram_size =3D machine->ram_size; + const char *bios_name =3D machine->firmware ?: LEON3_PROM_FILENAME; const char *kernel_filename =3D machine->kernel_filename; SPARCCPU *cpu; CPUSPARCState *env; @@ -259,9 +260,6 @@ static void leon3_generic_hw_init(MachineState *machine) memory_region_add_subregion(address_space_mem, LEON3_PROM_OFFSET, prom= ); =20 /* Load boot prom */ - if (bios_name =3D=3D NULL) { - bios_name =3D LEON3_PROM_FILENAME; - } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); =20 if (filename) { diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 66fecb152a..0f9cd2bf52 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -882,7 +882,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, hwdef->max_mem - machine->ram_size); } =20 - prom_init(hwdef->slavio_base, bios_name); + prom_init(hwdef->slavio_base, machine->firmware); =20 slavio_intctl =3D slavio_intctl_init(hwdef->intctl_base, hwdef->intctl_base + 0x10000ULL, diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 2f8fc670cf..22896b4c62 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -578,7 +578,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, /* set up devices */ ram_init(0, machine->ram_size); =20 - prom_init(hwdef->prom_addr, bios_name); + prom_init(hwdef->prom_addr, machine->firmware); =20 /* Init sabre (PCI host bridge) */ sabre =3D SABRE(qdev_new(TYPE_SABRE)); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898401; cv=none; d=zohomail.com; s=zohoarc; b=aIEAZPxxZSvxLZMAVH5o9YLFBWZAVVBT7waxc0vn+XSTngrSSVS8SF85JHrinRQpIgpL1NasOM6gzcndnhwj1B/izCA/7LZIU+S08FGSwV0s7denlTHcmSWuUSHZYm+jEM+ZRqlUtryk2kvSem4pvKT0gKSO8yrup0FsEZIQ0as= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898401; 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=8Jx7IcnnTEnJFuufAyVt0KVFFgy7BoFaS2hndOR0zKI=; b=kmXeJqMUz7VCM60oSALHjbgw5fjRkRAplGwD5Xj21B3CIiGrWPRn3Kx2DAR4t5Vt5lf5mkCgvZQqSyGx/qNAvrVjMXieueUVcbeCadBOFskv5WomcaEJWid9JqjzmrnkiDP4qyS6px9oHWnE8W7azPwHgcUVD/rSm7uPlLBUH3Y= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898401802137.75327767568535; Wed, 2 Dec 2020 00:40:01 -0800 (PST) Received: from localhost ([::1]:41506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNg8-0006ai-8N for importer@patchew.org; Wed, 02 Dec 2020 03:40:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCL-0002vm-Cp for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0003fh-0d for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-2wApcd6FNsOU9ovbKXwzlQ-1; Wed, 02 Dec 2020 03:09:03 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D2E138558F5 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BA2360855 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896545; 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: in-reply-to:in-reply-to:references:references; bh=8Jx7IcnnTEnJFuufAyVt0KVFFgy7BoFaS2hndOR0zKI=; b=WkB0LE8CjQfBI70wmZq2Uc2FPIuDqvm36lpS1aKDPTgxL4E+itvWBLYmCQ1gZ2yHDTVY6U mMZWFtkJVSGar0o7fJjgS2oJDGXMKPv4cbZRiHOZqrcznRCeZVjOmz2yrD5ldclLCCOoLB VDIbqUF5zjczeAm8QHDEN+mjTutP8CI= X-MC-Unique: 2wApcd6FNsOU9ovbKXwzlQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 034/113] digic: remove bios_name Date: Wed, 2 Dec 2020 03:07:30 -0500 Message-Id: <20201202080849.4125477-35-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Pull defaults to digic4_board_init so that a MachineState is available. Cc: Peter Maydell Signed-off-by: Paolo Bonzini --- hw/arm/digic_boards.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index d5524d3e72..fd228fa96f 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -70,19 +70,20 @@ static void digic4_board_init(MachineState *machine, Di= gicBoard *board) memory_region_add_subregion(get_system_memory(), 0, machine->ram); =20 if (board->add_rom0) { - board->add_rom0(s, DIGIC4_ROM0_BASE, board->rom0_def_filename); + board->add_rom0(s, DIGIC4_ROM0_BASE, + machine->firmware ?: board->rom0_def_filename); } =20 if (board->add_rom1) { - board->add_rom1(s, DIGIC4_ROM1_BASE, board->rom1_def_filename); + board->add_rom1(s, DIGIC4_ROM1_BASE, + machine->firmware ?: board->rom1_def_filename); } } =20 static void digic_load_rom(DigicState *s, hwaddr addr, - hwaddr max_size, const char *def_filename) + hwaddr max_size, const char *filename) { target_long rom_size; - const char *filename; =20 if (qtest_enabled()) { /* qtest runs no code so don't attempt a ROM load which @@ -91,12 +92,6 @@ static void digic_load_rom(DigicState *s, hwaddr addr, return; } =20 - if (bios_name) { - filename =3D bios_name; - } else { - filename =3D def_filename; - } - if (filename) { char *fn =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, filename); =20 @@ -119,7 +114,7 @@ static void digic_load_rom(DigicState *s, hwaddr addr, * 64M Bit (4Mx16) Page Mode / Multi-Bank NOR Flash Memory */ static void digic4_add_k8p3215uqb_rom(DigicState *s, hwaddr addr, - const char *def_filename) + const char *filename) { #define FLASH_K8P3215UQB_SIZE (4 * 1024 * 1024) #define FLASH_K8P3215UQB_SECTOR_SIZE (64 * 1024) @@ -131,7 +126,7 @@ static void digic4_add_k8p3215uqb_rom(DigicState *s, hw= addr addr, 0x00EC, 0x007E, 0x0003, 0x0001, 0x0555, 0x2aa, 0); =20 - digic_load_rom(s, addr, FLASH_K8P3215UQB_SIZE, def_filename); + digic_load_rom(s, addr, FLASH_K8P3215UQB_SIZE, filename); } =20 static DigicBoard digic4_board_canon_a1100 =3D { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898284; cv=none; d=zohomail.com; s=zohoarc; b=Kcy0Chw2QcgWnH7i1CK/Q0BSdmOAPYXsfsUdgAbeJLkYpz2LsOdAbF5KxiUZRyqq4oSHX1g2Ua+T+JzemIdk8QEhcM9IucViGZf6j1Q9Hsa/uUuL62BuM9EK7kDzqpXrfHSTXyMzOpoQDHaWaUV+Ss6LmzIPnnjAxxke3eBh3do= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898284; 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=3qFRcD58D/EahANoDQESLAiNhgElFlK0zCzXfS2LcPs=; b=M2xyBECRMt+CcPhVMeGEF8OmReJSY7IDFFJNTtMo5kG+cmot4t51Gz3HRyTozJU71IzCiLUTrqfAxrAHbHOV0PntucTUm9VeupX1KIYKBy+xY0Olu+zWCJnrfRRa390oJrEh2jptLIAuQWYFr2zjeBH7+fugZfmSnTG1dudwCXE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898284980145.62639865668336; Wed, 2 Dec 2020 00:38:04 -0800 (PST) Received: from localhost ([::1]:33060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNeF-0003BO-QQ for importer@patchew.org; Wed, 02 Dec 2020 03:38:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCL-0002v8-5p for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0003g7-Dj for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-4zA-KBEjOX6E3NyvPQFvNQ-1; Wed, 02 Dec 2020 03:09:04 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B106185E48B for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB53D60854 for ; Wed, 2 Dec 2020 08:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896545; 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: in-reply-to:in-reply-to:references:references; bh=3qFRcD58D/EahANoDQESLAiNhgElFlK0zCzXfS2LcPs=; b=VA0gn8y3Yf23mAvc3htvFDWPqjmoHpeiQ3LQXfw6rbVzb1WQoa81gZvqk/HekUP+Egkm+4 Z3Kr112l5VqzavUdRLEq+Up23n9DF15pOGU5jiG1C1Dh8DFwICDkaUmQEU4X3y3ggBTfJr ZMrJUo6j7QDB79hFT24Uy9xxNVop6ps= X-MC-Unique: 4zA-KBEjOX6E3NyvPQFvNQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 035/113] vl: remove bios_name Date: Wed, 2 Dec 2020 03:07:31 -0500 Message-Id: <20201202080849.4125477-36-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) bios_name was a legacy variable used by machine code, but it is no more. Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Message-Id: <20201026143028.3034018-16-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/sysemu.h | 1 - softmmu/vl.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 817ff4cf75..1336b4264a 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -8,7 +8,6 @@ =20 /* vl.c */ =20 -extern const char *bios_name; extern int only_migratable; extern const char *qemu_name; extern QemuUUID qemu_uuid; diff --git a/softmmu/vl.c b/softmmu/vl.c index bbe65d3742..2b82e6f5cd 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -119,7 +119,6 @@ =20 static const char *data_dir[16]; static int data_dir_idx; -const char *bios_name =3D NULL; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int display_opengl; const char* keyboard_layout =3D NULL; @@ -4212,7 +4211,6 @@ void qemu_init(int argc, char **argv, char **envp) kernel_filename =3D qemu_opt_get(machine_opts, "kernel"); initrd_filename =3D qemu_opt_get(machine_opts, "initrd"); kernel_cmdline =3D qemu_opt_get(machine_opts, "append"); - bios_name =3D qemu_opt_get(machine_opts, "firmware"); =20 opts =3D qemu_opts_find(qemu_find_opts("boot-opts"), NULL); if (opts) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898408; cv=none; d=zohomail.com; s=zohoarc; b=TMkq5Eei6oe/E3IWcGoCJkzfbeSYxRhydF71HRK/WhL8+sndCmhy2NKct4EjI4sUcglQZ87zVX7rgLx5Mod94ewxQ4tvLDsE9xpj8R0/gAfVFxEZrzLjZynwDXPY6O2tWtZ6YRG3gU3RRQrzRYyogWt8Xo0q9+7OO6KsSkWHa1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898408; 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=blQkOkQT5PANCZvLAbElIYkBDvT14KbE8AXseKQwuXU=; b=jH56+o0vQ14Us6dyRF8jRRRZmaSQOvTxZF5e/AXonAAPcjPH+Oz2gLdu9y+5je8LDiPkC1ZkI2tUM9/YRul+1y4M9Dx5azmoVyWN/Q6dkBBOYn/G3aKClmbhskJOECQaxNuTXadLB1dHdqrkDzm1RYaQQYPg95PvJhsq3or3b14= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160689840807146.46968111434296; Wed, 2 Dec 2020 00:40:08 -0800 (PST) Received: from localhost ([::1]:41656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNgF-0006eQ-0Q for importer@patchew.org; Wed, 02 Dec 2020 03:40:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCV-00030L-3e for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCE-0003gK-TL for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-519-ejMA-8zHPKS9u2sgK4fRHg-1; Wed, 02 Dec 2020 03:09:04 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A0CA1006C81 for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4616960854 for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896546; 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: in-reply-to:in-reply-to:references:references; bh=blQkOkQT5PANCZvLAbElIYkBDvT14KbE8AXseKQwuXU=; b=Ct88SrI+1HHDw+/D5flplR1nEaamrIon4/o0Bb64DV5QY9xtqLIgVkVQ335lCXV8x6U0mI +PJBvcw5Bc59wSDKPc6rVfA3vbL5HXjFF7mJzePSlvMGpPuYDCwl45ow2nRYBaS0GMQYKv S8/AhMeCDE1Y9HJNYKJQRZ507V9vxIY= X-MC-Unique: ejMA-8zHPKS9u2sgK4fRHg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 036/113] arm: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:32 -0500 Message-Id: <20201202080849.4125477-37-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: qemu-ppc@nongnu.org Signed-off-by: Paolo Bonzini --- hw/arm/aspeed.c | 8 ++++---- hw/display/pxa2xx_lcd.c | 5 +++-- target/arm/arm-semi.c | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 0ef3f6b412..cc8ed6ec9c 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -295,7 +295,7 @@ static void aspeed_machine_init(MachineState *machine) /* * This will error out if isize is not supported by memory controller. */ - object_property_set_uint(OBJECT(&bmc->soc), "ram-size", ram_size, + object_property_set_uint(OBJECT(&bmc->soc), "ram-size", machine->ram_s= ize, &error_fatal); =20 for (i =3D 0; i < sc->macs_num; i++) { @@ -332,8 +332,8 @@ static void aspeed_machine_init(MachineState *machine) max_ram_size =3D object_property_get_uint(OBJECT(&bmc->soc), "max-ram-= size", &error_abort); memory_region_init_io(&bmc->max_ram, NULL, &max_ram_ops, NULL, - "max_ram", max_ram_size - ram_size); - memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_r= am); + "max_ram", max_ram_size - machine->ram_size); + memory_region_add_subregion(&bmc->ram_container, machine->ram_size, &b= mc->max_ram); =20 aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ? bmc->fmc_model : amc->fmc_model); @@ -378,7 +378,7 @@ static void aspeed_machine_init(MachineState *machine) aspeed_board_binfo.smp_loader_start =3D AST_SMP_MBOX_CODE; } =20 - aspeed_board_binfo.ram_size =3D ram_size; + aspeed_board_binfo.ram_size =3D machine->ram_size; aspeed_board_binfo.loader_start =3D sc->memmap[ASPEED_DEV_SDRAM]; aspeed_board_binfo.nb_cpus =3D sc->num_cpus; =20 diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index ff90104b80..dfff994962 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -17,6 +17,7 @@ #include "ui/console.h" #include "hw/arm/pxa.h" #include "ui/pixel_ops.h" +#include "hw/boards.h" /* FIXME: For graphic_rotate. Should probably be done in common code. */ #include "sysemu/sysemu.h" #include "framebuffer.h" @@ -305,7 +306,7 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s) descptr =3D s->dma_ch[i].descriptor; =20 if (!((descptr >=3D PXA2XX_SDRAM_BASE && descptr + - sizeof(desc) <=3D PXA2XX_SDRAM_BASE + ram_size) || + sizeof(desc) <=3D PXA2XX_SDRAM_BASE + current_machine->ra= m_size) || (descptr >=3D PXA2XX_INTERNAL_BASE && descptr + sizeof(des= c) <=3D PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) { continue; @@ -850,7 +851,7 @@ static void pxa2xx_update_display(void *opaque) } fbptr =3D s->dma_ch[ch].source; if (!((fbptr >=3D PXA2XX_SDRAM_BASE && - fbptr <=3D PXA2XX_SDRAM_BASE + ram_size) || + fbptr <=3D PXA2XX_SDRAM_BASE + current_machine->ram_s= ize) || (fbptr >=3D PXA2XX_INTERNAL_BASE && fbptr <=3D PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZ= E))) { pxa2xx_dma_ber_set(s, ch); diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index c892e0e674..f7b7bff522 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -37,6 +37,7 @@ #include "exec/gdbstub.h" #include "qemu/cutils.h" #include "hw/arm/boot.h" +#include "hw/boards.h" #endif =20 #define TARGET_SYS_OPEN 0x01 @@ -1048,7 +1049,7 @@ target_ulong do_arm_semihosting(CPUARMState *env) retvals[2] =3D ts->stack_base; retvals[3] =3D 0; /* Stack limit. */ #else - limit =3D ram_size; + limit =3D current_machine->ram_size; /* TODO: Make this use the limit of the loaded application. */ retvals[0] =3D rambase + limit / 2; retvals[1] =3D rambase + limit; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898373; cv=none; d=zohomail.com; s=zohoarc; b=P9UO6pJB0bOpdP0U2DSPotDeR5eVejcUvu6sisao29wbqGFrVpDkwtMkqVzZrF9WrxrrKRNu7wjtBN5iMrOMbZdXiVuJ+lTIRrfcQQ98c9dL905i9/uJJ+MMMNLcHODqxZoa/IzD+3LFLu94OJsk3DVCT0RFpV+8MLl5iBtlh34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898373; 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=6sRkjmVhOwL6CdZ5aAVqczXmeSGgoS0sSd1QAioNC4c=; b=gpnoEWlhab42Fzm9/v8pLYjuifvkGirmh4Kti6LPoC+Ib0CDNybyEi5Zb1/ij2fJbCwLfsSdSE65VAukvYEMCcTvXHCTsmvomNmgMF9SNt6RSABDBMcC8pQZWYI1rU9tBRWPXZREApM7wmePcAOb7FBAOGVOICZRU8bdiLFOQ5c= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898373651819.2859354868466; Wed, 2 Dec 2020 00:39:33 -0800 (PST) Received: from localhost ([::1]:39448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNfg-0005lE-C1 for importer@patchew.org; Wed, 02 Dec 2020 03:39:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCR-0002ym-Ar for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCF-0003gM-0j for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-nS5TuGFTOrqfjDUCepsNLw-1; Wed, 02 Dec 2020 03:09:04 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C962C1074641 for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95DDE60854 for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896546; 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: in-reply-to:in-reply-to:references:references; bh=6sRkjmVhOwL6CdZ5aAVqczXmeSGgoS0sSd1QAioNC4c=; b=SfQCPKkYQgFJ4mdqcw/GHLif5RU65Fu46UKF8bfk1UaMIB7owpdiu0EeziZ6CixCNj+OhQ /2PtD0rar1g7+twd2K9/3dSKi4kJ5XJO1NMPat7PAry84UCFFcq6cqQD5eGf0uMnUxGbYI sCFnBKIn/RtCsEvgpowau1oojhTCuaY= X-MC-Unique: nS5TuGFTOrqfjDUCepsNLw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 037/113] cris: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:33 -0500 Message-Id: <20201202080849.4125477-38-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Signed-off-by: Paolo Bonzini --- hw/cris/axis_dev88.c | 1 + hw/cris/boot.c | 2 +- hw/cris/boot.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index dab7423c73..b0cb6d84af 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -333,6 +333,7 @@ void axisdev88_init(MachineState *machine) if (kernel_filename) { li.image_filename =3D kernel_filename; li.cmdline =3D kernel_cmdline; + li.ram_size =3D machine->ram_size; cris_load_image(cpu, &li); } else if (!qtest_enabled()) { fprintf(stderr, "Kernel image must be specified\n"); diff --git a/hw/cris/boot.c b/hw/cris/boot.c index aa8d2756d6..9fa09cfd83 100644 --- a/hw/cris/boot.c +++ b/hw/cris/boot.c @@ -81,7 +81,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info = *li) if (image_size < 0) { /* Takes a kimage from the axis devboard SDK. */ image_size =3D load_image_targphys(li->image_filename, 0x40004000, - ram_size); + li->ram_size); li->entry =3D 0x40004000; } =20 diff --git a/hw/cris/boot.h b/hw/cris/boot.h index 218854e5d1..9f1e0e340c 100644 --- a/hw/cris/boot.h +++ b/hw/cris/boot.h @@ -6,6 +6,7 @@ struct cris_load_info const char *image_filename; const char *cmdline; int image_size; + ram_addr_t ram_size; =20 hwaddr entry; }; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897566; cv=none; d=zohomail.com; s=zohoarc; b=SQoLFLqfsYvKdJJYotlxiyjA9olFYNmrwbgYBkNGLdXnsAX+xmxwsYa7IKQ0eT/+5xfppt9Gtp6QL8rUw/9bo1XB9gzzo8EKKP0zPUKhiA2b/4wSTCuekyGI2c7REi+V+jAiYiln2c6V8Net9B6mrPmfKq/kfUJdfP7un7yxKCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897566; 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=DrZZG5jmSiQnnHIn1NqKMicV5UuGzvfg9THg9XdXTqY=; b=RWLPuw6wthjjCp5B/uiY2fB87fnfdU0mlo8ZHpgXI+FRtyHIGXuep5WewvgEmz8COhygpG5Qs9Ta4nLpkTcnEbmDeexj3/+FlVqFy/4m0vzBfBWUQlHC46mhMnZoUOL3sCNG+31DC7DF2bCI2gKHXp75KsQXmzAkRf7BFaeAVos= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897566713204.14941596349206; Wed, 2 Dec 2020 00:26:06 -0800 (PST) Received: from localhost ([::1]:55422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNSf-0005VT-9y for importer@patchew.org; Wed, 02 Dec 2020 03:26:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCP-0002wz-99 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46290) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCF-0003gZ-I2 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-xExnd77dOUSX6qLoltMklA-1; Wed, 02 Dec 2020 03:09:05 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24B885708B for ; Wed, 2 Dec 2020 08:09:04 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4FDC60854 for ; Wed, 2 Dec 2020 08:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896546; 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: in-reply-to:in-reply-to:references:references; bh=DrZZG5jmSiQnnHIn1NqKMicV5UuGzvfg9THg9XdXTqY=; b=jQtGCz9dC2lAaGg+iitOdvswmI/LRX49MbvasIz6jDzhoppmWqWR4bDpAcyRiG3wNQOUpB 4rCVoQjivy1qmuqRBnU6zWFOX4b9+K83gP8hTAcjAayPiWa8VXPpc27II3U251fpv14Iv5 VDfqJY1pw9bHCMCHJwhyVlLIgp6H7yo= X-MC-Unique: xExnd77dOUSX6qLoltMklA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 038/113] hppa: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:34 -0500 Message-Id: <20201202080849.4125477-39-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: Richard Henderson Signed-off-by: Paolo Bonzini --- hw/hppa/machine.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5e745d5ea9..7e41cb2462 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -97,7 +97,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms) fw_cfg =3D fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); =20 val =3D cpu_to_le64(MIN_SEABIOS_HPPA_VERSION); fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", @@ -288,7 +288,7 @@ static void machine_hppa_init(MachineState *machine) (1) Due to sign-extension problems and PDC, put the initrd no higher than 1G. (2) Reserve 64k for stack. */ - initrd_base =3D MIN(ram_size, 1 * GiB); + initrd_base =3D MIN(machine->ram_size, 1 * GiB); initrd_base =3D initrd_base - 64 * KiB; initrd_base =3D (initrd_base - initrd_size) & TARGET_PAGE_MASK; =20 @@ -316,7 +316,7 @@ static void machine_hppa_init(MachineState *machine) * various parameters in registers. After firmware initialization, * firmware will start the Linux kernel with ramdisk and cmdline. */ - cpu[0]->env.gr[26] =3D ram_size; + cpu[0]->env.gr[26] =3D machine->ram_size; cpu[0]->env.gr[25] =3D kernel_entry; =20 /* tell firmware how many SMP CPUs to present in inventory table */ @@ -342,11 +342,11 @@ static void hppa_machine_reset(MachineState *ms) } =20 /* already initialized by machine_hppa_init()? */ - if (cpu[0]->env.gr[26] =3D=3D ram_size) { + if (cpu[0]->env.gr[26] =3D=3D ms->ram_size) { return; } =20 - cpu[0]->env.gr[26] =3D ram_size; + cpu[0]->env.gr[26] =3D ms->ram_size; cpu[0]->env.gr[25] =3D 0; /* no firmware boot menu */ cpu[0]->env.gr[24] =3D 'c'; /* gr22/gr23 unused, no initrd while reboot. */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899120; cv=none; d=zohomail.com; s=zohoarc; b=f2uaPuvqqtT0/qRTxB0rQokyVRI5vIpbdN0qxrqiiB1Y728Hv5dasLRAmCrb9WENr68h16rQ3DnhocLMXO80t0AvlQ0KAJ+t+knHYmcSb85GqVxcGqOVr6IM+HjxaXJdgZZsyQcijyFvgCGoPaRpgUy4+ljnRDjCtn/9holSVEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899120; 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=Y1gcIfC8ZNBU83Lp6V6I3GhGySHEpG0L5zvecdZ/VRc=; b=LBNuNf3f3tkIW6HSGbmGFbm670UTuil55OE9g1in6e7ZqPBh87qM+bDVOiWvZ9XFZE96FPhe1B72OkIEUygGy1SFQpweKRjLRlcmoVRpnfAmSPN15WBkg841wY2XCqGVt/GGhQ+6t7OvlsO4uw/tQmUkm3T1OQd79pFG2qE3PRI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899120050263.0531954461479; Wed, 2 Dec 2020 00:52:00 -0800 (PST) Received: from localhost ([::1]:47246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNri-000422-Su for importer@patchew.org; Wed, 02 Dec 2020 03:51:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-00033a-Ul for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0003gk-9I for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-d3KgGOnxNG6N_rg0rbZZSQ-1; Wed, 02 Dec 2020 03:09:05 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7501A185E486 for ; Wed, 2 Dec 2020 08:09:04 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40CD960854 for ; Wed, 2 Dec 2020 08:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896547; 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: in-reply-to:in-reply-to:references:references; bh=Y1gcIfC8ZNBU83Lp6V6I3GhGySHEpG0L5zvecdZ/VRc=; b=dKiNs4zgYzmDBpzNcjUsrQ2gygdMNawuyIdEBrqlr40JxgA407r8Tn860V+9v6jvKzLZoo RYyYdTrrk6tbSFibbYTr/Yqdjxhe8lmZDm6l8KKJSOa24CnLrqRhpPSRA/JQkDjR0VG9Xw FLwGw2FmtlqXDFdsuxIxPdCM/2b5MXQ= X-MC-Unique: d3KgGOnxNG6N_rg0rbZZSQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 039/113] i386: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:35 -0500 Message-Id: <20201202080849.4125477-40-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the loader parameters instead. Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c | 2 +- hw/i386/vmport.c | 3 ++- hw/i386/xen/xen-hvm.c | 2 +- hw/intc/apic_common.c | 3 ++- hw/smbios/smbios.c | 8 ++++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index e06579490c..b87f0e5070 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -118,7 +118,7 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, * "etc/max-cpus" actually being apic_id_limit */ fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); #ifdef CONFIG_ACPI fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES, acpi_tables, acpi_tables_len); diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 20d605506b..490a57f52c 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -32,6 +32,7 @@ #include "hw/isa/isa.h" #include "hw/i386/vmport.h" #include "hw/qdev-properties.h" +#include "hw/boards.h" #include "sysemu/sysemu.h" #include "sysemu/hw_accel.h" #include "sysemu/qtest.h" @@ -188,7 +189,7 @@ static uint32_t vmport_cmd_ram_size(void *opaque, uint3= 2_t addr) return -1; } cpu->env.regs[R_EBX] =3D 0x1177; - return ram_size; + return current_machine->ram_size; } =20 static uint32_t vmport_cmd_get_hz(void *opaque, uint32_t addr) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 9519c33c09..096c46fef1 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1493,7 +1493,7 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegi= on **ram_memory) #else xen_map_cache_init(NULL, state); #endif - xen_ram_init(pcms, ram_size, ram_memory); + xen_ram_init(pcms, ms->ram_size, ram_memory); =20 qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state); =20 diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 502e94effc..97dd96dffa 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -27,6 +27,7 @@ #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" #include "trace.h" +#include "hw/boards.h" #include "sysemu/hax.h" #include "sysemu/kvm.h" #include "hw/qdev-properties.h" @@ -297,7 +298,7 @@ static void apic_common_realize(DeviceState *dev, Error= **errp) =20 /* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK && - !hax_enabled() && ram_size >=3D 1024 * 1024) { + !hax_enabled() && current_machine->ram_size >=3D 1024 * 1024) { vapic =3D sysbus_create_simple("kvmvapic", -1, NULL); } s->vapic =3D vapic; diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 6a3d39793b..f22c4f5b73 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -678,13 +678,13 @@ static void smbios_build_type_16_table(unsigned dimm_= cnt) t->location =3D 0x01; /* Other */ t->use =3D 0x03; /* System memory */ t->error_correction =3D 0x06; /* Multi-bit ECC (for Microsoft, per Sea= BIOS) */ - size_kb =3D QEMU_ALIGN_UP(ram_size, KiB) / KiB; + size_kb =3D QEMU_ALIGN_UP(current_machine->ram_size, KiB) / KiB; if (size_kb < MAX_T16_STD_SZ) { t->maximum_capacity =3D cpu_to_le32(size_kb); t->extended_maximum_capacity =3D cpu_to_le64(0); } else { t->maximum_capacity =3D cpu_to_le32(MAX_T16_STD_SZ); - t->extended_maximum_capacity =3D cpu_to_le64(ram_size); + t->extended_maximum_capacity =3D cpu_to_le64(current_machine->ram_= size); } t->memory_error_information_handle =3D cpu_to_le16(0xFFFE); /* Not pro= vided */ t->number_of_memory_devices =3D cpu_to_le16(dimm_cnt); @@ -911,9 +911,9 @@ void smbios_get_tables(MachineState *ms, =20 #define MAX_DIMM_SZ (16 * GiB) #define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \ - : ((ram_size - 1) % MAX_DIMM_SZ) += 1) + : ((current_machine->ram_size - 1)= % MAX_DIMM_SZ) + 1) =20 - dimm_cnt =3D QEMU_ALIGN_UP(ram_size, MAX_DIMM_SZ) / MAX_DIMM_SZ; + dimm_cnt =3D QEMU_ALIGN_UP(current_machine->ram_size, MAX_DIMM_SZ)= / MAX_DIMM_SZ; =20 smbios_build_type_16_table(dimm_cnt); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898570; cv=none; d=zohomail.com; s=zohoarc; b=J111r9AtaOFAVWihJIQRoOU0xXuULS3tneZQtwPSgqsk73ky6e19jz8Rd3uhCT0xCNaPB5cYyFVIu7Ss6jZ5E+pxbtUlzJ+oI5YkztC4J9KBIzk/OBAbW+SWiJ/uhb5Wf2a6ClwwP9z5CpWQzkmAL1cK/bSfc8ReMc4UdRPVk3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898570; 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=Tm7yCEMpC8IvENFSCX1OwJhZl4J8hLCYYB6gZw2aigE=; b=A2dedaYu7M0OWWoPSkJw930sZez0q5iLrzZCKj079hkt8TZ6jMR2myzPc7nSgcIuv5Q3coTBriFwRC0Qec6meDKs3ufBiFL0K7EwGsfIfdzb2If0mz9xugvTKTQZqkK5kztDkVoJQSnd7hlsXFYI0POyPSihoDKukjj3BsEJGH8= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898570801364.1894649779938; Wed, 2 Dec 2020 00:42:50 -0800 (PST) Received: from localhost ([::1]:50038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNir-0001oB-EQ for importer@patchew.org; Wed, 02 Dec 2020 03:42:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCT-0002zk-2R for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0003gm-8v for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-RiGFGWE5NZmFNhYKoTWgmQ-1; Wed, 02 Dec 2020 03:09:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A2991074647 for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2641346F for ; Wed, 2 Dec 2020 08:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896547; 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: in-reply-to:in-reply-to:references:references; bh=Tm7yCEMpC8IvENFSCX1OwJhZl4J8hLCYYB6gZw2aigE=; b=L64Hj/ZUjcNSjpb01j/kAICt0hSetVAUc/dUZxiZTvjlKUOML5nyswOaENdZ81KJEzuVwh k/HOoFcT4Lp5vIyxpF6ycDNWbqGS9EOVDH5GFKr47DyZL141ouBBSR91+nXbKozh8i/i8p wFt6bw5gs/0XbGMxmDkh2K798QER9DQ= X-MC-Unique: RiGFGWE5NZmFNhYKoTWgmQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 040/113] m68k: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:36 -0500 Message-Id: <20201202080849.4125477-41-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: Laurent Vivier Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- hw/m68k/mcf5206.c | 4 +++- hw/m68k/mcf5208.c | 3 ++- target/m68k/m68k-semi.c | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index 51d2e0da1c..8708aa4480 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -10,6 +10,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "cpu.h" +#include "hw/boards.h" #include "hw/irq.h" #include "hw/m68k/mcf.h" #include "qemu/timer.h" @@ -311,8 +312,9 @@ static uint64_t m5206_mbar_read(m5206_mbar_state *s, /* FIXME: currently hardcoded to 128Mb. */ { uint32_t mask =3D ~0; - while (mask > ram_size) + while (mask > current_machine->ram_size) { mask >>=3D 1; + } return mask & 0x0ffe0000; } case 0x5c: return 1; /* DRAM bank 1 empty. */ diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 7c8ca5ddf6..2205145ecc 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -157,8 +157,9 @@ static uint64_t m5208_sys_read(void *opaque, hwaddr add= r, { int n; for (n =3D 0; n < 32; n++) { - if (ram_size < (2u << n)) + if (current_machine->ram_size < (2u << n)) { break; + } } return (n - 1) | 0x40000000; } diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index 8e5fbfc8fa..27600e0cc0 100644 --- a/target/m68k/m68k-semi.c +++ b/target/m68k/m68k-semi.c @@ -26,6 +26,7 @@ #else #include "exec/gdbstub.h" #include "exec/softmmu-semi.h" +#include "hw/boards.h" #endif #include "qemu/log.h" =20 @@ -455,8 +456,8 @@ void do_m68k_semihosting(CPUM68KState *env, int nr) * FIXME: This is wrong for boards where RAM does not start at * address zero. */ - env->dregs[1] =3D ram_size; - env->aregs[7] =3D ram_size; + env->dregs[1] =3D current_machine->ram_size; + env->aregs[7] =3D current_machine->ram_size; #endif return; default: --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898527; cv=none; d=zohomail.com; s=zohoarc; b=OiMVxAuLkvO9igPs9665nj0fnpApW50WjaO/CHSbRm+vESfl/IR59U7fwjuGTjqkXxmOHij4b77DthIZCOmKgg9rQNzEs9vmcqyoPo5/mpLhYulUyLahDbbo4AGk60COwegWk+rQr6SUP9SzXjNJW/x2VuLXW747td5cawxZhB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898527; 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=pYr+k8+J57XMwCr9tgCtGOTEWedDsJ/kyaidUapX1+E=; b=hhVtr0F+nP9oL4qcPNirP5isrEAJnAEMxDd/Yot6cHbCXgWVOmfWEyhqood5KYp+GlGxCuCEIhBfQQiuOU02kR6vaZ5/e4AmcI2x9hiYd5wOP8hLUXcy87WOua9tiICkrMgTL9olDS74xPzAnw2YxJDgPRPazCvNwU/G8GWVn1c= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898527329187.52980621250276; Wed, 2 Dec 2020 00:42:07 -0800 (PST) Received: from localhost ([::1]:47918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNi9-0000w7-SU for importer@patchew.org; Wed, 02 Dec 2020 03:42:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCX-00031r-3n for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0003gy-Nv for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-NK603P9MO7O177uuBY2_sw-1; Wed, 02 Dec 2020 03:09:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5699D8558F3 for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23B5D1346F for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896548; 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: in-reply-to:in-reply-to:references:references; bh=pYr+k8+J57XMwCr9tgCtGOTEWedDsJ/kyaidUapX1+E=; b=ezA1j/clB3gy+/gryG+WNOVyRdgce97SzOt01tUEbo2Glx6Go3JaizKYd8lvjo3B9za595 +2m8KyfOGV9WAOURso8waIavEOyXIFDGpDPj24Cdl6/TCIC04jczWKMs6TlgZzfKJ8QB/R lPcq9Vr4rjuqB2Xcj2UccyMuPw6qdM8= X-MC-Unique: NK603P9MO7O177uuBY2_sw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 041/113] microblaze: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:37 -0500 Message-Id: <20201202080849.4125477-42-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the equivalent argument to the function instead. Signed-off-by: Paolo Bonzini --- hw/microblaze/boot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 8ad3c27f2c..e1f56f83f9 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -170,7 +170,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr = ddr_base, /* Not an ELF image nor an u-boot image, try a RAW image. */ if (kernel_size < 0) { kernel_size =3D load_image_targphys(kernel_filename, ddr_base, - ram_size); + ramsize); boot_info.bootstrap_pc =3D ddr_base; high =3D (ddr_base + kernel_size + 3) & ~3; } @@ -185,11 +185,11 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwadd= r ddr_base, =20 initrd_size =3D load_ramdisk(initrd_filename, boot_info.initrd_start, - ram_size - initrd_offset); + ramsize - initrd_offset); if (initrd_size < 0) { initrd_size =3D load_image_targphys(initrd_filename, boot_info.initrd_start, - ram_size - initrd_offset= ); + ramsize - initrd_offset); } if (initrd_size < 0) { error_report("could not load initrd '%s'", @@ -206,7 +206,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr = ddr_base, } /* Provide a device-tree. */ boot_info.fdt =3D boot_info.cmdline + 4096; - microblaze_load_dtb(boot_info.fdt, ram_size, + microblaze_load_dtb(boot_info.fdt, ramsize, boot_info.initrd_start, boot_info.initrd_end, kernel_cmdline, --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898958; cv=none; d=zohomail.com; s=zohoarc; b=hii1gbxYXdz8q0y+f+G+suAONEESonmcAbbuhSxVbB131kxAqpKk9uPgGW0Zon+y0riKWj/nxwqJeqvIzkn9A3tWGGcUkCGAzEChVO9UBOkxYIzwg+swbnvYegbr24N+4m7+s6/OS2grgpxfaKQ/H5/JqBsqtADtQTXFXl3Kj+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898958; 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=8E+/Fiz3NqLS9yQanr0Zg453gPRiB9OY5V3QQ3GVy70=; b=jJtMdFrhdmGdznBB8uqOcPz3vSN16LV9I+azAuox5FYrT2pizA/YMyqybGcRBYLNjah/8jBeIhCSw3Gdv4FVJ6hB0V6cdpi91O3vvCjF+1uNe1A0Uk0rd8wa0mT7AY6j5AsAgG/17IqL1vhRZq5xPEk0uOLviNeH5a5OedsOqKA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898958789267.01861926715924; Wed, 2 Dec 2020 00:49:18 -0800 (PST) Received: from localhost ([::1]:38746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNp7-0000QK-LA for importer@patchew.org; Wed, 02 Dec 2020 03:49:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-000330-4e for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCG-0003h3-SK for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:27 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-581-n-MRha-ENx2lQLQkh4zgfg-1; Wed, 02 Dec 2020 03:09:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A368F185E48B for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 708D91346F for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896548; 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: in-reply-to:in-reply-to:references:references; bh=8E+/Fiz3NqLS9yQanr0Zg453gPRiB9OY5V3QQ3GVy70=; b=MkdK34KMHzn5DpY/+qKoOYAZKqO2d9dbG7bgRFtsg5GSW77K5K8kuUACKBbLKG2EbzGjvA 64QFlb31ZfAfXYKJ8gyt3U90SG2ecBvEofPvdKhipKoGfq5wezHNwdtf769UwyEK0+I70s aU2nMiMnxwXodXO7TdUOp/DvLkv1BFU= X-MC-Unique: n-MRha-ENx2lQLQkh4zgfg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 042/113] mips: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:38 -0500 Message-Id: <20201202080849.4125477-43-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Use the machine properties or loader parameters instead. Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- hw/mips/fuloong2e.c | 4 ++-- hw/mips/malta.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 25b679011f..84a2132f85 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -134,14 +134,14 @@ static int64_t load_kernel(CPUMIPSState *env) initrd_size =3D get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { initrd_offset =3D ROUND_UP(kernel_high, INITRD_PAGE_SIZE); - if (initrd_offset + initrd_size > ram_size) { + if (initrd_offset + initrd_size > loaderparams.ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, initrd_offset, - ram_size - initrd_offset); + loaderparams.ram_size - init= rd_offset); } if (initrd_size =3D=3D (target_ulong) -1) { error_report("could not load initial ram disk '%s'", diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ef369945d1..467b21849e 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1087,7 +1087,7 @@ static int64_t load_kernel(void) } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, initrd_offset, - ram_size - initrd_offset); + loaderparams.ram_size - init= rd_offset); } if (initrd_size =3D=3D (target_ulong) -1) { error_report("could not load initial ram disk '%s'", --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897720; cv=none; d=zohomail.com; s=zohoarc; b=EkxnJRO3Rvshm4tV5zLnVtqdHk9Ix7LIwyhNPXijh2xV5SXQf+jrx79fpj/EOTceHIHUF7EsZw59P8WEIDAVZaYQLHnxUY0j0WUeSWS4rEej1JEWrSBuqEn97B6mmVL5uCDR/vfV3U8wkLD4aveSKsf37t75oSt35r4CSipx7IQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897720; 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=y/Rg70LqxGxJo/1ByREtBp7p8S6w63ItlseTqbVo4u4=; b=l094opCj8PyzBnD+pGIk6bPNS6JQzUgWsOeFMBxaXsN7bSshT5oGhb0pemGDDkllrZ9SI96tvodsQihzOfQ6ISX/E8bgBn1LiPzuAv6kQY33N20BGDTibxh8Phh3M7ubng/cVe50QQmUcOXVQ9ZSyOY9uyy7zF11OdY4zI2i6iI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897720970549.8633321502034; Wed, 2 Dec 2020 00:28:40 -0800 (PST) Received: from localhost ([::1]:35680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNV9-0000gD-R5 for importer@patchew.org; Wed, 02 Dec 2020 03:28:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCY-00032w-Uw for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCH-0003hB-HY for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:26 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-8vibkAxYNmGmYaHB1hO_cw-1; Wed, 02 Dec 2020 03:09:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF7A4803654 for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD6CD1346F for ; Wed, 2 Dec 2020 08:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896548; 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: in-reply-to:in-reply-to:references:references; bh=y/Rg70LqxGxJo/1ByREtBp7p8S6w63ItlseTqbVo4u4=; b=RiM3EI8BFlbxvqr5Olmz6RZPL2AnjSc7Og5TW7VmlzsZuMUoRA9+bMXfMjLqJwrInud18x UQbNNHZMJs+TnN3WFH8l/nsBDw8vmTBriuUHplw/Opo4TyNns0f2SiHxYPW0o3HixnR3la KJuoecfMAFItRVEatLKEJdYHhknXhD4= X-MC-Unique: 8vibkAxYNmGmYaHB1hO_cw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 043/113] moxie: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:39 -0500 Message-Id: <20201202080849.4125477-44-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Use the loader parameters instead. Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- hw/moxie/moxiesim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index d07d504c0d..f7b57fcae1 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -82,7 +82,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *load= er_params) } initrd_size =3D load_image_targphys(loader_params->initrd_file= name, initrd_offset, - ram_size); + loader_params->ram_size); } if (initrd_size =3D=3D (target_ulong)-1) { error_report("could not load initial ram disk '%s'", --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898579; cv=none; d=zohomail.com; s=zohoarc; b=TGOP1oi5/gMRwRGRrrX8mshwqUUDWoYO0N760lEqVFA1pw1wfl5x9qtYtWHk/VGbhEYDTlNItlQ2DL71Ug1guAh2ZH3IXplTLTcm2nYNk5Z8iRfPPoUB0QI3yPTGlE2aAMzlT4O5MriqlCMywtm/BbjL+ZNCP7URN6Jcfe/DOxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898579; 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=zyf8JOy3zvW0QULYrBcv9uT6KGnhNJtj9ZcY4Y4Dt7w=; b=CrynTbc/hMHokTapYSLbnHwpPU//9DefJuwqnFwWVRzMzTViMzSoFr7+Y21N8yA1z9RvrQUzmG+7S/lg923B1+7lCtSjZ0XniHFzdeHiz1AGzu6VLbGX8vEb673RyG5x/JuHYUffvqh6VyDxt8lG0rGULEyVsNrPV399s9dHLMI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898579495370.5421912766301; Wed, 2 Dec 2020 00:42:59 -0800 (PST) Received: from localhost ([::1]:50210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNj0-0001t7-By for importer@patchew.org; Wed, 02 Dec 2020 03:42:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCb-00035J-JB for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCH-0003hL-Io for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:29 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-f1WtkT9_PlSsq2b8CD49Nw-1; Wed, 02 Dec 2020 03:09:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5610F8558E7 for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 156D81346F for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896548; 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: in-reply-to:in-reply-to:references:references; bh=zyf8JOy3zvW0QULYrBcv9uT6KGnhNJtj9ZcY4Y4Dt7w=; b=aXIZDFiHygiaIQHkiEBjr7dNLY29Kqhc4u2lBAG2tdcnI9nEEUE7NDyHfMY2mXqNx9Uuk0 f5dsxDVldEIJ2fiIVAhFaOZ4lIojn0bcBfvq9+G81/wXQOOAYCu6L/k5OY6S0DXFVrhvRR wGYPkyyYIpbf3mI5R60Q8o9dmd7oOgg= X-MC-Unique: f1WtkT9_PlSsq2b8CD49Nw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 044/113] nios2: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:40 -0500 Message-Id: <20201202080849.4125477-45-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the equivalent argument to the function instead. Signed-off-by: Paolo Bonzini --- hw/nios2/boot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 1df3b66c29..3cb864914b 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -181,7 +181,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, /* Not an ELF image nor an u-boot image, try a RAW image. */ if (kernel_size < 0) { kernel_size =3D load_image_targphys(kernel_filename, ddr_base, - ram_size); + ramsize); boot_info.bootstrap_pc =3D ddr_base; high =3D ddr_base + kernel_size; } @@ -198,11 +198,11 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, =20 initrd_size =3D load_ramdisk(initrd_filename, boot_info.initrd_start, - ram_size - initrd_offset); + ramsize - initrd_offset); if (initrd_size < 0) { initrd_size =3D load_image_targphys(initrd_filename, boot_info.initrd_start, - ram_size - initrd_offset= ); + ramsize - initrd_offset); } if (initrd_size < 0) { error_report("could not load initrd '%s'", @@ -216,7 +216,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, =20 /* Device tree must be placed right after initrd (if available) */ boot_info.fdt =3D high; - fdt_size =3D nios2_load_dtb(boot_info, ram_size, kernel_cmdline, + fdt_size =3D nios2_load_dtb(boot_info, ramsize, kernel_cmdline, /* Preference a -dtb argument */ dtb_arg ? dtb_arg : filename); high +=3D fdt_size; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899466; cv=none; d=zohomail.com; s=zohoarc; b=iQ6gbi5us1AxBaLbl85yJjbamRQXUzWnWQlvUhyDwKxsA6xtjq9wV7uZf/2SjINyTOaGpFXbO2BAo2A7c5mO9oWUOfmDagPZPRkHqf+Cj6gfg2oiSpDfsH9cIKgjbW/jp4tVi1XlNO09NUT4kWyBIToMSPS7Fiyo8eRpuzMDycc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899466; 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=ehmt36+3Lwhgf0Ky3LnraRhcYFEtG4dcMjc9yTu0Sj8=; b=jESs084oqsIAXzwgIVwuYjLbSzKdkghNriQbBfPeD8IswJRamoD4NcSDNSjOr8WrtkN6tBhdSA5FoJ3QFGCHmOGZpYvPJArErYdfcbEHQcbxE9FVOOUuHCPg3w3oa59NSK9XRT2P+N+moEAfEuotcgJciI07uuJrhmOUqIdzCAg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899466914267.17083383238105; Wed, 2 Dec 2020 00:57:46 -0800 (PST) Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNxJ-0002gq-Ja for importer@patchew.org; Wed, 02 Dec 2020 03:57:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCb-00034C-5z for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCH-0003hQ-PX for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-DbCUJwwTOTyRbL3M0UcQmQ-1; Wed, 02 Dec 2020 03:09:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 957B8185E48D for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 623051346F for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896549; 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: in-reply-to:in-reply-to:references:references; bh=ehmt36+3Lwhgf0Ky3LnraRhcYFEtG4dcMjc9yTu0Sj8=; b=dZyubq+aUThgZw729DX+MfXKGBxmfiqebQ2ArHIVH8mmw7/wy+jLOQBXAllOSdOPfcx1ai +/mLC46GW83Ie08avRHJ7O1hnPKQSE8CVXB0boQVS5IKw0boW1IoA8oITczjX14XCp+sUl puCuJuw/MZa3XZET14fT77Yin8Q3YUA= X-MC-Unique: DbCUJwwTOTyRbL3M0UcQmQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 045/113] ppc: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:41 -0500 Message-Id: <20201202080849.4125477-46-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: qemu-ppc@nongnu.org Signed-off-by: Paolo Bonzini --- hw/ppc/prep.c | 2 +- hw/ppc/spapr_vio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index c6b9d1ddcb..7e72f6e4a9 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -420,7 +420,7 @@ static void ibm_40p_init(MachineState *machine) =20 /* Prepare firmware configuration for Open Hack'Ware */ if (m48t59) { - PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", ram_size, + PPC_NVRAM_set_params(m48t59, NVRAM_SIZE, "PREP", machine->ram_size, boot_device, kernel_base, kernel_size, machine->kernel_cmdline, diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 5d6c56473f..3cc9421526 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -525,10 +525,10 @@ static void spapr_vio_busdev_realize(DeviceState *qde= v, Error **errp) uint32_t liobn =3D SPAPR_VIO_LIOBN(dev->reg); =20 memory_region_init(&dev->mrroot, OBJECT(dev), "iommu-spapr-root", - ram_size); + MACHINE(spapr)->ram_size); memory_region_init_alias(&dev->mrbypass, OBJECT(dev), "iommu-spapr-bypass", get_system_memory(), - 0, ram_size); + 0, MACHINE(spapr)->ram_size); memory_region_add_subregion_overlap(&dev->mrroot, 0, &dev->mrbypas= s, 1); address_space_init(&dev->as, &dev->mrroot, qdev->id); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899316; cv=none; d=zohomail.com; s=zohoarc; b=T2XUYldOX80fyAi7e2KId7cf/3asSJLvferFUwZaXnn+6e1bbJ9IFmD+2J7pLP3eNNwa0J+Pn172+U9ZZfPzXvW/jD9GfvRitucLnzNouHfBBH4hWupFIIWDeNnpEd3zZoJmCfckiXh4ZxihSF8ng0QGyFo7xI4M/d9QshpIquM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899316; 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=Z41wdtVrX1P7TMOdXTQDHU5/w3QF676y8J6+L1l1EKA=; b=hrmFZQUoRIEksUwGg4SEKxo+bVIMPdH1KYKqAzEiUg7IxGYOs14l6bnGoo+8VdLqGd6teCk2EIOPt78w395ZcdAguaBJ56OFLRsmtUNUOlZw8xPkVuCFFCPb7KIRWwFJMwDk/TLeaFOXFhpojwpUDrW/9yS8s1tA7QyJ3GM+mX0= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899316462756.4274866271272; Wed, 2 Dec 2020 00:55:16 -0800 (PST) Received: from localhost ([::1]:55652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNut-0007VQ-6S for importer@patchew.org; Wed, 02 Dec 2020 03:55:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-00033Q-U3 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0003hY-7K for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580-FT1K1tMbOOyviO8RK3ERlA-1; Wed, 02 Dec 2020 03:09:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB9AD185E486 for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE8331346F for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896549; 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: in-reply-to:in-reply-to:references:references; bh=Z41wdtVrX1P7TMOdXTQDHU5/w3QF676y8J6+L1l1EKA=; b=CguvsmgpcmCEuWA5Qv0n+/oCIHOcIgaNUC2lFONMfEkFhhREKWET9RHzDIxa3z8nwrfaiH ZN1AXPkq63k5ig6zgkWHnO+yB5VXurIUdOR2UsvXzSunAndv887JkhVOTgcgeEFOFpnoDH 9aE8UC9yBjQcW8lax9LVZJi0ISkQTkQ= X-MC-Unique: FT1K1tMbOOyviO8RK3ERlA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 046/113] riscv: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:42 -0500 Message-Id: <20201202080849.4125477-47-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: Alistair Francis Signed-off-by: Paolo Bonzini --- hw/riscv/boot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 9b3fe3fb1e..70a9bf8f5d 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -120,7 +120,8 @@ target_ulong riscv_load_firmware(const char *firmware_f= ilename, } =20 firmware_size =3D load_image_targphys_as(firmware_filename, - firmware_load_addr, ram_size, N= ULL); + firmware_load_addr, + current_machine->ram_size, NULL= ); =20 if (firmware_size > 0) { return firmware_load_addr + firmware_size; @@ -148,7 +149,7 @@ target_ulong riscv_load_kernel(const char *kernel_filen= ame, } =20 if (load_image_targphys_as(kernel_filename, kernel_start_addr, - ram_size, NULL) > 0) { + current_machine->ram_size, NULL) > 0) { return kernel_start_addr; } =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898688; cv=none; d=zohomail.com; s=zohoarc; b=bvpQw1JlWYolVK8syr1KI2ijVJs5AFviLORJyqSzGFc9j62U4PR2znNaxgFnqfkrcJli0os6Yv3e1di9tV6wrEBgVQl0kJMy2VcOpitIID9oHyF6E0CSqtI+Ot34hvuWAw2siq0m+FQW9lrVn7TTKp+dckdLUP5CdiGYXsSsCHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898688; 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=mjoEbg/0RgU7dmywMkQ/ZgZlTHMo1pdSQ4JkBIJSJ1w=; b=F+RalirDu2NwMHHXAI9mTkTOmMAkLG2dQwBelq1qkTB459riYNPUvuk0JUjrCL/OtfIPXuEWrqHQkY5uZQ1f4UlW7X8K2jfLhz66+lxsG/aFvnt855oLnUAPq6z9t5H4DYoWl/6mkroL1f86Et3sVumi2DbCRl4Tv5oN4YLC0zo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898688659176.2469180010545; Wed, 2 Dec 2020 00:44:48 -0800 (PST) Received: from localhost ([::1]:56462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNkl-0004SU-9r for importer@patchew.org; Wed, 02 Dec 2020 03:44:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCf-0003FX-La for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0003hj-JE for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:33 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-I0Ct96QFORqIijgCmbOZlw-1; Wed, 02 Dec 2020 03:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 380F5185E490 for ; Wed, 2 Dec 2020 08:09:07 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 062F71346F for ; Wed, 2 Dec 2020 08:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896549; 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: in-reply-to:in-reply-to:references:references; bh=mjoEbg/0RgU7dmywMkQ/ZgZlTHMo1pdSQ4JkBIJSJ1w=; b=OiaQpb57tB11sAvz5u3FWfJqUZ+NjlNixOAKIOr+sbNpoCzqQ9UJTWrJEMN+lwKW66g1BL O+QGEWpUj1Fz6KL8D91WZGe4YG0jvHuXCci9EOTBe1kdoPSG/INAzIVK3pVu7ZFrT/JrZT uI2g6Pv7VOWdi7A9alkLjH77g+jCMLY= X-MC-Unique: I0Ct96QFORqIijgCmbOZlw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 047/113] s390x: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:43 -0500 Message-Id: <20201202080849.4125477-48-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: Cornelia Huck Signed-off-by: Paolo Bonzini --- hw/s390x/ipl.c | 10 ++++++---- hw/s390x/s390-skeys.c | 6 ++++-- hw/s390x/s390-virtio-ccw.c | 4 +++- target/s390x/excp_helper.c | 3 ++- target/s390x/mem_helper.c | 10 +++++++--- target/s390x/mmu_helper.c | 4 +++- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 61e8c967d3..bddbaffac6 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -112,6 +112,7 @@ static uint64_t bios_translate_addr(void *opaque, uint6= 4_t srcaddr) =20 static void s390_ipl_realize(DeviceState *dev, Error **errp) { + MachineState *ms =3D MACHINE(qdev_get_machine()); S390IPLState *ipl =3D S390_IPL(dev); uint32_t *ipl_psw; uint64_t pentry; @@ -126,7 +127,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **= errp) * even if an external kernel has been defined. */ if (!ipl->kernel || ipl->enforce_bios) { - uint64_t fwbase =3D (MIN(ram_size, 0x80000000U) - 0x200000) & ~0xf= fffUL; + uint64_t fwbase =3D (MIN(ms->ram_size, 0x80000000U) - 0x200000) & = ~0xffffUL; =20 bios_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->firmwar= e); if (bios_filename =3D=3D NULL) { @@ -163,7 +164,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **= errp) &pentry, NULL, NULL, NULL, 1, EM_S390, 0, 0); if (kernel_size < 0) { - kernel_size =3D load_image_targphys(ipl->kernel, 0, ram_size); + kernel_size =3D load_image_targphys(ipl->kernel, 0, ms->ram_si= ze); if (kernel_size < 0) { error_setg(errp, "could not load kernel '%s'", ipl->kernel= ); return; @@ -210,7 +211,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **= errp) initrd_offset +=3D 0x100000; } initrd_size =3D load_image_targphys(ipl->initrd, initrd_offset, - ram_size - initrd_offset); + ms->ram_size - initrd_offset= ); if (initrd_size =3D=3D -1) { error_setg(errp, "could not load initrd '%s'", ipl->initrd= ); return; @@ -448,6 +449,7 @@ int s390_ipl_set_loadparm(uint8_t *loadparm) =20 static int load_netboot_image(Error **errp) { + MachineState *ms =3D MACHINE(qdev_get_machine()); S390IPLState *ipl =3D get_ipl_device(); char *netboot_filename; MemoryRegion *sysmem =3D get_system_memory(); @@ -480,7 +482,7 @@ static int load_netboot_image(Error **errp) false); =20 if (img_size < 0) { - img_size =3D load_image_size(netboot_filename, ram_ptr, ram_size); + img_size =3D load_image_size(netboot_filename, ram_ptr, ms->ram_si= ze); ipl->start_addr =3D KERN_IMAGE_START; } =20 diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 5cc559fe4c..9a8d60d1d9 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -109,7 +109,8 @@ void qmp_dump_skeys(const char *filename, Error **errp) { S390SKeysState *ss =3D s390_get_skeys_device(); S390SKeysClass *skeyclass =3D S390_SKEYS_GET_CLASS(ss); - const uint64_t total_count =3D ram_size / TARGET_PAGE_SIZE; + MachineState *ms =3D MACHINE(qdev_get_machine()); + const uint64_t total_count =3D ms->ram_size / TARGET_PAGE_SIZE; uint64_t handled_count =3D 0, cur_count; Error *lerr =3D NULL; vaddr cur_gfn =3D 0; @@ -256,7 +257,8 @@ static void s390_storage_keys_save(QEMUFile *f, void *o= paque) { S390SKeysState *ss =3D S390_SKEYS(opaque); S390SKeysClass *skeyclass =3D S390_SKEYS_GET_CLASS(ss); - uint64_t pages_left =3D ram_size / TARGET_PAGE_SIZE; + MachineState *ms =3D MACHINE(qdev_get_machine()); + uint64_t pages_left =3D ms->ram_size / TARGET_PAGE_SIZE; uint64_t read_count, eos =3D S390_SKEYS_SAVE_FLAG_EOS; vaddr cur_gfn =3D 0; int error =3D 0; diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 538229713a..fdfb386314 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -17,6 +17,7 @@ #include "hw/boards.h" #include "exec/address-spaces.h" #include "exec/ram_addr.h" +#include "hw/boards.h" #include "hw/s390x/s390-virtio-hcall.h" #include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" @@ -142,8 +143,9 @@ static int virtio_ccw_hcall_notify(const uint64_t *args) static int virtio_ccw_hcall_early_printk(const uint64_t *args) { uint64_t mem =3D args[0]; + MachineState *ms =3D MACHINE(qdev_get_machine()); =20 - if (mem < ram_size) { + if (mem < ms->ram_size) { /* Early printk */ return 0; } diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 0adfbbda27..9cf66d3690 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -156,9 +156,10 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, in= t size, !address_space_access_valid(&address_space_memory, raddr, TARGET_PAGE_SIZE, access_type, MEMTXATTRS_UNSPECIFIED)) { + MachineState *ms =3D MACHINE(qdev_get_machine()); qemu_log_mask(CPU_LOG_MMU, "%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", - __func__, (uint64_t)raddr, (uint64_t)ram_size); + __func__, (uint64_t)raddr, (uint64_t)ms->ram_size); excp =3D PGM_ADDRESSING; tec =3D 0; /* unused */ } diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index bd25eed3e8..0108611cc9 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -31,6 +31,7 @@ =20 #if !defined(CONFIG_USER_ONLY) #include "hw/s390x/storage-keys.h" +#include "hw/boards.h" #endif =20 /*************************************************************************= ****/ @@ -2075,12 +2076,13 @@ uint32_t HELPER(tprot)(CPUS390XState *env, uint64_t= a1, uint64_t a2) /* insert storage key extended */ uint64_t HELPER(iske)(CPUS390XState *env, uint64_t r2) { + MachineState *ms =3D MACHINE(qdev_get_machine()); static S390SKeysState *ss; static S390SKeysClass *skeyclass; uint64_t addr =3D wrap_address(env, r2); uint8_t key; =20 - if (addr > ram_size) { + if (addr > ms->ram_size) { return 0; } =20 @@ -2098,12 +2100,13 @@ uint64_t HELPER(iske)(CPUS390XState *env, uint64_t = r2) /* set storage key extended */ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2) { + MachineState *ms =3D MACHINE(qdev_get_machine()); static S390SKeysState *ss; static S390SKeysClass *skeyclass; uint64_t addr =3D wrap_address(env, r2); uint8_t key; =20 - if (addr > ram_size) { + if (addr > ms->ram_size) { return; } =20 @@ -2124,11 +2127,12 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, = uint64_t r2) /* reset reference bit extended */ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2) { + MachineState *ms =3D MACHINE(qdev_get_machine()); static S390SKeysState *ss; static S390SKeysClass *skeyclass; uint8_t re, key; =20 - if (r2 > ram_size) { + if (r2 > ms->ram_size) { return 0; } =20 diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 7d9f3059cd..d492b23a17 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -27,6 +27,7 @@ #include "trace.h" #include "hw/hw.h" #include "hw/s390x/storage-keys.h" +#include "hw/boards.h" =20 /* Fetch/store bits in the translation exception code: */ #define FS_READ 0x800 @@ -292,10 +293,11 @@ static void mmu_handle_skey(target_ulong addr, int rw= , int *flags) { static S390SKeysClass *skeyclass; static S390SKeysState *ss; + MachineState *ms =3D MACHINE(qdev_get_machine()); uint8_t key; int rc; =20 - if (unlikely(addr >=3D ram_size)) { + if (unlikely(addr >=3D ms->ram_size)) { return; } =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606897967; cv=none; d=zohomail.com; s=zohoarc; b=WcXMyXq7O8ux2z+TYE3W+cf4jNvdtfPYhAbGjqAD7kiABX3RXoJtk//ldlPLkUs06Gk1FWKrakeTtEmAEyW103GhxN3uti1XI1oXi7lHUzwdxLXSxp9wbHHwjYI6fDHxo3aZupo+qCNOk9GfWfkeVIp+ARQH1YwQvla9BIJm1u8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606897967; 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=JoTI8HLYNJHmxE2vsvZEe9/42vzmUbuqTpGxhCf7BEs=; b=CBY1Te+c6KX/LtZD9utwplKEP2Qep2SOvqjseWAMmXKxqXAQPyzbIKkwiJTQxQ+CmKJDcoSJtFCn36RpKg5SEmVci0p5ueePACgCcuXGjL/k63mcRWD6WHDiqGW0m0BuGXlu4zmvrdVT95zmylxiJiVaEbJHN9N/KJjaA5UVSMs= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606897967476187.95673693510332; Wed, 2 Dec 2020 00:32:47 -0800 (PST) Received: from localhost ([::1]:44130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNZ7-0004JY-UW for importer@patchew.org; Wed, 02 Dec 2020 03:32:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCd-0003Al-G0 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCI-0003iE-Ui for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:31 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-3uVqQrl4OkS44Y7ZS5_g_Q-1; Wed, 02 Dec 2020 03:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84A01185E48B for ; Wed, 2 Dec 2020 08:09:07 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 525A31346F for ; Wed, 2 Dec 2020 08:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896550; 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: in-reply-to:in-reply-to:references:references; bh=JoTI8HLYNJHmxE2vsvZEe9/42vzmUbuqTpGxhCf7BEs=; b=H0q+qG7b+Ng2B1PyRohvWYKBXOfXa7awHoCmvIQYBbPxsvAh0P1/crlwstO9rToGHCe2d4 mWrVyUSwDcphaYIONGMCu+fZczUNgvisbXSvO4gvJFrLTnZ7zoxwaiAsZmV6IgEXZ/rNIX FQAzOuTAtmAjg6XUaV0+ZQzNqf7CVJ0= X-MC-Unique: 3uVqQrl4OkS44Y7ZS5_g_Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 048/113] sparc64: do not use ram_size global Date: Wed, 2 Dec 2020 03:07:44 -0500 Message-Id: <20201202080849.4125477-49-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties instead. Cc: Mark Cave-Ayland Signed-off-by: Paolo Bonzini --- hw/sparc64/sparc64.c | 3 ++- hw/sparc64/sun4u.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 100b2fab17..e3f9219a10 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "hw/boards.h" #include "hw/char/serial.h" #include "hw/sparc/sparc64.h" #include "qemu/timer.h" @@ -180,7 +181,7 @@ static void main_cpu_reset(void *opaque) cpu_timer_reset(env->hstick); =20 env->gregs[1] =3D 0; /* Memory start */ - env->gregs[2] =3D ram_size; /* Memory size */ + env->gregs[2] =3D current_machine->ram_size; /* Memory size */ env->gregs[3] =3D 0; /* Machine description XXX */ if (nr_resets++ =3D=3D 0) { /* Power on reset */ diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 22896b4c62..8bee7dd2f4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -690,7 +690,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, initrd_addr =3D 0; kernel_size =3D sun4u_load_kernel(machine->kernel_filename, machine->initrd_filename, - ram_size, &initrd_size, &initrd_addr, + machine->ram_size, &initrd_size, &init= rd_addr, &kernel_addr, &kernel_entry); =20 sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", machine->ram_size, @@ -713,7 +713,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, fw_cfg =3D FW_CFG(dev); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id); fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry); fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899121; cv=none; d=zohomail.com; s=zohoarc; b=HkAV5wmBpvQrNTkDFemS/tM0r4/pcIeN8YVAyRHYtHg4c69CUpoCVL4WeBdrE/+m4AwZTypT3RU7hqRy43bzRklkvEuv/QcCw3RW/G5CktuHC/aclA7Twz0GQ70lWV0KlMCJ9pwpjsnDPHGMm2g7pNhq2G+oEzFwBqTEU7deg3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899121; 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=5rb20XKOkJc7zfvAvncCe6o2RFXtycVYClMRrjGxVaY=; b=aAui1alJHfXaOKS3OubQVFxNJ/oxv2gHqgDlwMSY//K9g2ZplAdjF+vUdtOveal2aDaCxTkuUAWtBuvyQduMoUhyX0nKzcKZTHcrUwiZzocFInHUVtu8G8fk1SaFv0P8liydTcbdP8yu/dIOcdJ9OTKGCa3J5x+y6sRkQ+kvGnk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160689912179961.7712441165088; Wed, 2 Dec 2020 00:52:01 -0800 (PST) Received: from localhost ([::1]:47416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNrk-00046M-Lg for importer@patchew.org; Wed, 02 Dec 2020 03:52:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCh-0003JS-7c for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCJ-0003iN-3c for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:34 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-29-fC6eiBX6MOSL-PLNIcCEvw-1; Wed, 02 Dec 2020 03:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D09461074641 for ; Wed, 2 Dec 2020 08:09:07 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EF411346F for ; Wed, 2 Dec 2020 08:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896550; 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: in-reply-to:in-reply-to:references:references; bh=5rb20XKOkJc7zfvAvncCe6o2RFXtycVYClMRrjGxVaY=; b=LlxbAiLa9SvLD3OI4HbwbbwjXf/UvDhe+qmhGW1q8pESaAXzFSBRgqY2fnIgiatsG0gTwD ehAJRwTmIlMJ1IqmxBr2ftS25INbcMC9EiU/H6MMl7cy5UJBBd/mRV3RcAit2d/4xKRSXR GzK1lNeqCFtK16mUIOtEQvEK8YB20b4= X-MC-Unique: fC6eiBX6MOSL-PLNIcCEvw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 049/113] make ram_size local to vl.c Date: Wed, 2 Dec 2020 03:07:45 -0500 Message-Id: <20201202080849.4125477-50-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the machine properties for the leftovers too. Signed-off-by: Paolo Bonzini --- hw/core/generic-loader.c | 3 ++- hw/core/numa.c | 10 +++++----- hw/virtio/virtio-balloon.c | 3 ++- include/exec/cpu-common.h | 2 -- monitor/qmp-cmds.c | 3 ++- softmmu/vl.c | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index a242c076f6..2b2a7b5e9a 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -35,6 +35,7 @@ #include "hw/sysbus.h" #include "sysemu/dma.h" #include "sysemu/reset.h" +#include "hw/boards.h" #include "hw/loader.h" #include "hw/qdev-properties.h" #include "qapi/error.h" @@ -154,7 +155,7 @@ static void generic_loader_realize(DeviceState *dev, Er= ror **errp) =20 if (size < 0 || s->force_raw) { /* Default to the maximum size being the machine's ram size */ - size =3D load_image_targphys_as(s->file, s->addr, ram_size, as= ); + size =3D load_image_targphys_as(s->file, s->addr, current_mach= ine->ram_size, as); } else { s->addr =3D entry; } diff --git a/hw/core/numa.c b/hw/core/numa.c index 7c4dd4e68e..68cee65f61 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -642,7 +642,7 @@ void numa_complete_configuration(MachineState *ms) =20 /* * If memory hotplug is enabled (slot > 0) or memory devices are enabl= ed - * (ms->maxram_size > ram_size) but without '-numa' options explicitly= on + * (ms->maxram_size > ms->ram_size) but without '-numa' options explic= itly on * CLI, guests will break. * * Windows: won't enable memory hotplug without SRAT table at all @@ -663,7 +663,7 @@ void numa_complete_configuration(MachineState *ms) mc->auto_enable_numa)) { NumaNodeOptions node =3D { }; parse_numa_node(ms, &node, &error_abort); - numa_info[0].node_mem =3D ram_size; + numa_info[0].node_mem =3D ms->ram_size; } =20 assert(max_numa_nodeid <=3D MAX_NODES); @@ -687,10 +687,10 @@ void numa_complete_configuration(MachineState *ms) for (i =3D 0; i < ms->numa_state->num_nodes; i++) { numa_total +=3D numa_info[i].node_mem; } - if (numa_total !=3D ram_size) { + if (numa_total !=3D ms->ram_size) { error_report("total memory for NUMA nodes (0x%" PRIx64 ")" " should equal RAM size (0x" RAM_ADDR_FMT ")", - numa_total, ram_size); + numa_total, ms->ram_size); exit(1); } =20 @@ -702,7 +702,7 @@ void numa_complete_configuration(MachineState *ms) } ms->ram =3D g_new(MemoryRegion, 1); memory_region_init(ms->ram, OBJECT(ms), mc->default_ram_id, - ram_size); + ms->ram_size); numa_init_memdev_container(ms, ms->ram); } /* QEMU needs at least all unique node pair distances to build diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index b22b5beda3..e83017c02d 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -20,6 +20,7 @@ #include "hw/virtio/virtio.h" #include "hw/mem/pc-dimm.h" #include "hw/qdev-properties.h" +#include "hw/boards.h" #include "sysemu/balloon.h" #include "hw/virtio/virtio-balloon.h" #include "exec/address-spaces.h" @@ -748,7 +749,7 @@ static int build_dimm_list(Object *obj, void *opaque) static ram_addr_t get_current_ram_size(void) { GSList *list =3D NULL, *item; - ram_addr_t size =3D ram_size; + ram_addr_t size =3D current_machine->ram_size; =20 build_dimm_list(qdev_get_machine(), &list); for (item =3D list; item; item =3D g_slist_next(item)) { diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 19805ed6db..bd5e15dd7d 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -42,8 +42,6 @@ typedef uintptr_t ram_addr_t; # define RAM_ADDR_FMT "%" PRIxPTR #endif =20 -extern ram_addr_t ram_size; - /* memory API */ =20 void qemu_ram_remap(ram_addr_t addr, ram_addr_t length); diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index a08143b323..6299c0c8c7 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -392,8 +392,9 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **err= p) MemoryInfo *qmp_query_memory_size_summary(Error **errp) { MemoryInfo *mem_info =3D g_malloc0(sizeof(MemoryInfo)); + MachineState *ms =3D MACHINE(qdev_get_machine()); =20 - mem_info->base_memory =3D ram_size; + mem_info->base_memory =3D ms->ram_size; =20 mem_info->plugged_memory =3D get_plugged_memory_size(); mem_info->has_plugged_memory =3D diff --git a/softmmu/vl.c b/softmmu/vl.c index 2b82e6f5cd..3819a4abf2 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -122,7 +122,7 @@ static int data_dir_idx; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int display_opengl; const char* keyboard_layout =3D NULL; -ram_addr_t ram_size; +static ram_addr_t ram_size; bool enable_mlock =3D false; bool enable_cpu_pm =3D false; int nb_nics; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899643; cv=none; d=zohomail.com; s=zohoarc; b=YseYEXn+2U89HX/uafz092l+zWQAg0bxkDaxcPxy0FlVBT0TxtfDuoL5ssY7WXisf9+IOXGMCdvd3vER1lFSP/VIyvTJcOtdw+Xyid3a/kdaKkx1Yl3/gvAxwESVfeK5DSur1wsca5HicMuKSsjeFvlrvXqn0VXeM/7hH+aKzu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899643; 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=ty3iAIwSeDAfny4IAymcTJQMuo7vVeAhfYZHYYjvnRI=; b=aOG51LGKPgBW2t+8JNz/ngH2UQUP2+z+V4LY0r+sdwEMSifOk7MNwZWuA0cdRAhTFYTdgqWH1vOiNJ098D2M2jYIMrByhjwOyDvqGL/e+3qVaSeEaesO2NBtUxQN0wslzq8SAxi6XY5aRcIakUNDoAosd0GRW90kI9NQv9/hj6U= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899643381191.8809589656248; Wed, 2 Dec 2020 01:00:43 -0800 (PST) Received: from localhost ([::1]:44314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO05-0006Mo-IL for importer@patchew.org; Wed, 02 Dec 2020 04:00:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCl-0003Ok-QK for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57660) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003jq-4S for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-rW2fRqOvMiWGTFFGsAMOsA-1; Wed, 02 Dec 2020 03:09:09 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A19F75708B for ; Wed, 2 Dec 2020 08:09:08 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BADC5D705 for ; Wed, 2 Dec 2020 08:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896553; 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: in-reply-to:in-reply-to:references:references; bh=ty3iAIwSeDAfny4IAymcTJQMuo7vVeAhfYZHYYjvnRI=; b=UvQdNtxMWGq5IYOQ45LXn0NlLDqeJMKsctV5LN6nLGtfeDsxjL12EL49X2jYwoYKpOMn3c 5GSz2VlQ+vmTwAJUc8NBJr4GDjJDHqgtP+9x39sEPlZbQ3mRPwD/jrSsxS7RAmX9xSdxNz Omfr8TbxqGaUOdGLNimIDYmdpd0mbLs= X-MC-Unique: rW2fRqOvMiWGTFFGsAMOsA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 050/113] hw/char/serial: Clean up unnecessary code Date: Wed, 2 Dec 2020 03:07:46 -0500 Message-Id: <20201202080849.4125477-51-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Since commit 5ec3a23e6c8 ("serial: convert PIO to new memory api read/write") we don't need to worry about accesses bigger than 8-bit. Use the extract()/deposit() functions to access the correct part of the 16-bit 'divider' register. Reported-by: Jonathan D. Belanger Buglink: https://bugs.launchpad.net/qemu/+bug/1904331 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201120161933.2514089-1-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index 97f71879ff..62c627f486 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -24,6 +24,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/bitops.h" #include "hw/char/serial.h" #include "hw/irq.h" #include "migration/vmstate.h" @@ -338,11 +339,7 @@ static void serial_ioport_write(void *opaque, hwaddr a= ddr, uint64_t val, default: case 0: if (s->lcr & UART_LCR_DLAB) { - if (size =3D=3D 1) { - s->divider =3D (s->divider & 0xff00) | val; - } else { - s->divider =3D val; - } + s->divider =3D deposit32(s->divider, 8 * addr, 8, val); serial_update_parameters(s); } else { s->thr =3D (uint8_t) val; @@ -364,7 +361,7 @@ static void serial_ioport_write(void *opaque, hwaddr ad= dr, uint64_t val, break; case 1: if (s->lcr & UART_LCR_DLAB) { - s->divider =3D (s->divider & 0x00ff) | (val << 8); + s->divider =3D deposit32(s->divider, 8 * addr, 8, val); serial_update_parameters(s); } else { uint8_t changed =3D (s->ier ^ val) & 0x0f; @@ -478,7 +475,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr= addr, unsigned size) default: case 0: if (s->lcr & UART_LCR_DLAB) { - ret =3D s->divider & 0xff; + ret =3D extract16(s->divider, 8 * addr, 8); } else { if(s->fcr & UART_FCR_FE) { ret =3D fifo8_is_empty(&s->recv_fifo) ? @@ -502,7 +499,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr= addr, unsigned size) break; case 1: if (s->lcr & UART_LCR_DLAB) { - ret =3D (s->divider >> 8) & 0xff; + ret =3D extract16(s->divider, 8 * addr, 8); } else { ret =3D s->ier; } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899472; cv=none; d=zohomail.com; s=zohoarc; b=iD+Zt+zclZOWhXOoWyi0VyxAkDBw7bdjRJoaZwdH+GNGS49JSs39/HabKGjeNPiqg/dEI5rv8K83EikawphC+JTf270lni0VqvV7btl2Jhp9sI5flvzJg1YVhkGjO4GJpyi62D71LejDmgx7nVxR5l2mu15Yos5hiIY/PtoiFwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899472; 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=ZFuS7cQ8LVM+1jJS9y/7mDeBblC+qCfgn25inE2fsjA=; b=F0O8VCYC8MR0to7UW3FvhALRNeytS1iRm88mc7yWUwDRf4thiUx13RV824E+w3Hv09WTGtOLuONs9JOOn1Kx3P/m/V0M/THbh4QWupQxuIjYXOeEYEpj15r4MkWXrnia/zrRx3B43kNAli1mNBDnTVngBVZyHy2aIZhnX0tVKqA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899472107162.99968310681822; Wed, 2 Dec 2020 00:57:52 -0800 (PST) Received: from localhost ([::1]:36042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNxO-0002tc-Q2 for importer@patchew.org; Wed, 02 Dec 2020 03:57:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCi-0003MB-Cw for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCL-0003jM-1n for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:35 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-pTBPoHoDMla7OCZv17xxYw-1; Wed, 02 Dec 2020 03:09:09 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CCA58558E7 for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDAC05D705 for ; Wed, 2 Dec 2020 08:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896552; 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: in-reply-to:in-reply-to:references:references; bh=ZFuS7cQ8LVM+1jJS9y/7mDeBblC+qCfgn25inE2fsjA=; b=QcImYGMPrp8fJTMZsCZXADhZVdDTSSSt+8mgx4CFOrNaPkBWHQI17K2Jb93nr0My/Kx8jb s9keOrwqgQLh4P9IVAItrxhNLsLoYkdCDUBDe8/rrneb3/K2svKOiImJizARR8X5zkT8HH 4Xa0eQ/NHeApUbLCA+dkgJyn+GAroec= X-MC-Unique: pTBPoHoDMla7OCZv17xxYw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 051/113] treewide: do not use short-form boolean options Date: Wed, 2 Dec 2020 03:07:47 -0500 Message-Id: <20201202080849.4125477-52-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" They are going to be deprecated, avoid warnings on stdout while the tests run. Signed-off-by: Paolo Bonzini --- docs/specs/tpm.rst | 2 +- python/qemu/machine.py | 2 +- qemu-options.hx | 32 ++++++++++++++-------------- tests/qtest/bios-tables-test.c | 2 +- tests/qtest/pflash-cfi02-test.c | 4 ++-- tests/qtest/test-filter-redirector.c | 8 +++---- tests/qtest/vhost-user-test.c | 8 +++---- tests/test-char.c | 8 +++---- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst index 5e9aef4db3..3be190343a 100644 --- a/docs/specs/tpm.rst +++ b/docs/specs/tpm.rst @@ -343,7 +343,7 @@ In case an Arm virt machine is emulated, use the follow= ing command line: -device tpm-tis-device,tpmdev=3Dtpm0 \ -device virtio-blk-pci,drive=3Ddrv0 \ -drive format=3Dqcow2,file=3Dhda.qcow2,if=3Dnone,id=3Ddrv0 \ - -drive if=3Dpflash,format=3Draw,file=3Dflash0.img,readonly \ + -drive if=3Dpflash,format=3Draw,file=3Dflash0.img,readonly=3Don \ -drive if=3Dpflash,format=3Draw,file=3Dflash1.img =20 In case SeaBIOS is used as firmware, it should show the TPM menu item diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 64d966aeeb..7a40f4604b 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -292,7 +292,7 @@ class QEMUMachine: for _ in range(self._console_index): args.extend(['-serial', 'null']) if self._console_set: - chardev =3D ('socket,id=3Dconsole,path=3D%s,server,nowait' % + chardev =3D ('socket,id=3Dconsole,path=3D%s,server=3Don,wait= =3Doff' % self._console_address) args.extend(['-chardev', chardev]) if self._console_device_type is None: diff --git a/qemu-options.hx b/qemu-options.hx index 104632ea34..e60ad42976 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1406,25 +1406,25 @@ ERST =20 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, "-fsdev local,id=3Did,path=3Dpath,security_model=3Dmapped-xattr|mapped= -file|passthrough|none\n" - " [,writeout=3Dimmediate][,readonly][,fmode=3Dfmode][,dmode=3Ddmode]\n" + " [,writeout=3Dimmediate][,readonly=3Don][,fmode=3Dfmode][,dmode=3Ddmo= de]\n" " [[,throttling.bps-total=3Db]|[[,throttling.bps-read=3Dr][,throttling= .bps-write=3Dw]]]\n" " [[,throttling.iops-total=3Di]|[[,throttling.iops-read=3Dr][,throttli= ng.iops-write=3Dw]]]\n" " [[,throttling.bps-total-max=3Dbm]|[[,throttling.bps-read-max=3Drm][,= throttling.bps-write-max=3Dwm]]]\n" " [[,throttling.iops-total-max=3Dim]|[[,throttling.iops-read-max=3Dirm= ][,throttling.iops-write-max=3Diwm]]]\n" " [[,throttling.iops-size=3Dis]]\n" - "-fsdev proxy,id=3Did,socket=3Dsocket[,writeout=3Dimmediate][,readonly= ]\n" - "-fsdev proxy,id=3Did,sock_fd=3Dsock_fd[,writeout=3Dimmediate][,readon= ly]\n" + "-fsdev proxy,id=3Did,socket=3Dsocket[,writeout=3Dimmediate][,readonly= =3Don]\n" + "-fsdev proxy,id=3Did,sock_fd=3Dsock_fd[,writeout=3Dimmediate][,readon= ly=3Don]\n" "-fsdev synth,id=3Did\n", QEMU_ARCH_ALL) =20 SRST -``-fsdev local,id=3Did,path=3Dpath,security_model=3Dsecurity_model [,write= out=3Dwriteout][,readonly][,fmode=3Dfmode][,dmode=3Ddmode] [,throttling.opt= ion=3Dvalue[,throttling.option=3Dvalue[,...]]]`` +``-fsdev local,id=3Did,path=3Dpath,security_model=3Dsecurity_model [,write= out=3Dwriteout][,readonly=3Don][,fmode=3Dfmode][,dmode=3Ddmode] [,throttlin= g.option=3Dvalue[,throttling.option=3Dvalue[,...]]]`` \=20 -``-fsdev proxy,id=3Did,socket=3Dsocket[,writeout=3Dwriteout][,readonly]`` +``-fsdev proxy,id=3Did,socket=3Dsocket[,writeout=3Dwriteout][,readonly=3Do= n]`` \ -``-fsdev proxy,id=3Did,sock_fd=3Dsock_fd[,writeout=3Dwriteout][,readonly]`` +``-fsdev proxy,id=3Did,sock_fd=3Dsock_fd[,writeout=3Dwriteout][,readonly= =3Don]`` \ -``-fsdev synth,id=3Did[,readonly]`` +``-fsdev synth,id=3Did[,readonly=3Don]`` Define a new file system device. Valid options are: =20 ``local`` @@ -1467,7 +1467,7 @@ SRST guest only when the data has been reported as written by the storage subsystem. =20 - ``readonly`` + ``readonly=3Don`` Enables exporting 9p share as a readonly mount for guests. By default read-write access is given. =20 @@ -1532,18 +1532,18 @@ ERST =20 DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, "-virtfs local,path=3Dpath,mount_tag=3Dtag,security_model=3Dmapped-xat= tr|mapped-file|passthrough|none\n" - " [,id=3Did][,writeout=3Dimmediate][,readonly][,fmode=3Dfmode][= ,dmode=3Ddmode][,multidevs=3Dremap|forbid|warn]\n" - "-virtfs proxy,mount_tag=3Dtag,socket=3Dsocket[,id=3Did][,writeout=3Di= mmediate][,readonly]\n" - "-virtfs proxy,mount_tag=3Dtag,sock_fd=3Dsock_fd[,id=3Did][,writeout= =3Dimmediate][,readonly]\n" - "-virtfs synth,mount_tag=3Dtag[,id=3Did][,readonly]\n", + " [,id=3Did][,writeout=3Dimmediate][,readonly=3Don][,fmode=3Dfm= ode][,dmode=3Ddmode][,multidevs=3Dremap|forbid|warn]\n" + "-virtfs proxy,mount_tag=3Dtag,socket=3Dsocket[,id=3Did][,writeout=3Di= mmediate][,readonly=3Don]\n" + "-virtfs proxy,mount_tag=3Dtag,sock_fd=3Dsock_fd[,id=3Did][,writeout= =3Dimmediate][,readonly=3Don]\n" + "-virtfs synth,mount_tag=3Dtag[,id=3Did][,readonly=3Don]\n", QEMU_ARCH_ALL) =20 SRST -``-virtfs local,path=3Dpath,mount_tag=3Dmount_tag ,security_model=3Dsecuri= ty_model[,writeout=3Dwriteout][,readonly] [,fmode=3Dfmode][,dmode=3Ddmode][= ,multidevs=3Dmultidevs]`` +``-virtfs local,path=3Dpath,mount_tag=3Dmount_tag ,security_model=3Dsecuri= ty_model[,writeout=3Dwriteout][,readonly=3Don] [,fmode=3Dfmode][,dmode=3Ddm= ode][,multidevs=3Dmultidevs]`` \=20 -``-virtfs proxy,socket=3Dsocket,mount_tag=3Dmount_tag [,writeout=3Dwriteou= t][,readonly]`` +``-virtfs proxy,socket=3Dsocket,mount_tag=3Dmount_tag [,writeout=3Dwriteou= t][,readonly=3Don]`` \=20 -``-virtfs proxy,sock_fd=3Dsock_fd,mount_tag=3Dmount_tag [,writeout=3Dwrite= out][,readonly]`` +``-virtfs proxy,sock_fd=3Dsock_fd,mount_tag=3Dmount_tag [,writeout=3Dwrite= out][,readonly=3Don]`` \ ``-virtfs synth,mount_tag=3Dmount_tag`` Define a new virtual filesystem device and expose it to the guest using @@ -1598,7 +1598,7 @@ SRST guest only when the data has been reported as written by the storage subsystem. =20 - ``readonly`` + ``readonly=3Don`` Enables exporting 9p share as a readonly mount for guests. By default read-write access is given. =20 diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index f23a5335a8..b93cbd0e97 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -672,7 +672,7 @@ static void test_acpi_one(const char *params, test_data= *data) * when arm/virt boad starts to support it. */ args =3D g_strdup_printf("-machine %s %s -accel tcg -nodefaults -n= ographic " - "-drive if=3Dpflash,format=3Draw,file=3D%s,readonly " + "-drive if=3Dpflash,format=3Draw,file=3D%s,readonly=3Don " "-drive if=3Dpflash,format=3Draw,file=3D%s,snapshot=3Don -cdro= m %s %s", data->machine, data->tcg_only ? "" : "-accel kvm", data->uefi_fl1, data->uefi_fl2, data->cd, params ? params : ""= ); diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-tes= t.c index afb702b565..60db81a3a2 100644 --- a/tests/qtest/pflash-cfi02-test.c +++ b/tests/qtest/pflash-cfi02-test.c @@ -261,7 +261,7 @@ static void test_geometry(const void *opaque) const FlashConfig *config =3D opaque; QTestState *qtest; qtest =3D qtest_initf("-M musicpal" - " -drive if=3Dpflash,file=3D%s,format=3Draw,copy-o= n-read" + " -drive if=3Dpflash,file=3D%s,format=3Draw,copy-o= n-read=3Don" /* Device geometry properties. */ " -global driver=3Dcfi.pflash02," "property=3Dnum-blocks0,value=3D%d" @@ -581,7 +581,7 @@ static void test_cfi_in_autoselect(const void *opaque) const FlashConfig *config =3D opaque; QTestState *qtest; qtest =3D qtest_initf("-M musicpal" - " -drive if=3Dpflash,file=3D%s,format=3Draw,copy-o= n-read", + " -drive if=3Dpflash,file=3D%s,format=3Draw,copy-o= n-read=3Don", image_path); FlashConfig explicit_config =3D expand_config_defaults(config); explicit_config.qtest =3D qtest; diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter= -redirector.c index 829db8c2ea..4269b2cdd9 100644 --- a/tests/qtest/test-filter-redirector.c +++ b/tests/qtest/test-filter-redirector.c @@ -95,8 +95,8 @@ static void test_redirector_tx(void) qts =3D qtest_initf( "-netdev socket,id=3Dqtest-bn0,fd=3D%d " "-device %s,netdev=3Dqtest-bn0,id=3Dqtest-e0 " - "-chardev socket,id=3Dredirector0,path=3D%s,server,nowait " - "-chardev socket,id=3Dredirector1,path=3D%s,server,nowait " + "-chardev socket,id=3Dredirector0,path=3D%s,server=3Don,wait=3Doff= " + "-chardev socket,id=3Dredirector1,path=3D%s,server=3Don,wait=3Doff= " "-chardev socket,id=3Dredirector2,path=3D%s " "-object filter-redirector,id=3Dqtest-f0,netdev=3Dqtest-bn0," "queue=3Dtx,outdev=3Dredirector0 " @@ -165,8 +165,8 @@ static void test_redirector_rx(void) qts =3D qtest_initf( "-netdev socket,id=3Dqtest-bn0,fd=3D%d " "-device %s,netdev=3Dqtest-bn0,id=3Dqtest-e0 " - "-chardev socket,id=3Dredirector0,path=3D%s,server,nowait " - "-chardev socket,id=3Dredirector1,path=3D%s,server,nowait " + "-chardev socket,id=3Dredirector0,path=3D%s,server=3Don,wait=3Doff= " + "-chardev socket,id=3Dredirector1,path=3D%s,server=3Don,wait=3Doff= " "-chardev socket,id=3Dredirector2,path=3D%s " "-object filter-redirector,id=3Dqtest-f0,netdev=3Dqtest-bn0," "queue=3Drx,indev=3Dredirector0 " diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 3df5322614..1a5f5313ff 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -537,7 +537,7 @@ static void test_server_create_chr(TestServer *server, = const gchar *opt) =20 static void test_server_listen(TestServer *server) { - test_server_create_chr(server, ",server,nowait"); + test_server_create_chr(server, ",server=3Don,wait=3Doff"); } =20 static void test_server_free(TestServer *server) @@ -846,7 +846,7 @@ static void *vhost_user_test_setup_reconnect(GString *c= md_line, void *arg) =20 g_thread_new("connect", connect_thread, s); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); - s->vu_ops->append_opts(s, cmd_line, ",server"); + s->vu_ops->append_opts(s, cmd_line, ",server=3Don"); =20 g_test_queue_destroy(vhost_user_test_cleanup, s); =20 @@ -883,7 +883,7 @@ static void *vhost_user_test_setup_connect_fail(GString= *cmd_line, void *arg) =20 g_thread_new("connect", connect_thread, s); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); - s->vu_ops->append_opts(s, cmd_line, ",server"); + s->vu_ops->append_opts(s, cmd_line, ",server=3Don"); =20 g_test_queue_destroy(vhost_user_test_cleanup, s); =20 @@ -898,7 +898,7 @@ static void *vhost_user_test_setup_flags_mismatch(GStri= ng *cmd_line, void *arg) =20 g_thread_new("connect", connect_thread, s); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); - s->vu_ops->append_opts(s, cmd_line, ",server"); + s->vu_ops->append_opts(s, cmd_line, ",server=3Don"); =20 g_test_queue_destroy(vhost_user_test_cleanup, s); =20 diff --git a/tests/test-char.c b/tests/test-char.c index 9196e566e9..953e0d1c1f 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -413,7 +413,7 @@ static void char_websock_test(void) CharBackend client_be; Chardev *chr_client; Chardev *chr =3D qemu_chr_new("server", - "websocket:127.0.0.1:0,server,nowait", NUL= L); + "websocket:127.0.0.1:0,server=3Don,wait=3D= off", NULL); const char handshake[] =3D "GET / HTTP/1.1\r\n" "Upgrade: websocket\r\n" "Connection: Upgrade\r\n" @@ -696,7 +696,7 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool f= d_pass, fd =3D ioc->fd; ioc->fd =3D -1; optstr =3D g_strdup_printf("socket,id=3Dcdev0,fd=3D%d%s", - fd, is_listen ? ",server,nowait" : ""); + fd, is_listen ? ",server=3Don,wait=3Doff"= : ""); object_unref(OBJECT(ioc)); return optstr; } else { @@ -706,13 +706,13 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool= fd_pass, addr->u.inet.host, addr->u.inet.port, reconnect ? reconnect : "", - is_listen ? ",server,nowait" : ""); + is_listen ? ",server=3Don,wait=3Doff" := ""); =20 case SOCKET_ADDRESS_TYPE_UNIX: return g_strdup_printf("socket,id=3Dcdev0,path=3D%s%s%s", addr->u.q_unix.path, reconnect ? reconnect : "", - is_listen ? ",server,nowait" : ""); + is_listen ? ",server=3Don,wait=3Doff" := ""); =20 default: g_assert_not_reached(); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898964; cv=none; d=zohomail.com; s=zohoarc; b=bcPu5xL/MEQgGmII1q5l+JRpH1IjxefubdWxf79gVweiCKms/g5vaIwJfvy3plDj/Dh/PsioS4f3eZ21zwLIinsuz77jfHcZrWu8+9AvHPwSJpOQOCSnYZoxM45WuMhRFDqBVanPYyPXlPZgR55yblBxoIhF4aIVo9/uiWUF/CI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898964; 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=O5P1C07imouEoYMx9sOMbnDgvjykRU4zlLCfdwh1mSY=; b=jPBypQ849DWM60RY00OD9za6HAX42h/4ceo1osGRw0WBPVDw3CHkr8RwOdz75x6GrQBIFtaP4vlbCd4EtN6B61S3S6ouUIGfP0zzvZvwQdzieTpu7IifWXMa03qqNT82GpI9D9M1QgRTxavaaW4nHrswZVE8RXV0GQ6BDlnp1KM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898964211929.208107570537; Wed, 2 Dec 2020 00:49:24 -0800 (PST) Received: from localhost ([::1]:38880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNpD-0000Uu-3N for importer@patchew.org; Wed, 02 Dec 2020 03:49:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCg-0003Hg-Hi for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCK-0003jC-UV for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:34 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20--k2zEYWkOLyKwXfm6bcKWQ-1; Wed, 02 Dec 2020 03:09:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C1FB8558EF for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 283465D705 for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896552; 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: in-reply-to:in-reply-to:references:references; bh=O5P1C07imouEoYMx9sOMbnDgvjykRU4zlLCfdwh1mSY=; b=a1qy7+GxW7p+9KzKIuUDUPeR0XEO45hteaVqP3c6L1J78W+idNFlm3pALu/PREUy5hjIQP cVuW6sP6Goebbx4VsBrVMw0+W6acJYlo3fQKCLmpmkPb8QqiXarYiqIoPNa+/4CszMCOfY B1G8EzvGJ9VdOnk6J1IgOu3jC0TePSE= X-MC-Unique: -k2zEYWkOLyKwXfm6bcKWQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 052/113] vl: extract validation of -smp to machine.c Date: Wed, 2 Dec 2020 03:07:48 -0500 Message-Id: <20201202080849.4125477-53-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Once smp_parse is done, the validation operates on the MachineState. There is no reason for that code to be in vl.c. Reviewed-by: Igor Mammedov Tested-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 23 +++++++++++++++++++++++ include/hw/boards.h | 1 + softmmu/vl.c | 20 ++------------------ 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index d0408049b5..cd298fac13 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1074,6 +1074,29 @@ MemoryRegion *machine_consume_memdev(MachineState *m= achine, return ret; } =20 +bool machine_smp_parse(MachineState *ms, QemuOpts *opts, Error **errp) +{ + MachineClass *mc =3D MACHINE_GET_CLASS(ms); + + mc->smp_parse(ms, opts); + + /* sanity-check smp_cpus and max_cpus against mc */ + if (ms->smp.cpus < mc->min_cpus) { + error_setg(errp, "Invalid SMP CPUs %d. The min CPUs " + "supported by machine '%s' is %d", + ms->smp.cpus, + mc->name, mc->min_cpus); + return false; + } else if (ms->smp.max_cpus > mc->max_cpus) { + error_setg(errp, "Invalid SMP CPUs %d. The max CPUs " + "supported by machine '%s' is %d", + current_machine->smp.max_cpus, + mc->name, mc->max_cpus); + return false; + } + return true; +} + void machine_run_board_init(MachineState *machine) { MachineClass *machine_class =3D MACHINE_GET_CLASS(machine); diff --git a/include/hw/boards.h b/include/hw/boards.h index a49e3a6b44..4537cfb5c6 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -26,6 +26,7 @@ OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE) extern MachineState *current_machine; =20 void machine_run_board_init(MachineState *machine); +bool machine_smp_parse(MachineState *ms, QemuOpts *opts, Error **errp); bool machine_usb(MachineState *machine); int machine_phandle_start(MachineState *machine); bool machine_dump_guest_core(MachineState *machine); diff --git a/softmmu/vl.c b/softmmu/vl.c index 3819a4abf2..69d54b27b9 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3976,24 +3976,8 @@ void qemu_init(int argc, char **argv, char **envp) exit(0); } =20 - machine_class->smp_parse(current_machine, - qemu_opts_find(qemu_find_opts("smp-opts"), NULL)); - - /* sanity-check smp_cpus and max_cpus against machine_class */ - if (current_machine->smp.cpus < machine_class->min_cpus) { - error_report("Invalid SMP CPUs %d. The min CPUs " - "supported by machine '%s' is %d", - current_machine->smp.cpus, - machine_class->name, machine_class->min_cpus); - exit(1); - } - if (current_machine->smp.max_cpus > machine_class->max_cpus) { - error_report("Invalid SMP CPUs %d. The max CPUs " - "supported by machine '%s' is %d", - current_machine->smp.max_cpus, - machine_class->name, machine_class->max_cpus); - exit(1); - } + machine_smp_parse(current_machine, + qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); =20 if (mem_prealloc) { char *val; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898734; cv=none; d=zohomail.com; s=zohoarc; b=Q6Sb1GZqCLEtwFNJ0z0RJnaIJbOHBM6aLh9NfkAoGIqt0y7g8FRkfEnNdPLmchCX1zb6PitsoP0gV8EVkM6AySJfYO+CME3cGXOxOBrCsG20KM+wu39AWlxKU34/TsnsWIsOInMnjikJyviDb3fQel7ZEUyGeirBo5fCQAuIDtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898734; 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=5BIvQ2eZiqMBqVbDjswDQKEC6cHH3qXd59qZ8tvv6IA=; b=W5nCwFuZEg0viF0nw+eyvdk/uEno7/BxPELQWy5W5cMrMEyWna7sy1D8/2ki7gHNRxCg+RKqqqeNsIt+jFgtH5xai+4KA9W76YNdpqQKE1kYW5RN0FddXFe0Ey6GBYuyvdVr/FhfKrbDMVWFTIfQn9DnGvw+Lq3ob1qL2HtuE3s= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898734098340.8529913275945; Wed, 2 Dec 2020 00:45:34 -0800 (PST) Received: from localhost ([::1]:58688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNlT-0005ME-OE for importer@patchew.org; Wed, 02 Dec 2020 03:45:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003CG-Em for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCK-0003jJ-TS for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-eush4CFPMbuv7SpsSrYRew-1; Wed, 02 Dec 2020 03:09:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACA578558F0 for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77C115D705 for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896552; 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: in-reply-to:in-reply-to:references:references; bh=5BIvQ2eZiqMBqVbDjswDQKEC6cHH3qXd59qZ8tvv6IA=; b=E9JNGCQASiMBole8Pz/PBsQaT0dtYZf/GQc9364QAO/vXkwyAwBKyy9V9ilL2Bl5uXcDel CyPlY3NFLkL7vuQMvS1U13yv4TpxDbMjHDBkLc0JRd4U3IHtbXWtp6T6eNV/3P6VC8B5mw pqtLeO4baz79zSD2jbxsZVuDVgOJAjs= X-MC-Unique: eush4CFPMbuv7SpsSrYRew-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 053/113] vl: remove bogus check Date: Wed, 2 Dec 2020 03:07:49 -0500 Message-Id: <20201202080849.4125477-54-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There is no reason to prevent -preconfig -daemonize. Of course if no monitor is defined there will be no way to start the VM, but that is a user error. Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 69d54b27b9..2f2372bac7 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4032,12 +4032,6 @@ void qemu_init(int argc, char **argv, char **envp) } =20 if (is_daemonized()) { - if (!preconfig_exit_requested) { - error_report("'preconfig' and 'daemonize' options are " - "mutually exclusive"); - exit(EXIT_FAILURE); - } - /* According to documentation and historically, -nographic redirec= ts * serial port, parallel port and monitor to stdio, which does not= work * with -daemonize. We can redirect these to null instead, but si= nce --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899334; cv=none; d=zohomail.com; s=zohoarc; b=adyQe23OEuMmxS86DnUYjHk8eIzaQWvg0JMlGO09CWcxkv8kCDTyM6o8deGgPs3xVFXhskM7RLy0vPcAtyV+C0fSA6bxQpxzZOGAno4gK381C1Ksl9lac+Oj5KkvizfbTje3X0F+TwGFH/qUMlkskniD8wdoT9MPzinSfERkWUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899334; 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=DP5v0aDuYSmiDSflO0D+wIrkUtHdRUtAOfcwnaOHby4=; b=FzlSlDwMTLYSyDVgT8yOcCaBAz3u1lTpM31HWbHdkcU9QKikhFXumaMhj1YyAd8YU4Z36t/tIx/sow1tkNf0mNiu9fn102fFg7KDl53yrVfbrGKcONidJcIH7BK3R3Z5XP4w9ZAw6ck26Zb7POR2cwb9TlKs1CMIjWbE0cEFTzo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899334716434.30478173430197; Wed, 2 Dec 2020 00:55:34 -0800 (PST) Received: from localhost ([::1]:55946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNvB-0007ch-JV for importer@patchew.org; Wed, 02 Dec 2020 03:55:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCh-0003L7-TB for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003ja-2P for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:35 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-90-UroDX7jEM-W3mSGEvf783Q-1; Wed, 02 Dec 2020 03:09:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08D161006C81 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7C175D705 for ; Wed, 2 Dec 2020 08:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896552; 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: in-reply-to:in-reply-to:references:references; bh=DP5v0aDuYSmiDSflO0D+wIrkUtHdRUtAOfcwnaOHby4=; b=htTIS0IknlQrtv8k+pdujO/JvsYb0KqBbvXZ+iL6UpPwhw27bgVUrYSpwlG3l63j+0KhoJ ck6aMhVyOroNWaSoBAzahzxSGkTfkL8Ss42O+AHRfsqlVN5SP3MqGTD/b3AL8sWm5eJTbx +zLNoN4xg843ckqg2iIKGDNIPwVa75k= X-MC-Unique: UroDX7jEM-W3mSGEvf783Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 054/113] vl: split various early command line options to a separate function Date: Wed, 2 Dec 2020 03:07:50 -0500 Message-Id: <20201202080849.4125477-55-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Various options affect the global state of QEMU including the rest of qemu_init, and they need to be called very early. Group them together in a function that is called at the beginning. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 200 ++++++++++++++++++++++++++++----------------------- 1 file changed, 112 insertions(+), 88 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 2f2372bac7..9caff9fe8e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -117,6 +117,7 @@ =20 #define MAX_VIRTIO_CONSOLES 1 =20 +static const char *cpu_option; static const char *data_dir[16]; static int data_dir_idx; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; @@ -142,6 +143,9 @@ int vga_interface_type =3D VGA_NONE; static DisplayOptions dpy; static int num_serial_hds; static Chardev **serial_hds; +static const char *log_mask; +static const char *log_file; +static bool list_data_dirs; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; int win2k_install_hack =3D 0; int singlestep =3D 0; @@ -2866,6 +2870,105 @@ static char *find_datadir(void) return get_relocated_path(CONFIG_QEMU_DATADIR); } =20 +static void qemu_process_early_options(void) +{ + char **dirs; + int i; + +#ifdef CONFIG_SECCOMP + QemuOptsList *olist =3D qemu_find_opts_err("sandbox", NULL); + if (olist) { + qemu_opts_foreach(olist, parse_sandbox, NULL, &error_fatal); + } +#endif + + qemu_opts_foreach(qemu_find_opts("name"), + parse_name, NULL, &error_fatal); + +#ifndef _WIN32 + qemu_opts_foreach(qemu_find_opts("add-fd"), + parse_add_fd, NULL, &error_fatal); + + qemu_opts_foreach(qemu_find_opts("add-fd"), + cleanup_add_fd, NULL, &error_fatal); +#endif + + if (!trace_init_backends()) { + exit(1); + } + trace_init_file(); + + /* Open the logfile at this point and set the log mask if necessary. = */ + qemu_set_log_filename(log_file, &error_fatal); + if (log_mask) { + int mask; + mask =3D qemu_str_to_log_mask(log_mask); + if (!mask) { + qemu_print_log_usage(stdout); + exit(1); + } + qemu_set_log(mask); + } else { + qemu_set_log(0); + } + + /* add configured firmware directories */ + dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); + for (i =3D 0; dirs[i] !=3D NULL; i++) { + qemu_add_data_dir(get_relocated_path(dirs[i])); + } + g_strfreev(dirs); + + /* try to find datadir relative to the executable path */ + qemu_add_data_dir(find_datadir()); +} + +static void qemu_process_help_options(void) +{ + int i; + + /* + * Check for -cpu help and -device help before we call select_machine(= ), + * which will return an error if the architecture has no default machi= ne + * type and the user did not specify one, so that the user doesn't need + * to say '-cpu help -machine something'. + */ + if (cpu_option && is_help_option(cpu_option)) { + list_cpus(cpu_option); + exit(0); + } + + if (qemu_opts_foreach(qemu_find_opts("device"), + device_help_func, NULL, NULL)) { + exit(0); + } + + /* -L help lists the data directories and exits. */ + if (list_data_dirs) { + for (i =3D 0; i < data_dir_idx; i++) { + printf("%s\n", data_dir[i]); + } + exit(0); + } +} + +static void qemu_maybe_daemonize(const char *pid_file) +{ + Error *err; + + os_daemonize(); + rcu_disable_atfork(); + + if (pid_file && !qemu_write_pidfile(pid_file, &err)) { + error_reportf_err(err, "cannot create PID file: "); + exit(1); + } + + qemu_unlink_pidfile_notifier.notify =3D qemu_unlink_pidfile; + qemu_add_exit_notifier(&qemu_unlink_pidfile_notifier); +} + + void qemu_init(int argc, char **argv, char **envp) { int i; @@ -2882,21 +2985,16 @@ void qemu_init(int argc, char **argv, char **envp) const char *optarg; const char *loadvm =3D NULL; MachineClass *machine_class; - const char *cpu_option; const char *vga_model =3D NULL; const char *incoming =3D NULL; bool userconfig =3D true; bool nographic =3D false; int display_remote =3D 0; - const char *log_mask =3D NULL; - const char *log_file =3D NULL; ram_addr_t maxram_size; uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; Error *main_loop_err =3D NULL; Error *err =3D NULL; - bool list_data_dirs =3D false; - char **dirs; const char *mem_path =3D NULL; bool have_custom_ram_size; BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue= ); @@ -3846,19 +3944,17 @@ void qemu_init(int argc, char **argv, char **envp) loc_set_none(); =20 /* - * Check for -cpu help and -device help before we call select_machine(= ), - * which will return an error if the architecture has no default machi= ne - * type and the user did not specify one, so that the user doesn't need - * to say '-cpu help -machine something'. + * These options affect everything else and should be processed + * before daemonizing. */ - if (cpu_option && is_help_option(cpu_option)) { - list_cpus(cpu_option); - exit(0); - } + qemu_process_early_options(); =20 - if (qemu_opts_foreach(qemu_find_opts("device"), - device_help_func, NULL, NULL)) { - exit(0); + qemu_process_help_options(); + qemu_maybe_daemonize(pid_file); + + if (qemu_init_main_loop(&main_loop_err)) { + error_report_err(main_loop_err); + exit(1); } =20 user_register_global_props(); @@ -3879,40 +3975,6 @@ void qemu_init(int argc, char **argv, char **envp) have_custom_ram_size =3D set_memory_options(&ram_slots, &maxram_size, machine_class); =20 - os_daemonize(); - rcu_disable_atfork(); - - if (pid_file && !qemu_write_pidfile(pid_file, &err)) { - error_reportf_err(err, "cannot create PID file: "); - exit(1); - } - - qemu_unlink_pidfile_notifier.notify =3D qemu_unlink_pidfile; - qemu_add_exit_notifier(&qemu_unlink_pidfile_notifier); - - if (qemu_init_main_loop(&main_loop_err)) { - error_report_err(main_loop_err); - exit(1); - } - -#ifdef CONFIG_SECCOMP - olist =3D qemu_find_opts_err("sandbox", NULL); - if (olist) { - qemu_opts_foreach(olist, parse_sandbox, NULL, &error_fatal); - } -#endif - - qemu_opts_foreach(qemu_find_opts("name"), - parse_name, NULL, &error_fatal); - -#ifndef _WIN32 - qemu_opts_foreach(qemu_find_opts("add-fd"), - parse_add_fd, NULL, &error_fatal); - - qemu_opts_foreach(qemu_find_opts("add-fd"), - cleanup_add_fd, NULL, &error_fatal); -#endif - current_machine =3D MACHINE(object_new_with_class(OBJECT_CLASS(machine= _class))); if (machine_help_func(qemu_get_machine_opts(), current_machine)) { exit(0); @@ -3938,44 +4000,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_set_hw_version(machine_class->hw_version); } =20 - if (!trace_init_backends()) { - exit(1); - } - trace_init_file(); - - /* Open the logfile at this point and set the log mask if necessary. - */ - qemu_set_log_filename(log_file, &error_fatal); - if (log_mask) { - int mask; - mask =3D qemu_str_to_log_mask(log_mask); - if (!mask) { - qemu_print_log_usage(stdout); - exit(1); - } - qemu_set_log(mask); - } else { - qemu_set_log(0); - } - - /* add configured firmware directories */ - dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); - for (i =3D 0; dirs[i] !=3D NULL; i++) { - qemu_add_data_dir(get_relocated_path(dirs[i])); - } - g_strfreev(dirs); - - /* try to find datadir relative to the executable path */ - qemu_add_data_dir(find_datadir()); - - /* -L help lists the data directories and exits. */ - if (list_data_dirs) { - for (i =3D 0; i < data_dir_idx; i++) { - printf("%s\n", data_dir[i]); - } - exit(0); - } - machine_smp_parse(current_machine, qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898915; cv=none; d=zohomail.com; s=zohoarc; b=gQ9lZC4PFHLhA1AUMW09saaymJ13mzM1gsrbAF1hXf8YeGLYchZjmPk7VPTaE6akxcBPKPboouFQgAEDB6h+B9W204DDpAS7N5xM6Jdz/1hbz5Mv0b5KlUaZBppaW/DRkUwut9OVmasZZwxG6PNsO5lVmKjAiBm6u+5Yd10NqO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898915; 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=eU9KOj3uIt3ukxp8s/YG41jfoeixGEbp0K0q2JH0hJM=; b=SArOAp74oPzJsYWNpde8Swjgf/1k6uCfxpr4EOQMxrnUsNUCpgFY8GqXYZazApptdzj0t+NU+p/fw5EnVbvWhO5e6IUHXe4CIKtLV/1WiyDKk/WpkAESlQdGKDWb9IZTE6TI0CKNBExDrXBDXOYQk0B/Niy7ngJOgOH8gKOkHvs= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898915549107.63210243391234; Wed, 2 Dec 2020 00:48:35 -0800 (PST) Received: from localhost ([::1]:36732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNoP-00082c-TH for importer@patchew.org; Wed, 02 Dec 2020 03:48:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCi-0003N0-WD for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003jt-37 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-1GXLXV07Ppy1TlvZvKHgag-1; Wed, 02 Dec 2020 03:09:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5923C1006C82 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2355B5D705 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896553; 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: in-reply-to:in-reply-to:references:references; bh=eU9KOj3uIt3ukxp8s/YG41jfoeixGEbp0K0q2JH0hJM=; b=ddyGZYu5QvfiCOx6L1DLnO8RdqZIWInLYE405chwF3S5ay8GzK/3+ZFNds/0QzO2jNJIBb Oje6Vr+9kzBMYVx+MGIHNmVhLUMiAWn+d/AUnJRDDK35Gt/HN2EhXFY/hP0twsI8qzTwcY aX4pXgBpOQ4vubAz23NjnaD3FSa54rI= X-MC-Unique: 1GXLXV07Ppy1TlvZvKHgag-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 055/113] vl: move various initialization routines out of qemu_init Date: Wed, 2 Dec 2020 03:07:51 -0500 Message-Id: <20201202080849.4125477-56-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Some very simple initialization routines can be nested in existing subsystem-level functions, do that to simplify qemu_init. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 3 +++ include/hw/qdev-core.h | 8 -------- migration/migration.c | 4 ++++ softmmu/qdev-monitor.c | 6 ------ softmmu/vl.c | 5 ----- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index cd298fac13..5260155962 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -874,6 +874,9 @@ static void machine_initfn(Object *obj) MachineState *ms =3D MACHINE(obj); MachineClass *mc =3D MACHINE_GET_CLASS(obj); =20 + container_get(obj, "/peripheral"); + container_get(obj, "/peripheral-anon"); + ms->dump_guest_core =3D true; ms->mem_merge =3D true; ms->enable_graphics =3D true; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 5e737195b5..b77a2f1da7 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -785,14 +785,6 @@ BusState *sysbus_get_default(void); char *qdev_get_fw_dev_path(DeviceState *dev); char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *de= v); =20 -/** - * @qdev_machine_init - * - * Initialize platform devices before machine init. This is a hack until = full - * support for composition is added. - */ -void qdev_machine_init(void); - /** * device_legacy_reset: * diff --git a/migration/migration.c b/migration/migration.c index 87a9b59f83..d9e94f4080 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -182,6 +182,10 @@ void migration_object_init(void) error_report_err(err); exit(1); } + + blk_mig_init(); + ram_mig_init(); + dirty_bitmap_mig_init(); } =20 void migration_shutdown(void) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index bf79d0bbcd..d060e765da 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -943,12 +943,6 @@ BlockBackend *blk_by_qdev_id(const char *id, Error **e= rrp) return blk; } =20 -void qdev_machine_init(void) -{ - qdev_get_peripheral_anon(); - qdev_get_peripheral(); -} - QemuOptsList qemu_device_opts =3D { .name =3D "device", .implied_opt_name =3D "driver", diff --git a/softmmu/vl.c b/softmmu/vl.c index 9caff9fe8e..8640ddd3ec 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4280,10 +4280,6 @@ void qemu_init(int argc, char **argv, char **envp) exit(1); } =20 - blk_mig_init(); - ram_mig_init(); - dirty_bitmap_mig_init(); - qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, &error_fatal); =20 @@ -4316,7 +4312,6 @@ void qemu_init(int argc, char **argv, char **envp) reading from the other reads, because timer polling functions query clock values from the log. */ replay_checkpoint(CHECKPOINT_INIT); - qdev_machine_init(); =20 current_machine->boot_order =3D boot_order; =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898120; cv=none; d=zohomail.com; s=zohoarc; b=JU8fETg21jrrt/dE2ieZ6qoHztX4mDH/0E9tgJ/mpCR/J9oxqwxc40BuGdgCp/jC+iNjfrukuKgQnOcGFOI+td9lvCEa/Ec/rf020JGsZ3fsV+dqLGibH6BYA1QV/tupQZI0dRdcBgV09AJhi2yLFYTgDmdII5EOSAMmHosqvJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898120; 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=QMI9iwXDGFsbqKHQA+MC86cQW3cOVRmlpWZ/dSetqZo=; b=TKy6xT4Z+cvop4B/XHuHUE27Xqkmt/ai6vQ3WO+dJA5NW/eKLChI6Vyzh+tLmAfhIBCGDcZuSSZYJ7wuz4XufSUUj3u/U1fP+64hsNFxlNMHlkcip2M1ObLZpzroCA2CkqHUp/Pk2hv31jT8ehAuWlrAu8eSEaMf6wKCWQVoKyA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898120668916.1212410581765; Wed, 2 Dec 2020 00:35:20 -0800 (PST) Received: from localhost ([::1]:52676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNbb-0007xG-8b for importer@patchew.org; Wed, 02 Dec 2020 03:35:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCi-0003Ml-ST for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003je-2g for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-136-VIN87F0QNmO6u_HbVoqucw-1; Wed, 02 Dec 2020 03:09:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8C351006C83 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 745CE5D705 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896553; 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: in-reply-to:in-reply-to:references:references; bh=QMI9iwXDGFsbqKHQA+MC86cQW3cOVRmlpWZ/dSetqZo=; b=SrGO4mJlS9xmYB4zQ5s09vCxR1yVL8bF5q5KGdWS9F33XIWqgz0d/k4oTll2OEB50rz0bo mNnQeFFdRR/p7IkM8ETWFHNqsIOlzq1jFS2d9fayCKbQF1C4tqo7yGlnYxnGyCYjlC8M1P hHvgyTbSOwkJrfKlXtAp+Y3xm5iocFU= X-MC-Unique: VIN87F0QNmO6u_HbVoqucw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 056/113] vl: extract qemu_init_subsystems Date: Wed, 2 Dec 2020 03:07:52 -0500 Message-Id: <20201202080849.4125477-57-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Group a bunch of subsystem initializations that can be done right after command line parsing. Remove initializations that can be done simply as global variable initializers. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 94 ++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 8640ddd3ec..41a685bb5d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -128,7 +128,7 @@ bool enable_mlock =3D false; bool enable_cpu_pm =3D false; int nb_nics; NICInfo nd_table[MAX_NICS]; -int autostart; +int autostart =3D 1; static enum { RTC_BASE_UTC, RTC_BASE_LOCALTIME, @@ -1228,7 +1228,8 @@ struct VMChangeStateEntry { int priority; }; =20 -static QTAILQ_HEAD(, VMChangeStateEntry) vm_change_state_head; +static QTAILQ_HEAD(, VMChangeStateEntry) vm_change_state_head =3D + QTAILQ_HEAD_INITIALIZER(vm_change_state_head); =20 /** * qemu_add_vm_change_state_handler_prio: @@ -2968,11 +2969,44 @@ static void qemu_maybe_daemonize(const char *pid_fi= le) qemu_add_exit_notifier(&qemu_unlink_pidfile_notifier); } =20 +static void qemu_init_subsystems(void) +{ + Error *err; + + os_set_line_buffering(); + + module_call_init(MODULE_INIT_TRACE); + + qemu_init_cpu_list(); + qemu_init_cpu_loop(); + qemu_mutex_lock_iothread(); + + atexit(qemu_run_exit_notifiers); + + module_call_init(MODULE_INIT_QOM); + module_call_init(MODULE_INIT_MIGRATION); + + runstate_init(); + precopy_infrastructure_init(); + postcopy_infrastructure_init(); + monitor_init_globals(); + + if (qcrypto_init(&err) < 0) { + error_reportf_err(err, "cannot initialize crypto: "); + exit(1); + } + + os_setup_early_signal_handling(); + + bdrv_init_with_whitelist(); + socket_init(); +} =20 void qemu_init(int argc, char **argv, char **envp) { int i; - int snapshot, linux_boot; + int snapshot =3D 0; + int linux_boot; const char *initrd_filename; const char *kernel_filename, *kernel_cmdline; const char *boot_order =3D NULL; @@ -2993,7 +3027,6 @@ void qemu_init(int argc, char **argv, char **envp) ram_addr_t maxram_size; uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; - Error *main_loop_err =3D NULL; Error *err =3D NULL; const char *mem_path =3D NULL; bool have_custom_ram_size; @@ -3001,22 +3034,6 @@ void qemu_init(int argc, char **argv, char **envp) QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); int mem_prealloc =3D 0; /* force preallocation of physical target memo= ry */ =20 - os_set_line_buffering(); - - error_init(argv[0]); - module_call_init(MODULE_INIT_TRACE); - - qemu_init_cpu_list(); - qemu_init_cpu_loop(); - - qemu_mutex_lock_iothread(); - - atexit(qemu_run_exit_notifiers); - qemu_init_exec_dir(argv[0]); - - module_call_init(MODULE_INIT_QOM); - module_call_init(MODULE_INIT_MIGRATION); - qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); qemu_add_drive_opts(&qemu_common_drive_opts); @@ -3051,27 +3068,10 @@ void qemu_init(int argc, char **argv, char **envp) qemu_add_opts(&qemu_fw_cfg_opts); module_call_init(MODULE_INIT_OPTS); =20 - runstate_init(); - precopy_infrastructure_init(); - postcopy_infrastructure_init(); - monitor_init_globals(); - - if (qcrypto_init(&err) < 0) { - error_reportf_err(err, "cannot initialize crypto: "); - exit(1); - } - - QTAILQ_INIT(&vm_change_state_head); - os_setup_early_signal_handling(); - - cpu_option =3D NULL; - snapshot =3D 0; - - nb_nics =3D 0; - - bdrv_init_with_whitelist(); + error_init(argv[0]); + qemu_init_exec_dir(argv[0]); =20 - autostart =3D 1; + qemu_init_subsystems(); =20 /* first pass of option parsing */ optind =3D 1; @@ -3952,13 +3952,10 @@ void qemu_init(int argc, char **argv, char **envp) qemu_process_help_options(); qemu_maybe_daemonize(pid_file); =20 - if (qemu_init_main_loop(&main_loop_err)) { - error_report_err(main_loop_err); - exit(1); - } + qemu_init_main_loop(&error_fatal); + cpu_timers_init(); =20 user_register_global_props(); - replay_configure(icount_opts); =20 if (incoming && !preconfig_exit_requested) { @@ -3995,6 +3992,7 @@ void qemu_init(int argc, char **argv, char **envp) } =20 cpu_exec_init_all(); + page_size_init(); =20 if (machine_class->hw_version) { qemu_set_hw_version(machine_class->hw_version); @@ -4137,9 +4135,6 @@ void qemu_init(int argc, char **argv, char **envp) exit(1); } =20 - page_size_init(); - socket_init(); - qemu_opts_foreach(qemu_find_opts("object"), user_creatable_add_opts_foreach, object_create_initial, &error_fatal); @@ -4256,9 +4251,6 @@ void qemu_init(int argc, char **argv, char **envp) semihosting_arg_fallback(kernel_filename, kernel_cmdline); } =20 - /* initialize cpu timers and VCPU throttle modules */ - cpu_timers_init(); - if (default_net) { QemuOptsList *net =3D qemu_find_opts("net"); qemu_opts_set(net, NULL, "type", "nic", &error_abort); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606905392; cv=none; d=zohomail.com; s=zohoarc; b=RGXNku1+BroR9ylkzdtoy1T4LjjFMNm+0T9SAuYlTjEpASZs5EqcF4izup61KHUQtAAylN8DJE/kMMCNlgWQiXihIGdccNc2QaGK49j0SF/UdkBJ4UVvot4sjV2wlrMoq7gz7JY5XWyfV/DRpvXOpc1F1NUkD2DSqTbYrDonFz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606905392; 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=ht4US+5pOoerk/gH7zEnBPKZlzGlnkzTTDX1Ts5dqx4=; b=cfCBilXQlLSAYKbjEjic8bDLA+ZEm5iZ6HBSDDkdyL0/fNqh4NWR6RxlEQCAmAYkwujg6nu2S/u9tcP7Ng1Us4j1Nf+K+T4oE2G75OQs/G4NgO+5scfcDcUAZMUHXMh7c/DANUXfwdtYKF7bBMhWbnAxIpx4tYE7C/brcOrnSQw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606905392343953.9874554230192; Wed, 2 Dec 2020 02:36:32 -0800 (PST) Received: from localhost ([::1]:60960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO69-0005ep-DL for importer@patchew.org; Wed, 02 Dec 2020 04:06:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCy-0003Rj-U9 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003k2-4h for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:49 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-qVYOfmbxMuO11wm5HoRhIw-1; Wed, 02 Dec 2020 03:09:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06C5D1006C85 for ; Wed, 2 Dec 2020 08:09:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4BE75D705 for ; Wed, 2 Dec 2020 08:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896553; 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: in-reply-to:in-reply-to:references:references; bh=ht4US+5pOoerk/gH7zEnBPKZlzGlnkzTTDX1Ts5dqx4=; b=Q25yGWIrlaiRg5vAfpxwHByG0PyhWycCt+emkhdWqrO+q7b6imfXx8aMeE4Uu95n5W92wZ XNPMbbQXMfDuZx5WswPtlRKU5AtbVlMN+JtrXvwUhxeNG7TUpNxHnZ+EDlctx6o6kETdqM 8Rd/2UH0xyMqPr0EuG2nJGFAMo/4ILo= X-MC-Unique: qVYOfmbxMuO11wm5HoRhIw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 057/113] vl: move prelaunch part of qemu_init to new functions Date: Wed, 2 Dec 2020 03:07:53 -0500 Message-Id: <20201202080849.4125477-58-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The final part of qemu_init, starting with the completion of board init, is already relatively clean. Split it out of qemu_init so that qemu_init keeps only the messy parts. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 249 +++++++++++++++++++++++++++------------------------ 1 file changed, 134 insertions(+), 115 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 41a685bb5d..90f9782107 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -120,6 +120,9 @@ static const char *cpu_option; static const char *data_dir[16]; static int data_dir_idx; +static const char *mem_path; +static const char *boot_order; +static const char *boot_once; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int display_opengl; const char* keyboard_layout =3D NULL; @@ -3002,6 +3005,134 @@ static void qemu_init_subsystems(void) socket_init(); } =20 +/* + * Called after leaving preconfig state. From here on runstate is + * RUN_STATE_PRELAUNCH or RUN_STATE_INMIGRATE. + */ +static void qemu_init_board(void) +{ + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + + if (machine_class->default_ram_id && current_machine->ram_size && + numa_uses_legacy_mem() && !current_machine->ram_memdev_id) { + create_default_memdev(current_machine, mem_path); + } + + machine_run_board_init(current_machine); + + /* + * TODO To drop support for deprecated bogus if=3D..., move + * drive_check_orphaned() here, replacing this call. Also drop + * its deprecation warning, along with DriveInfo member + * @claimed_by_board. + */ + drive_mark_claimed_by_board(); + + realtime_init(); + + if (hax_enabled()) { + /* FIXME: why isn't cpu_synchronize_all_post_init enough? */ + hax_sync_vcpus(); + } +} + +static void qemu_create_cli_devices(void) +{ + soundhw_init(); + + qemu_opts_foreach(qemu_find_opts("fw_cfg"), + parse_fw_cfg, fw_cfg_find(), &error_fatal); + + /* init USB devices */ + if (machine_usb(current_machine)) { + if (foreach_device_config(DEV_USB, usb_parse) < 0) + exit(1); + } + + /* init generic devices */ + rom_set_order_override(FW_CFG_ORDER_OVERRIDE_DEVICE); + qemu_opts_foreach(qemu_find_opts("device"), + device_init_func, NULL, &error_fatal); + rom_reset_order_override(); +} + +static void qemu_machine_creation_done(void) +{ + DisplayState *ds; + + cpu_synchronize_all_post_init(); + + /* Did we create any drives that we failed to create a device for? */ + drive_check_orphaned(); + + /* Don't warn about the default network setup that you get if + * no command line -net or -netdev options are specified. There + * are two cases that we would otherwise complain about: + * (1) board doesn't support a NIC but the implicit "-net nic" + * requested one + * (2) CONFIG_SLIRP not set, in which case the implicit "-net nic" + * sets up a nic that isn't connected to anything. + */ + if (!default_net && (!qtest_enabled() || has_defaults)) { + net_check_clients(); + } + + if (boot_once) { + qemu_boot_set(boot_once, &error_fatal); + qemu_register_reset(restore_boot_order, g_strdup(boot_order)); + } + + /* init local displays */ + ds =3D init_displaystate(); + qemu_display_init(ds, &dpy); + + /* must be after terminal init, SDL library changes signal handlers */ + os_setup_signal_handling(); + + /* init remote displays */ +#ifdef CONFIG_VNC + qemu_opts_foreach(qemu_find_opts("vnc"), + vnc_init_func, NULL, &error_fatal); +#endif + + if (using_spice) { + qemu_spice.display_init(); + } + + if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { + exit(1); + } + + qdev_machine_creation_done(); + + /* TODO: once all bus devices are qdevified, this should be done + * when bus is created by qdev.c */ + /* + * TODO: If we had a main 'reset container' that the whole system + * lived in, we could reset that using the multi-phase reset + * APIs. For the moment, we just reset the sysbus, which will cause + * all devices hanging off it (and all their child buses, recursively) + * to be reset. Note that this will *not* reset any Device objects + * which are not attached to some part of the qbus tree! + */ + qemu_register_reset(resettable_cold_reset_fn, sysbus_get_default()); + qemu_run_machine_init_done_notifiers(); + + if (rom_check_and_register_reset() !=3D 0) { + error_report("rom check and register reset failed"); + exit(1); + } + + replay_start(); + + /* This checkpoint is required by replay to separate prior clock + reading from the other reads, because timer polling functions query + clock values from the log. */ + replay_checkpoint(CHECKPOINT_RESET); + qemu_system_reset(SHUTDOWN_CAUSE_NONE); + register_global_state(); +} + void qemu_init(int argc, char **argv, char **envp) { int i; @@ -3009,9 +3140,6 @@ void qemu_init(int argc, char **argv, char **envp) int linux_boot; const char *initrd_filename; const char *kernel_filename, *kernel_cmdline; - const char *boot_order =3D NULL; - const char *boot_once =3D NULL; - DisplayState *ds; QemuOpts *opts, *machine_opts; QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL; QemuOptsList *olist; @@ -3028,7 +3156,6 @@ void qemu_init(int argc, char **argv, char **envp) uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; Error *err =3D NULL; - const char *mem_path =3D NULL; bool have_custom_ram_size; BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue= ); QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); @@ -4351,117 +4478,10 @@ void qemu_init(int argc, char **argv, char **envp) /* do monitor/qmp handling at preconfig state if requested */ qemu_main_loop(); =20 - if (machine_class->default_ram_id && current_machine->ram_size && - numa_uses_legacy_mem() && !current_machine->ram_memdev_id) { - create_default_memdev(current_machine, mem_path); - } - - /* from here on runstate is RUN_STATE_PRELAUNCH */ - machine_run_board_init(current_machine); - - /* - * TODO To drop support for deprecated bogus if=3D..., move - * drive_check_orphaned() here, replacing this call. Also drop - * its deprecation warning, along with DriveInfo member - * @claimed_by_board. - */ - drive_mark_claimed_by_board(); - - realtime_init(); - - soundhw_init(); - - if (hax_enabled()) { - hax_sync_vcpus(); - } - - qemu_opts_foreach(qemu_find_opts("fw_cfg"), - parse_fw_cfg, fw_cfg_find(), &error_fatal); - - /* init USB devices */ - if (machine_usb(current_machine)) { - if (foreach_device_config(DEV_USB, usb_parse) < 0) - exit(1); - } - - /* init generic devices */ - rom_set_order_override(FW_CFG_ORDER_OVERRIDE_DEVICE); - qemu_opts_foreach(qemu_find_opts("device"), - device_init_func, NULL, &error_fatal); - - cpu_synchronize_all_post_init(); - - rom_reset_order_override(); - - /* Did we create any drives that we failed to create a device for? */ - drive_check_orphaned(); - - /* Don't warn about the default network setup that you get if - * no command line -net or -netdev options are specified. There - * are two cases that we would otherwise complain about: - * (1) board doesn't support a NIC but the implicit "-net nic" - * requested one - * (2) CONFIG_SLIRP not set, in which case the implicit "-net nic" - * sets up a nic that isn't connected to anything. - */ - if (!default_net && (!qtest_enabled() || has_defaults)) { - net_check_clients(); - } - - if (boot_once) { - qemu_boot_set(boot_once, &error_fatal); - qemu_register_reset(restore_boot_order, g_strdup(boot_order)); - } - - /* init local displays */ - ds =3D init_displaystate(); - qemu_display_init(ds, &dpy); - - /* must be after terminal init, SDL library changes signal handlers */ - os_setup_signal_handling(); - - /* init remote displays */ -#ifdef CONFIG_VNC - qemu_opts_foreach(qemu_find_opts("vnc"), - vnc_init_func, NULL, &error_fatal); -#endif - - if (using_spice) { - qemu_spice.display_init(); - } - - if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { - exit(1); - } - - qdev_machine_creation_done(); - - /* TODO: once all bus devices are qdevified, this should be done - * when bus is created by qdev.c */ - /* - * TODO: If we had a main 'reset container' that the whole system - * lived in, we could reset that using the multi-phase reset - * APIs. For the moment, we just reset the sysbus, which will cause - * all devices hanging off it (and all their child buses, recursively) - * to be reset. Note that this will *not* reset any Device objects - * which are not attached to some part of the qbus tree! - */ - qemu_register_reset(resettable_cold_reset_fn, sysbus_get_default()); - qemu_run_machine_init_done_notifiers(); + qemu_init_board(); + qemu_create_cli_devices(); + qemu_machine_creation_done(); =20 - if (rom_check_and_register_reset() !=3D 0) { - error_report("rom check and register reset failed"); - exit(1); - } - - replay_start(); - - /* This checkpoint is required by replay to separate prior clock - reading from the other reads, because timer polling functions query - clock values from the log. */ - replay_checkpoint(CHECKPOINT_RESET); - qemu_system_reset(SHUTDOWN_CAUSE_NONE); - register_global_state(); if (loadvm) { Error *local_err =3D NULL; if (load_snapshot(loadvm, &local_err) < 0) { @@ -4480,7 +4500,6 @@ void qemu_init(int argc, char **argv, char **envp) dump_vmstate_json_to_file(vmstate_dump_file); exit(0); } - if (incoming) { Error *local_err =3D NULL; qemu_start_incoming_migration(incoming, &local_err); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899341; cv=none; d=zohomail.com; s=zohoarc; b=Wc3dRSCh4xH9EyEVSC4gpud9hyT12zp9zjq2AwpLJ3HtaHweTsLCJnnilnqp8WtEQ+1dZaEQgTwQ4MGTEwpw5f29ZJB1lsCWBiS9jutElqQyzlTSJ8dndd58Pj+4iFDgskNJHdBDNsCQHc1P9dLNUymtR64laNRcCDIL+2W9Sj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899341; 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=pCVh5j20ZuWqQl9mnKBGxJHe1C2rUICIaNHahVRGm+8=; b=KfRYiW/MhvCsF2/Ql/1D4/0kPZw77br+Iwa0xuTSDPcXqF2c0JNSMe94A/s4cccQ434K5QEvTWoc/LzMEbkg8Yt+lgKwcbR9nRMcQXn9poyEQJWLqf/UuooBAmDFk7mjfyxxi1V/8s6k8nI0CDsM48tBBeG1FgDxcP4DXzMJ1iM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899341179114.88959611539815; Wed, 2 Dec 2020 00:55:41 -0800 (PST) Received: from localhost ([::1]:56602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNvI-0007uc-1g for importer@patchew.org; Wed, 02 Dec 2020 03:55:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCj-0003OI-SS for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003k7-45 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:37 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-471-za5qrbQZNX6EQJm_VbI1RQ-1; Wed, 02 Dec 2020 03:09:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 575275708C for ; Wed, 2 Dec 2020 08:09:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22FDA5D705 for ; Wed, 2 Dec 2020 08:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896553; 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: in-reply-to:in-reply-to:references:references; bh=pCVh5j20ZuWqQl9mnKBGxJHe1C2rUICIaNHahVRGm+8=; b=Ix8/9InQnFL6D5+3FHj97Al3WLA3msmlrQP5UoIXf3KrAS8ybRrt2L+PnfPq6MD0dbBfQw iUZUrTzKfpnhPTjFTjG66+DnIYQ/BdPx3YniW0oThO6Xth/la2/DTOuaRkYJCqhhvQTQUe Vb0YRKcTyTK1VX137wwadj0k8sFiRxk= X-MC-Unique: za5qrbQZNX6EQJm_VbI1RQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 058/113] vl: extract various command line validation snippets to a new function Date: Wed, 2 Dec 2020 03:07:54 -0500 Message-Id: <20201202080849.4125477-59-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 1 + softmmu/vl.c | 78 +++++++++++++++++++++++------------------------ 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 5260155962..7ef3de5ce5 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -880,6 +880,7 @@ static void machine_initfn(Object *obj) ms->dump_guest_core =3D true; ms->mem_merge =3D true; ms->enable_graphics =3D true; + ms->kernel_cmdline =3D g_strdup(""); =20 if (mc->nvdimm_supported) { Object *obj =3D OBJECT(ms); diff --git a/softmmu/vl.c b/softmmu/vl.c index 90f9782107..71b5263d05 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -123,6 +123,7 @@ static int data_dir_idx; static const char *mem_path; static const char *boot_order; static const char *boot_once; +static const char *incoming; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int display_opengl; const char* keyboard_layout =3D NULL; @@ -2874,6 +2875,39 @@ static char *find_datadir(void) return get_relocated_path(CONFIG_QEMU_DATADIR); } =20 +static void qemu_validate_options(void) +{ + QemuOpts *machine_opts =3D qemu_get_machine_opts(); + const char *kernel_filename =3D qemu_opt_get(machine_opts, "kernel"); + const char *initrd_filename =3D qemu_opt_get(machine_opts, "initrd"); + const char *kernel_cmdline =3D qemu_opt_get(machine_opts, "append"); + + if (kernel_filename =3D=3D NULL) { + if (kernel_cmdline !=3D NULL) { + error_report("-append only allowed with -kernel option"); + exit(1); + } + + if (initrd_filename !=3D NULL) { + error_report("-initrd only allowed with -kernel option"); + exit(1); + } + } + + if (incoming && !preconfig_exit_requested) { + error_report("'preconfig' and 'incoming' options are " + "mutually exclusive"); + exit(EXIT_FAILURE); + } + +#ifdef CONFIG_CURSES + if (is_daemonized() && dpy.type =3D=3D DISPLAY_TYPE_CURSES) { + error_report("curses display cannot be used with -daemonize"); + exit(1); + } +#endif +} + static void qemu_process_early_options(void) { char **dirs; @@ -3137,9 +3171,6 @@ void qemu_init(int argc, char **argv, char **envp) { int i; int snapshot =3D 0; - int linux_boot; - const char *initrd_filename; - const char *kernel_filename, *kernel_cmdline; QemuOpts *opts, *machine_opts; QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL; QemuOptsList *olist; @@ -3148,7 +3179,6 @@ void qemu_init(int argc, char **argv, char **envp) const char *loadvm =3D NULL; MachineClass *machine_class; const char *vga_model =3D NULL; - const char *incoming =3D NULL; bool userconfig =3D true; bool nographic =3D false; int display_remote =3D 0; @@ -4070,6 +4100,8 @@ void qemu_init(int argc, char **argv, char **envp) */ loc_set_none(); =20 + qemu_validate_options(); + /* * These options affect everything else and should be processed * before daemonizing. @@ -4085,12 +4117,6 @@ void qemu_init(int argc, char **argv, char **envp) user_register_global_props(); replay_configure(icount_opts); =20 - if (incoming && !preconfig_exit_requested) { - error_report("'preconfig' and 'incoming' options are " - "mutually exclusive"); - exit(EXIT_FAILURE); - } - configure_rtc(qemu_find_opts_singleton("rtc")); =20 machine_class =3D select_machine(); @@ -4195,12 +4221,6 @@ void qemu_init(int argc, char **argv, char **envp) error_report("-nographic cannot be used with -daemonize"); exit(1); } -#ifdef CONFIG_CURSES - if (dpy.type =3D=3D DISPLAY_TYPE_CURSES) { - error_report("curses display cannot be used with -daemonize"); - exit(1); - } -#endif } =20 if (nographic) { @@ -4331,11 +4351,6 @@ void qemu_init(int argc, char **argv, char **envp) qtest_server_init(qtest_chrdev, qtest_log, &error_fatal); } =20 - machine_opts =3D qemu_get_machine_opts(); - kernel_filename =3D qemu_opt_get(machine_opts, "kernel"); - initrd_filename =3D qemu_opt_get(machine_opts, "initrd"); - kernel_cmdline =3D qemu_opt_get(machine_opts, "append"); - opts =3D qemu_opts_find(qemu_find_opts("boot-opts"), NULL); if (opts) { boot_order =3D qemu_opt_get(opts, "order"); @@ -4356,24 +4371,9 @@ void qemu_init(int argc, char **argv, char **envp) boot_order =3D machine_class->default_boot_order; } =20 - if (!kernel_cmdline) { - kernel_cmdline =3D ""; - current_machine->kernel_cmdline =3D (char *)kernel_cmdline; - } - - linux_boot =3D (kernel_filename !=3D NULL); - - if (!linux_boot && *kernel_cmdline !=3D '\0') { - error_report("-append only allowed with -kernel option"); - exit(1); - } - - if (!linux_boot && initrd_filename !=3D NULL) { - error_report("-initrd only allowed with -kernel option"); - exit(1); - } - - if (semihosting_enabled() && !semihosting_get_argc() && kernel_filenam= e) { + if (semihosting_enabled() && !semihosting_get_argc()) { + const char *kernel_filename =3D qemu_opt_get(machine_opts, "kernel= "); + const char *kernel_cmdline =3D qemu_opt_get(machine_opts, "append"= ); /* fall back to the -kernel/-append */ semihosting_arg_fallback(kernel_filename, kernel_cmdline); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899139; cv=none; d=zohomail.com; s=zohoarc; b=Xbs9GbdzQq+EyGDzst3FX4YXfgP529WEzNglqcQ37DTitG4K5kldohCosrrV0VHxdvK15BxaUp18BzL6RqyJLuru4ZwyE0X2Wuf6BDIGjECJ0AL9o+u+GHIniQOogKOXZlc6Gh2sfHiN/NU5E37Hzs3lnObRhonGW/ZyuS+4dl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899139; 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=hV+G3BmVdeGTCvNBnOYqDebtflkaLNRrYVcHttNrawA=; b=UzO5db2axWIpjoKK30YmydY3+kpcYjV61uLH+ps7alYlpE9ki/NrmXUCHQAZswVFP0uZhGDSSwUsPEpIGcW07GoTOqedQ8GF9v2+qet8D/1Ww4ZeTyRhLqDQnDXLMwQIHOnsEPFEqHnCQKC2FV/u+H7FsFWQ24crlcOjfr3dcdk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899139967498.69655785432565; Wed, 2 Dec 2020 00:52:19 -0800 (PST) Received: from localhost ([::1]:48164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNs2-0004S3-Rz for importer@patchew.org; Wed, 02 Dec 2020 03:52:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCj-0003ND-9B for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCN-0003kB-3q for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236--jYixDGsN9C8n4aQPo8h0Q-1; Wed, 02 Dec 2020 03:09:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A6CA88558E7 for ; Wed, 2 Dec 2020 08:09:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 729D65D705 for ; Wed, 2 Dec 2020 08:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896554; 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: in-reply-to:in-reply-to:references:references; bh=hV+G3BmVdeGTCvNBnOYqDebtflkaLNRrYVcHttNrawA=; b=bIsZEHs24zIxL2EHV4zFR6+mgbkq2RSFdnQSvsR/jjVMFdygvtTpmnERJtwUkhxcb/f8vo xfrh/NBS/B2hwXzCZkfYZesVSfNCLQr3tTRoioFAFl66T8LwWTZ7xj8M6sPJ61+cKm7lpW 4o2Z6ybj3jkWQwASMLBMr7kNwd7eouU= X-MC-Unique: -jYixDGsN9C8n4aQPo8h0Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 059/113] vl: preconfig and loadvm are mutually exclusive Date: Wed, 2 Dec 2020 03:07:55 -0500 Message-Id: <20201202080849.4125477-60-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Just like -incoming. Later we will add support for "-incoming defer -preconfig", because there are cases (Xen, block layer) that want to look at RUNSTATE_INMIGRATE. -loadvm will remain mutually exclusive with preconfig; the plan is to just do loadvm in the monitor, since the user is already going to interact with it for preconfiguration. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 71b5263d05..98994e10fa 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -124,6 +124,7 @@ static const char *mem_path; static const char *boot_order; static const char *boot_once; static const char *incoming; +static const char *loadvm; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int display_opengl; const char* keyboard_layout =3D NULL; @@ -2894,6 +2895,11 @@ static void qemu_validate_options(void) } } =20 + if (loadvm && !preconfig_exit_requested) { + error_report("'preconfig' and 'loadvm' options are " + "mutually exclusive"); + exit(EXIT_FAILURE); + } if (incoming && !preconfig_exit_requested) { error_report("'preconfig' and 'incoming' options are " "mutually exclusive"); @@ -3176,7 +3182,6 @@ void qemu_init(int argc, char **argv, char **envp) QemuOptsList *olist; int optind; const char *optarg; - const char *loadvm =3D NULL; MachineClass *machine_class; const char *vga_model =3D NULL; bool userconfig =3D true; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901070; cv=none; d=zohomail.com; s=zohoarc; b=Hh5v6yLn/SzZTunMcLtMzeBcJ1KZqhAi05tXFU36GsiihZ5+TcmcIQfem8iyUYzk+DO7TSWXU4uErvO6tlokHrgbQgPQMC20FDNJ9BlGe6y1ONehwsjh+JSFnCOG0D0fr0pxA//5Iw8AMlL4d4trjCfmmEKFrVGVU3vpGzgvQtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901070; 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=aoEY9amDCE/ofBNeD9yLPxQ+BRv39mk4G7Kgodv+DFI=; b=PRCBlIaSGN9vZmbq+DL0Q1APkLZvXvN0Abh+Hz2obdory2FMPFkql+/sxln5eOd81bKjuboG8hEt4QobU0qUlPEq+2EqAAkZLDENgI7WRjWi8WNIlC9L6rl6hQ5cjo2pK7n3tFwSPe4h1ZgIapmsckvRBb9j9h32Ky2zNY7Eht0= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901070441616.9644112759175; Wed, 2 Dec 2020 01:24:30 -0800 (PST) Received: from localhost ([::1]:43786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNzu-00069K-64 for importer@patchew.org; Wed, 02 Dec 2020 04:00:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCt-0003Pl-9j for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCO-0003kM-V0 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:47 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-246-hh1_JJXkN7WUtS0l4-OzJA-1; Wed, 02 Dec 2020 03:09:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53941185E48E for ; Wed, 2 Dec 2020 08:09:12 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16FFA10013BD for ; Wed, 2 Dec 2020 08:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896554; 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: in-reply-to:in-reply-to:references:references; bh=aoEY9amDCE/ofBNeD9yLPxQ+BRv39mk4G7Kgodv+DFI=; b=JYW6/SWcN021Z49DLRsTW5uf8gsSaap45nlf75tniP0I5ESLekHZvHw86C92wQ+odkkWrn 9IsvWrgSgpG186/cf4ekEanL2VRS/3UyjgwQRXN2uHI3XH4vhH3r+1yL1dGQDPxFNtF5xd MlaElkKYJiNfyCHxQ9QvU+HrLepcxb8= X-MC-Unique: hh1_JJXkN7WUtS0l4-OzJA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 060/113] vl: extract various command line desugaring snippets to a new function Date: Wed, 2 Dec 2020 03:07:56 -0500 Message-Id: <20201202080849.4125477-61-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Keep the machine initialization sequence free of miscellaneous command line parsing actions. The only difference is that preallocation will always be done with one thread if -smp is not provided; previously it was using mc->default_cpus, which is almost always 1 anyway. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 98994e10fa..85b23d51be 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -126,6 +126,7 @@ static const char *boot_once; static const char *incoming; static const char *loadvm; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; +static int mem_prealloc; /* force preallocation of physical target memory = */ int display_opengl; const char* keyboard_layout =3D NULL; static ram_addr_t ram_size; @@ -158,7 +159,7 @@ int fd_bootchk =3D 1; static int no_reboot; int no_shutdown =3D 0; int graphic_rotate =3D 0; -const char *watchdog; +static const char *watchdog; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; int nb_option_roms; int old_param =3D 0; @@ -2914,6 +2915,25 @@ static void qemu_validate_options(void) #endif } =20 +static void qemu_process_sugar_options(void) +{ + if (mem_prealloc) { + char *val; + + val =3D g_strdup_printf("%d", + (uint32_t) qemu_opt_get_number(qemu_find_opts_singleton("= smp-opts"), "cpus", 1)); + object_register_sugar_prop("memory-backend", "prealloc-threads", v= al); + g_free(val); + object_register_sugar_prop("memory-backend", "prealloc", "on"); + } + + if (watchdog) { + int i =3D select_watchdog(watchdog); + if (i > 0) + exit (i =3D=3D 1 ? 1 : 0); + } +} + static void qemu_process_early_options(void) { char **dirs; @@ -3175,7 +3195,6 @@ static void qemu_machine_creation_done(void) =20 void qemu_init(int argc, char **argv, char **envp) { - int i; int snapshot =3D 0; QemuOpts *opts, *machine_opts; QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL; @@ -3194,7 +3213,6 @@ void qemu_init(int argc, char **argv, char **envp) bool have_custom_ram_size; BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue= ); QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); - int mem_prealloc =3D 0; /* force preallocation of physical target memo= ry */ =20 qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); @@ -4106,6 +4124,7 @@ void qemu_init(int argc, char **argv, char **envp) loc_set_none(); =20 qemu_validate_options(); + qemu_process_sugar_options(); =20 /* * These options affect everything else and should be processed @@ -4159,15 +4178,6 @@ void qemu_init(int argc, char **argv, char **envp) machine_smp_parse(current_machine, qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); =20 - if (mem_prealloc) { - char *val; - - val =3D g_strdup_printf("%d", current_machine->smp.cpus); - object_register_sugar_prop("memory-backend", "prealloc-threads", v= al); - g_free(val); - object_register_sugar_prop("memory-backend", "prealloc", "on"); - } - /* * Get the default machine options from the machine if it is not alrea= dy * specified either by the configuration file or by the command line. @@ -4426,12 +4436,6 @@ void qemu_init(int argc, char **argv, char **envp) select_vgahw(machine_class, vga_model); } =20 - if (watchdog) { - i =3D select_watchdog(watchdog); - if (i > 0) - exit (i =3D=3D 1 ? 1 : 0); - } - /* This checkpoint is required by replay to separate prior clock reading from the other reads, because timer polling functions query clock values from the log. */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899478; cv=none; d=zohomail.com; s=zohoarc; b=e7xzpnvDj+gHE7PihB/DwHUad8xXxFldffsAh02yLw2b6pPZA4LJDlj4P0S21GLHFA30qiJJEpwxYtvYEl4IWpt/4cIwlIkGXuN89769oU+1l66fVyjqXAd6bkn+afrLcT3X3Dce6w+MrehS5JTikRm70YtYn5awX54gtQOF1Ng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899478; 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=3S5eYUz053L8Fm4YpxHeWkW2wUEcEivPHnhalqFN8I4=; b=IEGXgI4W5ETk/8S99WvUljrZQ8JitxaB5m9jB5VkFMockT0ur6YG3bzrP6LZFWUVugucAsdc5raBcPEm+9+G7vQu0hXlXvIUF+9PV2CpDgt708xQ85JC8Fw7Q9pJQJdXSOqC9uZU5ZmuHdSYjKq2q8CsvmPm2ZiMOagFWxsbShg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899478637787.9631878054918; Wed, 2 Dec 2020 00:57:58 -0800 (PST) Received: from localhost ([::1]:36606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNxV-000390-Fr for importer@patchew.org; Wed, 02 Dec 2020 03:57:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND0-0003SQ-St for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCO-0003kY-Vo for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:51 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-kLSNb66DMNGmunSCJNptyg-1; Wed, 02 Dec 2020 03:09:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B029E803652 for ; Wed, 2 Dec 2020 08:09:12 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74B9910013BD for ; Wed, 2 Dec 2020 08:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896555; 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: in-reply-to:in-reply-to:references:references; bh=3S5eYUz053L8Fm4YpxHeWkW2wUEcEivPHnhalqFN8I4=; b=iTWn1HwOqI9pPhEuzdoVlva2BHSPHrBnddS6ntcAGWrspfCz8/06HSgwz16/N51Shcn0tD 0AGBKCN8puysecjLNmPlgb92fFXine60Ao3YqwgJ+nEqgFDtaHm9QGlCo2TuWrhRGm8ja8 4gEHXixFwXNRltCC0RcwGsR4UJACCok= X-MC-Unique: kLSNb66DMNGmunSCJNptyg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 061/113] qemu-option: restrict qemu_opts_set to merge-lists QemuOpts Date: Wed, 2 Dec 2020 03:07:57 -0500 Message-Id: <20201202080849.4125477-62-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" qemu_opts_set is used to create default network backends and to parse sugar options -kernel, -initrd, -append, -bios and -dtb. These are very different uses: I would *expect* a function named qemu_opts_set to set an option in a merge-lists QemuOptsList, such as -kernel, and possibly to set an option in a non-merge-lists QemuOptsList with non-NULL id, similar to -set. However, it wouldn't *work* to use qemu_opts_set for the latter because qemu_opts_set uses fail_if_exists=3D=3D1. So, for non-merge-lists QemuOptsList and non-NULL id, the semantics of qemu_opts_set (fail if the (QemuOptsList, id) pair already exists) are debatable. On the other hand, I would not expect qemu_opts_set to create a non-merge-lists QemuOpts with a single option; which it does, though. For this case of non-merge-lists QemuOptsList and NULL id, qemu_opts_set hardly adds value over qemu_opts_parse. It does skip some parsing and unescaping, but that's not needed when creating default network backends. So qemu_opts_set has warty behavior for non-merge-lists QemuOptsList if id is non-NULL, and it's mostly pointless if id is NULL. My solution to keeping the API as simple as possible is to limit qemu_opts_set to merge-lists QemuOptsList. For them, it's useful (we don't want comma-unescaping for -kernel) *and* has sane semantics. Network backend creation is switched to qemu_opts_parse. qemu_opts_set is now only used on merge-lists QemuOptsList... except in the testcase, which is changed to use a merge-list QemuOptsList. With this change we can also remove the id parameter. With the parameter always NULL, we know that qemu_opts_create cannot fail and can pass &error_abort to it. Signed-off-by: Paolo Bonzini --- include/qemu/option.h | 3 +-- softmmu/vl.c | 19 +++++++------------ tests/test-qemu-opts.c | 20 +++++++++++++++++--- util/qemu-option.c | 9 +++------ 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index ac69352e0e..f73e0dc7d9 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -119,8 +119,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const ch= ar *id, int fail_if_exists, Error **errp); void qemu_opts_reset(QemuOptsList *list); void qemu_opts_loc_restore(QemuOpts *opts); -bool qemu_opts_set(QemuOptsList *list, const char *id, - const char *name, const char *value, Error **errp); +bool qemu_opts_set(QemuOptsList *list, const char *name, const char *value= , Error **errp); const char *qemu_opts_id(QemuOpts *opts); void qemu_opts_set_id(QemuOpts *opts, char *id); void qemu_opts_del(QemuOpts *opts); diff --git a/softmmu/vl.c b/softmmu/vl.c index 85b23d51be..5571f9ff75 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3388,20 +3388,16 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_kernel: - qemu_opts_set(qemu_find_opts("machine"), NULL, "kernel", o= ptarg, - &error_abort); + qemu_opts_set(qemu_find_opts("machine"), "kernel", optarg,= &error_abort); break; case QEMU_OPTION_initrd: - qemu_opts_set(qemu_find_opts("machine"), NULL, "initrd", o= ptarg, - &error_abort); + qemu_opts_set(qemu_find_opts("machine"), "initrd", optarg,= &error_abort); break; case QEMU_OPTION_append: - qemu_opts_set(qemu_find_opts("machine"), NULL, "append", o= ptarg, - &error_abort); + qemu_opts_set(qemu_find_opts("machine"), "append", optarg,= &error_abort); break; case QEMU_OPTION_dtb: - qemu_opts_set(qemu_find_opts("machine"), NULL, "dtb", opta= rg, - &error_abort); + qemu_opts_set(qemu_find_opts("machine"), "dtb", optarg, &e= rror_abort); break; case QEMU_OPTION_cdrom: drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS); @@ -3511,8 +3507,7 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_bios: - qemu_opts_set(qemu_find_opts("machine"), NULL, "firmware",= optarg, - &error_abort); + qemu_opts_set(qemu_find_opts("machine"), "firmware", optar= g, &error_abort); break; case QEMU_OPTION_singlestep: singlestep =3D 1; @@ -4395,9 +4390,9 @@ void qemu_init(int argc, char **argv, char **envp) =20 if (default_net) { QemuOptsList *net =3D qemu_find_opts("net"); - qemu_opts_set(net, NULL, "type", "nic", &error_abort); + qemu_opts_parse(net, "nic", true, &error_abort); #ifdef CONFIG_SLIRP - qemu_opts_set(net, NULL, "type", "user", &error_abort); + qemu_opts_parse(net, "user", true, &error_abort); #endif } =20 diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c index 297ffe79dd..2aab831d10 100644 --- a/tests/test-qemu-opts.c +++ b/tests/test-qemu-opts.c @@ -84,11 +84,25 @@ static QemuOptsList opts_list_03 =3D { }, }; =20 +static QemuOptsList opts_list_04 =3D { + .name =3D "opts_list_04", + .head =3D QTAILQ_HEAD_INITIALIZER(opts_list_04.head), + .merge_lists =3D true, + .desc =3D { + { + .name =3D "str3", + .type =3D QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + static void register_opts(void) { qemu_add_opts(&opts_list_01); qemu_add_opts(&opts_list_02); qemu_add_opts(&opts_list_03); + qemu_add_opts(&opts_list_04); } =20 static void test_find_unknown_opts(void) @@ -402,17 +416,17 @@ static void test_qemu_opts_set(void) QemuOpts *opts; const char *opt; =20 - list =3D qemu_find_opts("opts_list_01"); + list =3D qemu_find_opts("opts_list_04"); g_assert(list !=3D NULL); g_assert(QTAILQ_EMPTY(&list->head)); - g_assert_cmpstr(list->name, =3D=3D, "opts_list_01"); + g_assert_cmpstr(list->name, =3D=3D, "opts_list_04"); =20 /* should not find anything at this point */ opts =3D qemu_opts_find(list, NULL); g_assert(opts =3D=3D NULL); =20 /* implicitly create opts and set str3 value */ - qemu_opts_set(list, NULL, "str3", "value", &error_abort); + qemu_opts_set(list, "str3", "value", &error_abort); g_assert(!QTAILQ_EMPTY(&list->head)); =20 /* get the just created opts */ diff --git a/util/qemu-option.c b/util/qemu-option.c index acefbc23fa..25792159ba 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -670,15 +670,12 @@ void qemu_opts_loc_restore(QemuOpts *opts) loc_restore(&opts->loc); } =20 -bool qemu_opts_set(QemuOptsList *list, const char *id, - const char *name, const char *value, Error **errp) +bool qemu_opts_set(QemuOptsList *list, const char *name, const char *value= , Error **errp) { QemuOpts *opts; =20 - opts =3D qemu_opts_create(list, id, 1, errp); - if (!opts) { - return false; - } + assert(list->merge_lists); + opts =3D qemu_opts_create(list, NULL, 0, &error_abort); return qemu_opt_set(opts, name, value, errp); } =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898284; cv=none; d=zohomail.com; s=zohoarc; b=iIJsAmdXQjq73k8ZpCh+z4HAVUsAHCVuxxTaHRpt3l/rnJbCkVJm/yKIGMSrzhzkwStn1Qz3UbY78Dbu8wo7lHO6/GwzGeToiVPnMtz7Mwed2xgW7erQuzlg2W/0LOUfLyBlYTtAA+n87HLrlrl4KIBgFozJs9qyuhyjn53M0ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898284; 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=NVlkX2RNZ4VTfnS/EgqivsechNfR7j1XHKWeN48kAXM=; b=lauK0qccVNcJjApvPVmxngW7m9kTOThvxA9PWsqEz6vWAWp2nWzrUGZa4al20UrkLr6Z+J68W2xlA6K555Y3ValMdYZaDo0L0cMww6C6rznRiVn67x4oi0b8bJNHbIAIp63NcCIqI8xxZ+hUAI44S7Vm2GgSreaFwo2h9jmgrJ4= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898284461371.79580504127523; Wed, 2 Dec 2020 00:38:04 -0800 (PST) Received: from localhost ([::1]:33106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNeF-0003CT-Cd for importer@patchew.org; Wed, 02 Dec 2020 03:38:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCt-0003Pj-7z for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCO-0003kW-VQ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:45 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-32Nerja2NvO7hHE_NyMFUg-1; Wed, 02 Dec 2020 03:09:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 199C35708C for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D19C910023AE for ; Wed, 2 Dec 2020 08:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896555; 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: in-reply-to:in-reply-to:references:references; bh=NVlkX2RNZ4VTfnS/EgqivsechNfR7j1XHKWeN48kAXM=; b=ShaYbsIz+hW2t+0yLjmfRultcUCXNoE+b8z3cpeqvS6TFDJ5aW7RhTsKPDA3LrUXaw5wjd oC/IYzBkRwoHPPULlyJvJfeDnKCB77BU97+xJqyI30aSHxHaT0UKejSMW9O1k3Vl0cbL+K qSExXuD4F0l2yIjr8d0aSE3P/2hl9yw= X-MC-Unique: 32Nerja2NvO7hHE_NyMFUg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 062/113] vl: create "-net nic -net user" default earlier Date: Wed, 2 Dec 2020 03:07:58 -0500 Message-Id: <20201202080849.4125477-63-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Create it together with other default backends, even though the processing = is done later. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 5571f9ff75..a4b87ae742 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4253,6 +4253,14 @@ void qemu_init(int argc, char **argv, char **envp) monitor_parse("vc:80Cx24C", "readline", false); } =20 + if (default_net) { + QemuOptsList *net =3D qemu_find_opts("net"); + qemu_opts_parse(net, "nic", true, &error_abort); +#ifdef CONFIG_SLIRP + qemu_opts_parse(net, "user", true, &error_abort); +#endif + } + #if defined(CONFIG_VNC) if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) { display_remote++; @@ -4388,14 +4396,6 @@ void qemu_init(int argc, char **argv, char **envp) semihosting_arg_fallback(kernel_filename, kernel_cmdline); } =20 - if (default_net) { - QemuOptsList *net =3D qemu_find_opts("net"); - qemu_opts_parse(net, "nic", true, &error_abort); -#ifdef CONFIG_SLIRP - qemu_opts_parse(net, "user", true, &error_abort); -#endif - } - if (net_init_clients(&err) < 0) { error_report_err(err); exit(1); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606907013; cv=none; d=zohomail.com; s=zohoarc; b=S21/10xDGJZj5KYJjSSzdryer+davbKEhPK7oLELB4MkvmvymOgDwRn2M4AjYd5Sir19XwX8hMD58dxiqCmD6rSdBJ3G0dUvj2yrgFJ7bvpT4t4WHiKvArcwcQ568XiZ5EywjlpY1+vUFgwN61bz5FBR9qXKo6hAGWi9rgVeC8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606907013; 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=NXlx77nAu/WTPjVpsK5XPof+OySlzhG7W+nrmLVlxGg=; b=XSOg76ryFwSPifr4xG5EjMJDKRPrvOdHb8keyBQPP0Rcu9/Bb0NblZ/4IMPU4aAwDNBcJS0LA/S0aNlv4+uOsGieSyaJWgIwgTSyR+p0SICizZpKU4vKBs3pd+KGltyYyBBPn5zGZLSUaM5E+Via2SHXT1bYwObY0FwZeqdAJ+U= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606907013770847.8332276718478; Wed, 2 Dec 2020 03:03:33 -0800 (PST) Received: from localhost ([::1]:52532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO2k-0001gM-Ca for importer@patchew.org; Wed, 02 Dec 2020 04:03:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNCq-0003PU-VG for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCO-0003l5-VQ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-jsJ0p7pdPmmR1Rl7tR3mWA-1; Wed, 02 Dec 2020 03:09:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76C59803657 for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A92110013BD for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896555; 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: in-reply-to:in-reply-to:references:references; bh=NXlx77nAu/WTPjVpsK5XPof+OySlzhG7W+nrmLVlxGg=; b=GmgBIDeCIuTbUi7V8aRhKmTs8mlpwrPUJTj49KMy2kmD4+Ao3Wb/w331xRUfTEd8VRmJ/U ER2qSwua+lHPaqygyoT/viOw1QNSlbOzNMIxZQn6rx/3MzIYgEFSOHjzkP8ccrankma4z4 E+7JuwGLJxpJCYGrmXZFo2B9WhbK2Fw= X-MC-Unique: jsJ0p7pdPmmR1Rl7tR3mWA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 063/113] vl: load plugins as late as possible Date: Wed, 2 Dec 2020 03:07:59 -0500 Message-Id: <20201202080849.4125477-64-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) There is no need to load plugins in the middle of default device processing, move -plugin handling just before preconfig is entered. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index a4b87ae742..cb4b870f09 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -125,6 +125,7 @@ static const char *boot_order; static const char *boot_once; static const char *incoming; static const char *loadvm; +static QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; static int mem_prealloc; /* force preallocation of physical target memory = */ int display_opengl; @@ -3078,6 +3079,11 @@ static void qemu_init_board(void) create_default_memdev(current_machine, mem_path); } =20 + /* process plugin before CPUs are created, but once -smp has been pars= ed */ + if (qemu_plugin_load_list(&plugin_list)) { + exit(1); + } + machine_run_board_init(current_machine); =20 /* @@ -3212,7 +3218,6 @@ void qemu_init(int argc, char **argv, char **envp) Error *err =3D NULL; bool have_custom_ram_size; BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue= ); - QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); =20 qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); @@ -4182,11 +4187,6 @@ void qemu_init(int argc, char **argv, char **envp) machine_class->default_machine_opts, 0); } =20 - /* process plugin before CPUs are created, but once -smp has been pars= ed */ - if (qemu_plugin_load_list(&plugin_list)) { - exit(1); - } - qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, NULL); qemu_opts_foreach(qemu_find_opts("global"), --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606909614; cv=none; d=zohomail.com; s=zohoarc; b=f0Q69QDbJe4vaedD96gZAEGgfAEEO3F0i5YWX/ndtvtPNrjt79s0h7yCj30dlrJ90NxiJT79dDdV5mhzB5LT5N2jrRk4yLkX31/gjxwejMvhbX9bdtD3FBdQA/4AdGPiIXFkRPlQvcAdr9BPgqKQkhVqiHdo29GY8mWQdUtR8kM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606909614; 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=jWqme3AoyP8MgGDFY1gVUpTA5xFQw+YG5gnh7aXki9M=; b=TkFqdZKzkWHQ/M1RT9GyC3bkXvYQ/RkHXOJNTJRsfLpJd12/Bc5uupd+qK2AeZyWWhLr6dcZ8Rq3mBTvqrxBPPPcPOrDh5W4Zodeu3aV9+FpR0Gn0cubwvQi7mEBNJpXgQIft6YMwDJNdhbH3LynIgL76Sq699lE3VNSxD/2Oqo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606909613998834.0803499173608; Wed, 2 Dec 2020 03:46:53 -0800 (PST) Received: from localhost ([::1]:52154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO2J-0001Wi-Pn for importer@patchew.org; Wed, 02 Dec 2020 04:02:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND0-0003SR-V1 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCQ-0003lT-8a for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:54 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-xYhPZLdIPc6bUIZNbV-mpw-1; Wed, 02 Dec 2020 03:09:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D359D80364B for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97C2010013BD for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896556; 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: in-reply-to:in-reply-to:references:references; bh=jWqme3AoyP8MgGDFY1gVUpTA5xFQw+YG5gnh7aXki9M=; b=TbBWl/95JMVnKY+2jQPd/1d4cnFOMfvaYzTC9JB9yNg7/aEM9kZ2tqEt0YWrfTX8aVVz2g NQNz9jd57qT3W6XPbxjyiftzvK3TwH6tQl7DTBwCtVk09Hv5QyRNl899k9lmUmtg7opgAu N4JowBsR59TfXAwvXO8ublWF5DNCj1A= X-MC-Unique: xYhPZLdIPc6bUIZNbV-mpw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 064/113] vl: extract default devices to separate functions Date: Wed, 2 Dec 2020 03:08:00 -0500 Message-Id: <20201202080849.4125477-65-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 216 +++++++++++++++++++++++++++------------------------ 1 file changed, 114 insertions(+), 102 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index cb4b870f09..1a80a9a68d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -125,7 +125,9 @@ static const char *boot_order; static const char *boot_once; static const char *incoming; static const char *loadvm; +static int display_remote; static QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); +static bool nographic =3D false; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; static int mem_prealloc; /* force preallocation of physical target memory = */ int display_opengl; @@ -147,6 +149,7 @@ static int rtc_host_datetime_offset =3D -1; /* valid & = used only with RTC_BASE_DATETIME */ QEMUClockType rtc_clock; int vga_interface_type =3D VGA_NONE; +static const char *vga_model =3D NULL; static DisplayOptions dpy; static int num_serial_hds; static Chardev **serial_hds; @@ -2224,6 +2227,115 @@ static int foreach_device_config(int type, int (*fu= nc)(const char *cmdline)) return 0; } =20 +static void qemu_disable_default_devices(void) +{ + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + + qemu_opts_foreach(qemu_find_opts("device"), + default_driver_check, NULL, NULL); + qemu_opts_foreach(qemu_find_opts("global"), + default_driver_check, NULL, NULL); + + if (!vga_model && !default_vga) { + vga_interface_type =3D VGA_DEVICE; + } + if (!has_defaults || machine_class->no_serial) { + default_serial =3D 0; + } + if (!has_defaults || machine_class->no_parallel) { + default_parallel =3D 0; + } + if (!has_defaults || machine_class->no_floppy) { + default_floppy =3D 0; + } + if (!has_defaults || machine_class->no_cdrom) { + default_cdrom =3D 0; + } + if (!has_defaults || machine_class->no_sdcard) { + default_sdcard =3D 0; + } + if (!has_defaults) { + default_monitor =3D 0; + default_net =3D 0; + default_vga =3D 0; + } +} + +static void qemu_create_default_devices(void) +{ + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + + if (is_daemonized()) { + /* According to documentation and historically, -nographic redirec= ts + * serial port, parallel port and monitor to stdio, which does not= work + * with -daemonize. We can redirect these to null instead, but si= nce + * -nographic is legacy, let's just error out. + * We disallow -nographic only if all other ports are not redirect= ed + * explicitly, to not break existing legacy setups which uses + * -nographic _and_ redirects all ports explicitly - this is valid + * usage, -nographic is just a no-op in this case. + */ + if (nographic + && (default_parallel || default_serial || default_monitor)) { + error_report("-nographic cannot be used with -daemonize"); + exit(1); + } + } + + if (nographic) { + if (default_parallel) + add_device_config(DEV_PARALLEL, "null"); + if (default_serial && default_monitor) { + add_device_config(DEV_SERIAL, "mon:stdio"); + } else { + if (default_serial) + add_device_config(DEV_SERIAL, "stdio"); + if (default_monitor) + monitor_parse("stdio", "readline", false); + } + } else { + if (default_serial) + add_device_config(DEV_SERIAL, "vc:80Cx24C"); + if (default_parallel) + add_device_config(DEV_PARALLEL, "vc:80Cx24C"); + if (default_monitor) + monitor_parse("vc:80Cx24C", "readline", false); + } + + if (default_net) { + QemuOptsList *net =3D qemu_find_opts("net"); + qemu_opts_parse(net, "nic", true, &error_abort); +#ifdef CONFIG_SLIRP + qemu_opts_parse(net, "user", true, &error_abort); +#endif + } + +#if defined(CONFIG_VNC) + if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) { + display_remote++; + } +#endif + if (dpy.type =3D=3D DISPLAY_TYPE_DEFAULT && !display_remote) { + if (!qemu_display_find_default(&dpy)) { + dpy.type =3D DISPLAY_TYPE_NONE; +#if defined(CONFIG_VNC) + vnc_parse("localhost:0,to=3D99,id=3Ddefault", &error_abort); +#endif + } + } + if (dpy.type =3D=3D DISPLAY_TYPE_DEFAULT) { + dpy.type =3D DISPLAY_TYPE_NONE; + } + + /* If no default VGA is requested, the default is "none". */ + if (default_vga) { + vga_model =3D get_default_vga_model(machine_class); + } + if (vga_model) { + select_vgahw(machine_class, vga_model); + } +} + static int serial_parse(const char *devname) { int index =3D num_serial_hds; @@ -3208,10 +3320,7 @@ void qemu_init(int argc, char **argv, char **envp) int optind; const char *optarg; MachineClass *machine_class; - const char *vga_model =3D NULL; bool userconfig =3D true; - bool nographic =3D false; - int display_remote =3D 0; ram_addr_t maxram_size; uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; @@ -4187,97 +4296,8 @@ void qemu_init(int argc, char **argv, char **envp) machine_class->default_machine_opts, 0); } =20 - qemu_opts_foreach(qemu_find_opts("device"), - default_driver_check, NULL, NULL); - qemu_opts_foreach(qemu_find_opts("global"), - default_driver_check, NULL, NULL); - - if (!vga_model && !default_vga) { - vga_interface_type =3D VGA_DEVICE; - } - if (!has_defaults || machine_class->no_serial) { - default_serial =3D 0; - } - if (!has_defaults || machine_class->no_parallel) { - default_parallel =3D 0; - } - if (!has_defaults || machine_class->no_floppy) { - default_floppy =3D 0; - } - if (!has_defaults || machine_class->no_cdrom) { - default_cdrom =3D 0; - } - if (!has_defaults || machine_class->no_sdcard) { - default_sdcard =3D 0; - } - if (!has_defaults) { - default_monitor =3D 0; - default_net =3D 0; - default_vga =3D 0; - } - - if (is_daemonized()) { - /* According to documentation and historically, -nographic redirec= ts - * serial port, parallel port and monitor to stdio, which does not= work - * with -daemonize. We can redirect these to null instead, but si= nce - * -nographic is legacy, let's just error out. - * We disallow -nographic only if all other ports are not redirect= ed - * explicitly, to not break existing legacy setups which uses - * -nographic _and_ redirects all ports explicitly - this is valid - * usage, -nographic is just a no-op in this case. - */ - if (nographic - && (default_parallel || default_serial || default_monitor)) { - error_report("-nographic cannot be used with -daemonize"); - exit(1); - } - } - - if (nographic) { - if (default_parallel) - add_device_config(DEV_PARALLEL, "null"); - if (default_serial && default_monitor) { - add_device_config(DEV_SERIAL, "mon:stdio"); - } else { - if (default_serial) - add_device_config(DEV_SERIAL, "stdio"); - if (default_monitor) - monitor_parse("stdio", "readline", false); - } - } else { - if (default_serial) - add_device_config(DEV_SERIAL, "vc:80Cx24C"); - if (default_parallel) - add_device_config(DEV_PARALLEL, "vc:80Cx24C"); - if (default_monitor) - monitor_parse("vc:80Cx24C", "readline", false); - } - - if (default_net) { - QemuOptsList *net =3D qemu_find_opts("net"); - qemu_opts_parse(net, "nic", true, &error_abort); -#ifdef CONFIG_SLIRP - qemu_opts_parse(net, "user", true, &error_abort); -#endif - } - -#if defined(CONFIG_VNC) - if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) { - display_remote++; - } -#endif - if (dpy.type =3D=3D DISPLAY_TYPE_DEFAULT && !display_remote) { - if (!qemu_display_find_default(&dpy)) { - dpy.type =3D DISPLAY_TYPE_NONE; -#if defined(CONFIG_VNC) - vnc_parse("localhost:0,to=3D99,id=3Ddefault", &error_abort); -#endif - } - } - if (dpy.type =3D=3D DISPLAY_TYPE_DEFAULT) { - dpy.type =3D DISPLAY_TYPE_NONE; - } - + qemu_disable_default_devices(); + qemu_create_default_devices(); if ((alt_grab || ctrl_grab) && dpy.type !=3D DISPLAY_TYPE_SDL) { error_report("-alt-grab and -ctrl-grab are only valid " "for SDL, ignoring option"); @@ -4423,14 +4443,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_semihosting_connect_chardevs(); qemu_semihosting_console_init(); =20 - /* If no default VGA is requested, the default is "none". */ - if (default_vga) { - vga_model =3D get_default_vga_model(machine_class); - } - if (vga_model) { - select_vgahw(machine_class, vga_model); - } - /* This checkpoint is required by replay to separate prior clock reading from the other reads, because timer polling functions query clock values from the log. */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901583; cv=none; d=zohomail.com; s=zohoarc; b=j1PACsHvhIZdqn8ejBMWiyhNIL7M/9ttJnmr6326Rz+mzFWnLC2Wvgjkgy5Wmj78pXom7VmGaMgfbJvFeDasxbFoSzd0DmFLbBY+YEXA6HVIwPzCCtc+TaolQNL3ftrUdYZjzsq/6LD8WVSJug4wQcNwR5gAX0ab6ulCPlvVJak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901583; 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=bI5QmuHOd6rGXtDKNlB/F7CiIBhyGEFj5Yhm9bPi2Eg=; b=RbkVfPs9x1gnOE+3iM3HQiq9k6HLNyqRfFFI4QBkiKQjFuLkdsFst5C1SExIEqEGPPztIP6sFxr/OhjffZAtdH1f6gbl2fsslrJa78ZGnLeEmWkKFPRw2fq5VoTC9s/gC2Zp6jIWszchy0MjiNajwHjX/Gh69Ycv8YeVMXMEWMk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901583341794.8451516017806; Wed, 2 Dec 2020 01:33:03 -0800 (PST) Received: from localhost ([::1]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO63-0005RM-DI for importer@patchew.org; Wed, 02 Dec 2020 04:06:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND2-0003T6-0D for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCQ-0003lW-7B for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:55 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-553-ACG2gtFFO5e90y6GPQDayQ-1; Wed, 02 Dec 2020 03:09:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C4E91074641 for ; Wed, 2 Dec 2020 08:09:14 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 006E210013BD for ; Wed, 2 Dec 2020 08:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896556; 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: in-reply-to:in-reply-to:references:references; bh=bI5QmuHOd6rGXtDKNlB/F7CiIBhyGEFj5Yhm9bPi2Eg=; b=S4lnZrMTzurZ902G/acYUgceIDMZN8JXSP4M2VNeldcw4qa6OMQZzyXB3PMRC/C/ni5OHV cMB2UhXxxGUCHdu7SRsnpHv0+6ERHmbIUcQbWvJsTqxkHQO/IJSjOcAPCYAEO1drBsSgC0 V+BD4dtWTGzGQunb1WMb1VB59j2u7mw= X-MC-Unique: ACG2gtFFO5e90y6GPQDayQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 065/113] vl: move CHECKPOINT_INIT after preconfig Date: Wed, 2 Dec 2020 03:08:01 -0500 Message-Id: <20201202080849.4125477-66-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Move CHECKPOINT_INIT right before the machine initialization is completed. Everything before is essentially an extension of command line parsing. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 5 +++++ softmmu/vl.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 7ef3de5ce5..a5cfbcc7cb 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1107,6 +1107,11 @@ void machine_run_board_init(MachineState *machine) ObjectClass *oc =3D object_class_by_name(machine->cpu_type); CPUClass *cc; =20 + /* This checkpoint is required by replay to separate prior clock + reading from the other reads, because timer polling functions query + clock values from the log. */ + replay_checkpoint(CHECKPOINT_INIT); + if (machine->ram_memdev_id) { Object *o; o =3D object_resolve_path_type(machine->ram_memdev_id, diff --git a/softmmu/vl.c b/softmmu/vl.c index 1a80a9a68d..91ef21833b 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4443,11 +4443,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_semihosting_connect_chardevs(); qemu_semihosting_console_init(); =20 - /* This checkpoint is required by replay to separate prior clock - reading from the other reads, because timer polling functions query - clock values from the log. */ - replay_checkpoint(CHECKPOINT_INIT); - current_machine->boot_order =3D boot_order; =20 /* parse features once if machine provides default cpu_type */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898715; cv=none; d=zohomail.com; s=zohoarc; b=c03LIFQaCVocVJC153+UUZ8NVfDhnhXRsX7+5XZIxYSDvQrnInR/5Tr1xraF0ELvUGPqqzH317LLdkXdnlfz8rG94lbRVgmTI4WITtZMkasj7YjuHhMFpg5lRp9qV9ks/GUcyu62CHh8qFA7lrf/PSTDrf6NvkURov2KoZB8fuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898715; 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=rP6OUvjx4v7+K7ARm6JuYlhQiEZ8+rlZHB8RtHnnsmQ=; b=EYI2rx/uxBfa0qGlSVTIj4b9/uq/Uxc9NpSqdkQpJPS3sq+muetK9ySSIb97UkxfLYrWp4WVD19Oxwy1LXUyO7rTJ8WTbZ7I4m0NtQJn4SZ4+wWEhyMwRcNeny/9eV6SeTtn8zeYn27tM+6pc6wz8irnN3vkhjXx2c4LqjitvBQ= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898715128508.3837337729108; Wed, 2 Dec 2020 00:45:15 -0800 (PST) Received: from localhost ([::1]:58514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNl7-0005I2-GU for importer@patchew.org; Wed, 02 Dec 2020 03:45:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND7-0003VL-75 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCR-0003lm-3A for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:00 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-eeaM1bJ8PFiJX-DlmK_kHQ-1; Wed, 02 Dec 2020 03:09:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A4DE80364D for ; Wed, 2 Dec 2020 08:09:14 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D57610013BD for ; Wed, 2 Dec 2020 08:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896557; 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: in-reply-to:in-reply-to:references:references; bh=rP6OUvjx4v7+K7ARm6JuYlhQiEZ8+rlZHB8RtHnnsmQ=; b=Vsrti59wfFJn6V0xKJgPst6Trw6UOQWZ4YeXo42OA09627S0qoR4hPsPJ4LDRHEJ6sAipw mJafJp3G994vwFoCq2UWRMEJRbofeoFG+Z/73LR40Hb05+xEf4Q3UJdeGLdrvhM/Kfx/QO QH9UjCygeoZ2Fbc9cvFvxoY9rKmGiiM= X-MC-Unique: eeaM1bJ8PFiJX-DlmK_kHQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 066/113] vl: separate qemu_create_early_backends Date: Wed, 2 Dec 2020 03:08:02 -0500 Message-Id: <20201202080849.4125477-67-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" "Early" backends are created before the machine and can be used as machine options. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 123 +++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 58 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 91ef21833b..aafcbec356 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -117,6 +117,14 @@ =20 #define MAX_VIRTIO_CONSOLES 1 =20 +typedef struct BlockdevOptionsQueueEntry { + BlockdevOptions *bdo; + Location loc; + QSIMPLEQ_ENTRY(BlockdevOptionsQueueEntry) entry; +} BlockdevOptionsQueueEntry; + +typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue; + static const char *cpu_option; static const char *data_dir[16]; static int data_dir_idx; @@ -126,7 +134,9 @@ static const char *boot_once; static const char *incoming; static const char *loadvm; static int display_remote; +static int snapshot; static QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); +static BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_qu= eue); static bool nographic =3D false; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; static int mem_prealloc; /* force preallocation of physical target memory = */ @@ -1043,14 +1053,6 @@ static void default_drive(int enable, int snapshot, = BlockInterfaceType type, =20 } =20 -typedef struct BlockdevOptionsQueueEntry { - BlockdevOptions *bdo; - Location loc; - QSIMPLEQ_ENTRY(BlockdevOptionsQueueEntry) entry; -} BlockdevOptionsQueueEntry; - -typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue; - static void configure_blockdev(BlockdevOptionsQueue *bdo_queue, MachineClass *machine_class, int snapshot) { @@ -2644,7 +2646,7 @@ static int machine_set_property(void *opaque, * cannot be created here, as it depends on the chardev * already existing. */ -static bool object_create_initial(const char *type, QemuOpts *opts) +static bool object_create_early(const char *type, QemuOpts *opts) { if (user_creatable_print_help(type, opts)) { exit(0); @@ -2700,6 +2702,58 @@ static bool object_create_initial(const char *type, = QemuOpts *opts) return true; } =20 +static void qemu_create_early_backends(void) +{ + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + + if ((alt_grab || ctrl_grab) && dpy.type !=3D DISPLAY_TYPE_SDL) { + error_report("-alt-grab and -ctrl-grab are only valid " + "for SDL, ignoring option"); + } + if (dpy.has_window_close && + (dpy.type !=3D DISPLAY_TYPE_GTK && dpy.type !=3D DISPLAY_TYPE_SDL)= ) { + error_report("-no-quit is only valid for GTK and SDL, " + "ignoring option"); + } + + qemu_display_early_init(&dpy); + qemu_console_early_init(); + + if (dpy.has_gl && dpy.gl !=3D DISPLAYGL_MODE_OFF && display_opengl =3D= =3D 0) { +#if defined(CONFIG_OPENGL) + error_report("OpenGL is not supported by the display"); +#else + error_report("OpenGL support is disabled"); +#endif + exit(1); + } + + qemu_opts_foreach(qemu_find_opts("object"), + user_creatable_add_opts_foreach, + object_create_early, &error_fatal); + + /* spice needs the timers to be initialized by this point */ + /* spice must initialize before audio as it changes the default auiode= v */ + /* spice must initialize before chardevs (for spicevmc and spiceport) = */ + qemu_spice.init(); + + qemu_opts_foreach(qemu_find_opts("chardev"), + chardev_init_func, NULL, &error_fatal); + +#ifdef CONFIG_VIRTFS + qemu_opts_foreach(qemu_find_opts("fsdev"), + fsdev_init_func, NULL, &error_fatal); +#endif + + /* + * Note: we need to create audio and block backends before + * machine_set_property(), so machine properties can refer to + * them. + */ + configure_blockdev(&bdo_queue, machine_class, snapshot); + audio_init_audiodevs(); +} + =20 /* * The remainder of object creation happens after the @@ -2707,7 +2761,7 @@ static bool object_create_initial(const char *type, Q= emuOpts *opts) */ static bool object_create_delayed(const char *type, QemuOpts *opts) { - return !object_create_initial(type, opts); + return !object_create_early(type, opts); } =20 =20 @@ -3313,7 +3367,6 @@ static void qemu_machine_creation_done(void) =20 void qemu_init(int argc, char **argv, char **envp) { - int snapshot =3D 0; QemuOpts *opts, *machine_opts; QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL; QemuOptsList *olist; @@ -3326,7 +3379,6 @@ void qemu_init(int argc, char **argv, char **envp) FILE *vmstate_dump_file =3D NULL; Error *err =3D NULL; bool have_custom_ram_size; - BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue= ); =20 qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); @@ -4298,52 +4350,7 @@ void qemu_init(int argc, char **argv, char **envp) =20 qemu_disable_default_devices(); qemu_create_default_devices(); - if ((alt_grab || ctrl_grab) && dpy.type !=3D DISPLAY_TYPE_SDL) { - error_report("-alt-grab and -ctrl-grab are only valid " - "for SDL, ignoring option"); - } - if (dpy.has_window_close && - (dpy.type !=3D DISPLAY_TYPE_GTK && dpy.type !=3D DISPLAY_TYPE_SDL)= ) { - error_report("-no-quit is only valid for GTK and SDL, " - "ignoring option"); - } - - qemu_display_early_init(&dpy); - qemu_console_early_init(); - - if (dpy.has_gl && dpy.gl !=3D DISPLAYGL_MODE_OFF && display_opengl =3D= =3D 0) { -#if defined(CONFIG_OPENGL) - error_report("OpenGL is not supported by the display"); -#else - error_report("OpenGL support is disabled"); -#endif - exit(1); - } - - qemu_opts_foreach(qemu_find_opts("object"), - user_creatable_add_opts_foreach, - object_create_initial, &error_fatal); - - /* spice needs the timers to be initialized by this point */ - /* spice must initialize before audio as it changes the default auiode= v */ - /* spice must initialize before chardevs (for spicevmc and spiceport) = */ - qemu_spice.init(); - - qemu_opts_foreach(qemu_find_opts("chardev"), - chardev_init_func, NULL, &error_fatal); - -#ifdef CONFIG_VIRTFS - qemu_opts_foreach(qemu_find_opts("fsdev"), - fsdev_init_func, NULL, &error_fatal); -#endif - - /* - * Note: we need to create audio and block backends before - * machine_set_property(), so machine properties can refer to - * them. - */ - configure_blockdev(&bdo_queue, machine_class, snapshot); - audio_init_audiodevs(); + qemu_create_early_backends(); =20 machine_opts =3D qemu_get_machine_opts(); qemu_opt_foreach(machine_opts, machine_set_property, current_machine, --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899654; cv=none; d=zohomail.com; s=zohoarc; b=WhO58IonYJP86AxF1ITfycSHkohDFc+bTQRxmSCtIlwaQ/QXFszt5oAsmo1vb8+BVnODegTYNHS02Ij4ASOHmWTIIoAmR9RaicROGNiNYAslUcNDs7mFoI3YyiJ4f2ufuFXDee/dpGQk741wOmO0rsuX6c8qMuCqohw4cUTx0ys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899654; 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=I/Zz9ixS9AU27fXqk7P4iB9oaNHfWk0Up7i6tGttSOc=; b=EVkkH9OPNc1RdMVK1vmUqjIqZx9zEX2lCFY6+yf1eaue3CTTFcrso9/Atze8GQMhkZ9ulLJro3vVMDc3hK7x+6fLLE7gs0EYl6AvYQ5LGHn9WianN8bnd+WAIonlf//FyLpl1UbPYcFVCLcO9bplXsbaqRLGT87gvYA/ru7Zrmo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899654208818.5781834447124; Wed, 2 Dec 2020 01:00:54 -0800 (PST) Received: from localhost ([::1]:44846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO0H-0006bj-F3 for importer@patchew.org; Wed, 02 Dec 2020 04:00:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND1-0003T3-NO for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCQ-0003lk-Sc for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:55 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-AVHI8vb7M7-mnmbX8hTPgw-1; Wed, 02 Dec 2020 03:09:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 036755708B for ; Wed, 2 Dec 2020 08:09:15 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB42B10013BD for ; Wed, 2 Dec 2020 08:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896557; 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: in-reply-to:in-reply-to:references:references; bh=I/Zz9ixS9AU27fXqk7P4iB9oaNHfWk0Up7i6tGttSOc=; b=g67dVZ/tL7/kqWenhm9GoBAd3MTUUIAiUCIUXVXkSgEsCGBUV2xV4g9kM+SXJN1mnDUiMt 0ptDp36124FudBjq2DSv3aEQkMshf4W6O5ZFKzTc7Qd2d6wcojC9QeL17nSfOBnMF1hVf8 OQo/4WhhCUad7yiKgaKvrZn0+enSt7g= X-MC-Unique: AVHI8vb7M7-mnmbX8hTPgw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 067/113] vl: separate qemu_create_late_backends Date: Wed, 2 Dec 2020 03:08:03 -0500 Message-Id: <20201202080849.4125477-68-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" "Late" backends are created after the machine. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 64 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index aafcbec356..d9fe9f63c0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2759,11 +2759,41 @@ static void qemu_create_early_backends(void) * The remainder of object creation happens after the * creation of chardev, fsdev, net clients and device data types. */ -static bool object_create_delayed(const char *type, QemuOpts *opts) +static bool object_create_late(const char *type, QemuOpts *opts) { return !object_create_early(type, opts); } =20 +static void qemu_create_late_backends(void) +{ + if (qtest_chrdev) { + qtest_server_init(qtest_chrdev, qtest_log, &error_fatal); + } + + net_init_clients(&error_fatal); + + qemu_opts_foreach(qemu_find_opts("object"), + user_creatable_add_opts_foreach, + object_create_late, &error_fatal); + + if (tpm_init() < 0) { + exit(1); + } + + qemu_opts_foreach(qemu_find_opts("mon"), + mon_init_func, NULL, &error_fatal); + + if (foreach_device_config(DEV_SERIAL, serial_parse) < 0) + exit(1); + if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0) + exit(1); + if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0) + exit(1); + + /* now chardevs have been created we may have semihosting to connect */ + qemu_semihosting_connect_chardevs(); + qemu_semihosting_console_init(); +} =20 static bool set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_siz= e, MachineClass *mc) @@ -3377,7 +3407,6 @@ void qemu_init(int argc, char **argv, char **envp) ram_addr_t maxram_size; uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; - Error *err =3D NULL; bool have_custom_ram_size; =20 qemu_add_opts(&qemu_drive_opts); @@ -4392,10 +4421,6 @@ void qemu_init(int argc, char **argv, char **envp) */ migration_object_init(); =20 - if (qtest_chrdev) { - qtest_server_init(qtest_chrdev, qtest_log, &error_fatal); - } - opts =3D qemu_opts_find(qemu_find_opts("boot-opts"), NULL); if (opts) { boot_order =3D qemu_opt_get(opts, "order"); @@ -4423,32 +4448,7 @@ void qemu_init(int argc, char **argv, char **envp) semihosting_arg_fallback(kernel_filename, kernel_cmdline); } =20 - if (net_init_clients(&err) < 0) { - error_report_err(err); - exit(1); - } - - qemu_opts_foreach(qemu_find_opts("object"), - user_creatable_add_opts_foreach, - object_create_delayed, &error_fatal); - - if (tpm_init() < 0) { - exit(1); - } - - qemu_opts_foreach(qemu_find_opts("mon"), - mon_init_func, NULL, &error_fatal); - - if (foreach_device_config(DEV_SERIAL, serial_parse) < 0) - exit(1); - if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0) - exit(1); - if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0) - exit(1); - - /* now chardevs have been created we may have semihosting to connect */ - qemu_semihosting_connect_chardevs(); - qemu_semihosting_console_init(); + qemu_create_late_backends(); =20 current_machine->boot_order =3D boot_order; =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606908857; cv=none; d=zohomail.com; s=zohoarc; b=cu1iAqggqVLMdYA4FNwxsQPi1bzw+NnT58BG7PvrDHXYOGEwcLM0eGkMf5VpjGcSvXDZ8k9mKFKfI1cnxLMUl6oZu/F6LIerZo3nhAqNOsp3PnD9RZ/tEcdgDA2tj2iThOMe4lOb30qXLaBrqBC/klS5vftCZ9t9aaoBnPHJ4to= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606908857; 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=Ut9JtSPhb4amh7jnT2ADdCw3oqkoNlY0wz3NwDnvJ74=; b=fZbwHhBIdeGmb1HFtBaK+LTxjZ+qhR1j1hVy5/33MaL2Tn16LAoUrOtbppj0JoVNzcIt5WcHrv5B42ujYwofoMoJqzcxkq/Oaq5JGuZnEc4DbcLdS6VPP9+IgpHIULdOGeNDVwQ1imhe8A46B5vbPDq7lu6/N/6dcgdiHcG/zG4= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606908857528362.5212415707639; Wed, 2 Dec 2020 03:34:17 -0800 (PST) Received: from localhost ([::1]:33084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO6C-0005oA-5P for importer@patchew.org; Wed, 02 Dec 2020 04:06:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND9-0003Wi-48 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCR-0003ls-3T for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:02 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-73-YJ1J7-C8OpelXsVqoeyqZA-1; Wed, 02 Dec 2020 03:09:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60C0E1074642 for ; Wed, 2 Dec 2020 08:09:15 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 248DD10013BD for ; Wed, 2 Dec 2020 08:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896558; 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: in-reply-to:in-reply-to:references:references; bh=Ut9JtSPhb4amh7jnT2ADdCw3oqkoNlY0wz3NwDnvJ74=; b=hWu49TGVMs/U04okGp/ZlyGZgEAszOESyi4HKE2mLw4FGDlA9DHMkSCm+wQm/Z+XiJkLi9 AHQD80vUfer2WOoZdvuFGHYUYDg27b4lAjgCoOxcMSDTNNt4QYx3iidD6gASpF37DFQkPo FIH/k7wyABfkfHe/Mzr50dB1g6CCih8= X-MC-Unique: YJ1J7-C8OpelXsVqoeyqZA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 068/113] vl: separate qemu_create_machine Date: Wed, 2 Dec 2020 03:08:04 -0500 Message-Id: <20201202080849.4125477-69-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 113 +++++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index d9fe9f63c0..5af52454ee 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -133,6 +133,8 @@ static const char *boot_order; static const char *boot_once; static const char *incoming; static const char *loadvm; +static ram_addr_t maxram_size; +static uint64_t ram_slots; static int display_remote; static int snapshot; static QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); @@ -2795,8 +2797,13 @@ static void qemu_create_late_backends(void) qemu_semihosting_console_init(); } =20 -static bool set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_siz= e, - MachineClass *mc) +static bool have_custom_ram_size(void) +{ + QemuOpts *opts =3D qemu_find_opts_singleton("memory"); + return !!qemu_opt_get_size(opts, "size", 0); +} + +static void set_memory_options(MachineClass *mc) { uint64_t sz; const char *mem_str; @@ -2846,7 +2853,7 @@ static bool set_memory_options(uint64_t *ram_slots, r= am_addr_t *maxram_size, =20 /* store value for the future use */ qemu_opt_set_number(opts, "size", ram_size, &error_abort); - *maxram_size =3D ram_size; + maxram_size =3D ram_size; =20 if (qemu_opt_get(opts, "maxmem")) { uint64_t slots; @@ -2867,15 +2874,59 @@ static bool set_memory_options(uint64_t *ram_slots,= ram_addr_t *maxram_size, exit(EXIT_FAILURE); } =20 - *maxram_size =3D sz; - *ram_slots =3D slots; + maxram_size =3D sz; + ram_slots =3D slots; } else if (qemu_opt_get(opts, "slots")) { error_report("invalid -m option value: missing 'maxmem' option"); exit(EXIT_FAILURE); } =20 loc_pop(&loc); - return !!mem_str; +} + +static void qemu_create_machine(MachineClass *machine_class) +{ + object_set_machine_compat_props(machine_class->compat_props); + + set_memory_options(machine_class); + + current_machine =3D MACHINE(object_new_with_class(OBJECT_CLASS(machine= _class))); + if (machine_help_func(qemu_get_machine_opts(), current_machine)) { + exit(0); + } + object_property_add_child(object_get_root(), "machine", + OBJECT(current_machine)); + object_property_add_child(container_get(OBJECT(current_machine), + "/unattached"), + "sysbus", OBJECT(sysbus_get_default())); + + if (machine_class->minimum_page_bits) { + if (!set_preferred_target_page_bits(machine_class->minimum_page_bi= ts)) { + /* This would be a board error: specifying a minimum smaller t= han + * a target's compile-time fixed setting. + */ + g_assert_not_reached(); + } + } + + cpu_exec_init_all(); + page_size_init(); + + if (machine_class->hw_version) { + qemu_set_hw_version(machine_class->hw_version); + } + + machine_smp_parse(current_machine, + qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); + + /* + * Get the default machine options from the machine if it is not alrea= dy + * specified either by the configuration file or by the command line. + */ + if (machine_class->default_machine_opts) { + qemu_opts_set_defaults(qemu_find_opts("machine"), + machine_class->default_machine_opts, 0); + } } =20 static int global_init_func(void *opaque, QemuOpts *opts, Error **errp) @@ -3404,10 +3455,7 @@ void qemu_init(int argc, char **argv, char **envp) const char *optarg; MachineClass *machine_class; bool userconfig =3D true; - ram_addr_t maxram_size; - uint64_t ram_slots =3D 0; FILE *vmstate_dump_file =3D NULL; - bool have_custom_ram_size; =20 qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); @@ -4333,49 +4381,7 @@ void qemu_init(int argc, char **argv, char **envp) =20 configure_rtc(qemu_find_opts_singleton("rtc")); =20 - machine_class =3D select_machine(); - object_set_machine_compat_props(machine_class->compat_props); - - have_custom_ram_size =3D set_memory_options(&ram_slots, &maxram_size, - machine_class); - - current_machine =3D MACHINE(object_new_with_class(OBJECT_CLASS(machine= _class))); - if (machine_help_func(qemu_get_machine_opts(), current_machine)) { - exit(0); - } - object_property_add_child(object_get_root(), "machine", - OBJECT(current_machine)); - object_property_add_child(container_get(OBJECT(current_machine), - "/unattached"), - "sysbus", OBJECT(sysbus_get_default())); - - if (machine_class->minimum_page_bits) { - if (!set_preferred_target_page_bits(machine_class->minimum_page_bi= ts)) { - /* This would be a board error: specifying a minimum smaller t= han - * a target's compile-time fixed setting. - */ - g_assert_not_reached(); - } - } - - cpu_exec_init_all(); - page_size_init(); - - if (machine_class->hw_version) { - qemu_set_hw_version(machine_class->hw_version); - } - - machine_smp_parse(current_machine, - qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); - - /* - * Get the default machine options from the machine if it is not alrea= dy - * specified either by the configuration file or by the command line. - */ - if (machine_class->default_machine_opts) { - qemu_opts_set_defaults(qemu_find_opts("machine"), - machine_class->default_machine_opts, 0); - } + qemu_create_machine(select_machine()); =20 qemu_disable_default_devices(); qemu_create_default_devices(); @@ -4410,6 +4416,7 @@ void qemu_init(int argc, char **argv, char **envp) * called from configure_accelerator(). */ =20 + machine_class =3D MACHINE_GET_CLASS(current_machine); if (!qtest_enabled() && machine_class->deprecation_reason) { error_report("Machine type '%s' is deprecated: %s", machine_class->name, machine_class->deprecation_reaso= n); @@ -4470,7 +4477,7 @@ void qemu_init(int argc, char **argv, char **envp) exit(EXIT_FAILURE); } backend_size =3D object_property_get_uint(backend, "size", &error= _abort); - if (have_custom_ram_size && backend_size !=3D ram_size) { + if (have_custom_ram_size() && backend_size !=3D ram_size) { error_report("Size specified by -m option must match size = of " "explicitly specified 'memory-backend' proper= ty"); exit(EXIT_FAILURE); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901758; cv=none; d=zohomail.com; s=zohoarc; b=ThHG03g7GKbaWctU325uLQT/HHLY/ajnSBzzvcekdc3SM93dPxgWp7g0GakWsS839ttRigmA5AaF71p3DN+cSfNTWPE8ROO/g4qS+HxvZiJzob8MAulxw657IRX5yxEyC1P66J81NgtCOK6MV0dGZkRGMBvZcJEp6OUXEhz/Bnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901758; 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=Y9qS1cxkyeyi3EauORRpX5WKTwXo+zi0c2sRfQek578=; b=kLCOTxlWNywSYjYYCAxsfxUwzsVZE/BZlm5EJ+41H/IQkVHgS0SKZcCJLJzS/wuCYnjaWQXM5x/fwTBdi4r0zi9qjmEq3rHjJfQYQr9bHkEHYa6uf6QvaRLK0u9LMC6AjGt71akKg4oIelSufN5eTjU+ZqLarPDjf1KZykRoUoY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901758478365.71658509166764; Wed, 2 Dec 2020 01:35:58 -0800 (PST) Received: from localhost ([::1]:41006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO88-0000wM-A3 for importer@patchew.org; Wed, 02 Dec 2020 04:08:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND3-0003TC-KG for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCR-0003ly-49 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-4lm-MdBmMpGGxWGPdarYWw-1; Wed, 02 Dec 2020 03:09:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0A261006C83 for ; Wed, 2 Dec 2020 08:09:15 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 811F810016F6 for ; Wed, 2 Dec 2020 08:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896558; 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: in-reply-to:in-reply-to:references:references; bh=Y9qS1cxkyeyi3EauORRpX5WKTwXo+zi0c2sRfQek578=; b=XK6WPGB4xXwcNho426le5AHNDUdl4AFHa5t6IPQWeRhnEbpBPm6AHyL5B4rg5iwgJtgeqq z0hCdt9jwuInkQfVsRklN6vWm5csbl/NdeXGiRxv9OYB0OK9/xawJYJPz1mag0hhj2dWBR sX7PDvDJniu554hbGJVmqHsl6rg8fsw= X-MC-Unique: 4lm-MdBmMpGGxWGPdarYWw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 069/113] vl: separate qemu_apply_machine_options Date: Wed, 2 Dec 2020 03:08:05 -0500 Message-Id: <20201202080849.4125477-70-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 81 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 5af52454ee..acf09b2040 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2704,6 +2704,49 @@ static bool object_create_early(const char *type, Qe= muOpts *opts) return true; } =20 +static void qemu_apply_machine_options(void) +{ + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + QemuOpts *machine_opts =3D qemu_get_machine_opts(); + QemuOpts *opts; + + qemu_opt_foreach(machine_opts, machine_set_property, current_machine, + &error_fatal); + current_machine->ram_size =3D ram_size; + current_machine->maxram_size =3D maxram_size; + current_machine->ram_slots =3D ram_slots; + + opts =3D qemu_opts_find(qemu_find_opts("boot-opts"), NULL); + if (opts) { + boot_order =3D qemu_opt_get(opts, "order"); + if (boot_order) { + validate_bootdevices(boot_order, &error_fatal); + } + + boot_once =3D qemu_opt_get(opts, "once"); + if (boot_once) { + validate_bootdevices(boot_once, &error_fatal); + } + + boot_menu =3D qemu_opt_get_bool(opts, "menu", boot_menu); + boot_strict =3D qemu_opt_get_bool(opts, "strict", false); + } + + if (!boot_order) { + boot_order =3D machine_class->default_boot_order; + } + + current_machine->boot_order =3D boot_order; + + if (semihosting_enabled() && !semihosting_get_argc()) { + const char *kernel_filename =3D qemu_opt_get(machine_opts, "kernel= "); + const char *kernel_cmdline =3D qemu_opt_get(machine_opts, "append"= ) ?: ""; + /* fall back to the -kernel/-append */ + semihosting_arg_fallback(kernel_filename, kernel_cmdline); + } + +} + static void qemu_create_early_backends(void) { MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); @@ -3448,7 +3491,7 @@ static void qemu_machine_creation_done(void) =20 void qemu_init(int argc, char **argv, char **envp) { - QemuOpts *opts, *machine_opts; + QemuOpts *opts; QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL; QemuOptsList *olist; int optind; @@ -4387,12 +4430,7 @@ void qemu_init(int argc, char **argv, char **envp) qemu_create_default_devices(); qemu_create_early_backends(); =20 - machine_opts =3D qemu_get_machine_opts(); - qemu_opt_foreach(machine_opts, machine_set_property, current_machine, - &error_fatal); - current_machine->ram_size =3D ram_size; - current_machine->maxram_size =3D maxram_size; - current_machine->ram_slots =3D ram_slots; + qemu_apply_machine_options(); =20 /* * Note: uses machine properties such as kernel-irqchip, must run @@ -4428,37 +4466,8 @@ void qemu_init(int argc, char **argv, char **envp) */ migration_object_init(); =20 - opts =3D qemu_opts_find(qemu_find_opts("boot-opts"), NULL); - if (opts) { - boot_order =3D qemu_opt_get(opts, "order"); - if (boot_order) { - validate_bootdevices(boot_order, &error_fatal); - } - - boot_once =3D qemu_opt_get(opts, "once"); - if (boot_once) { - validate_bootdevices(boot_once, &error_fatal); - } - - boot_menu =3D qemu_opt_get_bool(opts, "menu", boot_menu); - boot_strict =3D qemu_opt_get_bool(opts, "strict", false); - } - - if (!boot_order) { - boot_order =3D machine_class->default_boot_order; - } - - if (semihosting_enabled() && !semihosting_get_argc()) { - const char *kernel_filename =3D qemu_opt_get(machine_opts, "kernel= "); - const char *kernel_cmdline =3D qemu_opt_get(machine_opts, "append"= ); - /* fall back to the -kernel/-append */ - semihosting_arg_fallback(kernel_filename, kernel_cmdline); - } - qemu_create_late_backends(); =20 - current_machine->boot_order =3D boot_order; - /* parse features once if machine provides default cpu_type */ current_machine->cpu_type =3D machine_class->default_cpu_type; if (cpu_option) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898400; cv=none; d=zohomail.com; s=zohoarc; b=lo/HayJsIsYCtEwWn6DQDYpbsw2sLhR0znlht+efY1Aam6Ytio81qnJZo+RbBKPDbiPAFHNsybfnguUh026dzYkuAntgyXVHXfvhea2DASkp2XZwWsRQi1Hu5gPET6060Ae35qEFnpBorUa0oB7A0u2trjyv3Gt7tm9d3hhq+vY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898400; 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=/U8oPdfNwSP9F+WJEMspClr+vbZKWauTKvY6dhCzbvU=; b=M3KbnKQLaLRJVigxzomAZhj37Gm4rUkiIw061ZlY/Rj628MsVo8VqY51FLq/IWWhYAffjhEQemJPF5cFh8KplzOShtDsDN+50EZyqw7ddROisEb5f46D35/vr6VBPVpccdXoAy21QLKtgQiqeF+cOhNJqJrtkbqvDqvXhFoBeqg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898400818614.4603453164561; Wed, 2 Dec 2020 00:40:00 -0800 (PST) Received: from localhost ([::1]:41504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNg7-0006ah-Iu for importer@patchew.org; Wed, 02 Dec 2020 03:39:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND6-0003UP-24 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCS-0003m9-RG for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:59 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-opxokyuuNzqr0Eq79adJrQ-1; Wed, 02 Dec 2020 03:09:17 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72A721074641 for ; Wed, 2 Dec 2020 08:09:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FBAA5D9C6 for ; Wed, 2 Dec 2020 08:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896559; 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: in-reply-to:in-reply-to:references:references; bh=/U8oPdfNwSP9F+WJEMspClr+vbZKWauTKvY6dhCzbvU=; b=IDf4UI/1IFDFP+Rj2DswJiu4gh+aItpzfVZm+Jt1/X14WFNYDWroIBxZkS391bh0YNSO+X +pRTzHtKlUp2cvFcZz7RDS9ETAqrPIpcg97vVJEyQX5rc3zTW6ZOlo0xsLkK0ylKFSwhsZ t3qZwhgF/Zu7hCOkPMGIRLQrciDJgYs= X-MC-Unique: opxokyuuNzqr0Eq79adJrQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 070/113] vl: separate qemu_resolve_machine_memdev Date: Wed, 2 Dec 2020 03:08:06 -0500 Message-Id: <20201202080849.4125477-71-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is a bit nasty: the machine is storing a string and later resolving it. We probably want to remove the memdev property and instead make this a memory-set command. "-M memdev" can be handled a legacy option that is special cased by machine_set_property. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 70 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index acf09b2040..891f959572 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2846,6 +2846,42 @@ static bool have_custom_ram_size(void) return !!qemu_opt_get_size(opts, "size", 0); } =20 +static void qemu_resolve_machine_memdev(void) +{ + if (current_machine->ram_memdev_id) { + Object *backend; + ram_addr_t backend_size; + + backend =3D object_resolve_path_type(current_machine->ram_memdev_i= d, + TYPE_MEMORY_BACKEND, NULL); + if (!backend) { + error_report("Memory backend '%s' not found", + current_machine->ram_memdev_id); + exit(EXIT_FAILURE); + } + backend_size =3D object_property_get_uint(backend, "size", &error= _abort); + if (have_custom_ram_size() && backend_size !=3D ram_size) { + error_report("Size specified by -m option must match size = of " + "explicitly specified 'memory-backend' proper= ty"); + exit(EXIT_FAILURE); + } + if (mem_path) { + error_report("'-mem-path' can't be used together with" + "'-machine memory-backend'"); + exit(EXIT_FAILURE); + } + ram_size =3D backend_size; + } + + if (!xen_enabled()) { + /* On 32-bit hosts, QEMU is limited by virtual address space */ + if (ram_size > (2047 << 20) && HOST_LONG_BITS =3D=3D 32) { + error_report("at most 2047 MB RAM can be simulated"); + exit(1); + } + } +} + static void set_memory_options(MachineClass *mc) { uint64_t sz; @@ -4474,39 +4510,7 @@ void qemu_init(int argc, char **argv, char **envp) current_machine->cpu_type =3D parse_cpu_option(cpu_option); } =20 - if (current_machine->ram_memdev_id) { - Object *backend; - ram_addr_t backend_size; - - backend =3D object_resolve_path_type(current_machine->ram_memdev_i= d, - TYPE_MEMORY_BACKEND, NULL); - if (!backend) { - error_report("Memory backend '%s' not found", - current_machine->ram_memdev_id); - exit(EXIT_FAILURE); - } - backend_size =3D object_property_get_uint(backend, "size", &error= _abort); - if (have_custom_ram_size() && backend_size !=3D ram_size) { - error_report("Size specified by -m option must match size = of " - "explicitly specified 'memory-backend' proper= ty"); - exit(EXIT_FAILURE); - } - if (mem_path) { - error_report("'-mem-path' can't be used together with" - "'-machine memory-backend'"); - exit(EXIT_FAILURE); - } - ram_size =3D backend_size; - } - - if (!xen_enabled()) { - /* On 32-bit hosts, QEMU is limited by virtual address space */ - if (ram_size > (2047 << 20) && HOST_LONG_BITS =3D=3D 32) { - error_report("at most 2047 MB RAM can be simulated"); - exit(1); - } - } - + qemu_resolve_machine_memdev(); parse_numa_opts(current_machine); =20 /* do monitor/qmp handling at preconfig state if requested */ --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901105; cv=none; d=zohomail.com; s=zohoarc; b=RcTXpjZO3S3Xeq6mKZRQgpvhRtcq/V/+3DboxBhjPfdOd6C1NU5YdYl5/U02oSeeL5kyumBath3/KvyXdMNoemg8jsUZw7GB3pXVwGvs7GY7FJacclrxKGTQ3M9VevO7ao/0+9/BDqrfAXENhJNjnI+ihQHXcvNV48dlCWChqSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901105; 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=lPtkCMrw59X+r/5tChbjmh1zpKFLCVCtXqdsXYufkW0=; b=Qq2mgToNse97T5ZW+zTeYGGnmet2RbC4HjdGjV4eOuMN+Y6WdfuQv/lWzoHVyhrAYJ58LYcqu8lXS8OPBu51c9T2trnP/cP0rTu4EyB2NFvSwlDlmkcUFAtMFAlZJvBEnf+h7/aWVC++hqKNXCQrBoltSmEhi/ZL8+m9GKGk6HA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901105854594.5646424073278; Wed, 2 Dec 2020 01:25:05 -0800 (PST) Received: from localhost ([::1]:53018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO2s-0001tD-Fw for importer@patchew.org; Wed, 02 Dec 2020 04:03:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND4-0003TI-OA for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCS-0003mK-Py for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:58 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-i8HHR9ocO5e-dru7F2rfBA-1; Wed, 02 Dec 2020 03:09:17 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C28068558EF for ; Wed, 2 Dec 2020 08:09:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EBBC5D9C6 for ; Wed, 2 Dec 2020 08:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896559; 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: in-reply-to:in-reply-to:references:references; bh=lPtkCMrw59X+r/5tChbjmh1zpKFLCVCtXqdsXYufkW0=; b=ReJrb3KgCFKF2B9PKVwVsZEkjwohgYJGcvW3LRYtMHjA93kKCT4M9BZq1z6GKiSRLEsPr+ PxE0siMSkxa+AFC8oX690ZIOEFChZotjyy3s6qICAQIz7ZqpoCigXdrkTTfvQB1Gx5zsjX uL3Q4tJmSnqAxQ+UTum1qeBju03NowU= X-MC-Unique: i8HHR9ocO5e-dru7F2rfBA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 071/113] vl: initialize displays before preconfig loop Date: Wed, 2 Dec 2020 03:08:07 -0500 Message-Id: <20201202080849.4125477-72-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Displays should be available before the monitor starts, so that it is possible to use the graphical console to interact with the monitor itself. This patch is quite ugly, but all this is temporary. The double call to qemu_init_displays will go away as soon we can unify machine initialization between the preconfig and "normal" flows, and so will the preconfig_exit_requested variable (that is only preconfig_requested remains). Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 57 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 891f959572..6a2972938d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -137,6 +137,7 @@ static ram_addr_t maxram_size; static uint64_t ram_slots; static int display_remote; static int snapshot; +static bool preconfig_requested; static QemuPluginList plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin_list); static BlockdevOptionsQueue bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_qu= eue); static bool nographic =3D false; @@ -3223,12 +3224,12 @@ static void qemu_validate_options(void) } } =20 - if (loadvm && !preconfig_exit_requested) { + if (loadvm && preconfig_requested) { error_report("'preconfig' and 'loadvm' options are " "mutually exclusive"); exit(EXIT_FAILURE); } - if (incoming && !preconfig_exit_requested) { + if (incoming && preconfig_requested) { error_report("'preconfig' and 'incoming' options are " "mutually exclusive"); exit(EXIT_FAILURE); @@ -3392,6 +3393,28 @@ static void qemu_init_subsystems(void) socket_init(); } =20 +static void qemu_init_displays(void) +{ + DisplayState *ds; + + /* init local displays */ + ds =3D init_displaystate(); + qemu_display_init(ds, &dpy); + + /* must be after terminal init, SDL library changes signal handlers */ + os_setup_signal_handling(); + + /* init remote displays */ +#ifdef CONFIG_VNC + qemu_opts_foreach(qemu_find_opts("vnc"), + vnc_init_func, NULL, &error_fatal); +#endif + + if (using_spice) { + qemu_spice.display_init(); + } +} + /* * Called after leaving preconfig state. From here on runstate is * RUN_STATE_PRELAUNCH or RUN_STATE_INMIGRATE. @@ -3450,8 +3473,6 @@ static void qemu_create_cli_devices(void) =20 static void qemu_machine_creation_done(void) { - DisplayState *ds; - cpu_synchronize_all_post_init(); =20 /* Did we create any drives that we failed to create a device for? */ @@ -3474,23 +3495,6 @@ static void qemu_machine_creation_done(void) qemu_register_reset(restore_boot_order, g_strdup(boot_order)); } =20 - /* init local displays */ - ds =3D init_displaystate(); - qemu_display_init(ds, &dpy); - - /* must be after terminal init, SDL library changes signal handlers */ - os_setup_signal_handling(); - - /* init remote displays */ -#ifdef CONFIG_VNC - qemu_opts_foreach(qemu_find_opts("vnc"), - vnc_init_func, NULL, &error_fatal); -#endif - - if (using_spice) { - qemu_spice.display_init(); - } - if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { exit(1); } @@ -4090,6 +4094,7 @@ void qemu_init(int argc, char **argv, char **envp) break; case QEMU_OPTION_preconfig: preconfig_exit_requested =3D false; + preconfig_requested =3D true; break; case QEMU_OPTION_enable_kvm: olist =3D qemu_find_opts("machine"); @@ -4513,11 +4518,21 @@ void qemu_init(int argc, char **argv, char **envp) qemu_resolve_machine_memdev(); parse_numa_opts(current_machine); =20 + if (preconfig_requested) { + qemu_init_displays(); + } + /* do monitor/qmp handling at preconfig state if requested */ qemu_main_loop(); =20 qemu_init_board(); + qemu_create_cli_devices(); + + /* initialize displays after all errors have been reported */ + if (!preconfig_requested) { + qemu_init_displays(); + } qemu_machine_creation_done(); =20 if (loadvm) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898571; cv=none; d=zohomail.com; s=zohoarc; b=V+3OZkEy6xsPw25aKv5B8UshWe4j+QOzfLYBtpuHzsmXYirognbNetQi9MzG6BeTFuXqPmy7MI1Dn5wGGCo3/IVNg60w13hyUCq3y3aTwz90EprvnAuKosVBQWkRCUDR3/+NVwbdwKGRwk+rklMN0dDaZ4kw2Cb6wm71HTEpx9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898571; 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=XaopSvQFOQg8qNe7dPekPUCjQOLZMQSxkW2ChW6RDSI=; b=SaoUuhYLV8Ks+WGWNAB5uEtLBa6lYavzzpgavzpvY7yWxO0I2bD4P5XCAy2+QNMWiXUtuso4h311gNC4Mb7u7BIY5Md2eSNo63ov3APpwmGl8A4oXhGNzlrqS30E7EHH24gDTWM0PG8zvmZLfu1sjwBS0rDa8ehue2sTuKervjE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898571137657.4166272275883; Wed, 2 Dec 2020 00:42:51 -0800 (PST) Received: from localhost ([::1]:50076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNis-0001pA-2O for importer@patchew.org; Wed, 02 Dec 2020 03:42:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND5-0003Tf-Gt for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42973) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCS-0003mI-Qf for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:09:59 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575--U7AI-WeN_KDIChTGMPfrQ-1; Wed, 02 Dec 2020 03:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1BA301006C82 for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD50F5D9C6 for ; Wed, 2 Dec 2020 08:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896559; 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: in-reply-to:in-reply-to:references:references; bh=XaopSvQFOQg8qNe7dPekPUCjQOLZMQSxkW2ChW6RDSI=; b=b9Lf2rIi2CQVsNncJ6zkaQ8GPrgbPads/TL5U315aw3/TI3F86+XsOBXpwQMN8fv/BU75h h5OOMEYTFBugdaPwZJP7CQ0ScE1Kmq3BjvgeDtOlxiy98TgV3aiJFqabt77q2RN0bHypQw T+UTh1yuIGZsaioKW+IP2JDizVREXNA= X-MC-Unique: -U7AI-WeN_KDIChTGMPfrQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 072/113] vl: move -global check earlier Date: Wed, 2 Dec 2020 03:08:08 -0500 Message-Id: <20201202080849.4125477-73-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The check has the same effect here, it only matters that it is performed once all devices, both builtin and user-specified, have been created. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 6a2972938d..e65eb0c9f2 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3490,6 +3490,8 @@ static void qemu_machine_creation_done(void) net_check_clients(); } =20 + qdev_prop_check_globals(); + if (boot_once) { qemu_boot_set(boot_once, &error_fatal); qemu_register_reset(restore_boot_order, g_strdup(boot_order)); @@ -4547,7 +4549,6 @@ void qemu_init(int argc, char **argv, char **envp) replay_vmstate_init(); } =20 - qdev_prop_check_globals(); if (vmstate_dump_file) { /* dump and exit */ dump_vmstate_json_to_file(vmstate_dump_file); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901543; cv=none; d=zohomail.com; s=zohoarc; b=JGttrLmIKSmyTk5HxeqWFKO8aCZ6KuqOqiV+fVvVqyO9/458pdfDx+9X23CYHvQbsRHka6EIu6Dp9aC8vyeqiQnHQUZylPm1Ysvxy5MiNismvucJSssKkWPA+RhDaND/V1dhsZoVOLP/SsSLbn9+ZV0JiiBC+yq9Gw14IMDIKIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901543; 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=+JE+6xeYsLHEy6YH+WMEM56L7hAsfZC9QF113GACzDs=; b=gaQ80wtq1tFIoXhuNrxVSPo8XAkKFEASsu0MPaVp9Rw2iY0zCnVs2PGI8/oTqBuIYq22rd5Gg3MHY5bnf+THYDdDochlYUrZqkpjEAgl0gKLP+x2Jl+y3SqIbbaXyLqTUl+ZmQ49Q48p2XaRw70XDv2SL9W/IS94LCE+3StuIuM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901543515675.9345812591087; Wed, 2 Dec 2020 01:32:23 -0800 (PST) Received: from localhost ([::1]:40404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO7l-0000gd-Lr for importer@patchew.org; Wed, 02 Dec 2020 04:08:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkND7-0003Vw-Cg for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCS-0003n8-T9 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:01 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-vwmE9_P5NtyOvQUZwr4ZeQ-1; Wed, 02 Dec 2020 03:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6AAD080364D for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37B385D9C6 for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896560; 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: in-reply-to:in-reply-to:references:references; bh=+JE+6xeYsLHEy6YH+WMEM56L7hAsfZC9QF113GACzDs=; b=jJvF6zDTdBroPmqLe5wgPLo40sTBl7LlbM+GH3Y2G8aeMuRe5GPLvvyRKEUNf87WxWcqW/ U6ok+iv3z6jaAzMiIBw5T6kNG48a1KmtxAFl7+WfTObUdCTp+myWvPKLnqcLYB+QTbTUtt macsf8IJ3aBJu8RSTkI715oX7afl9o4= X-MC-Unique: vwmE9_P5NtyOvQUZwr4ZeQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 073/113] migration, vl: start migration via qmp_migrate_incoming Date: Wed, 2 Dec 2020 03:08:09 -0500 Message-Id: <20201202080849.4125477-74-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make qemu_start_incoming_migration local to migration/migration.c. By using the runstate instead of a separate flag, vl need not do anything to setup deferred incoming migration. qmp_migrate_incoming also does not need the deferred_incoming flag anymore, because "-incoming PROTOCOL" will clear the "once" flag before the main loop starts. Therefore, later invocations of the migrate-incoming command will fail with the existing "The incoming migration has already been started" error message. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- include/migration/misc.h | 1 - migration/migration.c | 33 ++++++++------------------------- softmmu/vl.c | 11 +++++++---- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 34e7d75713..bccc1b6b44 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -58,7 +58,6 @@ void dump_vmstate_json_to_file(FILE *out_fp); /* migration/migration.c */ void migration_object_init(void); void migration_shutdown(void); -void qemu_start_incoming_migration(const char *uri, Error **errp); bool migration_is_idle(void); bool migration_is_active(MigrationState *); void add_migration_state_change_notifier(Notifier *notify); diff --git a/migration/migration.c b/migration/migration.c index d9e94f4080..e0dbde4091 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -118,8 +118,6 @@ static NotifierList migration_state_notifiers =3D NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); =20 -static bool deferred_incoming; - /* Messages sent on the return path from destination to source */ enum mig_rp_message_type { MIG_RP_MSG_INVALID =3D 0, /* Must be 0 */ @@ -275,19 +273,6 @@ static bool migrate_late_block_activate(void) MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; } =20 -/* - * Called on -incoming with a defer: uri. - * The migration can be started later after any parameters have been - * changed. - */ -static void deferred_incoming_migration(Error **errp) -{ - if (deferred_incoming) { - error_setg(errp, "Incoming migration already deferred"); - } - deferred_incoming =3D true; -} - /* * Send a message on the return channel back to the source * of the migration. @@ -429,16 +414,14 @@ void migrate_add_address(SocketAddress *address) addrs->value =3D QAPI_CLONE(SocketAddress, address); } =20 -void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p =3D NULL; =20 qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (!strcmp(uri, "defer")) { - deferred_incoming_migration(errp); - } else if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { + if (strstart(uri, "tcp:", &p) || + strstart(uri, "unix:", NULL) || + strstart(uri, "vsock:", NULL)) { socket_start_incoming_migration(p ? p : uri, errp); #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { @@ -1988,14 +1971,14 @@ void qmp_migrate_incoming(const char *uri, Error **= errp) Error *local_err =3D NULL; static bool once =3D true; =20 - if (!deferred_incoming) { - error_setg(errp, "For use with '-incoming defer'"); - return; - } if (!once) { error_setg(errp, "The incoming migration has already been started"= ); return; } + if (!runstate_check(RUN_STATE_INMIGRATE)) { + error_setg(errp, "'-incoming' was not specified on the command lin= e"); + return; + } =20 qemu_start_incoming_migration(uri, &local_err); =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index e65eb0c9f2..20dd0cd517 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -109,6 +109,7 @@ #include "qapi/qapi-visit-block-core.h" #include "qapi/qapi-visit-ui.h" #include "qapi/qapi-commands-block-core.h" +#include "qapi/qapi-commands-migration.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-commands-ui.h" #include "qapi/qmp/qerror.h" @@ -4556,10 +4557,12 @@ void qemu_init(int argc, char **argv, char **envp) } if (incoming) { Error *local_err =3D NULL; - qemu_start_incoming_migration(incoming, &local_err); - if (local_err) { - error_reportf_err(local_err, "-incoming %s: ", incoming); - exit(1); + if (strcmp(incoming, "defer") !=3D 0) { + qmp_migrate_incoming(incoming, &local_err); + if (local_err) { + error_reportf_err(local_err, "-incoming %s: ", incoming); + exit(1); + } } } else if (autostart) { vm_start(); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899468; cv=none; d=zohomail.com; s=zohoarc; b=i7hrmvwm+cuXZR1wwqf3zOnBoe3kwezvl5VEbLk+i5+cHpH5CEE66yYWLGQ7X8QrA6N9qxjPv8SSnpCge138h2+W96bDfEBUM194PbYSZ+xlRRdWcFDyRT8rs4bqC6pkv+dTAnil96kv0UgN+pKbtFsyMsRfw/HySFHftshA/K4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899468; 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=BCcz3IqagfXITHFE47MYIxcESWpWBZMhNW+sh/x6UAw=; b=dJajw3QV7mP7jPZ2IWEjF/3xIVqhqj2mvlMreUwIZJdTEWKeLNNb1nudaHUmRdgQuKdd02ilWXJ8qltKpG8T1SbuuQ2PEK+k96dP0tQpWi/erEMixXJ1IA8qEdFmyrrIOskH2zw4XPLajvalgIGek65P1p8o2Gv6dIPt6SOueXo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899468784612.5117220737627; Wed, 2 Dec 2020 00:57:48 -0800 (PST) Received: from localhost ([::1]:35786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNxL-0002lx-Ii for importer@patchew.org; Wed, 02 Dec 2020 03:57:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDG-0003ep-5x for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nA-9x for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-Rl20F8UUP52eEwvV00qYHA-1; Wed, 02 Dec 2020 03:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8966803650 for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8616E5D9C6 for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896560; 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: in-reply-to:in-reply-to:references:references; bh=BCcz3IqagfXITHFE47MYIxcESWpWBZMhNW+sh/x6UAw=; b=f2j9eZH/S1sqNY/e6yelNfW/MjgYT0KMtfHYIch715GJzcC/bWW93tNzraz5IdL/ZGXl/M +5O+XZrIFRPerZ4TDD8xV52CCz98MAdQ1dvX6MEvtW4VfZfCtB9zniI2cpxP5wWxNwMqZ5 Mrqp5UcJcHFeUOe2SvYQTui4O3tRcBE= X-MC-Unique: Rl20F8UUP52eEwvV00qYHA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 074/113] vl: start VM via qmp_cont Date: Wed, 2 Dec 2020 03:08:10 -0500 Message-Id: <20201202080849.4125477-75-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Complement the previous patch by starting the VM with a QMP command. The plan is that the user will be able to do the same, invoking two commands "finish-machine-init" and "cont" instead of "x-exit-preconfig". Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 20dd0cd517..dc8a47efcb 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -110,6 +110,7 @@ #include "qapi/qapi-visit-ui.h" #include "qapi/qapi-commands-block-core.h" #include "qapi/qapi-commands-migration.h" +#include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-commands-ui.h" #include "qapi/qmp/qerror.h" @@ -4565,7 +4566,7 @@ void qemu_init(int argc, char **argv, char **envp) } } } else if (autostart) { - vm_start(); + qmp_cont(NULL); } =20 accel_setup_post(current_machine); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901115; cv=none; d=zohomail.com; s=zohoarc; b=FsVDiBI7A6XbJSFs8oKOMbs1oO0qbyekejohC89ZEBm4gjqxatD26uf/vDm13oNo7+6wfKmNHko3dK51fYz/UTr8aLDC34SsbiqZXIFO1C/+6rgKhgPoh49ceQz7TJu2QqhFjiTFt7/c/66S/+m6yaTkF+I8jGoS4UJpSkr1m1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901115; 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=uu4pdBoN9dgyqSaHAUhMadj6P5dazVOovEt0liU4I1Y=; b=PDgggumnDIUuJy79ZFXcFTAaFRUtCMmFiMYBp+32y/ZQuYbtsEhFIjKOJilKUz+zEGNgdwlNvPszHpbfXbkUbBovmgDwgpiz5VaxY5lWymS3wDRqAZxKeiNbvg1NRcCkaCoVWtsghcApxplJ1ulW74t8T63f3H3m8uzWaV/YfrU= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901115758465.7231689835837; Wed, 2 Dec 2020 01:25:15 -0800 (PST) Received: from localhost ([::1]:57438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOCs-00086t-Pb for importer@patchew.org; Wed, 02 Dec 2020 04:13:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDB-0003ZD-3m for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nG-SQ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:04 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-sQp2oG2CPoOJDC0xC6nzTA-1; Wed, 02 Dec 2020 03:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12C791006C81 for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D44DB5D9C6 for ; Wed, 2 Dec 2020 08:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896560; 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: in-reply-to:in-reply-to:references:references; bh=uu4pdBoN9dgyqSaHAUhMadj6P5dazVOovEt0liU4I1Y=; b=Y3VrRo0eyH4dYtjaU4w8Q8f8qybpQpMODN3ZL4h4g65ji2qlLicV8DYYqp4winMFjBNh7Q xMn5wXyi+v2lkVGV5MUaC7lPFWcMUJuvCS6N+W7H5qujF6KQ1NXfwMi+3XktpbC6gwCk/2 V30XNpaeojA0MLLTOQMQ7/8194+R2dk= X-MC-Unique: sQp2oG2CPoOJDC0xC6nzTA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 075/113] hmp: introduce cmd_available Date: Wed, 2 Dec 2020 03:08:11 -0500 Message-Id: <20201202080849.4125477-76-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Combine the RUN_STATE_PRECONFIG and cmd_can_preconfig checks into a single function, to avoid repeating the same expression (or its negation after applying DeMorgan's rule) over and over again. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- monitor/hmp.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/monitor/hmp.c b/monitor/hmp.c index 1204233999..d40f4f4391 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -213,6 +213,11 @@ static bool cmd_can_preconfig(const HMPCommand *cmd) return strchr(cmd->flags, 'p'); } =20 +static bool cmd_available(const HMPCommand *cmd) +{ + return !runstate_check(RUN_STATE_PRECONFIG) || cmd_can_preconfig(cmd); +} + static void help_cmd_dump_one(Monitor *mon, const HMPCommand *cmd, char **prefix_args, @@ -220,7 +225,7 @@ static void help_cmd_dump_one(Monitor *mon, { int i; =20 - if (runstate_check(RUN_STATE_PRECONFIG) && !cmd_can_preconfig(cmd)) { + if (!cmd_available(cmd)) { return; } =20 @@ -248,8 +253,7 @@ static void help_cmd_dump(Monitor *mon, const HMPComman= d *cmds, /* Find one entry to dump */ for (cmd =3D cmds; cmd->name !=3D NULL; cmd++) { if (hmp_compare_cmd(args[arg_index], cmd->name) && - ((!runstate_check(RUN_STATE_PRECONFIG) || - cmd_can_preconfig(cmd)))) { + cmd_available(cmd)) { if (cmd->sub_table) { /* continue with next arg */ help_cmd_dump(mon, cmd->sub_table, @@ -653,7 +657,7 @@ static const HMPCommand *monitor_parse_command(MonitorH= MP *hmp_mon, (int)(p - cmdp_start), cmdp_start); return NULL; } - if (runstate_check(RUN_STATE_PRECONFIG) && !cmd_can_preconfig(cmd)) { + if (!cmd_available(cmd)) { monitor_printf(mon, "Command '%.*s' not available with -preconfig " "until after exit_preconfig.\n", (int)(p - cmdp_start), cmdp_start); @@ -1225,8 +1229,7 @@ static void monitor_find_completion_by_table(MonitorH= MP *mon, } readline_set_completion_index(mon->rs, strlen(cmdname)); for (cmd =3D cmd_table; cmd->name !=3D NULL; cmd++) { - if (!runstate_check(RUN_STATE_PRECONFIG) || - cmd_can_preconfig(cmd)) { + if (cmd_available(cmd)) { cmd_completion(mon, cmdname, cmd->name); } } @@ -1234,8 +1237,7 @@ static void monitor_find_completion_by_table(MonitorH= MP *mon, /* find the command */ for (cmd =3D cmd_table; cmd->name !=3D NULL; cmd++) { if (hmp_compare_cmd(args[0], cmd->name) && - (!runstate_check(RUN_STATE_PRECONFIG) || - cmd_can_preconfig(cmd))) { + cmd_available(cmd)) { break; } } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606908939; cv=none; d=zohomail.com; s=zohoarc; b=ClJXUV6w23exikflKmKFHjmW+hTB9lKCs41IgTVSt63LNeJ9cB1QyJzKMOCjBKkt8XH+jcpfSiWtYUOxJ8c/1QylfgO5Xh2cbRPFOaAbG0TlmugBFOYhyL6A4LumLwht4Exx+QWJDBClFdv1T0iEX1muCDjGKKmsAV50aGxev5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606908939; 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=kpbvJW/SMDBxvm0PbHWGwM2LclD86UUF8ucPAfTPQ50=; b=lsRmobt3T3OFsfeogmLPS3kSWnq0+xdKIGa/CF2cDRkxj+E1ZOiCWmonzr2N2+uOPxWCx1yjxxYj+zztqxv+wfRqhMs6Rx4HLSisEeGStKM4+iQjzYSMFFCXkhyM/wTpicDJKXDYAFsPbB5UdyI8c+eQSZB1vunSo6l9YiVs9fY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606908939282914.191227186663; Wed, 2 Dec 2020 03:35:39 -0800 (PST) Received: from localhost ([::1]:48732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOAY-0004Pu-PI for importer@patchew.org; Wed, 02 Dec 2020 04:11:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDE-0003cO-Hn for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nO-S2 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:06 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-T2K8urFEPMGi8XT1i6VvtA-1; Wed, 02 Dec 2020 03:09:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63CFE1074641 for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F6CE5D9C6 for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896561; 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: in-reply-to:in-reply-to:references:references; bh=kpbvJW/SMDBxvm0PbHWGwM2LclD86UUF8ucPAfTPQ50=; b=Seg3/nh4QGseUAj39fDYZmyGoxPH7RbX+Bt7icyTGnwZ11bO4hxBl7gmsIX2vHAlRHaRgz P70pB8jrXoJxa2XRMAaUT3Eyp8oLkhsDis1SLYbzy5OSJnruTVzP+gYegsYJLprIi/ntYl mt9Tns4wWBbb6xSNM0dZJbHQx1mPeic= X-MC-Unique: T2K8urFEPMGi8XT1i6VvtA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 076/113] vl: extract softmmu/datadir.c Date: Wed, 2 Dec 2020 03:08:12 -0500 Message-Id: <20201202080849.4125477-77-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/alpha/dp264.c | 1 + hw/arm/boot.c | 1 + hw/arm/digic_boards.c | 1 + hw/arm/highbank.c | 1 + hw/arm/npcm7xx_boards.c | 1 + hw/arm/sbsa-ref.c | 1 + hw/arm/vexpress.c | 1 + hw/arm/virt.c | 1 + hw/avr/boot.c | 1 + hw/core/loader.c | 1 + hw/display/cg3.c | 1 + hw/display/tcx.c | 1 + hw/hppa/machine.c | 1 + hw/i386/x86.c | 1 + hw/lm32/milkymist.c | 1 + hw/m68k/mcf5208.c | 1 + hw/m68k/q800.c | 1 + hw/microblaze/boot.c | 1 + hw/mips/fuloong2e.c | 1 + hw/mips/jazz.c | 1 + hw/mips/malta.c | 1 + hw/mips/mipssim.c | 1 + hw/nios2/boot.c | 1 + hw/nvram/fw_cfg.c | 1 + hw/pci-host/prep.c | 1 + hw/pci/pci.c | 1 + hw/ppc/e500.c | 1 + hw/ppc/mac_newworld.c | 1 + hw/ppc/mac_oldworld.c | 1 + hw/ppc/pnv.c | 1 + hw/ppc/ppc405_boards.c | 1 + hw/ppc/ppc440_bamboo.c | 1 + hw/ppc/sam460ex.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/virtex_ml507.c | 1 + hw/riscv/boot.c | 1 + hw/s390x/ipl.c | 1 + hw/sparc/leon3.c | 1 + hw/sparc/sun4m.c | 1 + hw/sparc64/sun4u.c | 1 + include/qemu-common.h | 21 ------- include/qemu/datadir.h | 28 +++++++++ include/sysemu/sysemu.h | 2 - softmmu/datadir.c | 129 ++++++++++++++++++++++++++++++++++++++++ softmmu/meson.build | 1 + softmmu/vl.c | 95 +---------------------------- tests/qtest/fuzz/fuzz.c | 1 + ui/keymaps.c | 1 + 48 files changed, 203 insertions(+), 115 deletions(-) create mode 100644 include/qemu/datadir.h create mode 100644 softmmu/datadir.c diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index c4d407a9f1..c8e300d93f 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -21,6 +21,7 @@ #include "hw/dma/i8257.h" #include "net/net.h" #include "qemu/cutils.h" +#include "qemu/datadir.h" #include "net/net.h" =20 #define MAX_IDE_BUS 2 diff --git a/hw/arm/boot.c b/hw/arm/boot.c index cf97600a91..4d9d47ba1c 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/error-report.h" #include "qapi/error.h" #include diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index fd228fa96f..be12873673 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/boards.h" #include "exec/address-spaces.h" diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index fd3429720e..bf7b8f4c64 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "hw/sysbus.h" #include "migration/vmstate.h" diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 9821013bc6..306260fa67 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -23,6 +23,7 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "sysemu/sysemu.h" =20 diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index c3a31f5b8b..b1fa3779d8 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/units.h" diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 1adb663d77..ac098375c1 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/boot.h" diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9c54eea585..82cb9c95cf 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -30,6 +30,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qemu/option.h" #include "monitor/qdev.h" diff --git a/hw/avr/boot.c b/hw/avr/boot.c index d16bb3dbe1..cbede775ce 100644 --- a/hw/avr/boot.c +++ b/hw/avr/boot.c @@ -10,6 +10,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "hw/loader.h" #include "elf.h" #include "boot.h" diff --git a/hw/core/loader.c b/hw/core/loader.c index 8bbb1797a4..fea22d265c 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -44,6 +44,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "trace.h" #include "hw/hw.h" diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 42fcf40010..4b7e78d919 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "ui/console.h" diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 3799d29b75..965f92ff6b 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "ui/console.h" #include "ui/pixel_ops.h" diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 7e41cb2462..f2b71db9bd 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -5,6 +5,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "elf.h" #include "hw/loader.h" diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 54c9d0c019..5d4b29052f 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -26,6 +26,7 @@ #include "qemu/cutils.h" #include "qemu/units.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qapi/qapi-visit-common.h" diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 93ca8bc2ac..72d1326531 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -21,6 +21,7 @@ #include "qemu/units.h" #include "qemu/error-report.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/sysbus.h" #include "hw/irq.h" diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 2205145ecc..7a03c71059 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -12,6 +12,7 @@ #include "qemu/log.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/irq.h" #include "hw/m68k/mcf.h" diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 6ebcddcfb2..4db2b9bbc7 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -23,6 +23,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "sysemu/sysemu.h" #include "cpu.h" #include "hw/hw.h" diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index e1f56f83f9..6715ba2ff9 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "qemu/option.h" #include "qemu/config-file.h" diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 84a2132f85..45c596f4fe 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index aa95c6a3d3..f9442731dd 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "hw/clock.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 467b21849e..5c11eecec1 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/clock.h" #include "hw/southbridge/piix.h" diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index cc9b0934b3..f2e6273525 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/clock.h" #include "hw/mips/mips.h" diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 3cb864914b..95a8697906 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -31,6 +31,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "qemu/option.h" #include "qemu/config-file.h" diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 08539a1aab..9e80633d6e 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "sysemu/sysemu.h" #include "sysemu/dma.h" #include "sysemu/reset.h" diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index d0323fefb1..0469db8c1d 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" #include "hw/pci/pci.h" diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0131d9d02c..9424231542 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "hw/irq.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 153a74c98c..6a64eb31ab 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -16,6 +16,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" #include "e500.h" diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 61c63819df..c0accda592 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -48,6 +48,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 11623e8e67..04f98a4d81 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" #include "hw/ppc/ppc.h" diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 53a5121cab..14fc9758a9 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" #include "sysemu/qtest.h" diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index c867e46330..b7249f21cf 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -26,6 +26,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 74028dc986..665bc1784e 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -15,6 +15,7 @@ #include "qemu/units.h" #include "qemu/error-report.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/error-report.h" #include "net/net.h" #include "hw/pci/pci.h" diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 7e59a91981..14e6583eb0 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "hw/boards.h" diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index cd8be98caf..049efa0bbf 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "sysemu/sysemu.h" diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index c790c1113f..7f1bca928c 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "cpu.h" #include "hw/sysbus.h" diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 70a9bf8f5d..d62f3dc758 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "qemu/error-report.h" #include "exec/cpu-defs.h" diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index bddbaffac6..ff6b55e816 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -14,6 +14,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 1c50b02f81..4bc4ebea84 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/irq.h" #include "qemu/timer.h" diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 0f9cd2bf52..8686371318 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qemu/datadir.h" #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 8bee7dd2f4..0fa13a7330 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "cpu.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" diff --git a/include/qemu-common.h b/include/qemu-common.h index fda7dc6ca7..654621444e 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -108,27 +108,6 @@ void qemu_progress_end(void); void qemu_progress_print(float delta, int max); const char *qemu_get_vm_name(void); =20 -#define QEMU_FILE_TYPE_BIOS 0 -#define QEMU_FILE_TYPE_KEYMAP 1 -/** - * qemu_find_file: - * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS) - * or QEMU_FILE_TYPE_KEYMAP (for keymaps). - * @name: Relative or absolute file name - * - * If @name exists on disk as an absolute path, or a path relative - * to the current directory, then returns @name unchanged. - * Otherwise searches for @name file in the data directories, either - * configured at build time (DATADIR) or registered with the -L command - * line option. - * - * The caller must use g_free() to free the returned data when it is - * no longer required. - * - * Returns: a path that can access @name, or NULL if no matching file exis= ts. - */ -char *qemu_find_file(int type, const char *name); - /* OS specific functions */ void os_setup_early_signal_handling(void); int os_parse_cmd_args(int index, const char *optarg); diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h new file mode 100644 index 0000000000..21f9097f58 --- /dev/null +++ b/include/qemu/datadir.h @@ -0,0 +1,28 @@ +#ifndef QEMU_DATADIR_H +#define QEMU_DATADIR_H + +#define QEMU_FILE_TYPE_BIOS 0 +#define QEMU_FILE_TYPE_KEYMAP 1 +/** + * qemu_find_file: + * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS) + * or QEMU_FILE_TYPE_KEYMAP (for keymaps). + * @name: Relative or absolute file name + * + * If @name exists on disk as an absolute path, or a path relative + * to the current directory, then returns @name unchanged. + * Otherwise searches for @name file in the data directories, either + * configured at build time (DATADIR) or registered with the -L command + * line option. + * + * The caller must use g_free() to free the returned data when it is + * no longer required. + * + * Returns: a path that can access @name, or NULL if no matching file exis= ts. + */ +char *qemu_find_file(int type, const char *name); +void qemu_add_default_firmwarepath(void); +void qemu_add_data_dir(char *path); +void qemu_list_data_dirs(void); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 1336b4264a..c94b2e7159 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -13,8 +13,6 @@ extern const char *qemu_name; extern QemuUUID qemu_uuid; extern bool qemu_uuid_set; =20 -void qemu_add_data_dir(char *path); - void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); =20 diff --git a/softmmu/datadir.c b/softmmu/datadir.c new file mode 100644 index 0000000000..504c4665be --- /dev/null +++ b/softmmu/datadir.c @@ -0,0 +1,129 @@ +/* + * QEMU firmware and keymap file search + * + * Copyright (c) 2003-2020 QEMU contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "qemu/datadir.h" +#include "qemu/cutils.h" +#include "trace.h" + +static const char *data_dir[16]; +static int data_dir_idx; + +char *qemu_find_file(int type, const char *name) +{ + int i; + const char *subdir; + char *buf; + + /* Try the name as a straight path first */ + if (access(name, R_OK) =3D=3D 0) { + trace_load_file(name, name); + return g_strdup(name); + } + + switch (type) { + case QEMU_FILE_TYPE_BIOS: + subdir =3D ""; + break; + case QEMU_FILE_TYPE_KEYMAP: + subdir =3D "keymaps/"; + break; + default: + abort(); + } + + for (i =3D 0; i < data_dir_idx; i++) { + buf =3D g_strdup_printf("%s/%s%s", data_dir[i], subdir, name); + if (access(buf, R_OK) =3D=3D 0) { + trace_load_file(name, buf); + return buf; + } + g_free(buf); + } + return NULL; +} + +void qemu_add_data_dir(char *path) +{ + int i; + + if (path =3D=3D NULL) { + return; + } + if (data_dir_idx =3D=3D ARRAY_SIZE(data_dir)) { + return; + } + for (i =3D 0; i < data_dir_idx; i++) { + if (strcmp(data_dir[i], path) =3D=3D 0) { + g_free(path); /* duplicate */ + return; + } + } + data_dir[data_dir_idx++] =3D path; +} + +/* + * Find a likely location for support files using the location of the bina= ry. + * When running from the build tree this will be "$bindir/pc-bios". + * Otherwise, this is CONFIG_QEMU_DATADIR (possibly relocated). + * + * The caller must use g_free() to free the returned data when it is + * no longer required. + */ +static char *find_datadir(void) +{ + g_autofree char *dir =3D NULL; + + dir =3D g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL); + if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { + return g_steal_pointer(&dir); + } + + return get_relocated_path(CONFIG_QEMU_DATADIR); +} + +void qemu_add_default_firmwarepath(void) +{ + char **dirs; + size_t i; + + /* add configured firmware directories */ + dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); + for (i =3D 0; dirs[i] !=3D NULL; i++) { + qemu_add_data_dir(get_relocated_path(dirs[i])); + } + g_strfreev(dirs); + + /* try to find datadir relative to the executable path */ + qemu_add_data_dir(find_datadir()); +} + +void qemu_list_data_dirs(void) +{ + int i; + for (i =3D 0; i < data_dir_idx; i++) { + printf("%s\n", data_dir[i]); + } +} diff --git a/softmmu/meson.build b/softmmu/meson.build index 8f7210b4f0..7b52339e7a 100644 --- a/softmmu/meson.build +++ b/softmmu/meson.build @@ -3,6 +3,7 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files( 'balloon.c', 'cpus.c', 'cpu-throttle.c', + 'datadir.c', 'physmem.c', 'ioport.c', 'memory.c', diff --git a/softmmu/vl.c b/softmmu/vl.c index dc8a47efcb..28aafc1101 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "qemu/units.h" #include "hw/boards.h" #include "hw/qdev-properties.h" @@ -128,8 +129,6 @@ typedef struct BlockdevOptionsQueueEntry { typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue; =20 static const char *cpu_option; -static const char *data_dir[16]; -static int data_dir_idx; static const char *mem_path; static const char *boot_order; static const char *boot_once; @@ -1994,59 +1993,6 @@ static void parse_display(const char *p) } } =20 -char *qemu_find_file(int type, const char *name) -{ - int i; - const char *subdir; - char *buf; - - /* Try the name as a straight path first */ - if (access(name, R_OK) =3D=3D 0) { - trace_load_file(name, name); - return g_strdup(name); - } - - switch (type) { - case QEMU_FILE_TYPE_BIOS: - subdir =3D ""; - break; - case QEMU_FILE_TYPE_KEYMAP: - subdir =3D "keymaps/"; - break; - default: - abort(); - } - - for (i =3D 0; i < data_dir_idx; i++) { - buf =3D g_strdup_printf("%s/%s%s", data_dir[i], subdir, name); - if (access(buf, R_OK) =3D=3D 0) { - trace_load_file(name, buf); - return buf; - } - g_free(buf); - } - return NULL; -} - -void qemu_add_data_dir(char *path) -{ - int i; - - if (path =3D=3D NULL) { - return; - } - if (data_dir_idx =3D=3D ARRAY_SIZE(data_dir)) { - return; - } - for (i =3D 0; i < data_dir_idx; i++) { - if (strcmp(data_dir[i], path) =3D=3D 0) { - g_free(path); /* duplicate */ - return; - } - } - data_dir[data_dir_idx++] =3D path; -} - static inline bool nonempty_str(const char *str) { return str && *str; @@ -3187,26 +3133,6 @@ static void create_default_memdev(MachineState *ms, = const char *path) &error_fatal); } =20 -/* - * Find a likely location for support files using the location of the bina= ry. - * When running from the build tree this will be "$bindir/pc-bios". - * Otherwise, this is CONFIG_QEMU_DATADIR (possibly relocated). - * - * The caller must use g_free() to free the returned data when it is - * no longer required. - */ -static char *find_datadir(void) -{ - g_autofree char *dir =3D NULL; - - dir =3D g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL); - if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { - return g_steal_pointer(&dir); - } - - return get_relocated_path(CONFIG_QEMU_DATADIR); -} - static void qemu_validate_options(void) { QemuOpts *machine_opts =3D qemu_get_machine_opts(); @@ -3266,9 +3192,6 @@ static void qemu_process_sugar_options(void) =20 static void qemu_process_early_options(void) { - char **dirs; - int i; - #ifdef CONFIG_SECCOMP QemuOptsList *olist =3D qemu_find_opts_err("sandbox", NULL); if (olist) { @@ -3306,21 +3229,11 @@ static void qemu_process_early_options(void) qemu_set_log(0); } =20 - /* add configured firmware directories */ - dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); - for (i =3D 0; dirs[i] !=3D NULL; i++) { - qemu_add_data_dir(get_relocated_path(dirs[i])); - } - g_strfreev(dirs); - - /* try to find datadir relative to the executable path */ - qemu_add_data_dir(find_datadir()); + qemu_add_default_firmwarepath(); } =20 static void qemu_process_help_options(void) { - int i; - /* * Check for -cpu help and -device help before we call select_machine(= ), * which will return an error if the architecture has no default machi= ne @@ -3339,9 +3252,7 @@ static void qemu_process_help_options(void) =20 /* -L help lists the data directories and exits. */ if (list_data_dirs) { - for (i =3D 0; i < data_dir_idx; i++) { - printf("%s\n", data_dir[i]); - } + qemu_list_data_dirs(); exit(0); } } diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index 7be7226bc0..238866a037 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -15,6 +15,7 @@ =20 #include =20 +#include "qemu/datadir.h" #include "sysemu/qtest.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" diff --git a/ui/keymaps.c b/ui/keymaps.c index 4e5fca57a8..d4a647464b 100644 --- a/ui/keymaps.c +++ b/ui/keymaps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/datadir.h" #include "keymaps.h" #include "trace.h" #include "qemu/ctype.h" --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606898958; cv=none; d=zohomail.com; s=zohoarc; b=bI1BR8DVhWuVnGD0j18ZDw9MU1VYUbIuWN++9IOtnyLbjsozgpkPRQgquwMf2kdNaTM26MC+kC5SNOipL/a2lGqWFe9jkfx3763Wokspg+oP9i1lzsWDzI2D8GtvGSjrFXuFvKfJVNhWYscyTe8qx+tnIA5a+HEfZ9alGtD8iAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606898958; 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=uAg+V9T3Kp/BE3sC6lddtN0wcVqe++cKySiw5Ax5D1o=; b=X9p6/8ZEx2Xg7c1fJZ4XLLWefhVr5az8GdPgwdURTjtaapuKsRKoAbsueZnKB4krAPDFqq9K9NC/hi0AwNIt4lVuMxYYmX1NE3+acLQwQaM61So2b1JdCBrlSJSHgHSwIiEdEHEH3YIqTCNbNFehlrG1Olr8GND9rQd89LcoSg0= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606898958816136.43365915162508; Wed, 2 Dec 2020 00:49:18 -0800 (PST) Received: from localhost ([::1]:38800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNp7-0000Sx-Jx for importer@patchew.org; Wed, 02 Dec 2020 03:49:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDC-0003aV-LU for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nR-Rn for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:06 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-G9p0WL7NN-u52zPeS0Ff9g-1; Wed, 02 Dec 2020 03:09:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1AE45708D for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EE1D5D9C6 for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896561; 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: in-reply-to:in-reply-to:references:references; bh=uAg+V9T3Kp/BE3sC6lddtN0wcVqe++cKySiw5Ax5D1o=; b=RL5WTS/6wARn4gXfTbtQQsFVN7Y74S73kIek7VxmHM4NfUHQAmrD9VLi6rvvOfuYAkbHs5 0g7QIfYVdnjWi17rVJSnFY59iKdwTcXVHUkn0o3YyTNC80i/fGnXDkLwhoqmx/5oKMQk+D 6Su0CzUi5wy7bjAAbOX9N6icPmvDWiQ= X-MC-Unique: G9p0WL7NN-u52zPeS0Ff9g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 077/113] vl: extract machine done notifiers Date: Wed, 2 Dec 2020 03:08:13 -0500 Message-Id: <20201202080849.4125477-78-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 24 ++++++++++++++++++++++++ include/sysemu/sysemu.h | 1 + softmmu/vl.c | 24 ------------------------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index a5cfbcc7cb..745531c9d9 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1166,6 +1166,30 @@ void machine_run_board_init(MachineState *machine) machine_class->init(machine); } =20 +static NotifierList machine_init_done_notifiers =3D + NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers); + +bool machine_init_done; + +void qemu_add_machine_init_done_notifier(Notifier *notify) +{ + notifier_list_add(&machine_init_done_notifiers, notify); + if (machine_init_done) { + notify->notify(notify, NULL); + } +} + +void qemu_remove_machine_init_done_notifier(Notifier *notify) +{ + notifier_remove(notify); +} + +void qemu_run_machine_init_done_notifiers(void) +{ + machine_init_done =3D true; + notifier_list_notify(&machine_init_done_notifiers, NULL); +} + static const TypeInfo machine_info =3D { .name =3D TYPE_MACHINE, .parent =3D TYPE_OBJECT, diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index c94b2e7159..1b62deaf2b 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -18,6 +18,7 @@ void qemu_remove_exit_notifier(Notifier *notify); =20 extern bool machine_init_done; =20 +void qemu_run_machine_init_done_notifiers(void); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index 28aafc1101..852ecf08e1 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -204,9 +204,6 @@ bool qemu_uuid_set; static NotifierList exit_notifiers =3D NOTIFIER_LIST_INITIALIZER(exit_notifiers); =20 -static NotifierList machine_init_done_notifiers =3D - NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers); - uint32_t xen_domid; enum xen_mode xen_mode =3D XEN_EMULATE; bool xen_domid_restrict; @@ -2451,27 +2448,6 @@ static void qemu_unlink_pidfile(Notifier *n, void *d= ata) } } =20 -bool machine_init_done; - -void qemu_add_machine_init_done_notifier(Notifier *notify) -{ - notifier_list_add(&machine_init_done_notifiers, notify); - if (machine_init_done) { - notify->notify(notify, NULL); - } -} - -void qemu_remove_machine_init_done_notifier(Notifier *notify) -{ - notifier_remove(notify); -} - -static void qemu_run_machine_init_done_notifiers(void) -{ - machine_init_done =3D true; - notifier_list_notify(&machine_init_done_notifiers, NULL); -} - static const QEMUOption *lookup_opt(int argc, char **argv, const char **poptarg, int *poptind) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899329; cv=none; d=zohomail.com; s=zohoarc; b=AmyIg5Jyqrqwr6DrxQT9SnABZ65P2lCNLhZGxA6/I41/9fv/4MyAd1HZuQFMBT+Y5Jai0thBYLVG8MuOEdeDUZjLzNwTZVuZWIvyu6ngxVPGy58dW4foX9Ab845gjJW2QQv98eZ71hCkfvGT8vIrwg23lHbiK+M/CBp8EKablZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899329; 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=LK9iVoiS8WjyOuMipiRTfDJkbHjhjcDAO3gSbk3KjGE=; b=EOp0UXhy818KYMHmjwNQLAFfDIQi0H1hSlYrw4REy15/7ezz6p+yLo9polwwqQ1XTaXqR19LEGGQZmgt2AhwId1VClFmEZjBpafq6YbZQEADftW8L3244doycoCfF5nlaKjDryvmXdlaRkb28m95WmQAut7iUayujKZXUTmbT8k= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160689932904236.76131807343495; Wed, 2 Dec 2020 00:55:29 -0800 (PST) Received: from localhost ([::1]:55790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNv4-0007Yo-Qv for importer@patchew.org; Wed, 02 Dec 2020 03:55:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDF-0003e4-LU for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nZ-Ry for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-1rKOpgdjMTOKYzgTGmStwA-1; Wed, 02 Dec 2020 03:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CC63185E48B for ; Wed, 2 Dec 2020 08:09:19 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE33A5D9C6 for ; Wed, 2 Dec 2020 08:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896562; 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: in-reply-to:in-reply-to:references:references; bh=LK9iVoiS8WjyOuMipiRTfDJkbHjhjcDAO3gSbk3KjGE=; b=OjgUHNag1Ni7jYG+mLD5EjHZLoHcBliiXcQ5iOOjESTnkSqUYipvO+MjiSctHip890/ccb fGxOKfb1+6S1SqdOsTmhXwProqVJRsjGqeMvrJ5lT/invJ2Ws3VsOUmRIaKkvUNyXGvmSL oQFrTZ3O19B3uyf+L9IGQtOiGFl+KII= X-MC-Unique: 1rKOpgdjMTOKYzgTGmStwA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 078/113] vl: extract softmmu/rtc.c Date: Wed, 2 Dec 2020 03:08:14 -0500 Message-Id: <20201202080849.4125477-79-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- include/sysemu/sysemu.h | 2 + softmmu/meson.build | 1 + softmmu/rtc.c | 190 ++++++++++++++++++++++++++++++++++++++++ softmmu/vl.c | 156 --------------------------------- 4 files changed, 193 insertions(+), 156 deletions(-) create mode 100644 softmmu/rtc.c diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 1b62deaf2b..18cf586cd0 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -22,6 +22,8 @@ void qemu_run_machine_init_done_notifiers(void); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 +void configure_rtc(QemuOpts *opts); + extern int autostart; =20 typedef enum { diff --git a/softmmu/meson.build b/softmmu/meson.build index 7b52339e7a..d098d89653 100644 --- a/softmmu/meson.build +++ b/softmmu/meson.build @@ -6,6 +6,7 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files( 'datadir.c', 'physmem.c', 'ioport.c', + 'rtc.c', 'memory.c', 'memory_mapping.c', 'qtest.c', diff --git a/softmmu/rtc.c b/softmmu/rtc.c new file mode 100644 index 0000000000..e1e15ef613 --- /dev/null +++ b/softmmu/rtc.c @@ -0,0 +1,190 @@ +/* + * RTC configuration and clock read + * + * Copyright (c) 2003-2020 QEMU contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qapi/error.h" +#include "qapi/qmp/qerror.h" +#include "qemu/error-report.h" +#include "qemu/option.h" +#include "qemu/timer.h" +#include "qom/object.h" +#include "sysemu/replay.h" +#include "sysemu/sysemu.h" + +static enum { + RTC_BASE_UTC, + RTC_BASE_LOCALTIME, + RTC_BASE_DATETIME, +} rtc_base_type =3D RTC_BASE_UTC; +static time_t rtc_ref_start_datetime; +static int rtc_realtime_clock_offset; /* used only with QEMU_CLOCK_REALTIM= E */ +static int rtc_host_datetime_offset =3D -1; /* valid & used only with + RTC_BASE_DATETIME */ +QEMUClockType rtc_clock; +/***********************************************************/ +/* RTC reference time/date access */ +static time_t qemu_ref_timedate(QEMUClockType clock) +{ + time_t value =3D qemu_clock_get_ms(clock) / 1000; + switch (clock) { + case QEMU_CLOCK_REALTIME: + value -=3D rtc_realtime_clock_offset; + /* fall through */ + case QEMU_CLOCK_VIRTUAL: + value +=3D rtc_ref_start_datetime; + break; + case QEMU_CLOCK_HOST: + if (rtc_base_type =3D=3D RTC_BASE_DATETIME) { + value -=3D rtc_host_datetime_offset; + } + break; + default: + assert(0); + } + return value; +} + +void qemu_get_timedate(struct tm *tm, int offset) +{ + time_t ti =3D qemu_ref_timedate(rtc_clock); + + ti +=3D offset; + + switch (rtc_base_type) { + case RTC_BASE_DATETIME: + case RTC_BASE_UTC: + gmtime_r(&ti, tm); + break; + case RTC_BASE_LOCALTIME: + localtime_r(&ti, tm); + break; + } +} + +int qemu_timedate_diff(struct tm *tm) +{ + time_t seconds; + + switch (rtc_base_type) { + case RTC_BASE_DATETIME: + case RTC_BASE_UTC: + seconds =3D mktimegm(tm); + break; + case RTC_BASE_LOCALTIME: + { + struct tm tmp =3D *tm; + tmp.tm_isdst =3D -1; /* use timezone to figure it out */ + seconds =3D mktime(&tmp); + break; + } + default: + abort(); + } + + return seconds - qemu_ref_timedate(QEMU_CLOCK_HOST); +} + +static void configure_rtc_base_datetime(const char *startdate) +{ + time_t rtc_start_datetime; + struct tm tm; + + if (sscanf(startdate, "%d-%d-%dT%d:%d:%d", &tm.tm_year, &tm.tm_mon, + &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) =3D=3D 6)= { + /* OK */ + } else if (sscanf(startdate, "%d-%d-%d", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday) =3D=3D 3) { + tm.tm_hour =3D 0; + tm.tm_min =3D 0; + tm.tm_sec =3D 0; + } else { + goto date_fail; + } + tm.tm_year -=3D 1900; + tm.tm_mon--; + rtc_start_datetime =3D mktimegm(&tm); + if (rtc_start_datetime =3D=3D -1) { + date_fail: + error_report("invalid datetime format"); + error_printf("valid formats: " + "'2006-06-17T16:01:21' or '2006-06-17'\n"); + exit(1); + } + rtc_host_datetime_offset =3D rtc_ref_start_datetime - rtc_start_dateti= me; + rtc_ref_start_datetime =3D rtc_start_datetime; +} + +void configure_rtc(QemuOpts *opts) +{ + const char *value; + + /* Set defaults */ + rtc_clock =3D QEMU_CLOCK_HOST; + rtc_ref_start_datetime =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) / 1000; + rtc_realtime_clock_offset =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) /= 1000; + + value =3D qemu_opt_get(opts, "base"); + if (value) { + if (!strcmp(value, "utc")) { + rtc_base_type =3D RTC_BASE_UTC; + } else if (!strcmp(value, "localtime")) { + Error *blocker =3D NULL; + rtc_base_type =3D RTC_BASE_LOCALTIME; + error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, + "-rtc base=3Dlocaltime"); + replay_add_blocker(blocker); + } else { + rtc_base_type =3D RTC_BASE_DATETIME; + configure_rtc_base_datetime(value); + } + } + value =3D qemu_opt_get(opts, "clock"); + if (value) { + if (!strcmp(value, "host")) { + rtc_clock =3D QEMU_CLOCK_HOST; + } else if (!strcmp(value, "rt")) { + rtc_clock =3D QEMU_CLOCK_REALTIME; + } else if (!strcmp(value, "vm")) { + rtc_clock =3D QEMU_CLOCK_VIRTUAL; + } else { + error_report("invalid option value '%s'", value); + exit(1); + } + } + value =3D qemu_opt_get(opts, "driftfix"); + if (value) { + if (!strcmp(value, "slew")) { + object_register_sugar_prop("mc146818rtc", + "lost_tick_policy", + "slew"); + } else if (!strcmp(value, "none")) { + /* discard is default */ + } else { + error_report("invalid option value '%s'", value); + exit(1); + } + } +} diff --git a/softmmu/vl.c b/softmmu/vl.c index 852ecf08e1..4c95537af3 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -152,16 +152,6 @@ bool enable_cpu_pm =3D false; int nb_nics; NICInfo nd_table[MAX_NICS]; int autostart =3D 1; -static enum { - RTC_BASE_UTC, - RTC_BASE_LOCALTIME, - RTC_BASE_DATETIME, -} rtc_base_type =3D RTC_BASE_UTC; -static time_t rtc_ref_start_datetime; -static int rtc_realtime_clock_offset; /* used only with QEMU_CLOCK_REALTIM= E */ -static int rtc_host_datetime_offset =3D -1; /* valid & used only with - RTC_BASE_DATETIME */ -QEMUClockType rtc_clock; int vga_interface_type =3D VGA_NONE; static const char *vga_model =3D NULL; static DisplayOptions dpy; @@ -772,152 +762,6 @@ void qemu_system_vmstop_request(RunState state) qemu_mutex_unlock(&vmstop_lock); qemu_notify_event(); } - -/***********************************************************/ -/* RTC reference time/date access */ -static time_t qemu_ref_timedate(QEMUClockType clock) -{ - time_t value =3D qemu_clock_get_ms(clock) / 1000; - switch (clock) { - case QEMU_CLOCK_REALTIME: - value -=3D rtc_realtime_clock_offset; - /* fall through */ - case QEMU_CLOCK_VIRTUAL: - value +=3D rtc_ref_start_datetime; - break; - case QEMU_CLOCK_HOST: - if (rtc_base_type =3D=3D RTC_BASE_DATETIME) { - value -=3D rtc_host_datetime_offset; - } - break; - default: - assert(0); - } - return value; -} - -void qemu_get_timedate(struct tm *tm, int offset) -{ - time_t ti =3D qemu_ref_timedate(rtc_clock); - - ti +=3D offset; - - switch (rtc_base_type) { - case RTC_BASE_DATETIME: - case RTC_BASE_UTC: - gmtime_r(&ti, tm); - break; - case RTC_BASE_LOCALTIME: - localtime_r(&ti, tm); - break; - } -} - -int qemu_timedate_diff(struct tm *tm) -{ - time_t seconds; - - switch (rtc_base_type) { - case RTC_BASE_DATETIME: - case RTC_BASE_UTC: - seconds =3D mktimegm(tm); - break; - case RTC_BASE_LOCALTIME: - { - struct tm tmp =3D *tm; - tmp.tm_isdst =3D -1; /* use timezone to figure it out */ - seconds =3D mktime(&tmp); - break; - } - default: - abort(); - } - - return seconds - qemu_ref_timedate(QEMU_CLOCK_HOST); -} - -static void configure_rtc_base_datetime(const char *startdate) -{ - time_t rtc_start_datetime; - struct tm tm; - - if (sscanf(startdate, "%d-%d-%dT%d:%d:%d", &tm.tm_year, &tm.tm_mon, - &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) =3D=3D 6)= { - /* OK */ - } else if (sscanf(startdate, "%d-%d-%d", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday) =3D=3D 3) { - tm.tm_hour =3D 0; - tm.tm_min =3D 0; - tm.tm_sec =3D 0; - } else { - goto date_fail; - } - tm.tm_year -=3D 1900; - tm.tm_mon--; - rtc_start_datetime =3D mktimegm(&tm); - if (rtc_start_datetime =3D=3D -1) { - date_fail: - error_report("invalid datetime format"); - error_printf("valid formats: " - "'2006-06-17T16:01:21' or '2006-06-17'\n"); - exit(1); - } - rtc_host_datetime_offset =3D rtc_ref_start_datetime - rtc_start_dateti= me; - rtc_ref_start_datetime =3D rtc_start_datetime; -} - -static void configure_rtc(QemuOpts *opts) -{ - const char *value; - - /* Set defaults */ - rtc_clock =3D QEMU_CLOCK_HOST; - rtc_ref_start_datetime =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) / 1000; - rtc_realtime_clock_offset =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) /= 1000; - - value =3D qemu_opt_get(opts, "base"); - if (value) { - if (!strcmp(value, "utc")) { - rtc_base_type =3D RTC_BASE_UTC; - } else if (!strcmp(value, "localtime")) { - Error *blocker =3D NULL; - rtc_base_type =3D RTC_BASE_LOCALTIME; - error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, - "-rtc base=3Dlocaltime"); - replay_add_blocker(blocker); - } else { - rtc_base_type =3D RTC_BASE_DATETIME; - configure_rtc_base_datetime(value); - } - } - value =3D qemu_opt_get(opts, "clock"); - if (value) { - if (!strcmp(value, "host")) { - rtc_clock =3D QEMU_CLOCK_HOST; - } else if (!strcmp(value, "rt")) { - rtc_clock =3D QEMU_CLOCK_REALTIME; - } else if (!strcmp(value, "vm")) { - rtc_clock =3D QEMU_CLOCK_VIRTUAL; - } else { - error_report("invalid option value '%s'", value); - exit(1); - } - } - value =3D qemu_opt_get(opts, "driftfix"); - if (value) { - if (!strcmp(value, "slew")) { - object_register_sugar_prop("mc146818rtc", - "lost_tick_policy", - "slew"); - } else if (!strcmp(value, "none")) { - /* discard is default */ - } else { - error_report("invalid option value '%s'", value); - exit(1); - } - } -} - static int parse_name(void *opaque, QemuOpts *opts, Error **errp) { const char *proc_name; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900934; cv=none; d=zohomail.com; s=zohoarc; b=kboudvS3eHBuM9T16Fs6hb+l7XS+5wiUcFdWBlayieAQlUjrSo2xeXvV3iUB76aWn4IOwDkuyrODhcaqpsWnNcjE56z1jCZmfhUjK0d1IjnH2L3Y0W3k1UL6x6gTkSjSHhQHVGDOZnMZ2c6FSi9VmxFFWiSe6C5KcrgY7HXnh+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900934; 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=5la8ii9N1TTSkwf4GZ7hlnK354ynlV/shXPQET+05qw=; b=EKSEDnKXdvqSVrmFuQQabwOVIrSCNOuIxIY1Qfoj9nPRYjrSqxGVszvwhMHlKJUiKeM4IK22kqgZ3jcjAPWnDfhF44RhGJUJDQ71ssOemjrdq3MkGeq2BBDYFPSZ89kD+IEN9eYjb76r90vyK0ZAMtyaIAGptdC3yc5TE6Qt5pw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606900934866171.2778880168155; Wed, 2 Dec 2020 01:22:14 -0800 (PST) Received: from localhost ([::1]:49164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOAd-0004bz-KZ for importer@patchew.org; Wed, 02 Dec 2020 04:11:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDA-0003YH-42 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCU-0003nY-SC for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-pehjXF6aP36S89Tmdknn5g-1; Wed, 02 Dec 2020 03:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 752DF185E48D for ; Wed, 2 Dec 2020 08:09:19 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 288085D9C6 for ; Wed, 2 Dec 2020 08:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896562; 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: in-reply-to:in-reply-to:references:references; bh=5la8ii9N1TTSkwf4GZ7hlnK354ynlV/shXPQET+05qw=; b=gcBU3f6cVaPIRXCo1kbSRsLkbLOjqEHIeIfd4rHNMOIdUkYR8rZqmvUN2tfxRSca+p+GJH JRAOgwgR/CVF6guKVvpCly27EMze4hUnFP0yPyAgTez2OfITYg49gZ2nm4qFH00t1H1eKZ OKnyY3jJXohL6JIUa8ZiDrqcGbZQnY4= X-MC-Unique: pehjXF6aP36S89Tmdknn5g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 079/113] vl: remove serial_max_hds Date: Wed, 2 Dec 2020 03:08:15 -0500 Message-Id: <20201202080849.4125477-80-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" serial_hd(i) is NULL if and only if i >=3D serial_max_hds(). Test serial_hd(i) instead of bounding the loop at serial_max_hds(), thus removing one more function that vl.c is expected to export. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/ppc/spapr.c | 6 ++---- include/sysemu/sysemu.h | 4 ---- softmmu/vl.c | 5 ----- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 049efa0bbf..b7e0894019 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2878,10 +2878,8 @@ static void spapr_machine_init(MachineState *machine) /* Set up VIO bus */ spapr->vio_bus =3D spapr_vio_bus_init(); =20 - for (i =3D 0; i < serial_max_hds(); i++) { - if (serial_hd(i)) { - spapr_vty_create(spapr->vio_bus, serial_hd(i)); - } + for (i =3D 0; serial_hd(i); i++) { + spapr_vty_create(spapr->vio_bus, serial_hd(i)); } =20 /* We always have at least the nvram device on VIO */ diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 18cf586cd0..29c32f9851 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -71,10 +71,6 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict= *qdict); =20 /* Return the Chardev for serial port i, or NULL if none */ Chardev *serial_hd(int i); -/* return the number of serial ports defined by the user. serial_hd(i) - * will always return NULL for any i which is greater than or equal to thi= s. - */ -int serial_max_hds(void); =20 /* parallel ports */ =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index 4c95537af3..43a0a45b68 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2159,11 +2159,6 @@ Chardev *serial_hd(int i) return NULL; } =20 -int serial_max_hds(void) -{ - return num_serial_hds; -} - static int parallel_parse(const char *devname) { static int index =3D 0; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899120; cv=none; d=zohomail.com; s=zohoarc; b=GbKQPQsu31ThQkrTSKHHGAR8BlGY4C/MYCbSkJo90vxJG0JWXO6R95T+aF9jrdAsEIKPUD6E2Ft69Kw9xYLKRuZOXGBR0w/aPhNJvvyk7jN6iEp/fd7HmSWkgCEgv/YzivT/2ZpEQO2UyHeDU4q6BQUOOOCEN5GE1RjxQer+bTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899120; 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=jRh0lPFjxnHpgU8ABm16exNUk8vxMf4S2bG9go1SF68=; b=IWSShAZoXUoG6zOaB+FPGGM8Ww5TzvUD+QBG42NAmlQBCpM1ItpnJE2wfcQIgTaG+iiwmcIleL9Ks2sX9n0aLEQR/sD8voPYBIWtoZuyvQXXEbg6nmGP+yOmEpiKPOGvnWAVlbFqjvc1/mViRrvDUi00heP+RChLtPNK7DvuPi4= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899119998121.75919986266581; Wed, 2 Dec 2020 00:51:59 -0800 (PST) Received: from localhost ([::1]:47270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkNri-00042Z-LJ for importer@patchew.org; Wed, 02 Dec 2020 03:51:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDE-0003cg-LT for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCW-0003ng-Fp for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-NQmvsr3cPOi1Ca1Mu5A_1A-1; Wed, 02 Dec 2020 03:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9DCA8558EF for ; Wed, 2 Dec 2020 08:09:19 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B505B60854 for ; Wed, 2 Dec 2020 08:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896562; 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: in-reply-to:in-reply-to:references:references; bh=jRh0lPFjxnHpgU8ABm16exNUk8vxMf4S2bG9go1SF68=; b=GrkqiCYH2Tar+q1StWbKwyyLSaZOTib+wK6oiXYze0SDmATktpHqinxnjPfJ7EdJPPd+ry JE+6fOsheSnd1QDNK2gcLYck2EJaR7V8dWNxdM4BrrKJDQd3IC/a1IBTZw/9fkbkUV/14c jnw0Mzt0UkCULU/MupFyfnOW+fjiT3k= X-MC-Unique: NQmvsr3cPOi1Ca1Mu5A_1A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 080/113] vl: clean up -boot variables Date: Wed, 2 Dec 2020 03:08:16 -0500 Message-Id: <20201202080849.4125477-81-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Move more of them into MachineState, in preparation for moving initializati= on of the machine out of vl.c. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- include/hw/boards.h | 1 + softmmu/vl.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 4537cfb5c6..b9233af54a 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -283,6 +283,7 @@ struct MachineState { ram_addr_t maxram_size; uint64_t ram_slots; const char *boot_order; + const char *boot_once; char *kernel_filename; char *kernel_cmdline; char *initrd_filename; diff --git a/softmmu/vl.c b/softmmu/vl.c index 43a0a45b68..77ee044c42 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -130,8 +130,6 @@ typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) Bloc= kdevOptionsQueue; =20 static const char *cpu_option; static const char *mem_path; -static const char *boot_order; -static const char *boot_once; static const char *incoming; static const char *loadvm; static ram_addr_t maxram_size; @@ -2472,6 +2470,8 @@ static void qemu_apply_machine_options(void) { MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); QemuOpts *machine_opts =3D qemu_get_machine_opts(); + const char *boot_order =3D NULL; + const char *boot_once =3D NULL; QemuOpts *opts; =20 qemu_opt_foreach(machine_opts, machine_set_property, current_machine, @@ -2501,6 +2501,7 @@ static void qemu_apply_machine_options(void) } =20 current_machine->boot_order =3D boot_order; + current_machine->boot_once =3D boot_once; =20 if (semihosting_enabled() && !semihosting_get_argc()) { const char *kernel_filename =3D qemu_opt_get(machine_opts, "kernel= "); @@ -2508,7 +2509,6 @@ static void qemu_apply_machine_options(void) /* fall back to the -kernel/-append */ semihosting_arg_fallback(kernel_filename, kernel_cmdline); } - } =20 static void qemu_create_early_backends(void) @@ -3220,9 +3220,9 @@ static void qemu_machine_creation_done(void) =20 qdev_prop_check_globals(); =20 - if (boot_once) { - qemu_boot_set(boot_once, &error_fatal); - qemu_register_reset(restore_boot_order, g_strdup(boot_order)); + if (current_machine->boot_once) { + qemu_boot_set(current_machine->boot_once, &error_fatal); + qemu_register_reset(restore_boot_order, g_strdup(current_machine->= boot_order)); } =20 if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900679; cv=none; d=zohomail.com; s=zohoarc; b=jK32urNTFdBbdqO0nlaOtTt5i2KiOjixTRDT/ZjlHIOzG49dka+T2aqdPXC3qpXFB4T6i+tTfxCbrwwfaQNppWWru4/Aat9lC0lTuz/pMXTIbgD9oyUVchgIoJSh5+m3mWg8d1AX69dTmhr4+9RMx9pd5cXMdLqMKGC+8EsfxYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900679; 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=zgVoL3H0l+Hb60P23cylHjQiDNUjrl2fQXiQK1fD/HM=; b=ILxAMxXkQhECFetjQeZg7YUv3k7pVXyIpMKaoeTVOqYRHBWyw+R3/7dltbkZ2tNGoXZCnOzTndaHXTuUkwtEWZzVCGE3lBH2AreVOG2PwcYwIOEWZIfXbp9zJA5hpU1GRZjcyNY9b1zrd44lc0SNcKlV/wpCQC99vheUp4vczpA= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606900679891307.14165328005504; Wed, 2 Dec 2020 01:17:59 -0800 (PST) Received: from localhost ([::1]:40570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOGs-0004Uy-QO for importer@patchew.org; Wed, 02 Dec 2020 04:17:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDI-0003jY-Gw for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCW-0003nj-Fo for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-Nt_Q-bdnPXSNdIIRlDRYUg-1; Wed, 02 Dec 2020 03:09:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43F1080364D for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 101B760854 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896562; 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: in-reply-to:in-reply-to:references:references; bh=zgVoL3H0l+Hb60P23cylHjQiDNUjrl2fQXiQK1fD/HM=; b=hRWwrJz0YQAhbTydW99wLijd5H8ib9NmAjsZocXcq8VEt2XZHtlh2e+7fY00GBJ1LRNRiE v/lFszkjDzReqVLca36AzU8h7VGRp/VTEq5vnHsKifZc5EjDP5L5ENUj6Jjf7nkgPUP6oN ljslOtQHkRt2IZA2vn/8qoU/krJ7lEE= X-MC-Unique: Nt_Q-bdnPXSNdIIRlDRYUg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 081/113] config-file: move -set implementation to vl.c Date: Wed, 2 Dec 2020 03:08:17 -0500 Message-Id: <20201202080849.4125477-82-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We want to make it independent of QemuOpts. Signed-off-by: Paolo Bonzini Signed-off-by: Paolo Bonzini --- include/qemu/config-file.h | 1 - softmmu/vl.c | 33 +++++++++++++++++++++++++++++++++ util/qemu-config.c | 33 --------------------------------- 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index d74f920152..29226107bd 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -8,7 +8,6 @@ QemuOpts *qemu_find_opts_singleton(const char *group); =20 void qemu_add_opts(QemuOptsList *list); void qemu_add_drive_opts(QemuOptsList *list); -int qemu_set_option(const char *str); int qemu_global_option(const char *str); =20 void qemu_config_write(FILE *fp); diff --git a/softmmu/vl.c b/softmmu/vl.c index 77ee044c42..7146fbe219 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2797,6 +2797,39 @@ static int qemu_read_default_config_file(void) return 0; } =20 +static int qemu_set_option(const char *str) +{ + Error *local_err =3D NULL; + char group[64], id[64], arg[64]; + QemuOptsList *list; + QemuOpts *opts; + int rc, offset; + + rc =3D sscanf(str, "%63[^.].%63[^.].%63[^=3D]%n", group, id, arg, &off= set); + if (rc < 3 || str[offset] !=3D '=3D') { + error_report("can't parse: \"%s\"", str); + return -1; + } + + list =3D qemu_find_opts(group); + if (list =3D=3D NULL) { + return -1; + } + + opts =3D qemu_opts_find(list, id); + if (!opts) { + error_report("there is no %s \"%s\" defined", + list->name, id); + return -1; + } + + if (!qemu_opt_set(opts, arg, str + offset + 1, &local_err)) { + error_report_err(local_err); + return -1; + } + return 0; +} + static void user_register_global_props(void) { qemu_opts_foreach(qemu_find_opts("global"), diff --git a/util/qemu-config.c b/util/qemu-config.c index 660f47b005..725e3d7e4b 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -313,39 +313,6 @@ void qemu_add_opts(QemuOptsList *list) abort(); } =20 -int qemu_set_option(const char *str) -{ - Error *local_err =3D NULL; - char group[64], id[64], arg[64]; - QemuOptsList *list; - QemuOpts *opts; - int rc, offset; - - rc =3D sscanf(str, "%63[^.].%63[^.].%63[^=3D]%n", group, id, arg, &off= set); - if (rc < 3 || str[offset] !=3D '=3D') { - error_report("can't parse: \"%s\"", str); - return -1; - } - - list =3D qemu_find_opts(group); - if (list =3D=3D NULL) { - return -1; - } - - opts =3D qemu_opts_find(list, id); - if (!opts) { - error_report("there is no %s \"%s\" defined", - list->name, id); - return -1; - } - - if (!qemu_opt_set(opts, arg, str + offset + 1, &local_err)) { - error_report_err(local_err); - return -1; - } - return 0; -} - struct ConfigWriteData { QemuOptsList *list; FILE *fp; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606908847; cv=none; d=zohomail.com; s=zohoarc; b=WdVqqecVCtu8luGFe2OOSjIBb6vIirhKC6HRHLMSpdsmW4SwMrgsFFXYGKIZLcT9p/RDjIAEyzXoKSE1fvS+hKn1KDMgVU0J9TQXwRfunZDv30O7V8ZkNDTR2+tJDKX1uOs8FZ2EiObUw0O4LPfo78Dugbgy0tQBc2ZKB1Y6PYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606908847; 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=ORkokebyZd7uYE6EL+PNhLAzVgs7mxSX6u3wc+B7flk=; b=mBvKjdKC/Ekev7BcDEN4jObsU0TkdMYU4XGEwr7r3ZQnYdPbahW4FxiwssE/kPbMiL6UwD5h6U0G8N3xswhvpihHbHofmB0D1ahg7meHTS0/uvdlhp7jGZMoyqmxN+iWMKr9MRJ3wgPELh+epHd8RTmCgXSj8/F7see1+G7Kmao= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606908847629580.9020192467464; Wed, 2 Dec 2020 03:34:07 -0800 (PST) Received: from localhost ([::1]:41430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO8C-000170-SZ for importer@patchew.org; Wed, 02 Dec 2020 04:09:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDI-0003j0-8Z for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCW-0003nv-PW for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-dYWNEmzbN2aHMKgM7WsYPg-1; Wed, 02 Dec 2020 03:09:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 922721074641 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FAE260854 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896563; 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: in-reply-to:in-reply-to:references:references; bh=ORkokebyZd7uYE6EL+PNhLAzVgs7mxSX6u3wc+B7flk=; b=OfnHUp50PJtISADiBnoB8fs6Fk8vks67nz4NtzDtDRldVvJgamdwIXYfzJHMnvxL0i3WBr /+1EntdB+iNVXhQPj1io2NRKSjTEmgYvmNV0zex2Vib88kPHrGRMhFq0E09+CX8sSNhzLO WqbBxD6GIqs6stXF2UR3NBNpBp6UaZ4= X-MC-Unique: dYWNEmzbN2aHMKgM7WsYPg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 082/113] docs: temporarily disable the kernel-doc extension Date: Wed, 2 Dec 2020 03:08:18 -0500 Message-Id: <20201202080849.4125477-83-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Preserve bisectability while we update scripts/kernel-doc from Linux. Without this patch, building with Sphinx 3 would break while we revert our own Sphinx 3 support and replace it with Linux's. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- docs/sphinx/kerneldoc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 3ac277d162..9124fcbff1 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -75,6 +75,9 @@ class KernelDocDirective(Directive): # Tell sphinx of the dependency env.note_dependency(os.path.abspath(filename)) =20 + # Disabled temporarily while scripts/kernel-doc is updated + return [] + tab_width =3D self.options.get('tab-width', self.state.document.se= ttings.tab_width) =20 # FIXME: make this nicer and more robust against errors --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901122; cv=none; d=zohomail.com; s=zohoarc; b=KwCtH5jcYHGS4lMtiDchEvibvC+BMHOmtq4wVN3mvehSDK9Sr4IpiLB4zJfebp13Ys7XnSHcK8XrTFpUymVXLRT3riO3GuB8X5ybJvZz48LH8snQBEN1lxog3qL6z07SXxskRFEjeWULQSo6e11f+/Q1g2KLvw9VL9HKGNko+wE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901122; 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=uQMQmygVLLo56KizHbgMm/0357/uoLkrergt4oaKiKI=; b=Mr6VnZ8EN8Q6wQSuh5b5LdtqDofApwaBvmsQ4dqfjZSJ5JdmFOROzgRYmyRwvovC/TRYkInupzGNc+lvhYqoBcqX72uj5iLNU+PI/Dcj6vm63ALfwXGWW6AwoE4LjvZJ7NJUoaAnAdViQo3BO1zDhDCryLpJeUe5FXtXLSEYrCM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901122269302.2980406006519; Wed, 2 Dec 2020 01:25:22 -0800 (PST) Received: from localhost ([::1]:37640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOFe-0003Bf-FF for importer@patchew.org; Wed, 02 Dec 2020 04:16:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDH-0003h1-90 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCW-0003o1-Rk for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-0C1ehk3PMt-57kQ4Y85Cbg-1; Wed, 02 Dec 2020 03:09:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E29221074642 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE42E60854 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896563; 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: in-reply-to:in-reply-to:references:references; bh=uQMQmygVLLo56KizHbgMm/0357/uoLkrergt4oaKiKI=; b=it4dytpdJSK7el0uKVtdDbV7TWBeTkVzQc/MwPLNtCMBO0xq0EvZZ/h4ZIDRAKD/4utZN2 N2qAsLhldfljRICRu3Cg1pj2QUqiy1ePKgZb8f0p2XmLqbvHdflaqKhVnEy8osKg+oJD9J YJgK15XkKJ00yNWBlvvtWIJgb/O8DC8= X-MC-Unique: 0C1ehk3PMt-57kQ4Y85Cbg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 083/113] kernel-doc: fix processing nested structs with attributes Date: Wed, 2 Dec 2020 03:08:19 -0500 Message-Id: <20201202080849.4125477-84-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Andr=C3=A9 Almeida The current regular expression for strip attributes of structs (and for nested ones as well) also removes all whitespaces that may surround the attribute. After that, the code will split structs and iterate for each symbol separated by comma at the end of struct definition (e.g. "} alias1, alias2;"). However, if the nested struct does not have any alias and has an attribute, it will result in a empty string at the closing bracket (e.g "};"). This will make the split return nothing and $newmember will keep uninitialized. Fix that, by ensuring that the attribute substitution will leave at least one whitespace. Signed-off-by: Andr=C3=A9 Almeida Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4fbaaa05e3..d6bdb77ceb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1103,10 +1103,10 @@ sub dump_struct($$) { # strip comments: $members =3D~ s/\/\*.*?\*\///gos; # strip attributes - $members =3D~ s/\s*__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)//gi; - $members =3D~ s/\s*__aligned\s*\([^;]*\)//gos; - $members =3D~ s/\s*__packed\s*//gos; - $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR//gos; + $members =3D~ s/\s*__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)/ /gi; + $members =3D~ s/\s*__aligned\s*\([^;]*\)/ /gos; + $members =3D~ s/\s*__packed\s*/ /gos; + $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; # replace DECLARE_BITMAP $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606899635; cv=none; d=zohomail.com; s=zohoarc; b=RI+NzpJ4jO7aVt5flCUes0eZOPpwC0GKPpn4H8ElYuHiMuFljQvgfe08VfM7XYo0zUn7XxCcJLcuQRW86UdLRNFfa9XpZmcvMWyiie+WXSRe6E/7VxFTluVbnC1YEyY/Z5rcXfFRfgxLrhxFejz/PCSvUijNcY0UL9O7EHqjkXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606899635; 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=WZYXKzO00JVUutQHmW9BkONu+EccXzcyR5d1oJJtjkE=; b=jqT7L20qXGcO609mA2PSulMUayRXExAQnKaBcCuSFy5UJ7oWqDPDEPIRT/bNs/HHu1YHzgmoZDe3MoY/3NDhLmkuUwINKDA1E6zmE0DJeHxLGMXmOY9p6O4ICdazlxD86kPujxqdgvcfdwC/COrjIw66Q8bsB5FBRRG5pj5JWkg= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606899635909793.506314401584; Wed, 2 Dec 2020 01:00:35 -0800 (PST) Received: from localhost ([::1]:43964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO00-0006Dx-Js for importer@patchew.org; Wed, 02 Dec 2020 04:00:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDG-0003fs-Pd for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCW-0003o5-GR for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-583-MpN-QtSvNleZIsLcSwdyKw-1; Wed, 02 Dec 2020 03:09:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D6171006C82 for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A61C60854 for ; Wed, 2 Dec 2020 08:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896563; 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: in-reply-to:in-reply-to:references:references; bh=WZYXKzO00JVUutQHmW9BkONu+EccXzcyR5d1oJJtjkE=; b=PrWDcL508VI5ROq2kiv/pd4IBYsImNwHfj7Bmobpc/EjjA4ZMKLmeM/IuWH9tQM/78kvMV dpJAadf1DKBLzxNto/hSzDFd2RgV2v7gOb9ljIXB09j5EtAzKs/VzW9o6Ats1NIRNaz0f2 psp7wWFUodbRCKleaoF0XTtzpGpTf6U= X-MC-Unique: MpN-QtSvNleZIsLcSwdyKw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 084/113] kernel-doc: add support for ____cacheline_aligned_in_smp attribute Date: Wed, 2 Dec 2020 03:08:20 -0500 Message-Id: <20201202080849.4125477-85-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Andr=C3=A9 Almeida Subroutine dump_struct uses type attributes to check if the struct syntax is valid. Then, it removes all attributes before using it for output. `____cacheline_aligned_in_smp` is an attribute that is not included in both steps. Add it, since it is used by kernel structs. Signed-off-by: Andr=C3=A9 Almeida Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d6bdb77ceb..2f421b7313 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1092,7 +1092,7 @@ sub dump_struct($$) { my $x =3D shift; my $file =3D shift; =20 - if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= __attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) { + if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)= { my $decl_type =3D $1; $declaration_name =3D $2; my $members =3D $3; @@ -1107,6 +1107,7 @@ sub dump_struct($$) { $members =3D~ s/\s*__aligned\s*\([^;]*\)/ /gos; $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; + $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; # replace DECLARE_BITMAP $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900892; cv=none; d=zohomail.com; s=zohoarc; b=dtAqZlp2PDs1Ru5ItxhjRs6WbQegcHj0abY86b+wSpEzKXT0/4cV/uysyEEpOP9oOQAlv5Gp8V86kOYTVCsDJbnxH95E/yFQrLVFOuo9Qnc2DU9dQMlVxvgQSb9FCdbtH/fb7pHpqzNPk9BqWTBqVKPrZL96FfCAkAy02wYwaUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900892; 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=lTbNvUmcxZxw5oB2uz5Cuhkq6SClsJLpylk8edw4H+k=; b=I398Vp2X+F/4LOdwLNi3ULUW9v8+3+eIlzPKLbsmdBWgNngrc1L0f1rUJMpcx0TSS6bDAqeEld5+8OIZlz1hO82AmIx/szXIRYmPn2QRAPwz3NJtov3pIJiep7+3grXVgBp2y8qM9kFBuZQ5M2z50PY4X2Kxb/12PzIECctcYdU= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606900892290224.72390035614285; Wed, 2 Dec 2020 01:21:32 -0800 (PST) Received: from localhost ([::1]:49274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOKJ-0008CE-6v for importer@patchew.org; Wed, 02 Dec 2020 04:21:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDJ-0003li-Ih for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCY-0003oO-Nm for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-tc4ruzKQMGq4krOPl6eW9g-1; Wed, 02 Dec 2020 03:09:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C75A8558F3 for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59A4560854 for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896564; 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: in-reply-to:in-reply-to:references:references; bh=lTbNvUmcxZxw5oB2uz5Cuhkq6SClsJLpylk8edw4H+k=; b=eOywnoPCLUdljii7nAzoim45ooon2E2hNyJrTnz5FapCVaQuqtFfSk2qt1gmckd+EQ0fDl fG8q2Pw4XNg8VPLIipXcJ7Jt5KaVAqlDaP70gbIoB1zBDGuXy9EOAd91KY4ZDn7Pc05Ih5 FMqOkI5cqEyepUV8tN94S04aWfhDzeo= X-MC-Unique: tc4ruzKQMGq4krOPl6eW9g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 085/113] scripts/kernel-doc: Add support for named variable macro arguments Date: Wed, 2 Dec 2020 03:08:21 -0500 Message-Id: <20201202080849.4125477-86-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Jonathan Neusch=C3=A4fer Currently, when kernel-doc encounters a macro with a named variable argument[1], such as this: #define hlist_for_each_entry_rcu(pos, head, member, cond...) ... it expects the variable argument to be documented as `cond...`, rather than `cond`. This is semantically wrong, because the name (as used in the macro body) is actually `cond`. With this patch, kernel-doc will accept the name without dots (`cond` in the example above) in doc comments, and warn if the name with dots (`cond...`) is used and verbose mode[2] is enabled. The support for the `cond...` syntax can be removed later, when the documentation of all such macros has been switched to the new syntax. Testing this patch on top of v5.4-rc6, `make htmldocs` shows a few changes in log output and HTML output: 1) The following warnings[3] are eliminated: ./include/linux/rculist.h:374: warning: Excess function parameter 'cond' description in 'list_for_each_entr= y_rcu' ./include/linux/rculist.h:651: warning: Excess function parameter 'cond' description in 'hlist_for_each_ent= ry_rcu' 2) For list_for_each_entry_rcu and hlist_for_each_entry_rcu, the correct description is shown 3) Named variable arguments are shown without dots [1]: https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html [2]: scripts/kernel-doc -v [3]: See also https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux= -rcu.git/commit/?h=3Ddev&id=3D5bc4bc0d6153617eabde275285b7b5a8137fdf3c Signed-off-by: Jonathan Neusch=C3=A4fer Tested-by: Paul E. McKenney Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2f421b7313..0f67664165 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1480,6 +1480,10 @@ sub push_parameter($$$$) { # handles unnamed variable parameters $param =3D "..."; } + elsif ($param =3D~ /\w\.\.\.$/) { + # for named variable parameters of the form `x...`, remove the dots + $param =3D~ s/\.\.\.$//; + } if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq ""= ) { $parameterdescs{$param} =3D "variable arguments"; } @@ -1967,6 +1971,18 @@ sub process_name($$) { sub process_body($$) { my $file =3D shift; =20 + # Until all named variable macro parameters are + # documented using the bare name (`x`) rather than with + # dots (`x...`), strip the dots: + if ($section =3D~ /\w\.\.\.$/) { + $section =3D~ s/\.\.\.$//; + + if ($verbose) { + print STDERR "${file}:$.: warning: Variable macro arguments should be= documented without dots\n"; + ++$warnings; + } + } + if (/$doc_sect/i) { # case insensitive for supported section names $newsection =3D $1; $newcontents =3D $2; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901521; cv=none; d=zohomail.com; s=zohoarc; b=nc9LFpaDBOtpAJm9+wz7EKX4Y1LSlKaSHzPaeSyy8PYhpAkDyvPDwJidWZk0uEwvfEkH5BSKXshUmPNn2r/JoUEOvo76vdughz2r2WobK4YD7vgjHhejsouKVAlL7i1CWIA0OXJxRIWanc89TuXLjNwc76xTpm7dlYxveBQWEe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901521; 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=fa85XuODKeELysHalEXDYFyhkK3TZ2Sm3iaRM4QBWm8=; b=ZOWJurXfMt1v0hYDWMPyz1PCjDCYozaIR3XVCmrIySugPLTHhCFQzL+j/9gMOfSKplA1AQ2GkMcW+ez6VdM3YNZJXjF+5hMP9YZ8CRmD9gxoP+ZnXN6Qz/e6Pl33fPFQylHc3Gn3VQeyeTZ5snXjAwnMcuLRu0w5Qj5okHz8lsM= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160690152191719.32372303361717; Wed, 2 Dec 2020 01:32:01 -0800 (PST) Received: from localhost ([::1]:60332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkODm-0000sG-Kg for importer@patchew.org; Wed, 02 Dec 2020 04:14:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDH-0003hw-Pl for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCX-0003oB-3g for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-129-Mi6EmIZONyyeycG9HXjxPA-1; Wed, 02 Dec 2020 03:09:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DAE9380364B for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A817A60854 for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896564; 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: in-reply-to:in-reply-to:references:references; bh=fa85XuODKeELysHalEXDYFyhkK3TZ2Sm3iaRM4QBWm8=; b=iZIAklOUUQuCjEJLBkDfXzr1zH2UH1SzoKKrbwCkHxoPflFONXhTRX6y/gJSlNjcm/51Se 17k87dgZlcUXGdgdpNl3BH8al3fM+MFP2E4i0d/44SzquM3WhSrJ2iPLfgbGzNOkA0vgoI gyLdxnJ8gLgfixV9gfP70oWrELjd1c4= X-MC-Unique: Mi6EmIZONyyeycG9HXjxPA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 086/113] scripts: kernel-doc: proper handle @foo->bar() Date: Wed, 2 Dec 2020 03:08:22 -0500 Message-Id: <20201202080849.4125477-87-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The pattern @foo->bar() is valid, as it can be used by a function pointer inside a struct passed as a parameter. Right now, it causes a warning: ./drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-st= ring without end-string. In this specific case, the kernel-doc markup is: /** * fw_core_remove_address_handler() - unregister an address handler * @handler: callback * * To be called in process context. * * When fw_core_remove_address_handler() returns, @handler->callback() is * guaranteed to not run on any CPU anymore. */ With seems valid on my eyes. So, instead of trying to hack the kernel-doc markup, let's teach it about how to handle such things. This should likely remove lots of other similar warnings as well. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/48b46426d7bf6ff7529f20e5718fbf4e9758e62c.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0f67664165..99530fb08b 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -216,6 +216,7 @@ my $type_constant2 =3D '\%([-_\w]+)'; my $type_func =3D '(\w+)\(\)'; my $type_param =3D '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; my $type_fp_param =3D '\@(\w+)\(\)'; # Special RST handling for func ptr = params +my $type_fp_param2 =3D '\@(\w+->\S+)\(\)'; # Special RST handling for str= ucts with func ptr params my $type_env =3D '(\$\w+)'; my $type_enum =3D '#(enum\s*([_\w]+))'; my $type_struct =3D '#(struct\s*([_\w]+))'; @@ -251,6 +252,7 @@ my @highlights_rst =3D ( [$type_member_func, "\\:c\\:type\\:`\$1\$2\$3\\\\(\= \\\) <\$1>`"], [$type_member, "\\:c\\:type\\:`\$1\$2\$3 <\$1>`"], [$type_fp_param, "**\$1\\\\(\\\\)**"], + [$type_fp_param2, "**\$1\\\\(\\\\)**"], [$type_func, "\$1()"], [$type_enum, "\\:c\\:type\\:`\$1 <\$2>`"], [$type_struct, "\\:c\\:type\\:`\$1 <\$2>`"], --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901045; cv=none; d=zohomail.com; s=zohoarc; b=FTGFmeZM+nO1lvmXqOHw+qUsJs89Q7X+J6s7q3PTmjS3fngkxdVeNEgTqqODBdmLbVpkkitMIHQvQFz+aKqcchkfooW4g/P9K4/vZbUtp3kIXpkzATKyyJGxytTMX+1nc90Yicd3RXJbZSw28nSVe490S08QU8ypKgZbQ+ckpas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901045; 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=xGyWuyk96qqKzEbfJ4PiZWk+a4+54l1Ti4T2Ca7YwMM=; b=IOxqgNaTb+/PEHgdAvUrqVwrZxTWzl4bqCIeIv5rQQxyzcKrDAw2lDM1gcwerY9VAUpVcV5XCXDFbFEI4T/KEIpyNgHMDeRPd0pC82KFnrwvdd5FPtg4bkVPemsAjEqFx74rCYMAx4gLh+q9B5O89otJijkLrs69ZrvvHkA3evQ= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901045794949.6849761672833; Wed, 2 Dec 2020 01:24:05 -0800 (PST) Received: from localhost ([::1]:57908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOMm-0003Yv-Gw for importer@patchew.org; Wed, 02 Dec 2020 04:24:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDJ-0003mc-UO for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCX-0003oG-Tn for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-ucim2BR8NAafO1maHfsKPw-1; Wed, 02 Dec 2020 03:09:23 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34B045708A for ; Wed, 2 Dec 2020 08:09:22 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 025E060854 for ; Wed, 2 Dec 2020 08:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896564; 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: in-reply-to:in-reply-to:references:references; bh=xGyWuyk96qqKzEbfJ4PiZWk+a4+54l1Ti4T2Ca7YwMM=; b=SY0sYiLUigO5C7E8SQHIKDkPdESntlIEs6R0asjNjJlBa9HnrOayGW4vJaKqtqY2Jk4Z0x 3EjjxxKMen7fQILVYlZiQx7jz9AaUPJr07BBv5vyARlqoWdIrzNp6kd7Em4pIlu4YCqxfA RDLb/tSwHML52SOPEKGzHVCha932WSg= X-MC-Unique: ucim2BR8NAafO1maHfsKPw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 087/113] scripts: kernel-doc: accept negation like !@var Date: Wed, 2 Dec 2020 03:08:23 -0500 Message-Id: <20201202080849.4125477-88-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab On a few places, it sometimes need to indicate a negation of a parameter, like: !@fshared This pattern happens, for example, at: kernel/futex.c and it is perfectly valid. However, kernel-doc currently transforms it into: !**fshared** This won't do what it would be expected. Fortunately, fixing the script is a simple matter of storing the "!" before "@" and adding it after the bold markup, like: **!fshared** Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/0314b47f8c3e1f9db00d5375a73dc3cddd8a21f2.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 99530fb08b..e4b3cd486f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -215,6 +215,7 @@ my $type_constant =3D '\b``([^\`]+)``\b'; my $type_constant2 =3D '\%([-_\w]+)'; my $type_func =3D '(\w+)\(\)'; my $type_param =3D '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; +my $type_param_ref =3D '([\!]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; my $type_fp_param =3D '\@(\w+)\(\)'; # Special RST handling for func ptr = params my $type_fp_param2 =3D '\@(\w+->\S+)\(\)'; # Special RST handling for str= ucts with func ptr params my $type_env =3D '(\$\w+)'; @@ -239,6 +240,7 @@ my @highlights_man =3D ( [$type_typedef, "\\\\fI\$1\\\\fP"], [$type_union, "\\\\fI\$1\\\\fP"], [$type_param, "\\\\fI\$1\\\\fP"], + [$type_param_ref, "\\\\fI\$1\$2\\\\fP"], [$type_member, "\\\\fI\$1\$2\$3\\\\fP"], [$type_fallback, "\\\\fI\$1\\\\fP"] ); @@ -260,7 +262,7 @@ my @highlights_rst =3D ( [$type_union, "\\:c\\:type\\:`\$1 <\$2>`"], # in rst this can refer to any type [$type_fallback, "\\:c\\:type\\:`\$1`"], - [$type_param, "**\$1**"] + [$type_param_ref, "**\$1\$2**"] ); my $blankline_rst =3D "\n"; =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900890; cv=none; d=zohomail.com; s=zohoarc; b=N+E6kMZHGwdgTN3vTk7HkTTZDPHPH9mOmQ5ZuiuaVGqcLOAfm0v7OQossK9sao0vhmSANXQL0YMFXlxNLvxtsZ/upb+9NPYw3k3Hfiz/dfysmJPfJSr40fS5Vi1v8Upvy6VUjsZriXlnYnPaozEzn0Isf/NLWSzqbARuFJqiIXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900890; 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=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=DVP+rM6dzZCiMcvzoulidc/S0TB4FeCl23IPU7JGLTyFCIWzyIae5Q3USVk4oBEIr56SrW448YJoMpW981B27FYVht+4Q3MaBMc8XvA7T/Qdj/iFnwoEzNZUmdmHXSmXhPcMWaKKGDNuzWla9lgVRfGTYDSLIqF9nQ/TSjUUAus= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160690089008379.89094718783144; Wed, 2 Dec 2020 01:21:30 -0800 (PST) Received: from localhost ([::1]:48944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOKE-00083r-SY for importer@patchew.org; Wed, 02 Dec 2020 04:21:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDJ-0003l1-3K for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCY-0003oE-Jf for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-piPyVgaIMV-nCOb7NNdIRA-1; Wed, 02 Dec 2020 03:09:23 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83032185E48B for ; Wed, 2 Dec 2020 08:09:22 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 509C960855 for ; Wed, 2 Dec 2020 08:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896564; 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: in-reply-to:in-reply-to:references:references; bh=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=MTy0r3ADpt8POBn45obBVTgYjqz5WAradBtofoC6VaDQ2g0b3LMETvVnEk1XuPyXctor1e q7anApCQH1QvL8Kw6KLpvt8lA4gNA2dXYSmVgqyhcdqsuTQEbSbqLRG6cQ2GMFNPExz3Mp OtcbsI82CaXGpqGxiiXH9fu8wCA2FhA= X-MC-Unique: piPyVgaIMV-nCOb7NNdIRA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 088/113] scripts: kernel-doc: accept blank lines on parameter description Date: Wed, 2 Dec 2020 03:08:24 -0500 Message-Id: <20201202080849.4125477-89-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Sphinx is very pedantic with respect to blank lines. Sometimes, in order to make it to properly handle something, we need to add a blank line. However, currently, any blank line inside a kernel-doc comment like: /* * @foo: bar * * foobar * * some description will be considered as if "foobar" was part of the description. This patch changes kernel-doc behavior. After it, foobar will be considered as part of the parameter text. The description will only be considered as such if it starts with: zero spaces after asterisk: *foo one space after asterisk: * foo or have a explicit Description section: * Description: Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c07d2862792d75a2691d69c9eceb7b89a0164cc0.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index e4b3cd486f..95f2d7adcf 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -334,13 +334,14 @@ my $lineprefix=3D""; =20 # Parser states use constant { - STATE_NORMAL =3D> 0, # normal code - STATE_NAME =3D> 1, # looking for function name - STATE_BODY_MAYBE =3D> 2, # body - or maybe more description - STATE_BODY =3D> 3, # the body of the comment - STATE_PROTO =3D> 4, # scanning prototype - STATE_DOCBLOCK =3D> 5, # documentation block - STATE_INLINE =3D> 6, # gathering documentation outside main blo= ck + STATE_NORMAL =3D> 0, # normal code + STATE_NAME =3D> 1, # looking for function name + STATE_BODY_MAYBE =3D> 2, # body - or maybe more description + STATE_BODY =3D> 3, # the body of the comment + STATE_BODY_WITH_BLANK_LINE =3D> 4, # the body, which has a blank line + STATE_PROTO =3D> 5, # scanning prototype + STATE_DOCBLOCK =3D> 6, # documentation block + STATE_INLINE =3D> 7, # gathering doc outside main block }; my $state; my $in_doc_sect; @@ -1987,6 +1988,12 @@ sub process_body($$) { } } =20 + if ($state =3D=3D STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) { + dump_section($file, $section, $contents); + $section =3D $section_default; + $contents =3D ""; + } + if (/$doc_sect/i) { # case insensitive for supported section names $newsection =3D $1; $newcontents =3D $2; @@ -2040,18 +2047,21 @@ sub process_body($$) { $state =3D STATE_PROTO; $brcount =3D 0; } elsif (/$doc_content/) { - # miguel-style comment kludge, look for blank lines after - # @parameter line to signify start of description if ($1 eq "") { - if ($section =3D~ m/^@/ || $section eq $section_context) { + if ($section eq $section_context) { dump_section($file, $section, $contents); $section =3D $section_default; $contents =3D ""; $new_start_line =3D $.; + $state =3D STATE_BODY; } else { + if ($section ne $section_default) { + $state =3D STATE_BODY_WITH_BLANK_LINE; + } else { + $state =3D STATE_BODY; + } $contents .=3D "\n"; } - $state =3D STATE_BODY; } elsif ($state =3D=3D STATE_BODY_MAYBE) { # Continued declaration purpose chomp($declaration_purpose); @@ -2203,7 +2213,8 @@ sub process_file($) { process_normal(); } elsif ($state =3D=3D STATE_NAME) { process_name($file, $_); - } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE) { + } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE || + $state =3D=3D STATE_BODY_WITH_BLANK_LINE) { process_body($file, $_); } elsif ($state =3D=3D STATE_INLINE) { # scanning for inline parameters process_inline($file, $_); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606908510; cv=none; d=zohomail.com; s=zohoarc; b=JN9Ulj8Tm5wlDdFZm+8PH1uiwC62Zp+JpLOod1PVs+zTVn2z32Pkn066/ABR8ZX7Fwd8YS/+ookOEDsDCJGdSPnqtifGKRlRt1EAggwPhAuZunn+9RZGVq+0EgMi+EyoTnFj8xStIkCWVNGzcQqYsrh1KY3Kk5j/Q61UV/oualg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606908510; 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=mnDt9dCJFmP8E0DM2A3oLfqLSGXZccI9gx1KuDRb0Zs=; b=erAXsGbzuJBtz/MKss9YYwDZ06hdLndVeGyHTrUp8IsM9iIyvfy5LQZKi7xVO4zD4Hos/4DKoLq1iErNJ94rHgOuC7JlneavFYz0oRYwn/eruah15+4DS7+nuP6VXNUY6FY08JEblgkgl/SBwEdTQByAV2B2DnMJxyzx5oLBNkU= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606908509998266.9400219321252; Wed, 2 Dec 2020 03:28:29 -0800 (PST) Received: from localhost ([::1]:52182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO2K-0001XT-9K for importer@patchew.org; Wed, 02 Dec 2020 04:02:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDK-0003oG-KH for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCZ-0003og-M7 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-ttO9Gh6DNJuhk_lHFncyPA-1; Wed, 02 Dec 2020 03:09:23 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D195B8558EF for ; Wed, 2 Dec 2020 08:09:22 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EABC60855 for ; Wed, 2 Dec 2020 08:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896566; 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: in-reply-to:in-reply-to:references:references; bh=mnDt9dCJFmP8E0DM2A3oLfqLSGXZccI9gx1KuDRb0Zs=; b=i7DSuzkDnLHrwLznEbagobjsLXCWvDt0qSDLj+xs3HZqxEjbdTr8heZWoateY0oImQzVWe LKaa00V8I55l7fzCDBipLP6O2KPdx+Kbszp4aJ4vnq9lZfqKZQWi7OWBeswdIxLsqayKTb Rk7PhJdF+ja83rDnmoEdu/oXAkcsXX8= X-MC-Unique: ttO9Gh6DNJuhk_lHFncyPA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 089/113] Replace HTTP links with HTTPS ones: documentation Date: Wed, 2 Dec 2020 03:08:25 -0500 Message-Id: <20201202080849.4125477-90-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Alexander A. Klimov" Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov Link: https://lore.kernel.org/r/20200526060544.25127-1-grandmaster@al2klimo= v.de Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 95f2d7adcf..fadc2f5b86 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -324,7 +324,7 @@ if (defined($ENV{'KBUILD_VERBOSE'})) { =20 # Generated docbook code is inserted in a template at a point where # docbook v3.1 requires a non-zero sequence of RefEntry's; see: -# http://www.oasis-open.org/docbook/documentation/reference/html/refentry.= html +# https://www.oasis-open.org/docbook/documentation/reference/html/refentry= .html # We keep track of number of generated entries and generate a dummy # if needs be to ensure the expanded template can be postprocessed # into html. --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606904523; cv=none; d=zohomail.com; s=zohoarc; b=PHkmIjMqSQlb4MXDD1r/qPMzNJrS5+hl5W7PIXf8SpCMedoFUJMode9MBo0a2lFMpmFHCDAC5DTo6BzfWHHLF1bhCp8W6xkm+pgJAzWNB1zfHcv31a1de4H88FFvpKldBV9DY8vJOB2oY+FA9j6bACfI2vHKF9qSfBlP6Q2ePbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606904523; 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=63F4hjsPgY3g+SgiHAsRKv4smSA5qlvgJjHWOrAc6a8=; b=QGt7FZWCPb9PUoC5YmFcz6vo6ni0xczk5mlCc43NBQcjyLioFr+Btd9oisIuVuCUAImXR/OvpVwsQ9F5B9lsFztJ0VNXKyqTYAzmlbxzi0A4lzGBiQKU/fkV3k4tG/A1FzK8Ut8mBSeleeR687mJkMz3lzq1LmNYWNOj5GUifVk= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160690452315186.99936890295805; Wed, 2 Dec 2020 02:22:03 -0800 (PST) Received: from localhost ([::1]:49654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOB0-0004p3-PS for importer@patchew.org; Wed, 02 Dec 2020 04:11:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDJ-0003mA-Op for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCY-0003oX-T9 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-190-oN8EN-k9NrqmtcxOaLORYA-1; Wed, 02 Dec 2020 03:09:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81C5E8558F0 for ; Wed, 2 Dec 2020 08:09:23 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 464BB5C1B4 for ; Wed, 2 Dec 2020 08:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896565; 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: in-reply-to:in-reply-to:references:references; bh=63F4hjsPgY3g+SgiHAsRKv4smSA5qlvgJjHWOrAc6a8=; b=UwAgrYsv86wUug7HaPRpvdTZInOTVBUzvd68RFsk92Lm9vVwHwEc+6Vj3eYag10/9Bu42w U2MPQtPNVCK1/E/NjJcP3/NZimM//ux5U1oR+jpbFfmuHaBRJU4wfnD9XjkGzosNUhBT+V v23I9odBn6ryFZUBfZCmNC4+blbKq1M= X-MC-Unique: oN8EN-k9NrqmtcxOaLORYA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 090/113] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK Date: Wed, 2 Dec 2020 03:08:26 -0500 Message-Id: <20201202080849.4125477-91-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The __ETHTOOL_DECLARE_LINK_MODE_MASK macro is a variant of DECLARE_BITMAP(), used by phylink.h. As we have already a parser for DECLARE_BITMAP(), let's add one for this macro, in order to avoid such warnings: ./include/linux/phylink.h:54: warning: Function parameter or member '__ETH= TOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_sta= te' ./include/linux/phylink.h:54: warning: Function parameter or member '__ETH= TOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_= state' Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d1d1dea67a28117c0b0c33271b139c4455fef287.15= 92895969.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-9-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index fadc2f5b86..e8fff6a525 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1113,7 +1113,9 @@ sub dump_struct($$) { $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; + # replace DECLARE_BITMAP + $members =3D~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_B= ITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE $members =3D~ s/DECLARE_HASHTABLE\s*\(([^,)]+),\s*([^,)]+)\)/unsigned lon= g $1\[1 << (($2) - 1)\]/gos; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901236; cv=none; d=zohomail.com; s=zohoarc; b=STNcIqd6/4Ud2ms3/k2ansBPDiwwJEO22yzJutMZ3kotKnAJGefdtJCfJzVXl5w1zpeu5neAms70aM3jEaO4jbLkMbtJfORTAVzfPgJqzz7Vxji2wj8E8150S137encAS/2uALGk4wcijQPmLU5S61v2Dbax6MInDZ3afMLF4M0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901236; 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=O9hSD6aXz202BRQxQakOz7bqCncJQ7SCRZireavH59k=; b=k8vRqS6ZINxY8M1FwFe1Q5ee7jmtlhq8fMDm98F71l8tLY45vIazeoDDX4sVRVGwlqcYcWszlO7oG/TAo2w7lbO3zMKueXJ5ZnIPBu5eRt6qnecZuPEkIvaV8f0Jy3HY0Q7lq3ZtGLeHAGnzEv0LfAhkIctTAci/FB0tDVeiG+w= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901236736638.4762556924518; Wed, 2 Dec 2020 01:27:16 -0800 (PST) Received: from localhost ([::1]:38194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOPr-0007G0-IG for importer@patchew.org; Wed, 02 Dec 2020 04:27:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDL-0003pO-5J for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCZ-0003oc-Li for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-2x65Rl16Oz6dxKw7Ov8eZw-1; Wed, 02 Dec 2020 03:09:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDD3E80364B for ; Wed, 2 Dec 2020 08:09:23 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A22785C1B4 for ; Wed, 2 Dec 2020 08:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896566; 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: in-reply-to:in-reply-to:references:references; bh=O9hSD6aXz202BRQxQakOz7bqCncJQ7SCRZireavH59k=; b=b5XzYbI/+oKxo/u3ZCQ55fQoWIHceUk0bWdA+pFnOMx+PcepOF/RjuSr71cvv1cT+lPcyb yqHhQyGTPU/J1NmqgxTt1QEvo7yN4PCaVlluU82hlDpl+6Sh18E8R/sgXZHwDXZ9vf2sqb 2Dzn6PHLMs1r5jXEeIpV7osBTBUvrME= X-MC-Unique: 2x65Rl16Oz6dxKw7Ov8eZw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 091/113] scripts/kernel-doc: handle function pointer prototypes Date: Wed, 2 Dec 2020 03:08:27 -0500 Message-Id: <20201202080849.4125477-92-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There are some function pointer prototypes inside the net includes, like this one: int (*pcs_config)(struct phylink_config *config, unsigned int mode, phy_interface_t interface, const unsigned long *advertising); There's nothing wrong using it with kernel-doc, but we need to add a rule for it to parse such kind of prototype. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/fec520dd731a273013ae06b7653a19c7d15b9562.15= 92895969.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-10-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index e8fff6a525..1cdece23fb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1801,6 +1801,11 @@ sub process_proto_function($$) { $prototype =3D~ s@/\*.*?\*/@@gos; # strip comments. $prototype =3D~ s@[\r\n]+@ @gos; # strip newlines/cr's. $prototype =3D~ s@^\s+@@gos; # strip leading spaces + + # Handle prototypes for function pointers like: + # int (*pcs_config)(struct foo) + $prototype =3D~ s@^(\S+\s+)\(\s*\*(\S+)\)@$1$2@gos; + if ($prototype =3D~ /SYSCALL_DEFINE/) { syscall_munge(); } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901262; cv=none; d=zohomail.com; s=zohoarc; b=AoHXOD1bcEWSG/dZSw4cv9WTlcVaZVM9RR7KC4ZULztugxhcEC/JCH5qgg1PejW5stecxhuu+E7gkMJnF7zORApWizxSvSY80bObzav9K1RnUc8Nko/r85LNDwxN5lI3Sjsu0wPmyFaxMhAuiJryfyyMfUzLRSjWIuhURHtX+ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901262; 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=S1wx4TC4FJnM01CiYUL9Na+v5QgrCrPNyRPcarA1104=; b=IXPTVP+Tkaon9tkiCjkxRuiGvZ+P7OQgayg+pU45FKohWyY/5CIbsI292DNdIJtgobAwRNz2g4g2ipLgjH9UpScXLw0udyk6RKeVRzvKYMqZY/SkkUZe2Jighoh2GSemni72oe7t34AG0NtundG17BYqDFZBo4MnXGcLXtfX/Hc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901262971837.3162652461106; Wed, 2 Dec 2020 01:27:42 -0800 (PST) Received: from localhost ([::1]:57972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkODO-0008KG-JO for importer@patchew.org; Wed, 02 Dec 2020 04:14:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDL-0003pq-Dy for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCZ-0003oq-Lv for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-aO9vFFSEPc6S9dRg3nnuIQ-1; Wed, 02 Dec 2020 03:09:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 463E41006C81 for ; Wed, 2 Dec 2020 08:09:24 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A8395C1B4 for ; Wed, 2 Dec 2020 08:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896566; 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: in-reply-to:in-reply-to:references:references; bh=S1wx4TC4FJnM01CiYUL9Na+v5QgrCrPNyRPcarA1104=; b=XPyZigP7y36Duwjme1Y74IedPAjzqPBdgK8CGMP+IcDnsFx6/GEmNZUvsVl0H4QQbdoihp xA2hUkdOOrfx+dR+v8aZpz0aM3kozbbuLYN5DhV9VwZh7oNHVQA8dGgqNexpdw/1qF1Zjq fwHto17MWJbZlY331nnOPAcdn7QsY7A= X-MC-Unique: aO9vFFSEPc6S9dRg3nnuIQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 092/113] scripts/kernel-doc: optionally treat warnings as errors Date: Wed, 2 Dec 2020 03:08:28 -0500 Message-Id: <20201202080849.4125477-93-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Pierre-Louis Bossart The kbuild bot recently added the W=3D1 option, which triggered documentation cleanups to squelch hundreds of kernel-doc warnings. To make sure new kernel contributions don't add regressions to kernel-doc descriptors, this patch suggests an option to treat warnings as errors in CI/automated tests. A -Werror command-line option is added to the kernel-doc script. When this option is set, the script will return the number of warnings found. The caller can then treat this positive return value as an error and stop the build. Using this command line option is however not straightforward when the kernel-doc script is called from other scripts. To align with typical kernel compilation or documentation generation, the Werror option is also set by checking the KCFLAGS environment variable, or if KDOC_WERROR is defined, as in the following examples: KCFLAGS=3D"-Wall -Werror" make W=3D1 sound/ KCFLAGS=3D"-Wall -Werror" make W=3D1 drivers/soundwire/ KDOC_WERROR=3D1 make htmldocs Note that in the last example the documentation build does not stop, only an additional log is provided. Credits to Randy Dunlap for suggesting the use of environment variables. Suggested-by: Randy Dunlap Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200728162040.92467-1-pierre-louis.bossart= @linux.intel.com Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-11-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 1cdece23fb..eb635eb94c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -83,6 +83,7 @@ Output selection modifiers: Other parameters: -v Verbose output, more warnings and other information. -h Print this help. + -Werror Treat warnings as errors. =20 EOF print $message; @@ -275,6 +276,7 @@ my $kernelversion; my $dohighlight =3D ""; =20 my $verbose =3D 0; +my $Werror =3D 0; my $output_mode =3D "rst"; my $output_preformatted =3D 0; my $no_doc_sections =3D 0; @@ -322,6 +324,18 @@ if (defined($ENV{'KBUILD_VERBOSE'})) { $verbose =3D "$ENV{'KBUILD_VERBOSE'}"; } =20 +if (defined($ENV{'KDOC_WERROR'})) { + $Werror =3D "$ENV{'KDOC_WERROR'}"; +} + +if (defined($ENV{'KCFLAGS'})) { + my $kcflags =3D "$ENV{'KCFLAGS'}"; + + if ($kcflags =3D~ /Werror/) { + $Werror =3D 1; + } +} + # Generated docbook code is inserted in a template at a point where # docbook v3.1 requires a non-zero sequence of RefEntry's; see: # https://www.oasis-open.org/docbook/documentation/reference/html/refentry= .html @@ -436,6 +450,8 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { push(@export_file_list, $file); } elsif ($cmd eq "v") { $verbose =3D 1; + } elsif ($cmd eq "Werror") { + $Werror =3D 1; } elsif (($cmd eq "h") || ($cmd eq "help")) { usage(); } elsif ($cmd eq 'no-doc-sections') { @@ -2292,4 +2308,9 @@ if ($verbose && $warnings) { print STDERR "$warnings warnings\n"; } =20 -exit($output_mode eq "none" ? 0 : $errors); +if ($Werror && $warnings) { + print STDERR "$warnings warnings as Errors\n"; + exit($warnings); +} else { + exit($output_mode eq "none" ? 0 : $errors) +} --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900803; cv=none; d=zohomail.com; s=zohoarc; b=MXujRUnMzu80uKf8p8RZEXCAYCuqXM8OOOtSHwNxglNKNscRrmi+z2bLAZNRdW6SGVzL4VvxgGTNDh5YRm5MiEDWx4A3U+Zd60hbAVmBEJsiHZKIh+pTlAoLtN3ANggBMGMUJIFybEhQ19tFA4YNdDMnu6aNvgeoxAVcg/i/xdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900803; 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=w5+i7WtTOWFay7Bbldi9tvqw4ql3MDE7bXj9l/6PVIE=; b=iiUJhFnlqwSeuZH4qnEdU7HxYWp6NVSFbs+hnvYxE0fthvKsm9a94843SPnWF513JT/PJDvulsIYw9PXLK3NtlAz/ugdchx0cWt6PWvks7uh5Gog5/s+JnBYCqs6lSiSoMHRjH3faZ/sL91A7DJu1zYfXvxcGV1yQtfdhh/uCDs= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160690080371410.304303981926182; Wed, 2 Dec 2020 01:20:03 -0800 (PST) Received: from localhost ([::1]:46662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOIs-00075t-Hh for importer@patchew.org; Wed, 02 Dec 2020 04:20:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDN-0003v6-ND for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-0003p9-K3 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-jA9o9zwrPYKM1LiXDDQkcg-1; Wed, 02 Dec 2020 03:09:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A376B8558EF for ; Wed, 2 Dec 2020 08:09:24 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 669635C1B4 for ; Wed, 2 Dec 2020 08:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896567; 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: in-reply-to:in-reply-to:references:references; bh=w5+i7WtTOWFay7Bbldi9tvqw4ql3MDE7bXj9l/6PVIE=; b=W5vyGOHZp144hS9BC4wQyJyfo1+HAInOUc9JeUUhPQI2vQ9x5YtkU1fAy+d6oOfekDyWtH KcMMxobm/S7n2hRZc/fu7phSlDfHDa/bCKAfTQQzgOJe5hqFHGxFbBVJtqD15tXkBkt7PH bISjgJdwHqvYJ5fb/pX1d1M+vRD3+14= X-MC-Unique: jA9o9zwrPYKM1LiXDDQkcg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 093/113] kernel-doc: include line numbers for function prototypes Date: Wed, 2 Dec 2020 03:08:29 -0500 Message-Id: <20201202080849.4125477-94-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab This should solve bad error reports like this one: ./include/linux/iio/iio.h:0: WARNING: Unknown target name: "devm". Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/56eed0ba50cd726236acd12b11b55ce54854c5ea.15= 99660067.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-12-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index eb635eb94c..3fd6f3925e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1624,6 +1624,8 @@ sub dump_function($$) { my $file =3D shift; my $noret =3D 0; =20 + print_lineno($.); + $prototype =3D~ s/^static +//; $prototype =3D~ s/^extern +//; $prototype =3D~ s/^asmlinkage +//; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901041; cv=none; d=zohomail.com; s=zohoarc; b=nbEkan02AitYEHYUA1pioaXpc/OvAnYXaemcNO7Z6Bkf6uZrm3vZBgx8N9XsAlD47FbngpUR2mt9Kk9/07O7R6kU//6OfmtJc91ra2eV+Xq5lc0BYvCebORTrcI5+4T96g63uHoQqXVyFltd4EzJkmDpJDqb/lu7IlrQk9Kl/w4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901041; 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=Cu74eGbX1Pzti3T+9FIBrGUXU++sBJFK1SRMc5dwyjo=; b=Lw7ErEG1sLiC0gHCVUz9Onncc8MfeS8U2HIQVvs8mSBS0j0prn1wrLyEJI+JiS/neSorMMglN1Ac2PR2lJUkWRiNrKN6JMAnIQAx7EejeIs8m6UABVbXiw3uunj9qg1bMyosouvwqCg0JxWBcpiqRaeK/LUxka1IJQP98ig65DI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901041572179.03265702182262; Wed, 2 Dec 2020 01:24:01 -0800 (PST) Received: from localhost ([::1]:57530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOMi-0003PU-Fv for importer@patchew.org; Wed, 02 Dec 2020 04:24:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDL-0003qR-LT for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-0003pq-Ng for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-mwYJXPnSOLCyd_0V-RY1sA-1; Wed, 02 Dec 2020 03:09:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A2411074642 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C35455C1B4 for ; Wed, 2 Dec 2020 08:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896567; 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: in-reply-to:in-reply-to:references:references; bh=Cu74eGbX1Pzti3T+9FIBrGUXU++sBJFK1SRMc5dwyjo=; b=EbvboEdQWBafo8hkIVPmvk1+4R1KeCshW5QWsLLp4IGkFGPgx8QyC8E+DYCUIun/V8HU44 vxaXngZAGVRPsO0Ggg6eDntRAoT0j0+aVOFbCiodxU34I7Nd2DqUKdF6piPbm9iyPyGPmb WTXgrVAKlA4X7y9h76i1u2dbCJPp6Kk= X-MC-Unique: mwYJXPnSOLCyd_0V-RY1sA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 094/113] kernel-doc: add support for ____cacheline_aligned attribute Date: Wed, 2 Dec 2020 03:08:30 -0500 Message-Id: <20201202080849.4125477-95-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Subroutine dump_struct uses type attributes to check if the struct syntax is valid. Then, it removes all attributes before using it for output. `____cacheline_aligned` is an attribute that is not included in both steps. Add it, since it is used by kernel structs. Based on previous patch to add ____cacheline_aligned_in_smp. Motivated by patches to reorder this attribute to before the variable name. Whilst we could do that in all cases, that would be a massive change and it is more common in the kernel to place this particular attribute after the variable name. A quick grep suggests approximately 400 instances of which 341 have this attribute just before a semicolon and hence after the variable name. Signed-off-by: Jonathan Cameron Cc: Lee Jones Link: https://lore.kernel.org/r/20200910185415.653139-1-jic23@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 3fd6f3925e..c4c5640ded 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1113,7 +1113,7 @@ sub dump_struct($$) { my $x =3D shift; my $file =3D shift; =20 - if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)= { + if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z= 0-9,_\s\(\)]*\)\)))*/) { my $decl_type =3D $1; $declaration_name =3D $2; my $members =3D $3; @@ -1129,6 +1129,7 @@ sub dump_struct($$) { $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; + $members =3D~ s/\s*____cacheline_aligned/ /gos; =20 # replace DECLARE_BITMAP $members =3D~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_B= ITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900628; cv=none; d=zohomail.com; s=zohoarc; b=GnAolm/SJs2fj+DkjMpxvxQzRxkip490FqNZx6lSbHwxJpxVnEgY5tYNlJD2WmHLI0QpCBma/QJgyUuTC9ieZP7ygHIy+xh++DFcUGan1Vydd5Iw5mIFLAVizZz0xLGMpiu1oR7q77CywuZzCErZYwTZ4EtKUEVJL1fyshwpbKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900628; 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=eg1UCSP6TBFRjWh8o362r/gExEhG9FGt2zB8v+faRZc=; b=Vh28nVlfz5NA1OokM5xrx2E98M5T8cGNecL1e2x5TlEPxOOlvQnQqqSAKTcsEh0rl0iRNvOwK1kgpXQbhQ2mpceiqE2tMAcp0Ger3rptyeSMgLP4LiHl1XzcQkV83HVEWz0hoLJ9FEW0B1yvUOHRs232fQR/9iYNQRkM9lVmtys= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16069006283181016.1581890440921; Wed, 2 Dec 2020 01:17:08 -0800 (PST) Received: from localhost ([::1]:38254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOG3-0003R7-1i for importer@patchew.org; Wed, 02 Dec 2020 04:17:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDM-0003rb-4U for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCa-0003pm-Q1 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-rcxgJCJLPWa-guP6gj-y7A-1; Wed, 02 Dec 2020 03:09:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65F0D185E489 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B1515C1B4 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896567; 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: in-reply-to:in-reply-to:references:references; bh=eg1UCSP6TBFRjWh8o362r/gExEhG9FGt2zB8v+faRZc=; b=I6dNuMuYpTi7QVXKWxSOFChgh6ptpOrYfEppjA9GzMoFPdmm4+6bAQ9HLN3U+cbsWPXRad MIAIQBOtfgr/X+hKMVfiiP9MgZouZDwpE6GOGUfKS5ZbFimxzws7uLGgh3T5c9Ab+4maZC gO+55awsHkzRGXHa5l/mqmsxEtZdhAg= X-MC-Unique: rcxgJCJLPWa-guP6gj-y7A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 095/113] scripts: kernel-doc: add support for typedef enum Date: Wed, 2 Dec 2020 03:08:31 -0500 Message-Id: <20201202080849.4125477-96-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The PHY kernel-doc markup has gained support for documenting a typedef enum. However, right now the parser was not prepared for it. So, add support for parsing it. Fixes: 4069a572d423 ("net: phy: Document core PHY structures") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c4c5640ded..073f72c7da 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1295,14 +1295,22 @@ sub show_warnings($$) { sub dump_enum($$) { my $x =3D shift; my $file =3D shift; + my $members; + =20 $x =3D~ s@/\*.*?\*/@@gos; # strip comments. # strip #define macros inside enums $x =3D~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; =20 - if ($x =3D~ /enum\s+(\w*)\s*\{(.*)\}/) { + if ($x =3D~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) { + $declaration_name =3D $2; + $members =3D $1; + } elsif ($x =3D~ /enum\s+(\w*)\s*\{(.*)\}/) { $declaration_name =3D $1; - my $members =3D $2; + $members =3D $2; + } + + if ($declaration_name) { my %_members; =20 $members =3D~ s/\s+$//; @@ -1337,8 +1345,7 @@ sub dump_enum($$) { 'sections' =3D> \%sections, 'purpose' =3D> $declaration_purpose }); - } - else { + } else { print STDERR "${file}:$.: error: Cannot parse enum!\n"; ++$errors; } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901596; cv=none; d=zohomail.com; s=zohoarc; b=Wmt/NamAHtuA488RK7y0gUJ7c1T43F2Bx1/nKSiZTcWeE0O8AyuYcBBYw551I3IOvCeSQgWX49LZ1CPEro3anFS77DmnVT7F+RAg9EVPUcq6YKq4+s/xAwapLNUXfP7xENE0mwMKM3UCXubE5BbDRGP2GS228Tjl2zPFEgcQu/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901596; 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=eCs0riI9kHM//7BOaTOgwbI1V82e+fKC6hbIAxErEfY=; b=PGee62K+bGKI6MiEEx9MvJKD9Mzffm3mlurY2pJc6xdl0ZiLYHWqvfRgBzjuj6+PfbEirZQgFwSdtF4UNs1v71Aho/9iezyaFhmgPxz1rwBrb3+/34tC4C2s5P8MLiYFqSwJce8gEs6s2vqUtQau9dlY1pZjfrVavBeL8SCEUTE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901596953551.5586090105733; Wed, 2 Dec 2020 01:33:16 -0800 (PST) Received: from localhost ([::1]:60490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO63-0005Sn-Fh for importer@patchew.org; Wed, 02 Dec 2020 04:06:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDM-0003st-Kr for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCb-0003pt-00 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-fo-J25G4OBe92JwHJ0v_BQ-1; Wed, 02 Dec 2020 03:09:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C32648558E7 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87E875C1B4 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896568; 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: in-reply-to:in-reply-to:references:references; bh=eCs0riI9kHM//7BOaTOgwbI1V82e+fKC6hbIAxErEfY=; b=PQgVSZWo7fbzTSDJuCk6jTwLMhoabLaWj566FhRFa8UnPxLT9FV12jj4Y6JTbmGp8VnGh2 5L3l6ceRPcc0aTa7EfFQXThKTu+aPQrS3+789Q9JGLpxRBeHETzValAJ2ZwmbEBDEhIY+g j3Vjeu7BSwWtgiSQ2MwfobdrW05i+5k= X-MC-Unique: fo-J25G4OBe92JwHJ0v_BQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 096/113] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments" Date: Wed, 2 Dec 2020 03:08:32 -0500 Message-Id: <20201202080849.4125477-97-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 92bb29f9b2c3d4a98eef5f0db935d4be291eec72. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-15-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 073f72c7da..cb603532ed 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -860,23 +860,7 @@ sub output_function_rst(%) { output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; } else { - if ((split(/\./, $sphinx_version))[0] >=3D 3) { - # Sphinx 3 and later distinguish macros and functions and - # complain if you use c:function with something that's not - # syntactically valid as a function declaration. - # We assume that anything with a return type is a function - # and anything without is a macro. - if ($args{'functiontype'} ne "") { - print ".. c:function:: "; - } else { - print ".. c:macro:: "; - } - } else { - # Older Sphinx don't support documenting macros that take - # arguments with c:macro, and don't complain about the use - # of c:function for this. - print ".. c:function:: "; - } + print ".. c:function:: "; } if ($args{'functiontype'} ne "") { $start .=3D $args{'functiontype'} . " " . $args{'function'} . " ("; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901539; cv=none; d=zohomail.com; s=zohoarc; b=EfpdPtXILB8v/hy4f+zjJ4I3pxuf/NJWK1takwVqJN843BSt3UE9ziH4RLF6DmVkiqhiFSz78Os5X//Uu6N37T6/zeRxCjP37qE/YT7vEGsp+Mx/Ryn5PesAOBM1cT2urvUcZPkAeNXXiQ0l2CQL/F4zKXiM1jJxYo8AfnYUpi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901539; 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=2xQpkPILcilVjGBJAZDcOXL4fhbJFhBizJguZe8vEgc=; b=C+dmQ63u89RdhrNFLd3M+j/UWn6TimTowonwOC0JAvrRqKSIvhx06BaJMEYXlW6Mld2pH0oxzVwVPCnvGRaTCuYJiuh0nhATnBRbnzsnwr3AIMbnWzVKFZgVtPL8TdMdcPabaZgJJO6TxA4dHfZYrVGnc9jhiEWAEv29+WqQ8sY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901539136769.3461660808221; Wed, 2 Dec 2020 01:32:19 -0800 (PST) Received: from localhost ([::1]:40434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkO7m-0000hO-92 for importer@patchew.org; Wed, 02 Dec 2020 04:08:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDN-0003u1-5J for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCb-0003q4-Fi for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-Nd8QuWQEPTyZxVdFJEKcXQ-1; Wed, 02 Dec 2020 03:09:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 471665708D for ; Wed, 2 Dec 2020 08:09:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3E805C1B4 for ; Wed, 2 Dec 2020 08:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896568; 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: in-reply-to:in-reply-to:references:references; bh=2xQpkPILcilVjGBJAZDcOXL4fhbJFhBizJguZe8vEgc=; b=Mi+cdgbjdJrJtX/Wl2+mYZ/MwCBQBhQ7JB5/rWj+yp2pM6NhNskFmF4iZQODEp/hEUaU3l t8oaQgbMT/wOFvITlST5GYEHJZ2qxdQvztRKLlRGxqWMzzoiVaBH6FaOeCxI/or6tShfUs p0TVXJAz8FXoGwQZbZN3NDsKmrTtr2Y= X-MC-Unique: Nd8QuWQEPTyZxVdFJEKcXQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 097/113] Revert "kernel-doc: Use c:struct for Sphinx 3.0 and later" Date: Wed, 2 Dec 2020 03:08:33 -0500 Message-Id: <20201202080849.4125477-98-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 152d1967f650f67b7ece3a5dda77d48069d72647. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-16-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- docs/sphinx/kerneldoc.py | 1 - scripts/kernel-doc | 16 +--------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 9124fcbff1..c0180e02a2 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -102,7 +102,6 @@ class KernelDocDirective(Directive): env.note_dependency(os.path.abspath(f)) cmd +=3D ['-export-file', f] =20 - cmd +=3D ['-sphinx-version', sphinx.__version__] cmd +=3D [filename] =20 try: diff --git a/scripts/kernel-doc b/scripts/kernel-doc index cb603532ed..60f75cd176 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -71,8 +71,6 @@ Output selection (mutually exclusive): DOC: sections. May be specified multiple times. =20 Output selection modifiers: - -sphinx-version VER Generate rST syntax for the specified Sphinx versi= on. - Only works with reStructuredTextFormat. -no-doc-sections Do not output DOC: sections. -enable-lineno Enable output of #define LINENO lines. Only works = with reStructuredText format. @@ -294,7 +292,6 @@ use constant { }; my $output_selection =3D OUTPUT_ALL; my $show_not_found =3D 0; # No longer used -my $sphinx_version =3D "0.0"; # if not specified, assume old =20 my @export_file_list; =20 @@ -460,8 +457,6 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $enable_lineno =3D 1; } elsif ($cmd eq 'show-not-found') { $show_not_found =3D 1; # A no-op but don't fail - } elsif ($cmd eq 'sphinx-version') { - $sphinx_version =3D shift @ARGV; } else { # Unknown argument usage(); @@ -989,16 +984,7 @@ sub output_struct_rst(%) { my $oldprefix =3D $lineprefix; my $name =3D $args{'type'} . " " . $args{'struct'}; =20 - # Sphinx 3.0 and up will emit warnings for "c:type:: struct Foo". - # It wants to see "c:struct:: Foo" (and will add the word 'struct' in - # the rendered output). - if ((split(/\./, $sphinx_version))[0] >=3D 3) { - my $sname =3D $name; - $sname =3D~ s/^struct //; - print "\n\n.. c:struct:: " . $sname . "\n\n"; - } else { - print "\n\n.. c:type:: " . $name . "\n\n"; - } + print "\n\n.. c:type:: " . $name . "\n\n"; print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901426; cv=none; d=zohomail.com; s=zohoarc; b=HV/sk50PkBQWJN1CGFWYXOAQBcRF1L2htDWQRUa3SKmvrBcEmPGrk/H9RCHv//vSomgxO+RE9KYIGiPYfPWkhhbKxIkWp5vJd2D3AH2M1Fm3Wwe10Qc3MFCb/siEcGCaqJTPsAvbiUruLcD+UWQWA/mhc4PgiRj0et4vifDMhOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901426; 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=YRIkoNqZeWXHR0EnZtaHGymS/XZpyIR+HCZcqdjuTu0=; b=LrSX/UxldOTulByEOf4jUPt56i3QvY6FSWoBeiujZyMwr7yhxy7EDBfx+Cz3SBNfnuBPPfB8Y66xfpB7Czxrds8PMjaWsj9M/JAS7v6O32b/maaZYl91h86khnEHFag+RVYU77SkDhGhrHoYNU7gmzgYdfaUhiKXx8VTkt299Dw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901425993108.43724467251286; Wed, 2 Dec 2020 01:30:25 -0800 (PST) Received: from localhost ([::1]:46788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOSu-0002UF-Pv for importer@patchew.org; Wed, 02 Dec 2020 04:30:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDP-0003yY-25 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCd-0003qO-4K for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-349-Pu2nTXLpMbOyvTF7du9jrQ-1; Wed, 02 Dec 2020 03:09:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87D12185E48B for ; Wed, 2 Dec 2020 08:09:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C45B5C1B4 for ; Wed, 2 Dec 2020 08:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896569; 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: in-reply-to:in-reply-to:references:references; bh=YRIkoNqZeWXHR0EnZtaHGymS/XZpyIR+HCZcqdjuTu0=; b=gCgKj1crjoaxMzwehUmC1a07+d6My9KPOC6KZRF/P36HEVf9eBUA2Ai5reEJJ7gpKjitKA H14f6zIfACMFEE3tq7CY5nLvaukhJM18La6JEf+TxxI1BvUiU2Zh/ckc8FK8xjfB8bd5p1 +WDM0FJfZqqRGxMCZsJCeYa6DkJhUVA= X-MC-Unique: Pu2nTXLpMbOyvTF7du9jrQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 098/113] scripts: kernel-doc: make it more compatible with Sphinx 3.x Date: Wed, 2 Dec 2020 03:08:34 -0500 Message-Id: <20201202080849.4125477-99-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab With Sphinx 3.x, the ".. c:type:" tag was changed to accept either: .. c:type:: typedef-like declaration .. c:type:: name Using it for other types (including functions) don't work anymore. So, there are newer tags for macro, enum, struct, union, and others, which doesn't exist on older versions. Add a check for the Sphinx version and change the produced tags accordingly. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-17-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 71 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 60f75cd176..771367a6ab 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -271,6 +271,8 @@ if ($#ARGV =3D=3D -1) { } =20 my $kernelversion; +my $sphinx_major; + my $dohighlight =3D ""; =20 my $verbose =3D 0; @@ -465,6 +467,43 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { =20 # continue execution near EOF; =20 +# The C domain dialect changed on Sphinx 3. So, we need to check the +# version in order to produce the right tags. +sub findprog($) +{ + foreach(split(/:/, $ENV{PATH})) { + return "$_/$_[0]" if(-x "$_/$_[0]"); + } +} + +sub get_sphinx_version() +{ + my $ver; + my $major =3D 1; + + my $cmd =3D "sphinx-build"; + if (!findprog($cmd)) { + my $cmd =3D "sphinx-build3"; + return $major if (!findprog($cmd)); + } + + open IN, "$cmd --version 2>&1 |"; + while () { + if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) { + $major=3D$1; + last; + } + # Sphinx 1.2.x uses a different format + if (m/^\s*Sphinx.*\s+([\d]+)\.([\d\.]+)$/) { + $major=3D$1; + last; + } + } + close IN; + + return $major; +} + # get kernel version from env sub get_kernel_version() { my $version =3D 'unknown kernel version'; @@ -848,7 +887,11 @@ sub output_function_rst(%) { my $start =3D ""; =20 if ($args{'typedef'}) { - print ".. c:type:: ". $args{'function'} . "\n\n"; + if ($sphinx_major < 3) { + print ".. c:type:: ". $args{'function'} . "\n\n"; + } else { + print ".. c:function:: ". $args{'function'} . "\n\n"; + } print_lineno($declaration_start_line); print " **Typedef**: "; $lineprefix =3D ""; @@ -938,9 +981,14 @@ sub output_enum_rst(%) { my ($parameter); my $oldprefix =3D $lineprefix; my $count; - my $name =3D "enum " . $args{'enum'}; =20 - print "\n\n.. c:type:: " . $name . "\n\n"; + if ($sphinx_major < 3) { + my $name =3D "enum " . $args{'enum'}; + print "\n\n.. c:type:: " . $name . "\n\n"; + } else { + my $name =3D $args{'enum'}; + print "\n\n.. c:enum:: " . $name . "\n\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); @@ -966,8 +1014,13 @@ sub output_typedef_rst(%) { my %args =3D %{$_[0]}; my ($parameter); my $oldprefix =3D $lineprefix; - my $name =3D "typedef " . $args{'typedef'}; + my $name; =20 + if ($sphinx_major < 3) { + $name =3D "typedef " . $args{'typedef'}; + } else { + $name =3D $args{'typedef'}; + } print "\n\n.. c:type:: " . $name . "\n\n"; print_lineno($declaration_start_line); $lineprefix =3D " "; @@ -982,9 +1035,14 @@ sub output_struct_rst(%) { my %args =3D %{$_[0]}; my ($parameter); my $oldprefix =3D $lineprefix; - my $name =3D $args{'type'} . " " . $args{'struct'}; =20 - print "\n\n.. c:type:: " . $name . "\n\n"; + if ($sphinx_major < 3) { + my $name =3D $args{'type'} . " " . $args{'struct'}; + print "\n\n.. c:type:: " . $name . "\n\n"; + } else { + my $name =3D $args{'struct'}; + print "\n\n.. c:struct:: " . $name . "\n\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); @@ -2242,6 +2300,7 @@ sub process_file($) { } =20 =20 +$sphinx_major =3D get_sphinx_version(); $kernelversion =3D get_kernel_version(); =20 # generate a sequence of code that will splice in highlighting information --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901013; cv=none; d=zohomail.com; s=zohoarc; b=igpQba5Y+bRl3tKhyhAkwWIIDfBU5qBfsk9mvexP6D9y10HyI27w/HyvQQdbKvfcRt+iTzqpj9MyDrHzLhnq/1OQCeUQyccnO9sPWc4jY2n5Y3/2mxFWMsLOwMLmIlfM2OOkUGaoDviafTLfOTNWbMM1YX7TAcHoGLU9n7xb7P4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901013; 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=e8hnoZGivgr313ZDbOqA0Nv2kwefhhsEAfF44TGY+aU=; b=P/3CLxeBaoft7xf0ab/Qz9h7ZnfrADXw/vFTmfVSdRqTWlkjU9nIqDf3u8HVe4B6XziKAsR3yswN08nwDFID/+rXFbVO5bgfUJOQwKYtvvQ5eda+b5HvUWOujf4FwDpBQlEZ54szzvV3LCwKJXUSCAeziaDVzTFuEL+dywD8z8w= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901013084632.8874650401935; Wed, 2 Dec 2020 01:23:33 -0800 (PST) Received: from localhost ([::1]:55362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOMF-0002U0-Vw for importer@patchew.org; Wed, 02 Dec 2020 04:23:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDO-0003xI-Gl for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003rL-0I for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-MSzugtTQNCuUtLdG7UStcg-1; Wed, 02 Dec 2020 03:09:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3BA7185E489 for ; Wed, 2 Dec 2020 08:09:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A80CE5C1B4 for ; Wed, 2 Dec 2020 08:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896571; 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: in-reply-to:in-reply-to:references:references; bh=e8hnoZGivgr313ZDbOqA0Nv2kwefhhsEAfF44TGY+aU=; b=LtEUVkvguKY8Q/BpU4I1RD2kMJ0pnPAUsBeV0xG1xwsirKr65G6i1Mo2F9VTTplq1CGlge iPP8nIL8UtpIV1YzrYfcnooXXdK5XB8+LsogIU/hzAVlroOVcffBIfx+SlSAFUXoH4Ccnl 75wjoNPAbYAXaBWfwMLwdhK8yG4LTq0= X-MC-Unique: MSzugtTQNCuUtLdG7UStcg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 099/113] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x Date: Wed, 2 Dec 2020 03:08:35 -0500 Message-Id: <20201202080849.4125477-100-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Unfortunately, Sphinx 3.x parser for c functions is too pedantic: https://github.com/sphinx-doc/sphinx/issues/8241 While it could be relaxed with some configurations, there are several corner cases that it would make it hard to maintain, and will require teaching conf.py about several macros. So, let's instead use the :c:macro notation. This will produce an output that it is not as nice as currently, but it should still be acceptable, and will provide cross-references, removing thousands of warnings when building with newer versions of Sphinx. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-18-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 771367a6ab..75ddd3b5e6 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -886,19 +886,29 @@ sub output_function_rst(%) { my $oldprefix =3D $lineprefix; my $start =3D ""; =20 - if ($args{'typedef'}) { - if ($sphinx_major < 3) { + if ($sphinx_major < 3) { + if ($args{'typedef'}) { print ".. c:type:: ". $args{'function'} . "\n\n"; + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix =3D ""; + output_highlight_rst($args{'purpose'}); + $start =3D "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: ". $args{'function'} . "\n\n"; + print ".. c:function:: "; } - print_lineno($declaration_start_line); - print " **Typedef**: "; - $lineprefix =3D ""; - output_highlight_rst($args{'purpose'}); - $start =3D "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: "; + print ".. c:macro:: ". $args{'function'} . "\n\n"; + + if ($args{'typedef'}) { + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix =3D ""; + output_highlight_rst($args{'purpose'}); + $start =3D "\n\n**Syntax**\n\n ``"; + } else { + print "``"; + } } if ($args{'functiontype'} ne "") { $start .=3D $args{'functiontype'} . " " . $args{'function'} . " ("; @@ -925,7 +935,11 @@ sub output_function_rst(%) { if ($args{'typedef'}) { print ");``\n\n"; } else { - print ")\n\n"; + if ($sphinx_major < 3) { + print ")\n\n"; + } else { + print ")``\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901375; cv=none; d=zohomail.com; s=zohoarc; b=g8/GWWxDq/INaFBP7vTu1mbynYGZLgo0UFqcmbKkR0Rzf3qCPKljWpS1y9ADY+/EhSPxp5rlh2jhvjuHBX0ljy5ReXIUjqEXRLa/BB2mt1aLNLG8Thl55eLInd3Fg50dsAWkUlreyHPDCkGRkVaaPTLadBUXQplEp+c5RHE+onM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901375; 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=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=XtS8X6Hz0qkx49LMgRgsi1o9YcdAdBCoCa6VHCPp0D38QKt9OJyqq/5T6ouNIG5rZUqPefuf1RWIHna174IOcVrMXh1xUFfXlzg7wutQLUNZP9oSkRpeSDypFS4hhqarXcog+KD2AWU7o9gzVvUAlfMgLSI6phPvUMkjPHjXYRw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901375576562.1917336592196; Wed, 2 Dec 2020 01:29:35 -0800 (PST) Received: from localhost ([::1]:44288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOS5-0001Pn-1c for importer@patchew.org; Wed, 02 Dec 2020 04:29:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDP-000419-W3 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003rc-BV for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-1lynP_x0Mdy-Oi6Wgml5AA-1; Wed, 02 Dec 2020 03:09:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98FCA5708A for ; Wed, 2 Dec 2020 08:09:27 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB4260854 for ; Wed, 2 Dec 2020 08:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896571; 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: in-reply-to:in-reply-to:references:references; bh=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=QxlTvWcv7L8IK8+U8quFJME/OaAEbValeHrjRyi68M3onvqxSfQ5TDtfpmnuuPXkQIXoVd gqNuf1N9bsvtekZ3b2IWLRkYR7nVq7x35JYRFdmE8FOSaAVQWMnuvzrmJ6kXsAA4QEPvf/ lF/ZkbRQa9euE40kqn00VRwJo75BUtk= X-MC-Unique: 1lynP_x0Mdy-Oi6Wgml5AA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 100/113] scripts: kernel-doc: fix troubles with line counts Date: Wed, 2 Dec 2020 03:08:36 -0500 Message-Id: <20201202080849.4125477-101-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There's currently a bug with the way kernel-doc script counts line numbers that can be seen with: $ ./scripts/kernel-doc -rst -enable-lineno include/linux/math64.h >all &&= ./scripts/kernel-doc -rst -internal -enable-lineno include/linux/math64.h = >int && diff -U0 int all --- int 2020-09-28 12:58:08.927486808 +0200 +++ all 2020-09-28 12:58:08.905486845 +0200 @@ -1 +1 @@ -#define LINENO 27 +#define LINENO 26 @@ -3 +3 @@ -#define LINENO 16 +#define LINENO 15 @@ -9 +9 @@ -#define LINENO 17 +#define LINENO 16 ... This is happening with perl version 5.30.3, but I'm not so sure if this is a perl bug, or if this is due to something else. In any case, fixing it is easy. Basically, when "-internal" parameter is used, the process_export_file() function opens the handle "IN". This makes the line number to be incremented, as the handler for the main open is also "IN". Fix the problem by using a different handler for the main open(). While here, add a missing close for it. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-19-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 75ddd3b5e6..f33a4b1cc7 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2268,7 +2268,7 @@ sub process_file($) { =20 $file =3D map_filename($orig_file); =20 - if (!open(IN,"<$file")) { + if (!open(IN_FILE,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; @@ -2277,9 +2277,9 @@ sub process_file($) { $. =3D 1; =20 $section_counter =3D 0; - while () { + while () { while (s/\\\s*$//) { - $_ .=3D ; + $_ .=3D ; } # Replace tabs by spaces while ($_ =3D~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; @@ -2311,6 +2311,7 @@ sub process_file($) { print STDERR "${file}:1: warning: no structured comments found\n"; } } + close IN_FILE; } =20 =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901194; cv=none; d=zohomail.com; s=zohoarc; b=TrjOtfGrNaeadHe+iWUZP9cr4+geRM++6UlO/eFVubu2Cu+V/HqRMWiY6ivcSGRarlcPWxzNymHs4aBh38xmTm1P/gkq/I7uMOnTy2TS6OHmMBXavfBlkpDj9joTQb4TBpajeK71noSyxWQSouDD4W9KBSTCnbBkCDO1+uXaa58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901194; 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=Wdy6f88n2LIny//0BmS54CtVFj89l1KsmAMFogQ24V4=; b=OMkNJdlJqHo0qwXhtv3V3nxKAB+3wrRrLr+F9YVUwOC/mX3so6YBcxLdUciEz0IY4R9he+uxV5cGJRUz6/5LaxXi6zBx5NZVVY2rPrEwSO4Pbz6RxMLrGFH9KeGIYs3EZ0yh1v3vRH+H7PJt4lRp5cWeI6hb8OWNzVvR1BtAElw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901194880218.7093433643255; Wed, 2 Dec 2020 01:26:34 -0800 (PST) Received: from localhost ([::1]:35660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOPB-00069k-JY for importer@patchew.org; Wed, 02 Dec 2020 04:26:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDP-0003zo-Ei for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003ra-AQ for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-iRlmIzzLMS-xGRh_C5hzyA-1; Wed, 02 Dec 2020 03:09:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 020481006C85 for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B952160854 for ; Wed, 2 Dec 2020 08:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896571; 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: in-reply-to:in-reply-to:references:references; bh=Wdy6f88n2LIny//0BmS54CtVFj89l1KsmAMFogQ24V4=; b=BrfHtpdsajJwIzyeYIF2jMECb++TYcNaQr+AmdFoqvvz+OVi+aTaDrYwMCYmvV9bQoj+8T QE1kEmPIyOAgX/8rz6tbwS3mNw5L46u6FUJB5cp9cWfTkxOnagpa6oQSoMjIthu2TlJqgo CvBLoo8dlax1L9IH+aROsSG47eJ+Ehg= X-MC-Unique: iRlmIzzLMS-xGRh_C5hzyA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 101/113] scripts: kernel-doc: reimplement -nofunction argument Date: Wed, 2 Dec 2020 03:08:37 -0500 Message-Id: <20201202080849.4125477-102-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Right now, the build system doesn't use -nofunction, as it is pretty much useless, because it doesn't consider the other output modes (extern, internal), working only with all. Also, it is limited to exclude functions. Re-implement it in order to allow excluding any symbols from the document output, no matter what mode is used. The parameter was also renamed to "-nosymbol", as it express better its meaning. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-20-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index f33a4b1cc7..35d60af834 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -66,9 +66,8 @@ Output selection (mutually exclusive): -function NAME Only output documentation for the given function(s) or DOC: section title(s). All other functions and DOC: sections are ignored. May be specified multiple times. - -nofunction NAME Do NOT output documentation for the given function(s); - only output documentation for the other functions and - DOC: sections. May be specified multiple times. + -nosymbol NAME Exclude the specified symbols from the output + documentation. May be specified multiple times. =20 Output selection modifiers: -no-doc-sections Do not output DOC: sections. @@ -288,9 +287,8 @@ my $modulename =3D "Kernel API"; use constant { OUTPUT_ALL =3D> 0, # output all symbols and doc sections OUTPUT_INCLUDE =3D> 1, # output only specified symbols - OUTPUT_EXCLUDE =3D> 2, # output everything except specified symbo= ls - OUTPUT_EXPORTED =3D> 3, # output exported symbols - OUTPUT_INTERNAL =3D> 4, # output non-exported symbols + OUTPUT_EXPORTED =3D> 2, # output exported symbols + OUTPUT_INTERNAL =3D> 3, # output non-exported symbols }; my $output_selection =3D OUTPUT_ALL; my $show_not_found =3D 0; # No longer used @@ -315,6 +313,7 @@ my $man_date =3D ('January', 'February', 'March', 'Apri= l', 'May', 'June', # CAVEAT EMPTOR! Some of the others I localised may not want to be, which # could cause "use of undefined value" or other bugs. my ($function, %function_table, %parametertypes, $declaration_purpose); +my %nosymbol_table =3D (); my $declaration_start_line; my ($type, $declaration_name, $return_type); my ($newsection, $newcontents, $prototype, $brcount, %source_map); @@ -434,10 +433,9 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $output_selection =3D OUTPUT_INCLUDE; $function =3D shift @ARGV; $function_table{$function} =3D 1; - } elsif ($cmd eq "nofunction") { # output all except specific functions - $output_selection =3D OUTPUT_EXCLUDE; - $function =3D shift @ARGV; - $function_table{$function} =3D 1; + } elsif ($cmd eq "nosymbol") { # Exclude specific symbols + my $symbol =3D shift @ARGV; + $nosymbol_table{$symbol} =3D 1; } elsif ($cmd eq "export") { # only exported symbols $output_selection =3D OUTPUT_EXPORTED; %function_table =3D (); @@ -570,11 +568,11 @@ sub dump_doc_section { return; } =20 + return if (defined($nosymbol_table{$name})); + if (($output_selection =3D=3D OUTPUT_ALL) || - ($output_selection =3D=3D OUTPUT_INCLUDE && - defined($function_table{$name})) || - ($output_selection =3D=3D OUTPUT_EXCLUDE && - !defined($function_table{$name}))) + (($output_selection =3D=3D OUTPUT_INCLUDE) && + defined($function_table{$name}))) { dump_section($file, $name, $contents); output_blockhead({'sectionlist' =3D> \@sectionlist, @@ -800,6 +798,8 @@ sub output_blockhead_rst(%) { my ($parameter, $section); =20 foreach $section (@{$args{'sectionlist'}}) { + next if (defined($nosymbol_table{$section})); + if ($output_selection !=3D OUTPUT_INCLUDE) { print "**$section**\n\n"; } @@ -1115,12 +1115,14 @@ sub output_declaration { my $name =3D shift; my $functype =3D shift; my $func =3D "output_${functype}_$output_mode"; + + return if (defined($nosymbol_table{$name})); + if (($output_selection =3D=3D OUTPUT_ALL) || (($output_selection =3D=3D OUTPUT_INCLUDE || $output_selection =3D=3D OUTPUT_EXPORTED) && defined($function_table{$name})) || - (($output_selection =3D=3D OUTPUT_EXCLUDE || - $output_selection =3D=3D OUTPUT_INTERNAL) && + ($output_selection =3D=3D OUTPUT_INTERNAL && !($functype eq "function" && defined($function_table{$name})))) { &$func(@_); @@ -1301,6 +1303,8 @@ sub show_warnings($$) { my $functype =3D shift; my $name =3D shift; =20 + return 0 if (defined($nosymbol_table{$name})); + return 1 if ($output_selection =3D=3D OUTPUT_ALL); =20 if ($output_selection =3D=3D OUTPUT_EXPORTED) { @@ -1324,13 +1328,6 @@ sub show_warnings($$) { return 0; } } - if ($output_selection =3D=3D OUTPUT_EXCLUDE) { - if (!defined($function_table{$name})) { - return 1; - } else { - return 0; - } - } die("Please add the new output type at show_warnings()"); } =20 @@ -1952,6 +1949,7 @@ sub process_export_file($) { =20 while () { if (/$export_symbol/) { + next if (defined($nosymbol_table{$2})); $function_table{$2} =3D 1; } } --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606905105; cv=none; d=zohomail.com; s=zohoarc; b=jHirzaR12sUUzQo612cFrSbebNt0nJ5moLdgKpnCCIguDTaMucQr4TR/5ALkKA1IqjFhGv9Xy4f0lZtZYQEVHxbSK1qZuEfmLu2uhSOBW9Vo+vCZD0geIviMICRzuiuucih5xi2EsN864EtXcxMOgbJJFvbJPyVpIIxYzTJdv4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606905105; 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=VkXrc6iYkC+E7KRGBxIBJR/SSDGRT2IvzZaJy0Vyq68=; b=d9sK/WQdyaPj+C7CO7vOCLgJtBozXf5A911zx7UHeEaOLMHcD8j4bnY6r/KmlxM/oM5M5rc0VjHubyxJwhqvJVStWOmhKKwadVLs+q0Kv09rC68ynaO/D1MbDAo0VH8yVvckXfRsgWAC2ihanbaZqQ8GgpdAUx/tMsqekRpE1sc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606905105873877.7132654053393; Wed, 2 Dec 2020 02:31:45 -0800 (PST) Received: from localhost ([::1]:48622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOAW-0004Mf-6R for importer@patchew.org; Wed, 02 Dec 2020 04:11:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDN-0003vX-Oz for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCd-0003rA-Fr for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-uJB2yfDQNWmnMZpxoYE4XA-1; Wed, 02 Dec 2020 03:09:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E9D81074641 for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 230D060854 for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896570; 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: in-reply-to:in-reply-to:references:references; bh=VkXrc6iYkC+E7KRGBxIBJR/SSDGRT2IvzZaJy0Vyq68=; b=Kq9DPjkp3R/XaUrjIorCSwWelzUrL3Qxht0V91cOysVx4ITgTHx0vU4CUz/yacI5NbK3RB rfWEJCnDXEOPzMpA2bCFpEdH3OuEIebWfB3/xqS6rPZHPK+whbtDVdDhpFjSnvn52zZ529 liXTN8GgdnPvlJLV9skA33KyME4rkt8= X-MC-Unique: uJB2yfDQNWmnMZpxoYE4XA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 102/113] scripts: kernel-doc: fix typedef identification Date: Wed, 2 Dec 2020 03:08:38 -0500 Message-Id: <20201202080849.4125477-103-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Some typedef expressions are output as normal functions. As we need to be clearer about the type with Sphinx 3.x, detect such cases. While here, fix a wrongly-indented block. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-21-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 64 +++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 35d60af834..0c31e9ad66 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1748,30 +1748,48 @@ sub dump_function($$) { return; } =20 - my $prms =3D join " ", @parameterlist; - check_sections($file, $declaration_name, "function", $sectcheck, $prms); - - # This check emits a lot of warnings at the moment, because many - # functions don't have a 'Return' doc section. So until the number - # of warnings goes sufficiently down, the check is only performed = in - # verbose mode. - # TODO: always perform the check. - if ($verbose && !$noret) { - check_return_section($file, $declaration_name, $return_typ= e); - } + my $prms =3D join " ", @parameterlist; + check_sections($file, $declaration_name, "function", $sectcheck, $prms= ); + + # This check emits a lot of warnings at the moment, because many + # functions don't have a 'Return' doc section. So until the number + # of warnings goes sufficiently down, the check is only performed in + # verbose mode. + # TODO: always perform the check. + if ($verbose && !$noret) { + check_return_section($file, $declaration_name, $return_type); + } =20 - output_declaration($declaration_name, - 'function', - {'function' =3D> $declaration_name, - 'module' =3D> $modulename, - 'functiontype' =3D> $return_type, - 'parameterlist' =3D> \@parameterlist, - 'parameterdescs' =3D> \%parameterdescs, - 'parametertypes' =3D> \%parametertypes, - 'sectionlist' =3D> \@sectionlist, - 'sections' =3D> \%sections, - 'purpose' =3D> $declaration_purpose - }); + # The function parser can be called with a typedef parameter. + # Handle it. + if ($return_type =3D~ /typedef/) { + output_declaration($declaration_name, + 'function', + {'function' =3D> $declaration_name, + 'typedef' =3D> 1, + 'module' =3D> $modulename, + 'functiontype' =3D> $return_type, + 'parameterlist' =3D> \@parameterlist, + 'parameterdescs' =3D> \%parameterdescs, + 'parametertypes' =3D> \%parametertypes, + 'sectionlist' =3D> \@sectionlist, + 'sections' =3D> \%sections, + 'purpose' =3D> $declaration_purpose + }); + } else { + output_declaration($declaration_name, + 'function', + {'function' =3D> $declaration_name, + 'module' =3D> $modulename, + 'functiontype' =3D> $return_type, + 'parameterlist' =3D> \@parameterlist, + 'parameterdescs' =3D> \%parameterdescs, + 'parametertypes' =3D> \%parametertypes, + 'sectionlist' =3D> \@sectionlist, + 'sections' =3D> \%sections, + 'purpose' =3D> $declaration_purpose + }); + } } =20 sub reset_state { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901878; cv=none; d=zohomail.com; s=zohoarc; b=EI0roEWoJCBMpkvnDCcyBiMAXyY+b8OgeR/Ee6zXoE8KizhHag0H7BtzQzM/aXuSLX7h/kXcoTM8YWB+64eTPdSjQ60/GQIUEUVUafA2msRyPZQPDS3fwWJm+T89wPzo91gG0EtntkfeVj/Ny+/Gfzj3lvyJ5T/tAPWheUKG+Ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901878; 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=2Hqr6mt+EekxiJYbciaRspwkwPYDs2CfXQtqWsJjinE=; b=KY1Ms/EaSfMLd4AIDGnumEx0ZTk+iRfHnW2tpMGYCxHS0X/kabyTZGtZ6KhdHbE45BnN3E07ydGk10tHaU2E16qSe6ladtfKkqEZu6ddq2rX+wnhLAjgZAFTWQQHDstk9QiBkto2Ln5hoGGitTMG8glTgClzdl73Gr/gMZN4/+I= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901878080600.0096254328589; Wed, 2 Dec 2020 01:37:58 -0800 (PST) Received: from localhost ([::1]:38234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOaA-0002jJ-SB for importer@patchew.org; Wed, 02 Dec 2020 04:37:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDS-00046x-J2 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003rN-13 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-Q98QdPBhNmuLmR-0MPIJgw-1; Wed, 02 Dec 2020 03:09:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB7025708C for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F80160854 for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896571; 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: in-reply-to:in-reply-to:references:references; bh=2Hqr6mt+EekxiJYbciaRspwkwPYDs2CfXQtqWsJjinE=; b=NiavDD5BiJrwnZIj0yYR5My+OMEOBZqza7vbMxOv1vqLF192RnGricTUz2lOO03FJFKUYA OBS9gsfC+CZXSqxNAECfXlLnZzKk8v97AcCeVVHNlrhL3S0X2LTKprPLpeHOoEfeXlcCtB itCIKyBtMzQ20kfeGIQGws3GdAE1TuA= X-MC-Unique: Q98QdPBhNmuLmR-0MPIJgw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 103/113] scripts: kernel-doc: don't mangle with parameter list Date: Wed, 2 Dec 2020 03:08:39 -0500 Message-Id: <20201202080849.4125477-104-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab While kernel-doc needs to parse parameters in order to identify its name, it shouldn't be touching the type, as parsing it is very difficult, and errors happen. One current error is when parsing this parameter: const u32 (*tab)[256] Found at ./lib/crc32.c, on this function: u32 __pure crc32_be_generic (u32 crc, unsigned char const *p, size_t len, = const u32 (*tab)[256], u32 polynomial); The current logic mangles it, producing this output: const u32 ( *tab That's something that it is not recognizeable. So, instead, let's push the argument as-is, and use it when printing the function prototype and when describing each argument. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-22-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0c31e9ad66..478037f736 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -655,10 +655,10 @@ sub output_function_man(%) { $type =3D $args{'parametertypes'}{$parameter}; if ($type =3D~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { # pointer-to-function - print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 .= ")" . $post . "\"\n"; + print ".BI \"" . $parenth . $1 . "\" " . " \") (" . $2 . ")" . $post = . "\"\n"; } else { $type =3D~ s/([^\*])$/$1 /; - print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $pos= t . "\"\n"; + print ".BI \"" . $parenth . $type . "\" " . " \"" . $post . "\"\n"; } $count++; $parenth =3D ""; @@ -929,7 +929,7 @@ sub output_function_rst(%) { # pointer-to-function print $1 . $parameter . ") (" . $2 . ")"; } else { - print $type . " " . $parameter; + print $type; } } if ($args{'typedef'}) { @@ -954,7 +954,7 @@ sub output_function_rst(%) { $type =3D $args{'parametertypes'}{$parameter}; =20 if ($type ne "") { - print "``$type $parameter``\n"; + print "``$type``\n"; } else { print "``$parameter``\n"; } @@ -1479,7 +1479,7 @@ sub create_parameterlist($$$$) { # Treat preprocessor directive as a typeless variable just to fill # corresponding data structures "correctly". Catch it later in # output_* subs. - push_parameter($arg, "", $file); + push_parameter($arg, "", "", $file); } elsif ($arg =3D~ m/\(.+\)\s*\(/) { # pointer-to-function $arg =3D~ tr/#/,/; @@ -1488,7 +1488,7 @@ sub create_parameterlist($$$$) { $type =3D $arg; $type =3D~ s/([^\(]+\(\*?)\s*$param/$1/; save_struct_actual($param); - push_parameter($param, $type, $file, $declaration_name); + push_parameter($param, $type, $arg, $file, $declaration_name); } elsif ($arg) { $arg =3D~ s/\s*:\s*/:/g; $arg =3D~ s/\s*\[/\[/g; @@ -1513,26 +1513,28 @@ sub create_parameterlist($$$$) { foreach $param (@args) { if ($param =3D~ m/^(\*+)\s*(.*)/) { save_struct_actual($2); - push_parameter($2, "$type $1", $file, $declaration_name); + + push_parameter($2, "$type $1", $arg, $file, $declaration_name); } elsif ($param =3D~ m/(.*?):(\d+)/) { if ($type ne "") { # skip unnamed bit-fields save_struct_actual($1); - push_parameter($1, "$type:$2", $file, $declaration_name) + push_parameter($1, "$type:$2", $arg, $file, $declaration_name) } } else { save_struct_actual($param); - push_parameter($param, $type, $file, $declaration_name); + push_parameter($param, $type, $arg, $file, $declaration_name); } } } } } =20 -sub push_parameter($$$$) { +sub push_parameter($$$$$) { my $param =3D shift; my $type =3D shift; + my $org_arg =3D shift; my $file =3D shift; my $declaration_name =3D shift; =20 @@ -1596,8 +1598,8 @@ sub push_parameter($$$$) { # "[blah" in a parameter string; ###$param =3D~ s/\s*//g; push @parameterlist, $param; - $type =3D~ s/\s\s+/ /g; - $parametertypes{$param} =3D $type; + $org_arg =3D~ s/\s\s+/ /g; + $parametertypes{$param} =3D $org_arg; } =20 sub check_sections($$$$$) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901397; cv=none; d=zohomail.com; s=zohoarc; b=SwfJfCnVDz1BYIpKp9l/HPJNlIFxaLIVFfS2h9dI0dy7nTeecqkYkdOpIl17ZBjwFClj8/OgmcodThkSIRCCWC7ohXOKugmSlv7h2Uuj+lnOveqHwHg2SO3YOzaMvZ5cGx9C9C4YHvtlwSPS8MVgncYKq6NXujPKxUyzuqvoUfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901397; 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=Ukg5Y1cAgqxZBGLArhGZ7RHHMiikRdI3w0My8dsythw=; b=X1H2iy/CuAckRXcJTk6xDxeR5M1tToEuMdL2y4rcYu53bZksx0Im8WCc+NxPZn6o3/ohcVd1q+Ez8Qcf1vVQ5Y7p4gXWjFoS5Lb1eC/lyeTCYH8N9hYxJo1B01NGLk9ex8ps3jDU0PNap8Voec7vH4zJrnSq+Q7UtNqyi1jKK0g= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901397216471.83122328125046; Wed, 2 Dec 2020 01:29:57 -0800 (PST) Received: from localhost ([::1]:56902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOCn-0007t2-4Q for importer@patchew.org; Wed, 02 Dec 2020 04:13:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDQ-00042E-Ew for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCf-0003rp-0H for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-UlrWcBnZN4O6CLkRHc-x6w-1; Wed, 02 Dec 2020 03:09:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24535185E48B for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC4FA60854 for ; Wed, 2 Dec 2020 08:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896572; 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: in-reply-to:in-reply-to:references:references; bh=Ukg5Y1cAgqxZBGLArhGZ7RHHMiikRdI3w0My8dsythw=; b=T4a+YT11iGOWVAU8T0dFT2JUOjtsHRJm8YHMHOO2sj3D0AWOWLx2JliYFmnB9oSph2nS+V xBV0Ihr/GZoMXB9qnEYkwTg6CJv7CMKOA0Iop8ivqWkIw3MM4BOf0VIypGzSFX7xkkHja7 FFMY3vDbBqZiCo94U/GlFJQaXBpTyVo= X-MC-Unique: UlrWcBnZN4O6CLkRHc-x6w-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 104/113] scripts: kernel-doc: allow passing desired Sphinx C domain dialect Date: Wed, 2 Dec 2020 03:08:40 -0500 Message-Id: <20201202080849.4125477-105-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab When kernel-doc is called via kerneldoc.py, there's no need to auto-detect the Sphinx version, as the Sphinx module already knows it. So, add an optional parameter to allow changing the Sphinx dialect. As kernel-doc can also be manually called, keep the auto-detection logic if the parameter was not specified. On such case, emit a warning if sphinx-build can't be found at PATH. I ended using a suggestion from Joe for using a more readable regex, instead of using a complex one with a hidden group like: m/^(\d+)\.(\d+)(?:\.?(\d+)?)/ in order to get the optional argument. Thanks-to: Joe Perches Suggested-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-23-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- docs/sphinx/kerneldoc.py | 5 ++++ scripts/kernel-doc | 51 +++++++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index c0180e02a2..079aadced3 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -69,6 +69,11 @@ class KernelDocDirective(Directive): env =3D self.state.document.settings.env cmd =3D env.config.kerneldoc_bin + ['-rst', '-enable-lineno'] =20 + # Pass the version string to kernel-doc, as it needs to use a diff= erent + # dialect, depending what the C domain supports for each specific + # Sphinx versions + cmd +=3D ['-sphinx-version', sphinx.__version__] + filename =3D env.config.kerneldoc_srctree + '/' + self.arguments[0] export_file_patterns =3D [] =20 diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 478037f736..667ad3169c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -56,6 +56,13 @@ Output format selection (mutually exclusive): -rst Output reStructuredText format. -none Do not output documentation, only warnings. =20 +Output format selection modifier (affects only ReST output): + + -sphinx-version Use the ReST C domain dialect compatible with an + specific Sphinx Version. + If not specified, kernel-doc will auto-detect using + the sphinx-build version found on PATH. + Output selection (mutually exclusive): -export Only output documentation for symbols that have been exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() @@ -270,7 +277,7 @@ if ($#ARGV =3D=3D -1) { } =20 my $kernelversion; -my $sphinx_major; +my ($sphinx_major, $sphinx_minor, $sphinx_patch); =20 my $dohighlight =3D ""; =20 @@ -457,6 +464,23 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $enable_lineno =3D 1; } elsif ($cmd eq 'show-not-found') { $show_not_found =3D 1; # A no-op but don't fail + } elsif ($cmd eq "sphinx-version") { + my $ver_string =3D shift @ARGV; + if ($ver_string =3D~ m/^(\d+)(\.\d+)?(\.\d+)?/) { + $sphinx_major =3D $1; + if (defined($2)) { + $sphinx_minor =3D substr($2,1); + } else { + $sphinx_minor =3D 0; + } + if (defined($3)) { + $sphinx_patch =3D substr($3,1) + } else { + $sphinx_patch =3D 0; + } + } else { + die "Sphinx version should either major.minor or major.minor.patch fo= rmat\n"; + } } else { # Unknown argument usage(); @@ -477,29 +501,37 @@ sub findprog($) sub get_sphinx_version() { my $ver; - my $major =3D 1; =20 my $cmd =3D "sphinx-build"; if (!findprog($cmd)) { my $cmd =3D "sphinx-build3"; - return $major if (!findprog($cmd)); + if (!findprog($cmd)) { + $sphinx_major =3D 1; + $sphinx_minor =3D 2; + $sphinx_patch =3D 0; + printf STDERR "Warning: Sphinx version not found. Using default (Sphinx= version %d.%d.%d)\n", + $sphinx_major, $sphinx_minor, $sphinx_patch; + return; + } } =20 open IN, "$cmd --version 2>&1 |"; while () { if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) { - $major=3D$1; + $sphinx_major =3D $1; + $sphinx_minor =3D $2; + $sphinx_patch =3D $3; last; } # Sphinx 1.2.x uses a different format if (m/^\s*Sphinx.*\s+([\d]+)\.([\d\.]+)$/) { - $major=3D$1; + $sphinx_major =3D $1; + $sphinx_minor =3D $2; + $sphinx_patch =3D $3; last; } } close IN; - - return $major; } =20 # get kernel version from env @@ -2333,7 +2365,10 @@ sub process_file($) { } =20 =20 -$sphinx_major =3D get_sphinx_version(); +if ($output_mode eq "rst") { + get_sphinx_version() if (!$sphinx_major); +} + $kernelversion =3D get_kernel_version(); =20 # generate a sequence of code that will splice in highlighting information --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606906331; cv=none; d=zohomail.com; s=zohoarc; b=P7sriWbkcfnJ4zIAlr1S0ZW2IICssMEE+y441Xeb9RcwOkq5FNyQ1Gy1/fxb8jSMn2zlCj+VnBPonuwOIBaHeH2IJzXClihgImiaD9dwy+dvr3LugzzXdyZhMudZisVs9Zo67wJhJZNWpaWwrFykNTOi+Gt+8GrRaB95YntdDnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606906331; 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=iUR8QomuX/Blkx1DYOhTiUT7FwKK7aUab2JpYXJFiRg=; b=CVBa1Vc/rD9EXPDUPEailn46VE7lfQW5ONflogAe/39wqJEyZ0+WQrgnKu+fKj44uVYtzMhhFtujL0KhK7bdBYsQK2Q1heHhpgST/kxdCG7ReV0P2wO2F3sK18U8Ybmc5jVyMyQZYKiytt7ecDuRgucmCEO4KvbizP9vzWuU3mc= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606906331399198.67341086377144; Wed, 2 Dec 2020 02:52:11 -0800 (PST) Received: from localhost ([::1]:37162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOFZ-0002zX-N7 for importer@patchew.org; Wed, 02 Dec 2020 04:16:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDS-00045t-7E for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCg-0003sM-7e for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-P9v1zrSaMCebZJZRROHI3w-1; Wed, 02 Dec 2020 03:09:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80D9780364D for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 455AF60854 for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896573; 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: in-reply-to:in-reply-to:references:references; bh=iUR8QomuX/Blkx1DYOhTiUT7FwKK7aUab2JpYXJFiRg=; b=b4x7ODwKdWF+dvqYGH94nic1YEjZJAfxxrrKZxFSZyKlov+H2Ru3mNI4/hNaN5wcj3lJap lCR5j0Hto/hTJBeo/08rdOZe4VvXpDBHRMlqsR0dFQQJEQDypNXIIYa85D3icfkTy1GyTo r9gtANcCy4LqsjqaM0ligArZjhZQejM= X-MC-Unique: P9v1zrSaMCebZJZRROHI3w-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 105/113] scripts: kernel-doc: fix line number handling Date: Wed, 2 Dec 2020 03:08:41 -0500 Message-Id: <20201202080849.4125477-106-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Address several issues related to pointing to the wrong line number: 1) ensure that line numbers will always be initialized When section is the default (Description), the line number is not initializing, producing this: $ ./scripts/kernel-doc --enable-lineno ./drivers/media/v4l2-core/v4l2-mem2= mem.c|less **Description** #define LINENO 0 In case of streamoff or release called on any context, 1] If the context is currently running, then abort job will be called 2] If the context is queued, then the context will be removed from the job_queue Which is not right. Ensure that the line number will always be there. After applied, the result now points to the right location: **Description** #define LINENO 410 In case of streamoff or release called on any context, 1] If the context is currently running, then abort job will be called 2] If the context is queued, then the context will be removed from the job_queue 2) The line numbers for function prototypes are always + 1, because it is taken at the line after handling the prototype. Change the logic to point to the next line after the /** */ block; 3) The "DOC:" line number should point to the same line as this markup is found, and not to the next one. Probably part of the issues were due to a but that was causing the line number offset to be incremented by one, if --export were used. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-24-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 667ad3169c..98752164eb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1705,7 +1705,7 @@ sub dump_function($$) { my $file =3D shift; my $noret =3D 0; =20 - print_lineno($.); + print_lineno($new_start_line); =20 $prototype =3D~ s/^static +//; $prototype =3D~ s/^extern +//; @@ -2033,7 +2033,7 @@ sub process_name($$) { if (/$doc_block/o) { $state =3D STATE_DOCBLOCK; $contents =3D ""; - $new_start_line =3D $. + 1; + $new_start_line =3D $.; =20 if ( $1 eq "" ) { $section =3D $section_intro; @@ -2116,6 +2116,7 @@ sub process_body($$) { if ($state =3D=3D STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) { dump_section($file, $section, $contents); $section =3D $section_default; + $new_start_line =3D $.; $contents =3D ""; } =20 @@ -2171,6 +2172,7 @@ sub process_body($$) { $prototype =3D ""; $state =3D STATE_PROTO; $brcount =3D 0; + $new_start_line =3D $. + 1; } elsif (/$doc_content/) { if ($1 eq "") { if ($section eq $section_context) { --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901218; cv=none; d=zohomail.com; s=zohoarc; b=Eo/F1ayeJWUBpI2DongaKURGBx9Uq99oLKBYaLHuE2z7WwoTS48kZjmOhy3Lf8kS5PPXvWqLTXy+EmJU89jnYK7s5pLmVFhkHvHF93Me1rQ1q8E2/OWuJ6mPCBrjuSTidPciYmqVXDmtse4l3W5SY/LYhSfv4k/VN+zq2fdWS/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901218; 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=NKqe7y+mXgOFikYR5IZB9Gho5DKqxTtHmA1FFYL0kT8=; b=PLCpgtUkdhJNYBwIEYc98KHPXNmtgp6VUTTUqJ0UY4nynmBAk6h3/JLgc16amZUsUf+eo3ZND7Iy1mtd10G/mhr1OhtDFuJQTXRqYtv8NViStg0bxAOpFxgbNiuqKgIe7tXDhjI/pTaZMuEqKRrol3BJ7Pgh9NMYZRU4Fpr/G6c= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901218141122.54196585507225; Wed, 2 Dec 2020 01:26:58 -0800 (PST) Received: from localhost ([::1]:37876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOPZ-000789-21 for importer@patchew.org; Wed, 02 Dec 2020 04:26:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDR-00044n-Lj for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCg-0003sD-19 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-SdFJ8SwYP9ePmhfSQFi57w-1; Wed, 02 Dec 2020 03:09:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC1AA5708D for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A15FE60854 for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896573; 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: in-reply-to:in-reply-to:references:references; bh=NKqe7y+mXgOFikYR5IZB9Gho5DKqxTtHmA1FFYL0kT8=; b=Jh8Bp5Ch95DXbg4xQ1Ds5EtCjz59x904VOKXQ6gwx9S7JOVS9baB395eIcJryYCkHuUzZg D9z8jpaZsrN1WNqHB2jWD46jYdvTgitMycUqsIExertXmREAxlv6scWSjAp2cQvbJKaMMt +QgVArjjzUx6d0oGAgeKU80sigB0mk8= X-MC-Unique: SdFJ8SwYP9ePmhfSQFi57w-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 106/113] scripts: kernel-doc: try to use c:function if possible Date: Wed, 2 Dec 2020 03:08:42 -0500 Message-Id: <20201202080849.4125477-107-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There are a few namespace clashes by using c:macro everywhere: basically, when using it, we can't have something like: .. c:struct:: pwm_capture .. c:macro:: pwm_capture So, we need to use, instead: .. c:function:: int pwm_capture (struct pwm_device * pwm, struct pwm_captu= re * result, unsigned long timeout) for the function declaration. The kernel-doc change was proposed by Jakob Lykke Andersen here: https://github.com/jakobandersen/linux_docs/commit/6fd2076ec001cca74668574= 93cd678df4dfe4a65 Although I did a different implementation. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-25-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 98752164eb..2d56c46933 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -917,6 +917,7 @@ sub output_function_rst(%) { my ($parameter, $section); my $oldprefix =3D $lineprefix; my $start =3D ""; + my $is_macro =3D 0; =20 if ($sphinx_major < 3) { if ($args{'typedef'}) { @@ -926,11 +927,17 @@ sub output_function_rst(%) { $lineprefix =3D ""; output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; + $is_macro =3D 1; } else { print ".. c:function:: "; } } else { - print ".. c:macro:: ". $args{'function'} . "\n\n"; + if ($args{'typedef'} || $args{'functiontype'} eq "") { + $is_macro =3D 1; + print ".. c:macro:: ". $args{'function'} . "\n\n"; + } else { + print ".. c:function:: "; + } =20 if ($args{'typedef'}) { print_lineno($declaration_start_line); @@ -939,7 +946,7 @@ sub output_function_rst(%) { output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; } else { - print "``"; + print "``" if ($is_macro); } } if ($args{'functiontype'} ne "") { @@ -964,14 +971,12 @@ sub output_function_rst(%) { print $type; } } - if ($args{'typedef'}) { - print ");``\n\n"; + if ($is_macro) { + print ")``\n\n"; } else { - if ($sphinx_major < 3) { - print ")\n\n"; - } else { - print ")``\n"; - } + print ")\n\n"; + } + if (!$args{'typedef'}) { print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901686; cv=none; d=zohomail.com; s=zohoarc; b=BWt1DsYRRttjn33VsgPajDQmqcN4UotZ2k3/NGEmAQcfBR2DEt753S9To0+SjVvt8Kj5k1kONDa3EiUmfP6E6nHPRLjNU3KnKOIA9jSFTtaSvNhybtaF4mLhxAMMsOx8jXwVLrTY//UcNt/E/4NOl+Pl6Ld0Bx/y55BZS5JyZwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901686; 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=RhwMeLb8WEPNPD1HkbeUC+TAOzuLzw7E47zkdkxByCk=; b=RBovXNGIM78FJ01e3+kPxRJcfFXDIEHaAfGGllQKlGK+v4fqpJvJ4doKLTsGuK1z09jndJkgN6780gWK6GXdZApn8GCoIMsOzE6IPgnTzwW8mOArQyhoWq0E2Fgm2b8AfeK+4tR08Vda3DkYdeD4jFs8p0wUKkmPv/N6EFqsz3k= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901686254934.4667607091956; Wed, 2 Dec 2020 01:34:46 -0800 (PST) Received: from localhost ([::1]:58208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOX7-0007V5-2m for importer@patchew.org; Wed, 02 Dec 2020 04:34:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDQ-00042G-Di for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:27734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCf-0003s0-Gz for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-534-zJma0cYIP9qMstamwRJnUQ-1; Wed, 02 Dec 2020 03:09:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 452095708E for ; Wed, 2 Dec 2020 08:09:30 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0944D60854 for ; Wed, 2 Dec 2020 08:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896572; 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: in-reply-to:in-reply-to:references:references; bh=RhwMeLb8WEPNPD1HkbeUC+TAOzuLzw7E47zkdkxByCk=; b=NQZp4e8BkpasHyM/YbXI8t1hLtZz9LKr7eYJPWV/mLAxqrVjhpEufOcF0hxtWp+4jKmbKR sewn8oFbHlxmeEWiDEIk73OyZqxAWzUEtYeBILc4tO4rPIR+WQwtEF5tgjykm6vkZFE0ld cHKRj73GmX3MwBRXGatZZjYcauN1fq4= X-MC-Unique: zJma0cYIP9qMstamwRJnUQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 107/113] Revert "kernel-doc: Handle function typedefs without asterisks" Date: Wed, 2 Dec 2020 03:08:43 -0500 Message-Id: <20201202080849.4125477-108-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 3cd3c5193cde5242e243c25759f85802e267994f. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-26-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2d56c46933..780aee4e92 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,7 +1434,7 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*?\s*(\w\S+)\s*\)\s*\((.*)\);/= || + if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901567; cv=none; d=zohomail.com; s=zohoarc; b=BLYdwpFTsrHqouxfXtw5b1DaVeaTCyc5/Z37qeaM0eaR+wGwYCm58IMnTNgenK4386TKFb7+B1revhxRNVFZ8Z5JbHYDQayv+v2rKDHZ+7hLrdNur5jHBkhcxKOcQOMsum4bZmf7WtMNrU8QlZLba23baRMxnN8LIvOH/qsMzlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901567; 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=GiAsebyEgUN6g6nMYa5Mkh5gItth4ZEtNuU0Vbs8Oe4=; b=NbNvxme8+d/b/VV2QNQVD//G3PBRvwS0LGtJvAW/O01a0919Z0hzXJASBTuOCftsJHqao6L1PuI8tKX0qHJs3NUwA4Gwtcv375CDJ7kxn7cHbUW7pawV0Oyl41nBrCly9+bM04RJqwS13FLtA0Z7Zq4v9M0QVgCWg3FKaPHC7bw= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901567851582.6546654426626; Wed, 2 Dec 2020 01:32:47 -0800 (PST) Received: from localhost ([::1]:52660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOVC-00054b-KS for importer@patchew.org; Wed, 02 Dec 2020 04:32:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDQ-000431-TG for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCf-0003s3-LH for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-10WNEDNUPUW-9D7ZmLn4VA-1; Wed, 02 Dec 2020 03:09:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A22A9185E489 for ; Wed, 2 Dec 2020 08:09:30 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6628C60855 for ; Wed, 2 Dec 2020 08:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896572; 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: in-reply-to:in-reply-to:references:references; bh=GiAsebyEgUN6g6nMYa5Mkh5gItth4ZEtNuU0Vbs8Oe4=; b=RLAsvcjzH4YJlcT3Y/Rul9MhR7ZWRirTjoJboyFMzOs1MWduiC2cFIt0NhjfJL/056ekjT I8EkUM+an5Z++hhg12gMJzcnxdAu0nFYIv1WHirtQgQvr5JTWBB91lYW5sNPY12qqGvrJI 8ebEq0JgAFrSeDjsFQMxDJM8leD6wSc= X-MC-Unique: 10WNEDNUPUW-9D7ZmLn4VA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 108/113] Revert "kernel-doc: Handle function typedefs that return pointers" Date: Wed, 2 Dec 2020 03:08:44 -0500 Message-Id: <20201202080849.4125477-109-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 19ab6044be0c55d529e875e3ee16fdd5c3b54d33. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-27-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 780aee4e92..d3a289628c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,8 +1434,8 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || - $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { + if ($x =3D~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || + $x =3D~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs $return_type =3D $1; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901420; cv=none; d=zohomail.com; s=zohoarc; b=Wv0Xo+byBMwjJr8wWyQyH9XtDvUtU43nEZrs3G9jFTlXitpKcdoNk8TEORESoYUTfqvmvUi8WqEFZpXWbAekzZfNCdTJoiU2mL2c7yfKjUQvcP3AhewI9pkm1o89pa3eQDK5TMqydGZOCTT/8OjG8XSwbvp59LauFdcH7M/5vvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901420; 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=9FsWZNmQMTzP45CGKAZDRB7a8dvrSmV62DmBnscUAZg=; b=M0+a3yIA/oXh13b0VLV+lQN6lQo05FsfxFLn63QFUJVk5l/ubPrXwjptEWH899JIfABk7m6XtzU60tZo2KbGE+lW9ntKmaYMzwa82554YMBg9DN4SIo5t2GHTlO8GWuXzliirYZ3DtgaqcO0kQBfUPMk0NgteB1BGx1M3LSksdE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901420291671.9391877210197; Wed, 2 Dec 2020 01:30:20 -0800 (PST) Received: from localhost ([::1]:46422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOSp-0002Kv-6e for importer@patchew.org; Wed, 02 Dec 2020 04:30:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDR-00045S-Vz for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCg-0003sH-1H for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-Kc03iG9oMnuLw7zOOVUFFw-1; Wed, 02 Dec 2020 03:09:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09DC480364D for ; Wed, 2 Dec 2020 08:09:31 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C286460854 for ; Wed, 2 Dec 2020 08:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896573; 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: in-reply-to:in-reply-to:references:references; bh=9FsWZNmQMTzP45CGKAZDRB7a8dvrSmV62DmBnscUAZg=; b=ZKQO/+zcqZnCRP31hkPXZ/EwHj//mMuNyAkzVgtoWfC69mSlbDzFveErmc/rHsmGX+GJgv JX/fgBJNmxaBOsA/sYQwcos/Q65FB3UbaHq3gP5GcSVLMivtbLanrSSfwUhggGDrNQTFBq cq2eU98gOnPQvCOyNw5qQXIMBa+dbIU= X-MC-Unique: Kc03iG9oMnuLw7zOOVUFFw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 109/113] scripts: kernel-doc: fix typedef parsing Date: Wed, 2 Dec 2020 03:08:45 -0500 Message-Id: <20201202080849.4125477-110-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The include/linux/genalloc.h file defined this typedef: typedef unsigned long (*genpool_algo_t)(unsigned long *map,unsigned long s= ize,unsigned long start,unsigned int nr,void *data, struct gen_pool *pool, = unsigned long start_addr); Because it has a type composite of two words (unsigned long), the parser gets the typedef name wrong: .. c:macro:: long **Typedef**: Allocation callback function type definition Fix the regex in order to accept composite types when defining a typedef for a function pointer. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/328e8018041cc44f7a1684e57f8d111230761c4f.16= 03792384.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-28-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d3a289628c..862b77686e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,13 +1434,14 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || - $x =3D~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { + if ($x =3D~ /typedef((?:\s+[\w\*]+){1,8})\s*\(\*?\s*(\w\S+)\s*\)\s*\((= .*)\);/ || + $x =3D~ /typedef((?:\s+[\w\*]+\s+){1,8})\s*\*?(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs $return_type =3D $1; $declaration_name =3D $2; my $args =3D $3; + $return_type =3D~ s/^\s+//; =20 create_parameterlist($args, ',', $file, $declaration_name); =20 --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901903; cv=none; d=zohomail.com; s=zohoarc; b=CpMah/D1PIJyOI05oXq1DFNHcn597W4y7suZ7yMBG1bQaJVQVni9Fs7PHpQoYmfwaeVfRWQyULRTy317kgg8z0vqT4Mrv4MdCfd6ZfF33CbTsVRnt89IfvNkKDbJHvsBgbFPPX19fJ5+iRjR9mPNscMkk4eDdgMC5bak/P/sGpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901903; 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=qHV1Bw2XcvB86SinjjcaViQAYlGKdlvYVGUfC9qwTiU=; b=CsqZ7Ttjw+iQzOOF4GugKVorVw+fYwbypJfFDWI38swJnGB0M2+U4hdWyR8bc82XubBhSYQRL470yj+D8dtOpNZm7RgwtAS5owhx6nmIud4XmzF6p14jhVFNClGkDuZ7nn0vDBrFGE4u/sXEGKN3mU7tcICyIwDAPE9XwDbKTV0= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160690190388380.77817484872901; Wed, 2 Dec 2020 01:38:23 -0800 (PST) Received: from localhost ([::1]:40998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOac-0003uI-Qv for importer@patchew.org; Wed, 02 Dec 2020 04:38:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDU-0004Ag-Dt for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCh-0003t4-1q for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123-1fRmO03YPWO_wKOqhbH9fw-1; Wed, 02 Dec 2020 03:09:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD84F185E48B for ; Wed, 2 Dec 2020 08:09:31 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72D4F60C17 for ; Wed, 2 Dec 2020 08:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896574; 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: in-reply-to:in-reply-to:references:references; bh=qHV1Bw2XcvB86SinjjcaViQAYlGKdlvYVGUfC9qwTiU=; b=DI640nlvFgH3512dbnta5guDvN4kJrbvt1BvxjXDsmbuTDa+qBPucwq4gQ15CBEX9nD7PL JulYdky4OLWtZNrmCSTrb7mFJvYKP4VOCqNcKmgLBNNCOcvBKpz3xMDqhHMfBJj3t7MrU7 BINBNt30YYMiIlV+lfJ7lKgQI6OQ920= X-MC-Unique: 1fRmO03YPWO_wKOqhbH9fw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 110/113] scripts: kernel-doc: split typedef complex regex Date: Wed, 2 Dec 2020 03:08:46 -0500 Message-Id: <20201202080849.4125477-111-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The typedef regex for function prototypes are very complex. Split them into 3 separate regex and then join them using qr. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3a4af999a0d62d4ab9dfae1cdefdfcad93383356.16= 03792384.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-29-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 862b77686e..524fc626ed 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1427,17 +1427,21 @@ sub dump_enum($$) { } } =20 +my $typedef_type =3D qr { ((?:\s+[\w\*]+){1,8})\s* }x; +my $typedef_ident =3D qr { \*?\s*(\w\S+)\s* }x; +my $typedef_args =3D qr { \s*\((.*)\); }x; + +my $typedef1 =3D qr { typedef$typedef_type\($typedef_ident\)$typedef_args = }x; +my $typedef2 =3D qr { typedef$typedef_type$typedef_ident$typedef_args }x; + sub dump_typedef($$) { my $x =3D shift; my $file =3D shift; =20 $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 - # Parse function prototypes - if ($x =3D~ /typedef((?:\s+[\w\*]+){1,8})\s*\(\*?\s*(\w\S+)\s*\)\s*\((= .*)\);/ || - $x =3D~ /typedef((?:\s+[\w\*]+\s+){1,8})\s*\*?(\w\S+)\s*\s*\((.*)\);/) { - - # Function typedefs + # Parse function typedef prototypes + if ($x =3D~ $typedef1 || $x =3D~ $typedef2) { $return_type =3D $1; $declaration_name =3D $2; my $args =3D $3; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901631; cv=none; d=zohomail.com; s=zohoarc; b=jRI0DEY3sNRvkxU/VVUCuZb0TWUwAz8M2nJMB02lN57c/2fvrBo4rxHpQeGwk7JFJRVHzwBLQHq+NERjbu+EVRAYNXcoFSk7jellDUAECwTL2isvz6HLlzJwcv2gAqPSP1mj7kh0/4TxbIjrzDNRmvYPckdpnJuh7OIM7YyEwWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901631; 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=kSjg7m+HaAHtujriKl1vHsebKVqWjUJdu+/lbf1VQG0=; b=n/+c9MgwMaz6xHMCmFzkcdh/s9PKJP+//VLD1mv0/O2edD6wLSOTU86IqedOJPTLevJjuY7+2Wr8p/ZJ02GitnY+LKXhtfjzHIuEKY8eaZ7qVS9/Xtg0NNb3XMa4cj4EEj6qgfCYCJa82B3Bx1rA2lKKJElwZRzaiVcYCBXuTtI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901631523710.2731067355107; Wed, 2 Dec 2020 01:33:51 -0800 (PST) Received: from localhost ([::1]:54778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOWE-0005yF-8f for importer@patchew.org; Wed, 02 Dec 2020 04:33:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDU-0004Bw-Vh for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCh-0003tO-Az for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-QcF4biqbP-iUfh_v1vxSrQ-1; Wed, 02 Dec 2020 03:09:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15A5B1074645 for ; Wed, 2 Dec 2020 08:09:32 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CED0B60C17 for ; Wed, 2 Dec 2020 08:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896574; 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: in-reply-to:in-reply-to:references:references; bh=kSjg7m+HaAHtujriKl1vHsebKVqWjUJdu+/lbf1VQG0=; b=fEGK66VpZuJJ64ChDdFA1l62sIYAIClW72X/OUq/rZ7kHwsvv/nCmAWGye6F7H+tBJMFSL 3xrFFXNsubBiibs0AF3lsKf6KJuk1fGlzGjChkzGj6ZEyvULkZQEX5GOyRlySD0JkyxqRi tMl9Mi4bbODARppzP/HVMBkXxVxqycY= X-MC-Unique: QcF4biqbP-iUfh_v1vxSrQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 111/113] scripts: kernel-doc: use :c:union when needed Date: Wed, 2 Dec 2020 03:08:47 -0500 Message-Id: <20201202080849.4125477-112-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Sphinx C domain code after 3.2.1 will start complaning if :c:struct would be used for an union type: .../Documentation/gpu/drm-kms-helpers:352: ../drivers/video/hdmi.c:851: WA= RNING: C 'identifier' cross-reference uses wrong tag: reference name is 'un= ion hdmi_infoframe' but found name is 'struct hdmi_infoframe'. Full referen= ce name is 'union hdmi_infoframe'. Full found name is 'struct hdmi_infofram= e'. So, let's address this issue too in advance, in order to avoid future issues. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6e4ec3eec914df62389a299797a3880ae4490f35.16= 03791716.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-30-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 524fc626ed..b95bae3654 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1092,7 +1092,11 @@ sub output_struct_rst(%) { print "\n\n.. c:type:: " . $name . "\n\n"; } else { my $name =3D $args{'struct'}; - print "\n\n.. c:struct:: " . $name . "\n\n"; + if ($args{'type'} eq 'union') { + print "\n\n.. c:union:: " . $name . "\n\n"; + } else { + print "\n\n.. c:struct:: " . $name . "\n\n"; + } } print_lineno($declaration_start_line); $lineprefix =3D " "; --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606901774; cv=none; d=zohomail.com; s=zohoarc; b=LMe4x3JmgBi6woZ8MXPmaLOdCdvTxSJyHf3ETPLrB27zu1jf0X6recMknW6fMYzP5mxfjiXGBWPjDPZR9txizQPsNj1VT3u9jI2vEHE03owWyQG3GXdyiu06sr35ig240aF79IuH7EMp4OltYrTnLFTkd6lp7C2rcqrUDaVhjAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901774; 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=JEZ4bKBmLgXP1GaPE/TykVdYqezDQVYguILf+dYH7QQ=; b=Ujv2oYyCWxktrQZHqq7oeOBd4qKHddwBMFc5wn8oIXleZ9AdzdHE4KwPy6N3sP8GYDUgCSHMDkm9kxhYUjBUo7G/GTtiP6frk5LPVo7jheG2wmai5MSqf34dTMiYQns+EjfLURabKGg03fUcJlK4XunzG602XD9hCyoMPt/N+wQ= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901774258914.5495461992857; Wed, 2 Dec 2020 01:36:14 -0800 (PST) Received: from localhost ([::1]:32768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOYX-0000E6-3w for importer@patchew.org; Wed, 02 Dec 2020 04:36:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDT-00048W-IU for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCh-0003tV-Lb for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-7md_NVVuP9ecGds20FFclA-1; Wed, 02 Dec 2020 03:09:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70E8C1074641 for ; Wed, 2 Dec 2020 08:09:32 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3685D60C17 for ; Wed, 2 Dec 2020 08:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896574; 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: in-reply-to:in-reply-to:references:references; bh=JEZ4bKBmLgXP1GaPE/TykVdYqezDQVYguILf+dYH7QQ=; b=UTAwK21PQAr2597Nj6wkA6saaQzTY85saZLQXjOH0r2z9ozYZ7D9bZyww6HOD3HoNUA8zU QU360GnSZQpk9QXYhgaH1JyPQ5UPWYjGA4MeiUXMjtn/89XbM/QkgCQ7JJb23MQ+zsuJ72 kYDRPrbRbiILVCR8nvfeYZ3YjPM5Qqw= X-MC-Unique: 7md_NVVuP9ecGds20FFclA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 112/113] Revert "docs: temporarily disable the kernel-doc extension" Date: Wed, 2 Dec 2020 03:08:48 -0500 Message-Id: <20201202080849.4125477-113-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit fd68a72875cf318f4310726f842139119c5f45d5. We're done with the update of kernel-doc and we can restore kernel-doc's functionality. Signed-off-by: Paolo Bonzini Signed-off-by: Paolo Bonzini --- docs/sphinx/kerneldoc.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 079aadced3..bf44215016 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -80,9 +80,6 @@ class KernelDocDirective(Directive): # Tell sphinx of the dependency env.note_dependency(os.path.abspath(filename)) =20 - # Disabled temporarily while scripts/kernel-doc is updated - return [] - tab_width =3D self.options.get('tab-width', self.state.document.se= ttings.tab_width) =20 # FIXME: make this nicer and more robust against errors --=20 2.26.2 From nobody Mon Feb 9 10:57:46 2026 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=1606900792; cv=none; d=zohomail.com; s=zohoarc; b=AyO5UxHWs3MBaWKcuAzqyMvkHxdctWcklB0L6FUre9g+qAQROv+psYWJqvcqYmM3C9CBgKxkD/ZDxf4if/cp6kKLipsoc5I64cvswExS33a/2osLUZ1dHzFU02nrH1bUOjno/I2qYur1C3uW3pLNz1kyj638+XGylick1xNF3bA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606900792; 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=DPtg02KBbgeo/fb7I7tYDFfslZ3GmxNcSArYS7E1QLU=; b=g0gpvwi2bO4H7F95Sdnvol5oIdFE/vHR2qBwb7w8H3FCf0LzJOyS2ZkBs2mcgS87EnJuatj1rWrSzv87I/vFuqL2g5/dYpj9S9aIkQgvfEX6eiTYvc20fP99eE1QGD075RG/saPVARqz7Ud1PssDZ5Z+HWkx119tiohIamEM6AY= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606900792038613.3743286386168; Wed, 2 Dec 2020 01:19:52 -0800 (PST) Received: from localhost ([::1]:45554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOIg-0006bp-N8 for importer@patchew.org; Wed, 02 Dec 2020 04:19:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDU-00049z-5e for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCi-0003te-3b for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-WifgYmzEN3WC3Rm8ldxJ2g-1; Wed, 02 Dec 2020 03:09:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC8D15708B for ; Wed, 2 Dec 2020 08:09:32 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 921D560C17 for ; Wed, 2 Dec 2020 08:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896575; 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: in-reply-to:in-reply-to:references:references; bh=DPtg02KBbgeo/fb7I7tYDFfslZ3GmxNcSArYS7E1QLU=; b=YQR0RKE8WGpWNvQlAO2lRWkHmAohEhi1FmaiVR4Tcu7WCglxaVrzS5PyxRW5DvdDmGsSMa YsUrQha4VuhvZ/2eYA9807g8Jyy2tYKAl/n9khsdUEG2nD2nRCikK4W9zHARJZPBIYfYun W7qteb1ysJoLfVYdEE3hnbCsWkmHbfw= X-MC-Unique: WifgYmzEN3WC3Rm8ldxJ2g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 113/113] scripts: kernel-doc: remove unnecesssary change wrt Linux Date: Wed, 2 Dec 2020 03:08:49 -0500 Message-Id: <20201202080849.4125477-114-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" A comment in kernel-doc mentions QEMU's qatomic_set macro, but since this code originated in Linux we should just revert it and stay as close to the kernel's copy of the script as possible. The change was introduced (more or less unintentionally) in QEMU commit commit d73415a31547, which did a global search-and-replace of QEMU's atomic access macros. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index b95bae3654..4b19851b2d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1758,7 +1758,7 @@ sub dump_function($$) { # If you mess with these regexps, it's a good idea to check that # the following functions' documentation still comes out right: # - parport_register_device (function pointer parameters) - # - qatomic_set (macro) + # - atomic_set (macro) # - pci_match_device, __copy_to_user (long return type) =20 if ($define && $prototype =3D~ m/^()([a-zA-Z0-9_~:]+)\s+/) { --=20 2.26.2