From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568174848; cv=none; d=zoho.com; s=zohoarc; b=OcMqTNs7C1lKsXwQKcUjzfiWRX/4wM4aNq1B6j8AQGoei7kcu5MM0Pt+E4BBaJyhO3vFqudhgTz7rSMW+W3DN+qKu0rkSO9A04ZSnt9CrESHej8gIN339k5UWybnYg9UMFMb1UG6rCFnXpNvU0WG4T5HmJriOuBWj6G1KnKwfqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568174848; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=hIvT5YUolDNa5TnZ4CfS9MSXCXfUjQ3ue9/FqjgV5+U=; b=dxf2AyobJXTx2ohXY/+mdSxGFp4eCAUOxrishqpAqlvgPC2mmMhnyo7X+J9sbYatSHLpT3FHV3UMSodGEVG97pkbC8P5sVe0dvZjNSsx0ecPm8Fs5cB8qOk0Fifug5BHfar32EMZ3REDcwucH2SoZgcnqH8uSG28L6u2bg0IR5A= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 156817484822139.17233857617805; Tue, 10 Sep 2019 21:07:28 -0700 (PDT) Received: from localhost ([::1]:46374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tuY-0002L9-8Z for importer@patchew.org; Wed, 11 Sep 2019 00:07:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46466) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsS-0000TG-82 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsQ-0002pg-6C for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:08 -0400 Received: from ozlabs.org ([203.11.71.1]:59947) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsM-0002gY-92; Wed, 11 Sep 2019 00:05:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh0f98z9sNT; Wed, 11 Sep 2019 14:04:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=+W9UPN/ALOo34+VF9qLrqmg3j867eeOuEWzF8cMTtWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHxQBc/nRm3nxg7YUFaYEJ8u9/haYi6SytvMhHnX4x1EhbvV5EU3eDJmsrSeU80Gl +B3xKFIVHLqIUqX78Anf7WOwiC3kbLdTb9bQEGEuiBA8FWxLmwpMC1td/mNzoRN1ql xsetM/yeZ2BH+LZUKXjwY3fwTF0le+4bz7TOlktk= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:46 +1000 Message-Id: <20190911040452.8341-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PATCH 1/7] spapr: Simplify handling of pre ISA 3.0 guest workaround handling 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Certain old guest versions don't understand the radix MMU introduced with POWER ISA 3.0, but incorrectly select it if presented with the option at CAS time. We workaround this in qemu by explicitly excluding the radix (and other ISA 3.0 linked) options if the guest doesn't explicitly note support for ISA 3.0. This is handled by the 'cas_legacy_guest_workaround' flag, which is pretty vague. Rename it to 'cas_pre_isa3_guest' to be clearer about what it's for. In addition, we unnecessarily call spapr_populate_pa_features() with different options when initially constructing the device tree and when adjusting it at CAS time. At the initial construct time cas_pre_isa3_guest is already false, so we can still use the flag, rather than explicitly overriding it to be false at the callsite. Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz --- hw/ppc/spapr.c | 10 ++++------ hw/ppc/spapr_hcall.c | 3 +-- include/hw/ppc/spapr.h | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7124053b43..c551001f86 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -218,8 +218,7 @@ static int spapr_fixup_cpu_numa_dt(void *fdt, int offse= t, PowerPCCPU *cpu) /* Populate the "ibm,pa-features" property */ static void spapr_populate_pa_features(SpaprMachineState *spapr, PowerPCCPU *cpu, - void *fdt, int offset, - bool legacy_guest) + void *fdt, int offset) { uint8_t pa_features_206[] =3D { 6, 0, 0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 }; @@ -285,7 +284,7 @@ static void spapr_populate_pa_features(SpaprMachineStat= e *spapr, if ((spapr_get_cap(spapr, SPAPR_CAP_HTM) !=3D 0) && pa_size > 24) { pa_features[24] |=3D 0x80; /* Transactional memory support */ } - if (legacy_guest && pa_size > 40) { + if (spapr->cas_pre_isa3_guest && pa_size > 40) { /* Workaround for broken kernels that attempt (guest) radix * mode when they can't handle it, if they see the radix bit set * in pa-features. So hide it from them. */ @@ -348,8 +347,7 @@ static int spapr_fixup_cpu_dt(void *fdt, SpaprMachineSt= ate *spapr) return ret; } =20 - spapr_populate_pa_features(spapr, cpu, fdt, offset, - spapr->cas_legacy_guest_workaround); + spapr_populate_pa_features(spapr, cpu, fdt, offset); } return ret; } @@ -551,7 +549,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *f= dt, int offset, page_sizes_prop, page_sizes_prop_size))); } =20 - spapr_populate_pa_features(spapr, cpu, fdt, offset, false); + spapr_populate_pa_features(spapr, cpu, fdt, offset); =20 _FDT((fdt_setprop_cell(fdt, offset, "ibm,chip-id", cs->cpu_index / vcpus_per_socket))); diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 23e4bdb829..3d3a67149a 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1765,8 +1765,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, exit(EXIT_FAILURE); } } - spapr->cas_legacy_guest_workaround =3D !spapr_ovec_test(ov1_guest, - OV1_PPC_3_00); + spapr->cas_pre_isa3_guest =3D !spapr_ovec_test(ov1_guest, OV1_PPC_3_00= ); spapr_ovec_cleanup(ov1_guest); if (!spapr->cas_reboot) { /* If spapr_machine_reset() did not set up a HPT but one is necess= ary diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 03111fd55b..dfec8e8e76 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -175,7 +175,7 @@ struct SpaprMachineState { =20 /* ibm,client-architecture-support option negotiation */ bool cas_reboot; - bool cas_legacy_guest_workaround; + bool cas_pre_isa3_guest; SpaprOptionVector *ov5; /* QEMU-supported option vectors */ SpaprOptionVector *ov5_cas; /* negotiated (via CAS) option vectors= */ uint32_t max_compat_pvr; --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568175042; cv=none; d=zoho.com; s=zohoarc; b=oeI1qtKtYvSYJgEEud0CItOdOOYBAT9G5zE58Ib2/ypEM8MQhdJLKe9V8pt6iQNjUgq/C7QsryCgMdXv7I2M2jft+65cK7kOb3vJAMsK+C/UA2qg92iFPyF5Vpzi16C0rvsHsOk6jBqNECfkwjQ9o3DbW5f212K03VgSd6z2n/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568175042; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=i+62+nypeVcZQGoXW1IjCd1+WkoTyyl/9HAkkXaMkDE=; b=AEvOsvhU4dxdigaQ/AHXjcl+OoVCXl/quUZsl9P104FpvypPQs0BqzyzVbbyTLHZqdBmRjHa5uwgQDgYFLQ4dx7u+1lJn/H930ML4yDu2h4oPB+9regUFyk7rKVXzD2ruFisveehwQxf5xItMrb2Gxj2tMPBkeupZg1B9FdgJDE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568175042162132.0012539775762; Tue, 10 Sep 2019 21:10:42 -0700 (PDT) Received: from localhost ([::1]:46406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7txo-0006Dv-GW for importer@patchew.org; Wed, 11 Sep 2019 00:10:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46464) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsS-0000TE-8T for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsO-0002nq-89 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:06 -0400 Received: from ozlabs.org ([203.11.71.1]:44519) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsK-0002gG-Gr; Wed, 11 Sep 2019 00:05:02 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFg55LSz9sDB; Wed, 11 Sep 2019 14:04:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174695; bh=M/opkdlGyilRi9732MZlFGdJqgm95fZi8DV2n5tc3FM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+eVjgv+3RmcxIQtxnnylaWYQSPtu6tbYyY1nc/FPj1iE1sv5xaGAnKbeNxzzIxOj P7X5JVOUVJIFZVMpB5lDK2Fwz9nfSIbviTyb/weAmXRaVgNoVT0jkcI0gMl0MfU75a /H65ds1CAKKDJw8jfR4j2pa99Sd9FypXWjzViQFI= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:47 +1000 Message-Id: <20190911040452.8341-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PATCH 2/7] spapr: Move handling of special NVLink numa node from reset to init 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The number of NUMA nodes in the system is fixed from the command line. Therefore, there's no need to recalculate it at reset time, and we can determine the special gpu_numa_id value used for NVLink2 devices at init time. This simplifies the reset path a bit which will make further improvements easier. Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Tested-by: Alexey Kardashevskiy --- hw/ppc/spapr.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c551001f86..e03e874d94 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1737,16 +1737,6 @@ static void spapr_machine_reset(MachineState *machin= e) spapr_setup_hpt_and_vrma(spapr); } =20 - /* - * NVLink2-connected GPU RAM needs to be placed on a separate NUMA nod= e. - * We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which = is - * called from vPHB reset handler so we initialize the counter here. - * If no NUMA is configured from the QEMU side, we start from 1 as GPU= RAM - * must be equally distant from any other node. - * The final value of spapr->gpu_numa_id is going to be written to - * max-associativity-domains in spapr_build_fdt(). - */ - spapr->gpu_numa_id =3D MAX(1, machine->numa_state->num_nodes); qemu_devices_reset(); =20 /* @@ -2885,6 +2875,17 @@ static void spapr_machine_init(MachineState *machine) =20 } =20 + /* + * NVLink2-connected GPU RAM needs to be placed on a separate NUMA nod= e. + * We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which = is + * called from vPHB reset handler so we initialize the counter here. + * If no NUMA is configured from the QEMU side, we start from 1 as GPU= RAM + * must be equally distant from any other node. + * The final value of spapr->gpu_numa_id is going to be written to + * max-associativity-domains in spapr_build_fdt(). + */ + spapr->gpu_numa_id =3D MAX(1, machine->numa_state->num_nodes); + if ((!kvm_enabled() || kvmppc_has_cap_mmu_radix()) && ppc_type_check_compat(machine->cpu_type, CPU_POWERPC_LOGICAL_3_00,= 0, spapr->max_compat_pvr)) { --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568174884; cv=none; d=zoho.com; s=zohoarc; b=lUZQNhXHxCIBo69/FT+8Yl/fxryNdSEii0NJyTYVJB0HB1mLFxnWCOJL9kePWz5TJte1x/X1nZK4qSkOwlwVvJQP0SQvzQr/jhBBqhMfHEVpQptH6T9u7jlPQzPkaBWs5I0D13Uf0/I3/xswFYf9mNHCjaMzmxrfh+CzaIXEY+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568174884; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=v4KxjLPrYdvih1EXB5PWoSp6zKOPg5xQyBU/bCKC67k=; b=kgnrNOuldCb2zd2xaGs8cJD22dmOmHSv6ouVVonQHHwdXd3r1kGRxbULRUtvMZgzblj7KprPLWZNblXqrJGRpDJNTMzw9OurqJrlFQlIxuliZKixsj2krQd3Q0LxJt/UF8ftS/bnx8WD6wMtozlg6g6F6mqr3ge3KmCkKKRRpGI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156817488479194.11137529327243; Tue, 10 Sep 2019 21:08:04 -0700 (PDT) Received: from localhost ([::1]:46380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tvG-0003MB-F7 for importer@patchew.org; Wed, 11 Sep 2019 00:08:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46542) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsW-0000Tq-2G for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsU-0002v9-JF for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:11 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:38643 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsU-0002oS-5M; Wed, 11 Sep 2019 00:05:10 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh35nkz9sPK; Wed, 11 Sep 2019 14:04:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=uLh2TErb7o3yTJbd+R/IE8x2VY0Sd7delo2pPs+T6HQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YOImvHkMBRO8DyMCaYBR0XpP+7BClvCE6lTWZ/chlGZbZjIMZoDHgY6lD72DS2n6E PdL3s0Jg+naCmCDt0ytG+5cijaMdCsn93wzk1BAP+BcMCum1eeT6fzhDlLajjPV61s o9LRJ14lYy9KMWDK7ENkSnvyw5WdsDgfYjggvc0s= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:48 +1000 Message-Id: <20190911040452.8341-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH 3/7] spapr: Fixes a leak in CAS 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy Add a missing g_free(fdt) if the resulting tree is bigger than the space allocated by SLOF. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz --- hw/ppc/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e03e874d94..d93dacd483 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1024,6 +1024,7 @@ int spapr_h_cas_compose_response(SpaprMachineState *s= papr, _FDT((fdt_pack(fdt))); =20 if (fdt_totalsize(fdt) + sizeof(hdr) > size) { + g_free(fdt); trace_spapr_cas_failed(size); return -1; } --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568175040; cv=none; d=zoho.com; s=zohoarc; b=kClPGwEjw0eoRozWE7dmQnBpzPLrxPYd4hWrDQc/uvvWwI47I4oN4COv/GKpMawsyXPi1m9f6Ps3NiHuBi0GcXvrkz7HvGNV6l5AdDeRFwYI4sGTQx3/6+2VYrHxL4oeUUYrvkna2bxzDyeEUF34K23TuDGK7voFwcrrORm0RlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568175040; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=QQPuQEw59PNVwCfJWLkB8C6RjBfB+i5gCdr1PF2ARc0=; b=Fje7D/GqTDdn/iXHur9QRpvmjWtcU7wr6wp7Msve9XfBqfKRfBtjRdY/Ijgt9wGTYWWXQZ8y9x0CGJHaBF+jYhfABEMJKhCiLMHJDZv8RqXvY29E4GDhCzS+b45QsmjI63lreR+qWa/Ix3B9ElLr1FtmEUGysBGkD32LWztmjns= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156817504015570.9442865338068; Tue, 10 Sep 2019 21:10:40 -0700 (PDT) Received: from localhost ([::1]:46404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7txm-00067a-HC for importer@patchew.org; Wed, 11 Sep 2019 00:10:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46534) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsV-0000Tp-N3 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsU-0002u5-7L for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:11 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:56033 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsS-0002oU-3w; Wed, 11 Sep 2019 00:05:10 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh3x6dz9sP7; Wed, 11 Sep 2019 14:04:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=ylhoDfJcjV2qvn5MxSZQG8aGRM94Y37JeaOOSb3exk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KZiB379g12JRigBzvMLx+UvAp98Jlut87ijKuAndv6Qkt8Tz/QGaZWm+wQ/LAEZd4 Fusm8L8eWPXI6WBqQp+x+cka+/w5yf4O6uxNo+7ipu/8cjHQfEiake5E4G4lV+xMSQ +eyViX8sf4tZgbHZxxsOHe/VVdJksOnFfk+3EYGw= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:49 +1000 Message-Id: <20190911040452.8341-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH 4/7] spapr: Skip leading zeroes from memory@ DT node names 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy The device tree build by QEMU at the machine reset time is used by SLOF to build its internal device tree but the node names are not preserved exactly so when QEMU provides a device tree update in response to H_CAS, it might become tricky to match a node from the update blob to the actual node in SLOF. This removed leading zeroes from "memory@" nodes and makes the DTC checker happy. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson Reviewed-by: Greg Kurz --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d93dacd483..d072c2aa3d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -386,7 +386,7 @@ static int spapr_populate_memory_node(void *fdt, int no= deid, hwaddr start, mem_reg_property[0] =3D cpu_to_be64(start); mem_reg_property[1] =3D cpu_to_be64(size); =20 - sprintf(mem_name, "memory@" TARGET_FMT_lx, start); + sprintf(mem_name, "memory@%" HWADDR_PRIx, start); off =3D fdt_add_subnode(fdt, 0, mem_name); _FDT(off); _FDT((fdt_setprop_string(fdt, off, "device_type", "memory"))); --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568174846; cv=none; d=zoho.com; s=zohoarc; b=OPaXd5NaHg2VVzSKSN5ro/atnOrzJ1mF2xmenbIpOfMDh5gXBshtS+DEnqgbbP3kN0AIwHe7CsHsF3g5jJYsVnfhpqSoO791zvyJOWCIOHCup2aVg+ZzMkccS3NnLNT3CNPzOdGbiaAEM4TB3nufNXtfNyhz50dvzIW8XmUhIS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568174846; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=9o0zqpCpr5h6CDkqvFYft0qSy8M8VpTAq5H1RciHtWQ=; b=ldVm6wiXiXy71Iz0/HiGfbaMVO+o6RJQB0/Bxtoz+KhkX9r444fegqZLbFUAy930NhaA/HxtbzBsVjYdSBpOUCzZidnghHYS1dWZOx/3Z37qgoru60e5lHNnkhUuXxx2zS0YzhpL1gZgbk0aDoWuw9WhdNA2yrUCAvdHaSOiJ0g= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568174845169878.9075083266164; Tue, 10 Sep 2019 21:07:25 -0700 (PDT) Received: from localhost ([::1]:46372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tuW-0002Gv-2P for importer@patchew.org; Wed, 11 Sep 2019 00:07:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46465) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsS-0000TF-7b for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsO-0002o0-8q for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:06 -0400 Received: from ozlabs.org ([203.11.71.1]:53195) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsM-0002gV-A0; Wed, 11 Sep 2019 00:05:03 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh2WDHz9sPT; Wed, 11 Sep 2019 14:04:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=0D9EaTAy03qlicbnrizkJdRGliPDljqrRoq2NdZgOSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HUCwcgYb345QzUUTAshAU5Xuhv41OceiIErK/P51WTREZs5kKt3x9C0r7NvnEi7GD jgE4OMLX/iztcgsvdiml+NaHjeuIaufLVe4zl3QFHxvS77GeNAC9w5zhWRJhr0/YfT YAHngo5HHQjcjCfk+0m/PA3ifSj6cR+jpfGVqr3c= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:50 +1000 Message-Id: <20190911040452.8341-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PATCH 5/7] spapr: Do not put empty properties for -kernel/-initrd/-append 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy We are going to use spapr_build_fdt() for the boot time FDT and as an update for SLOF during handling of H_CAS. SLOF will apply all properties from the QEMU's FDT which is usually ok unless there are properties changed by grub or guest kernel. The properties are: bootargs, linux,initrd-start, linux,initrd-end, linux,stdout-path, linux,rtas-base, linux,rtas-entry. Resetting those during CAS will most likely cause grub failure. This only creates such properties if we are booting with "-kernel" and "-initrd" so they won't get included into the DT update blob and therefore the guest is more likely to boot successfully. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson --- hw/ppc/spapr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d072c2aa3d..d18744268f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1177,11 +1177,16 @@ static void spapr_dt_chosen(SpaprMachineState *spap= r, void *fdt) =20 _FDT(chosen =3D fdt_add_subnode(fdt, 0, "chosen")); =20 - _FDT(fdt_setprop_string(fdt, chosen, "bootargs", machine->kernel_cmdli= ne)); - _FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-start", - spapr->initrd_base)); - _FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-end", - spapr->initrd_base + spapr->initrd_size)); + if (machine->kernel_cmdline && machine->kernel_cmdline[0]) { + _FDT(fdt_setprop_string(fdt, chosen, "bootargs", + machine->kernel_cmdline)); + } + if (spapr->initrd_size) { + _FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-start", + spapr->initrd_base)); + _FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-end", + spapr->initrd_base + spapr->initrd_size)); + } =20 if (spapr->kernel_size) { uint64_t kprop[2] =3D { cpu_to_be64(KERNEL_LOAD_ADDR), --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568175105; cv=none; d=zoho.com; s=zohoarc; b=dMAwnUqTSFl2xAcye+yo7Xcm5opRCcU3Jlpc9rxL7Am/8J/68WeH16O/HwsSnuw4ccrXkle+6hfPxkmb2xgFZMjKlkTjtC3oxVRZJ/Cptrcb3+JeBZaeuh1Z9rtODuOWatumN6vkoNsH2DJYLvlraxyDlCye0ES+G8hvbdd9IOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568175105; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=ZbepvY1LC24dz2Rhy9qOBERfk1douZSasVj8H3sH9s8=; b=UFMjycchwtloVqJSJNRAx4e7QJXoyhgmDozvEoiHzC5pzoZmz0OfYDA+3DkP5PUCMs226Ba0NV1S/zXFFyVY6v676ZZStmztSnn0NJjDo3bF4PViDLmTqXh6g4PGYm6aybGdrNG1RJ/B/hd2opRriG7SvEdSF2+dZ0KJMBMKDds= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568175105000165.5532725060367; Tue, 10 Sep 2019 21:11:44 -0700 (PDT) Received: from localhost ([::1]:46408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7typ-00082I-KW for importer@patchew.org; Wed, 11 Sep 2019 00:11:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46577) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsX-0000VA-69 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsU-0002vc-Ne for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:13 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:33663 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsU-0002oT-1B; Wed, 11 Sep 2019 00:05:10 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh4T62z9sPF; Wed, 11 Sep 2019 14:04:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=0VYI6Tox1lhkmtJda24mpWtHzWQtHTGxbIrMC1fn09g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VFcikU5zAy+m0LGJ6PwtyURgcNm5ZoVia+G0O8L0aO7GmFjiy+HbJ6UyEeruZ1ZfG aDKfhC8HtlqOTvQ1yNMkzbYvn9jrkMM2XvY1S4TRqLRRbdC29VKQlP3r5OKJ3v5POQ u8FSeiXMoqYId0ariz+MR/RMT/rlfVb+wU0ilk2A= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:51 +1000 Message-Id: <20190911040452.8341-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH 6/7] spapr: Stop providing RTAS blob 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy SLOF implements one itself so let's remove it from QEMU. It is one less image and simpler setup as the RTAS blob never stays in its initial place anyway as the guest OS always decides where to put it. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson Reviewed-by: Greg Kurz --- MAINTAINERS | 2 -- Makefile | 2 +- configure | 6 +---- hw/ppc/spapr.c | 32 ++----------------------- hw/ppc/spapr_rtas.c | 41 -------------------------------- include/hw/ppc/spapr.h | 2 -- pc-bios/spapr-rtas.bin | Bin 20 -> 0 bytes pc-bios/spapr-rtas/Makefile | 27 --------------------- pc-bios/spapr-rtas/spapr-rtas.S | 37 ---------------------------- 9 files changed, 4 insertions(+), 145 deletions(-) delete mode 100644 pc-bios/spapr-rtas.bin delete mode 100644 pc-bios/spapr-rtas/Makefile delete mode 100644 pc-bios/spapr-rtas/spapr-rtas.S diff --git a/MAINTAINERS b/MAINTAINERS index 50eaf005f4..9823f40213 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1077,8 +1077,6 @@ F: hw/*/spapr* F: include/hw/*/spapr* F: hw/*/xics* F: include/hw/*/xics* -F: pc-bios/spapr-rtas/* -F: pc-bios/spapr-rtas.bin F: pc-bios/slof.bin F: docs/specs/ppc-spapr-hcalls.txt F: docs/specs/ppc-spapr-hotplug.txt diff --git a/Makefile b/Makefile index ae17a83067..4637f95371 100644 --- a/Makefile +++ b/Makefile @@ -764,7 +764,7 @@ qemu-nsis.bmp \ bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \ s390-ccw.img s390-netboot.img \ -spapr-rtas.bin slof.bin skiboot.lid \ +slof.bin skiboot.lid \ palcode-clipper \ u-boot.e500 u-boot-sam460-20100605.bin \ qemu_vga.ndrv \ diff --git a/configure b/configure index 95134c0180..b79d38592b 100755 --- a/configure +++ b/configure @@ -6211,9 +6211,6 @@ if { test "$cpu" =3D "i386" || test "$cpu" =3D "x86_6= 4"; } && \ fi done fi -if test "$ARCH" =3D "ppc64" && test "$targetos" !=3D "Darwin" ; then - roms=3D"$roms spapr-rtas" -fi =20 # Only build s390-ccw bios if we're on s390x and the compiler has -march= =3Dz900 if test "$cpu" =3D "s390x" ; then @@ -7930,14 +7927,13 @@ fi DIRS=3D"tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/q= api-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS=3D"$DIRS tests/fp tests/qgraph" DIRS=3D"$DIRS docs docs/interop fsdev scsi" -DIRS=3D"$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" +DIRS=3D"$DIRS pc-bios/optionrom pc-bios/s390-ccw" DIRS=3D"$DIRS roms/seabios roms/vgabios" LINKS=3D"Makefile tests/tcg/Makefile" LINKS=3D"$LINKS tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" LINKS=3D"$LINKS tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makef= ile" LINKS=3D"$LINKS tests/fp/Makefile" LINKS=3D"$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" -LINKS=3D"$LINKS pc-bios/spapr-rtas/Makefile" LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" LINKS=3D"$LINKS roms/seabios/Makefile roms/vgabios/Makefile" LINKS=3D"$LINKS pc-bios/qemu-icon.bmp" diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d18744268f..5a919a6cc1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -94,7 +94,6 @@ * We load our kernel at 4M, leaving space for SLOF initial image */ #define FDT_MAX_SIZE 0x100000 -#define RTAS_MAX_SIZE 0x10000 #define RTAS_MAX_ADDR 0x80000000 /* RTAS must stay below that */ #define FW_MAX_SIZE 0x400000 #define FW_FILE_NAME "slof.bin" @@ -1721,8 +1720,7 @@ static void spapr_machine_reset(MachineState *machine) { SpaprMachineState *spapr =3D SPAPR_MACHINE(machine); PowerPCCPU *first_ppc_cpu; - uint32_t rtas_limit; - hwaddr rtas_addr, fdt_addr; + hwaddr fdt_addr; void *fdt; int rc; =20 @@ -1786,14 +1784,10 @@ static void spapr_machine_reset(MachineState *machi= ne) * or just below 2GB, whichever is lower, so that it can be * processed with 32-bit real mode code if necessary */ - rtas_limit =3D MIN(spapr->rma_size, RTAS_MAX_ADDR); - rtas_addr =3D rtas_limit - RTAS_MAX_SIZE; - fdt_addr =3D rtas_addr - FDT_MAX_SIZE; + fdt_addr =3D MIN(spapr->rma_size, RTAS_MAX_ADDR) - FDT_MAX_SIZE; =20 fdt =3D spapr_build_fdt(spapr); =20 - spapr_load_rtas(spapr, fdt, rtas_addr); - rc =3D fdt_pack(fdt); =20 /* Should only fail if we've built a corrupted tree */ @@ -2953,28 +2947,6 @@ static void spapr_machine_init(MachineState *machine) spapr_create_lmb_dr_connectors(spapr); } =20 - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, "spapr-rtas.bin"); - if (!filename) { - error_report("Could not find LPAR rtas '%s'", "spapr-rtas.bin"); - exit(1); - } - spapr->rtas_size =3D get_image_size(filename); - if (spapr->rtas_size < 0) { - error_report("Could not get size of LPAR rtas '%s'", filename); - exit(1); - } - spapr->rtas_blob =3D g_malloc(spapr->rtas_size); - if (load_image_size(filename, spapr->rtas_blob, spapr->rtas_size) < 0)= { - error_report("Could not load LPAR rtas '%s'", filename); - exit(1); - } - if (spapr->rtas_size > RTAS_MAX_SIZE) { - error_report("RTAS too big ! 0x%zx bytes (max is 0x%x)", - (size_t)spapr->rtas_size, RTAS_MAX_SIZE); - exit(1); - } - g_free(filename); - /* Set up RTAS event infrastructure */ spapr_events_init(spapr); =20 diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index bee3835214..8d8d8cdfcb 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -477,47 +477,6 @@ void spapr_dt_rtas_tokens(void *fdt, int rtas) } } =20 -void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr) -{ - int rtas_node; - int ret; - - /* Copy RTAS blob into guest RAM */ - cpu_physical_memory_write(addr, spapr->rtas_blob, spapr->rtas_size); - - ret =3D fdt_add_mem_rsv(fdt, addr, spapr->rtas_size); - if (ret < 0) { - error_report("Couldn't add RTAS reserve entry: %s", - fdt_strerror(ret)); - exit(1); - } - - /* Update the device tree with the blob's location */ - rtas_node =3D fdt_path_offset(fdt, "/rtas"); - assert(rtas_node >=3D 0); - - ret =3D fdt_setprop_cell(fdt, rtas_node, "linux,rtas-base", addr); - if (ret < 0) { - error_report("Couldn't add linux,rtas-base property: %s", - fdt_strerror(ret)); - exit(1); - } - - ret =3D fdt_setprop_cell(fdt, rtas_node, "linux,rtas-entry", addr); - if (ret < 0) { - error_report("Couldn't add linux,rtas-entry property: %s", - fdt_strerror(ret)); - exit(1); - } - - ret =3D fdt_setprop_cell(fdt, rtas_node, "rtas-size", spapr->rtas_size= ); - if (ret < 0) { - error_report("Couldn't add rtas-size property: %s", - fdt_strerror(ret)); - exit(1); - } -} - static void core_rtas_register_types(void) { spapr_rtas_register(RTAS_DISPLAY_CHARACTER, "display-character", diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index dfec8e8e76..cbd1a4c9f3 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -154,8 +154,6 @@ struct SpaprMachineState { =20 hwaddr rma_size; int vrma_adjust; - ssize_t rtas_size; - void *rtas_blob; uint32_t fdt_size; uint32_t fdt_initial_size; void *fdt_blob; diff --git a/pc-bios/spapr-rtas.bin b/pc-bios/spapr-rtas.bin deleted file mode 100644 index fc24c8ed8b..0000000000 Binary files a/pc-bios/spapr-rtas.bin and /dev/null differ diff --git a/pc-bios/spapr-rtas/Makefile b/pc-bios/spapr-rtas/Makefile deleted file mode 100644 index 4b9bb12306..0000000000 --- a/pc-bios/spapr-rtas/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -all: build-all -# Dummy command so that make thinks it has done something - @true - -include ../../config-host.mak -include $(SRC_PATH)/rules.mak - -$(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas) - -.PHONY : all clean build-all - -#CFLAGS +=3D -I$(SRC_PATH) -#QEMU_CFLAGS =3D $(CFLAGS) - -build-all: spapr-rtas.bin - -%.o: %.S - $(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@") - -%.img: %.o - $(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_= DIR)$@") - -%.bin: %.img - $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TA= RGET_DIR)$@") - -clean: - rm -f *.o *.d *.img *.bin *~ diff --git a/pc-bios/spapr-rtas/spapr-rtas.S b/pc-bios/spapr-rtas/spapr-rta= s.S deleted file mode 100644 index 903bec2150..0000000000 --- a/pc-bios/spapr-rtas/spapr-rtas.S +++ /dev/null @@ -1,37 +0,0 @@ -/* - * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emul= ator - * - * Trivial in-partition RTAS implementation, based on a hypercall - * - * Copyright (c) 2010,2011 David Gibson, IBM Corporation. - * - * 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. - * - */ - -#define KVMPPC_HCALL_BASE 0xf000 -#define KVMPPC_H_RTAS (KVMPPC_HCALL_BASE + 0x0) - -.globl _start -_start: - mr 4,3 - lis 3,KVMPPC_H_RTAS@h - ori 3,3,KVMPPC_H_RTAS@l - sc 1 - blr --=20 2.21.0 From nobody Thu Mar 28 10:57:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568175038; cv=none; d=zoho.com; s=zohoarc; b=HUyexQd0F5zuEdlkDgDaIgmN4uhtRRF01erJXeFmPEdxj8wUy7lbPmMNz12B0cgj+bPnYMqK0ezx/nfpodofo+6O7pFKjZNX+9UuY7hSnU9Pd9yDL9SxEWM6DKUYYQoMGSi+kOI+Gi0Z6fkQNBejYzdXApWTn4kONvmrV74zdlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568175038; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=BrVVL1ZrUrWMoYT0Tg58p5Xj10W2FCGIZjKiH8DrvCI=; b=NBFDEef0r663H0Yg00+wQBeIJgzFaSQ3PzJbO1D9ZQ5UMnq2Otql20tYFjyATWEy7KN1jTCIfr4eW7s0JpJ0+av6PV74bREg9S3/ajltJa5GOqQBa+u7mZGiKeBcYNtmwy6lQ1IVlyatRIclCBgL81hLeSba201oy1kXKQdOaBY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568175038129784.2138579922018; Tue, 10 Sep 2019 21:10:38 -0700 (PDT) Received: from localhost ([::1]:46402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7txk-00060C-Hw for importer@patchew.org; Wed, 11 Sep 2019 00:10:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46487) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7tsU-0000TR-1n for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7tsP-0002pJ-JH for qemu-devel@nongnu.org; Wed, 11 Sep 2019 00:05:08 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:55205 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7tsM-0002gc-AJ; Wed, 11 Sep 2019 00:05:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46SpFh1r6jz9sNk; Wed, 11 Sep 2019 14:04:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1568174696; bh=raU0a+JnIcBoqXKDb0A97AqcM6JTh7CnyZizdQL7HOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hSPkDmkaJpS5sopLCZALIxirddQxijU+6iAXbPC424i7KX52BR7SKEGqbXWAzgxhB 7ydajdWwBYUsROz78QM1tAKFbnQjo8xnniNmu9fzL5XlJUAfNtfOF6Z+XCFh0AZiDl NUAxEYNIjI694Bb3gQhLZGyhNv8g86o2yjDb6KPU= From: David Gibson To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 11 Sep 2019 14:04:52 +1000 Message-Id: <20190911040452.8341-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911040452.8341-1-david@gibson.dropbear.id.au> References: <20190911040452.8341-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH 7/7] spapr: Perform machine reset in a more sensible order 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: , Cc: lvivier@redhat.com, aik@ozlabs.ru, groug@kaod.org, clg@kaod.org, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We've made several changes in the past to the machine reset order to fix specific problems. However, we've ended up with an order that doesn't make a lot of logical sense. This is an attempt to rectify this. First we reset global CAS options, since that should depend on nothing else. Then we reset the CPUs, which shouldn't depend on external devices. Then the irq subsystem, then the bulk of devices (which might rely on irqs). Finally we set up the entry state ready for boot, which could potentially rely on a bunch of other things. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5a919a6cc1..1560a11738 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1724,6 +1724,28 @@ static void spapr_machine_reset(MachineState *machin= e) void *fdt; int rc; =20 + /* + * If this reset wasn't generated by CAS, we should reset our + * negotiated options and start from scratch + */ + if (!spapr->cas_reboot) { + spapr_ovec_cleanup(spapr->ov5_cas); + spapr->ov5_cas =3D spapr_ovec_new(); + + ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); + } + + /* + * There is no CAS under qtest. Simulate one to please the code that + * depends on spapr->ov5_cas. This is especially needed to test device + * unplug, so we do that before resetting the DRCs. + */ + if (qtest_enabled()) { + spapr_ovec_cleanup(spapr->ov5_cas); + spapr->ov5_cas =3D spapr_ovec_clone(spapr->ov5); + } + + /* Reset the CPUs */ spapr_caps_apply(spapr); =20 first_ppc_cpu =3D POWERPC_CPU(first_cpu); @@ -1741,34 +1763,15 @@ static void spapr_machine_reset(MachineState *machi= ne) spapr_setup_hpt_and_vrma(spapr); } =20 - qemu_devices_reset(); - - /* - * If this reset wasn't generated by CAS, we should reset our - * negotiated options and start from scratch - */ - if (!spapr->cas_reboot) { - spapr_ovec_cleanup(spapr->ov5_cas); - spapr->ov5_cas =3D spapr_ovec_new(); - - ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); - } - + /* Reset IRQ subsystem */ /* * This is fixing some of the default configuration of the XIVE * devices. To be called after the reset of the machine devices. */ spapr_irq_reset(spapr, &error_fatal); =20 - /* - * There is no CAS under qtest. Simulate one to please the code that - * depends on spapr->ov5_cas. This is especially needed to test device - * unplug, so we do that before resetting the DRCs. - */ - if (qtest_enabled()) { - spapr_ovec_cleanup(spapr->ov5_cas); - spapr->ov5_cas =3D spapr_ovec_clone(spapr->ov5); - } + /* Reset other devices */ + qemu_devices_reset(); =20 /* DRC reset may cause a device to be unplugged. This will cause troub= les * if this device is used by another device (eg, a running vhost backe= nd --=20 2.21.0