From nobody Tue Nov 26 16:30:02 2024 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; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1707142881; cv=none; d=zohomail.com; s=zohoarc; b=b9PZoAQ3XZh0uuP4/gc+SnHq0DS+vkhC0QAi7+pxo/af5Akoya/2tL1FQP3u9sA5+5ru4M7tl1pvpfAZzqpPwI4VFqHybJLeC5wQtECmxJNjRlhOU+qkCkXt/wKzpajzwaymVcAplLmKdtZrBIXn6aFhRRWQqGt7++/NQa9EyHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707142881; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=ZESr6VKyZPH65BG7WLl7RZvLbUPT+9s7mMeSdU5bmc0=; b=dtWBsXPspEYWqNls1Iwl1jQSNeiqbXlj86UT7VsD0VkM1QDIwWKb77K1SwHbQslb52frE5lQ9TWh4F4F2kRvIK0P8PvHaRBGEIxoSrTGSFJcg64k8oWmRAOCn2t9lDqSAZNThaix+ENjq4cjpwAJDBcCJSt27FHqmuhHdBmGDHE= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707142881902712.9918295285969; Mon, 5 Feb 2024 06:21:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWzqT-0005Uu-Ji; Mon, 05 Feb 2024 09:21:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWzqS-0005Tu-4O for qemu-devel@nongnu.org; Mon, 05 Feb 2024 09:21:12 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWzqQ-0000Pw-3n for qemu-devel@nongnu.org; Mon, 05 Feb 2024 09:21:11 -0500 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TT7kr0Ddtz6J66x; Mon, 5 Feb 2024 22:17:56 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 4FAC1140A87; Mon, 5 Feb 2024 22:21:08 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 14:21:07 +0000 To: , CC: Igor Mammedov , Ani Sinha , Shannon Zhao , Dongjiu Geng , , "Michael S . Tsirkin" , Ira Weiny , Peter Maydell , Fan Ni , Marcel Apfelbaum Subject: [RFC PATCH 03/11] arm/virt: Add fw-first-ras property. Date: Mon, 5 Feb 2024 14:19:32 +0000 Message-ID: <20240205141940.31111-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205141940.31111-1-Jonathan.Cameron@huawei.com> References: <20240205141940.31111-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500005.china.huawei.com (7.191.163.240) 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=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1707142882458100003 Content-Type: text/plain; charset="utf-8" Provide a machine parameter to request firmware first RAS handling and no hand over to the OS via _OSC. Includes a bug fix as register access is not in CDW5 but only in CXW4 (OS support field). Signed-off-by: Jonathan Cameron --- include/hw/arm/virt.h | 1 + hw/acpi/cxl.c | 3 --- hw/arm/virt-acpi-build.c | 1 + hw/arm/virt.c | 20 ++++++++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 0a14551f19..84323ccb32 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -153,6 +153,7 @@ struct VirtMachineState { bool tcg_its; bool virt; bool ras; + bool fw_first_ras; bool mte; bool dtb_randomness; OnOffAuto acpi; diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c index 526cfe961a..1d6dadbddd 100644 --- a/hw/acpi/cxl.c +++ b/hw/acpi/cxl.c @@ -316,9 +316,6 @@ static Aml *__build_cxl_osc_method(bool fw_first) aml_append(if_cxl, aml_store(aml_name("CDW4"), aml_name("SUPC"))); aml_append(if_cxl, aml_store(aml_name("CDW5"), aml_name("CTRC"))); =20 - /* CXL 2.0 Port/Device Register access */ - aml_append(if_cxl, - aml_or(aml_name("CDW5"), aml_int(0x1), aml_name("CDW5"))); aml_append(if_uuid, if_cxl); =20 aml_append(if_uuid, aml_return(aml_arg(3))); diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e5f6996111..cdc0bca729 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -208,6 +208,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapE= ntry *memmap, .ecam =3D memmap[ecam_id], .irq =3D irq, .bus =3D vms->bus, + .fw_first_ras =3D vms->fw_first_ras, }; =20 if (vms->highmem_mmio) { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 14d3b66657..c1c8a514d7 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2864,6 +2864,20 @@ static void virt_set_ras(Object *obj, bool value, Er= ror **errp) vms->ras =3D value; } =20 +static bool virt_get_fw_first_ras(Object *obj, Error **errp) +{ + VirtMachineState *vms =3D VIRT_MACHINE(obj); + + return vms->fw_first_ras; +} + +static void virt_set_fw_first_ras(Object *obj, bool value, Error **errp) +{ + VirtMachineState *vms =3D VIRT_MACHINE(obj); + + vms->fw_first_ras =3D value; +} + static bool virt_get_mte(Object *obj, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); @@ -3400,6 +3414,12 @@ static void virt_machine_class_init(ObjectClass *oc,= void *data) "Set on/off to enable/disable re= porting host memory errors " "to a KVM guest using ACPI and g= uest external abort exceptions"); =20 + object_class_property_add_bool(oc, "fw-first-ras", virt_get_fw_first_r= as, + virt_set_fw_first_ras); + object_class_property_set_description(oc, "fw-first-ras", + "Set on/off to control PCI/CXL _= OSC allow the guest to" + "obtain permission to do native = handling of AER and CXL errors"); + object_class_property_add_bool(oc, "mte", virt_get_mte, virt_set_mte); object_class_property_set_description(oc, "mte", "Set on/off to enable/disable em= ulating a " --=20 2.39.2