From nobody Tue Feb 10 06:27:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1597842769; cv=none; d=zohomail.com; s=zohoarc; b=buEEU6AWZ3tMi+EMU4PHZsir9CvCi0XSXjaizTxpgVuI64p7dsdb5w/OULpN0X55MVja+SF5ScWBIjAsFhRrnJ66p1j0BZBDC24n1rxW2HfDNsDeJkS/kpClXhAXUc9QPQkAqaJcWHRQHeRq0RL+alS/8f1PfDGWHWBkfcVGQ94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597842769; h=Content-Type: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; bh=NimRfZlZpp56TOU3XtI2IX5wtAEb+2NrjMM8mXnqbx8=; b=EUDUHssdmO6+BjfWNm4A99bOHMSdhxLknpmXHD2uJprDLr51pCl1GqhWhar7W0AUpEw/rysiL+bwDd2EIU2iHgR0HxFXOeTqz6XKySS7Ea3cssefiuNS8p/PTz9VCuaeLsdYWAKdZx4eKsCIZaRyd0fY+56qJwO2e7CshXn12nw= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597842769219175.23398970264577; Wed, 19 Aug 2020 06:12:49 -0700 (PDT) Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8NtX-0002lY-8o for importer@patchew.org; Wed, 19 Aug 2020 09:12:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8Npp-0004yF-6c; Wed, 19 Aug 2020 09:08:57 -0400 Received: from smtpout1.mo804.mail-out.ovh.net ([79.137.123.220]:36813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8Npl-0006Lq-LV; Wed, 19 Aug 2020 09:08:56 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.138.109]) by mo804.mail-out.ovh.net (Postfix) with ESMTPS id 6958258A0B8A; Wed, 19 Aug 2020 15:08:51 +0200 (CEST) Received: from kaod.org (37.59.142.98) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 19 Aug 2020 15:08:50 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-98R00222ed0cb7-28ec-4adb-bcfa-41a54b3a8a55, 56ABA3BD09B5898CED80C8E013D4E39E9C6048D1) smtp.auth=clg@kaod.org From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 4/8] spapr/xive: Activate StoreEOI for POWER10 only Date: Wed, 19 Aug 2020 15:08:39 +0200 Message-ID: <20200819130843.2230799-5-clg@kaod.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200819130843.2230799-1-clg@kaod.org> References: <20200819130843.2230799-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [37.59.142.98] X-ClientProxiedBy: DAG2EX1.mxp5.local (172.16.2.11) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: a88e599d-486e-4347-8993-cb6e5e2a3057 X-Ovh-Tracer-Id: 2621939408889350950 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedruddtkedggeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfhisehtkeertdertdejnecuhfhrohhmpeevrogurhhitgcunfgvucfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepheehfeegjeeitdfffeetjeduveejueefuefgtdefueelueetveeliefhhffgtdelnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdelkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheptghlgheskhgrohgurdhorhhg 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=79.137.123.220; envelope-from=clg@kaod.org; helo=smtpout1.mo804.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/19 09:08:51 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Cc: qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , Gustavo Romero Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The StoreEOI features is safe to use with a P10 compat machine but not with P9 compat, as it can not be migrated to a P9 host. Introdude a "hw-storeeoi" property in the SpaprXive model to check for the availability of StoreEOI at the HW level when a kernel IRQ chip is in use. XIVE emulated is not impacted. Signed-off-by: C=C3=A9dric Le Goater --- include/hw/ppc/spapr_xive.h | 1 + hw/intc/spapr_xive.c | 3 ++- hw/ppc/spapr_irq.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 3f325723ea74..402e38a7cf5e 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -51,6 +51,7 @@ typedef struct SpaprXive { VMChangeStateEntry *change; =20 uint8_t hv_prio; + bool hw_storeeoi; } SpaprXive; =20 typedef struct SpaprXiveClass { diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 943b9958a68b..d184d17e30e7 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -596,6 +596,7 @@ static Property spapr_xive_properties[] =3D { DEFINE_PROP_UINT64("vc-base", SpaprXive, vc_base, SPAPR_XIVE_VC_BASE), DEFINE_PROP_UINT64("tm-base", SpaprXive, tm_base, SPAPR_XIVE_TM_BASE), DEFINE_PROP_UINT8("hv-prio", SpaprXive, hv_prio, 7), + DEFINE_PROP_BOOL("hw-storeeoi", SpaprXive, hw_storeeoi, false), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -945,7 +946,7 @@ static target_ulong h_int_get_source_info(PowerPCCPU *c= pu, /* * Override QEMU settings with KVM values */ - if (flags & XIVE_SRC_STORE_EOI) { + if (xive->hw_storeeoi && flags & XIVE_SRC_STORE_EOI) { args[0] |=3D SPAPR_XIVE_SRC_STORE_EOI; } else { args[0] &=3D ~SPAPR_XIVE_SRC_STORE_EOI; diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 72bb938375ef..80cf1c3d6bb2 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -199,6 +199,23 @@ static int spapr_irq_check(SpaprMachineState *spapr, E= rror **errp) return 0; } =20 +static bool spapr_irq_xive_hw_storeeoi(SpaprMachineState *spapr) +{ + MachineState *machine =3D MACHINE(spapr); + + /* + * All P10 compat kernels should enforce load-after-store ordering + * for StoreEOI. + */ + if (ppc_type_check_compat(machine->cpu_type, CPU_POWERPC_LOGICAL_3_10, + 0, spapr->max_compat_pvr)) { + return true; + } + + /* StoreEOI on P9 compat is unsafe */ + return false; +} + /* * sPAPR IRQ frontend routines for devices */ @@ -325,6 +342,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **e= rrp) =20 if (spapr->irq->xive) { uint32_t nr_servers =3D spapr_max_server_number(spapr); + bool storeeoi =3D spapr_irq_xive_hw_storeeoi(spapr); DeviceState *dev; int i; =20 @@ -337,6 +355,8 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **e= rrp) qdev_prop_set_uint32(dev, "nr-ends", nr_servers << 3); object_property_set_link(OBJECT(dev), "xive-fabric", OBJECT(spapr), &error_abort); + object_property_set_bool(OBJECT(dev), "hw-storeeoi", storeeoi, + &error_abort); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 spapr->xive =3D SPAPR_XIVE(dev); --=20 2.25.4