From nobody Tue Feb 10 04:15:19 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=1597842949; cv=none; d=zohomail.com; s=zohoarc; b=UEwoC/Z4Nr6L2ZBy/K9k1HiP1oGBcW2MwGIQ9+oLagCMWCZmHN+v7fhQ7z3Bvd/K4+nEbJVISVf67bVi1L9dWNxkSVGExsixx2oK0wt8txcTIXYrwlBDrZn8Hc07431LaBXHDLP1WcIdBuqaov12mjOjQIeQxjsszrvKL4S0CZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597842949; 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=LcHkK8xIpmJc95upzUkXZY0ss1Hx31R0E9NDEC2+3L8=; b=LqTxEMq9ijNjsnONU2Uk0Vg4xFOGImFHBRpzwm3We4MO0aiqRBTnm9o9PRK+WgZuL5yykulUBm9wIpfI9C1w5U7ssRLFJty4Fy+kUo0Nzw/c2iEdENFujJKt7Gr+U5njgBDSMZFrL2EQ8mGJLykRMd3azzuvuMuGjgwbVpf62QY= 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 1597842949572922.2953319559925; Wed, 19 Aug 2020 06:15:49 -0700 (PDT) Received: from localhost ([::1]:58736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8NwS-0005rB-Bo for importer@patchew.org; Wed, 19 Aug 2020 09:15:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8Npr-00055I-Lv; Wed, 19 Aug 2020 09:08:59 -0400 Received: from smtpout1.mo529.mail-out.ovh.net ([178.32.125.2]:46331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8Npp-0006Mv-US; Wed, 19 Aug 2020 09:08:59 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.20.10]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 15D3F51EFD31; Wed, 19 Aug 2020 15:08:56 +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:54 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-98R00262a691de-efbb-447f-b2d2-3f782b00fa18, 56ABA3BD09B5898CED80C8E013D4E39E9C6048D1) smtp.auth=clg@kaod.org From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 8/8] spapr/xive: Introduce a XIVE StoreEOI IRQ backend Date: Wed, 19 Aug 2020 15:08:43 +0200 Message-ID: <20200819130843.2230799-9-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: 21d15091-42c4-4934-a479-09f3442ea952 X-Ovh-Tracer-Id: 2623346785664338727 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedruddtkedggeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfhisehtkeertdertdejnecuhfhrohhmpeevrogurhhitgcunfgvucfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepheehfeegjeeitdfffeetjeduveejueefuefgtdefueelueetveeliefhhffgtdelnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdelkeenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheptghlgheskhgrohgurdhorhhg 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=178.32.125.2; envelope-from=clg@kaod.org; helo=smtpout1.mo529.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/19 09:08:48 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" As it is still useful to run a P9 compat guest with StoreEOI enabled, introduce a new IRQ backend to allow that. May be we should add a migration blocker. Signed-off-by: C=C3=A9dric Le Goater --- include/hw/ppc/spapr_irq.h | 1 + hw/ppc/spapr.c | 6 +++++- hw/ppc/spapr_irq.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index ca8cb4421374..548895a89cca 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -90,6 +90,7 @@ typedef struct SpaprIrq { extern SpaprIrq spapr_irq_xics; extern SpaprIrq spapr_irq_xics_legacy; extern SpaprIrq spapr_irq_xive; +extern SpaprIrq spapr_irq_xive_storeeoi; extern SpaprIrq spapr_irq_dual; =20 void spapr_irq_init(SpaprMachineState *spapr, Error **errp); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a5bb0736e237..23f26d50f598 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3248,6 +3248,8 @@ static char *spapr_get_ic_mode(Object *obj, Error **e= rrp) return g_strdup("xics"); } else if (spapr->irq =3D=3D &spapr_irq_xive) { return g_strdup("xive"); + } else if (spapr->irq =3D=3D &spapr_irq_xive_storeeoi) { + return g_strdup("xive-storeeoi"); } else if (spapr->irq =3D=3D &spapr_irq_dual) { return g_strdup("dual"); } @@ -3268,6 +3270,8 @@ static void spapr_set_ic_mode(Object *obj, const char= *value, Error **errp) spapr->irq =3D &spapr_irq_xics; } else if (strcmp(value, "xive") =3D=3D 0) { spapr->irq =3D &spapr_irq_xive; + } else if (strcmp(value, "xive-storeeoi") =3D=3D 0) { + spapr->irq =3D &spapr_irq_xive_storeeoi; } else if (strcmp(value, "dual") =3D=3D 0) { spapr->irq =3D &spapr_irq_dual; } else { @@ -3350,7 +3354,7 @@ static void spapr_instance_init(Object *obj) object_property_add_str(obj, "ic-mode", spapr_get_ic_mode, spapr_set_ic_mode); object_property_set_description(obj, "ic-mode", - "Specifies the interrupt controller mode (xics, xive, dua= l)"); + "Specifies the interrupt controller mode (xics, xive, xiv= e-storeeoi, dual)"); =20 object_property_add_str(obj, "host-model", spapr_get_host_model, spapr_set_host_model); diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index d036c8fef519..c2e83fd0b34d 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -119,6 +119,15 @@ SpaprIrq spapr_irq_xive =3D { .xive =3D true, }; =20 +/* + * XIVE IRQ backend + StoreEOI activated + */ + +SpaprIrq spapr_irq_xive_storeeoi =3D { + .xics =3D false, + .xive =3D true, +}; + /* * Dual XIVE and XICS IRQ backend. * @@ -213,6 +222,11 @@ static bool spapr_irq_xive_hw_storeeoi(SpaprMachineSta= te *spapr) } =20 /* StoreEOI on P9 compat is unsafe */ + if (spapr->irq =3D=3D &spapr_irq_xive_storeeoi) { + warn_report("HW Store EOI on a POWER9 CPU is unsafe."); + return true; + } + return false; } =20 --=20 2.25.4