From nobody Mon Sep 16 19:10:31 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 ARC-Seal: i=1; a=rsa-sha256; t=1589252703; cv=none; d=zohomail.com; s=zohoarc; b=POZv7nuLapnDS/f1z8RWV2jJZNYBHQyKm4to+ru9XMTYGJ6Z2qh8kfzlM8IM6+bchVaIKpe2Bo2NQFDlWIXz9pSzK0qrbkbTYBo0NSkbujVcHSWG/rp9AmOb6vcejppmLaGri4pmMb839L1iKdpWTOCx3wJyF1cTx0PSSt8+HkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589252703; h=Content-Type: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=s+fvDRZ1CPRG/7H9NdYT/yaVKL6n50iFZFAJ/UH7uSY=; b=JlX5N3Kkl0/ww83QG2zzB8fjN0CpeazFleMoW+g8CqglYJRcHzldwPRppMhJ36EDxxt7uLFMDcexjb4EHfMwxxqniY5JDfqxsxHIc2R4CTz0wxPqCVUjnTu9uyh3xdlmciIAySXgfuSc12ipg/EzePBshDIeqmvU1swJE5yLMTE= 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 158925270368911.031657115803796; Mon, 11 May 2020 20:05:03 -0700 (PDT) Received: from localhost ([::1]:48344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYLE5-0002lb-Pb for importer@patchew.org; Mon, 11 May 2020 23:05:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLCP-0000ur-UZ; Mon, 11 May 2020 23:03:17 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40716 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLCO-00083m-Fw; Mon, 11 May 2020 23:03:17 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9119AE9D41E74A1CA8F9; Tue, 12 May 2020 11:03:11 +0800 (CST) Received: from huawei.com (10.151.151.243) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 12 May 2020 11:03:04 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , Subject: [PATCH v27 02/10] hw/arm/virt: Introduce a RAS machine option Date: Tue, 12 May 2020 11:06:01 +0800 Message-ID: <20200512030609.19593-3-gengdongjiu@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200512030609.19593-1-gengdongjiu@huawei.com> References: <20200512030609.19593-1-gengdongjiu@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.151.151.243] X-CFilter-Loop: Reflected 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=45.249.212.32; envelope-from=gengdongjiu@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 23:03:12 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: zhengxiang9@huawei.com, Jonathan.Cameron@huawei.com, linuxarm@huawei.com, gengdongjiu@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" RAS Virtualization feature is not supported now, so add a RAS machine option and disable it by default. Reviewed-by: Peter Maydell Signed-off-by: Dongjiu Geng Signed-off-by: Xiang Zheng Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- hw/arm/virt.c | 23 +++++++++++++++++++++++ include/hw/arm/virt.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 171e690..2d46c3f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1995,6 +1995,20 @@ static void virt_set_acpi(Object *obj, Visitor *v, c= onst char *name, visit_type_OnOffAuto(v, name, &vms->acpi, errp); } =20 +static bool virt_get_ras(Object *obj, Error **errp) +{ + VirtMachineState *vms =3D VIRT_MACHINE(obj); + + return vms->ras; +} + +static void virt_set_ras(Object *obj, bool value, Error **errp) +{ + VirtMachineState *vms =3D VIRT_MACHINE(obj); + + vms->ras =3D value; +} + static char *virt_get_gic_version(Object *obj, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); @@ -2327,6 +2341,15 @@ static void virt_instance_init(Object *obj) "Valid values are none and smmuv3", NULL); =20 + /* Default disallows RAS instantiation */ + vms->ras =3D false; + object_property_add_bool(obj, "ras", virt_get_ras, + virt_set_ras, NULL); + object_property_set_description(obj, "ras", + "Set on/off to enable/disable reportin= g host memory errors " + "to a KVM guest using ACPI and guest e= xternal abort exceptions", + NULL); + vms->irqmap =3D a15irqmap; =20 virt_flash_create(vms); diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 6d67ace..31878dd 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -132,6 +132,7 @@ typedef struct { bool highmem_ecam; bool its; bool virt; + bool ras; OnOffAuto acpi; VirtGICType gic_version; VirtIOMMUType iommu; --=20 1.8.3.1