From patchwork Mon Jan 10 22:41:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFC76C433F5 for ; Mon, 10 Jan 2022 22:52:30 +0000 (UTC) Received: from localhost ([::1]:48838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73Wg-0007kF-0Q for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:52:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73Mz-0004DX-Ht for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:29 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:21190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73Mx-0001pE-E1 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:29 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJm25J026247; Mon, 10 Jan 2022 22:42:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=MQE9ffAldLj6CsUNMHpIZYzpFwQuooZ7bGIxeC8po3Z8hgAQh5oKvsbcwMc4jU9JKcL/ nFXFli3bfvzkpotedKjs4+uT2B5yL9cE5qp2eWNwU8U0jbnSOGTAfxlVD6ueBuo5Xgv4 0oNUJKDRxEcirmcSJSrZbpXFktnwN/8ADi6MGfg5EmxSYj2KtCeQW9PYvsta/WFOVkbl QjWPhgxRuZdZcqEzc4xNDuFkEDOYuxqK9HT6emGn8vD4yqPZThTTR4mU451+/Sk1WRs+ 4k2ondWUm7ccY2ssEem8MvWz3/QE2pFoFxBpG/8ciQUWNP8pkD4pUPU4FIc5sZ90F0uO WQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgp7nhcjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:22 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZaap009147; Mon, 10 Jan 2022 22:42:21 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by userp3020.oracle.com with ESMTP id 3df42kpj4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E1nIKlsoFUX2pFQwg8ey8KTRjqdCiaL1/cSpS8UZlw7gLpdRZsIW8DhUcvJ08gkgi1fM3do9MicgCIyRpYus/kedHItyxi/zrBDQq/THn+fND3MX9oI5u1y9hJaJkuJJRIkLZ/N0+MnFm+7MjGkBYRnW4BomVwIHlT0g9E8jFXpv1IDXSmn9PrnhNOb/ua2wMmjsZSpUzxlgGcoyqL4S02bFRTa7jCvfPere0zfBZ8P8hDNfuLRuUx4L+cOFo80U3mT42fAGA2FJqijwKlzbTZg6dJC66NSLupynGPBEvG+X0DrM1SeAXaMEpT91EBzLNsWbGkpmHPsFa/31sECvAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=fupyASw0AZni6J113xMPTLmwnMsxvIVyL6kgRlHLqqa3i3FoagmLavNTiYhh5CMUHuFslyv8qyFe2FheTe7JbafMNDmGZsVp07zOTWejBsWOhcqjbA2nxB2m1R/UEgGIusKamby6LxQ+bOZpmuRFOdmcAFHDrICmEGuiQ5Hbd3tyFuU6u6qGtmw4skPavndiJW+eOWiVljh6ufvIi9dHdD/46O4bDN8sVzKWqxJq34ikimkOfL/BxhvXhao+hfioHLIduay19DCi+EqQVWrpsWAvqtB1FpYDPR3s6I7jml+bbIud6ARd5GbUf/Tlgh8WQcpsd2Yqh9EK9pVX+pZPOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=JTBhJflKT7lkp9/fZ8XdwC+eKHmrqj0BV8JnEPHwjVd/ElfHCi5fRa2/5B6fLaWhc/5fvKtI9Y9an8ZSZMnzcvRRshAJ9Z2wXHDbuGU7hVZSLHlhI53qcsnpzoWNMXjfl31N/pyYR8W2ypg3k88eYCkrC24l4Vr4LTQVDzenGK4= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:19 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:19 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 1/9] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Mon, 10 Jan 2022 17:41:56 -0500 Message-Id: <1641854524-11009-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4dc6dfe8-52ed-49a4-00c9-08d9d48a7568 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NZRJIVcyliSZE1gUkOFR0cGRbj+jhbYo/czQ9Fx+/Sil6UNsm0H2gmxG21W9GTJmBEl7qQMu9Z8ZO8OroZN70e0Gc8Hj1/AtITbyJGVWfcI0ms1JC3hUdMxnNfkFY6vvP2WFrdWbNW6UGvVZW4JNNhaYc3QHB6TGjDS+Iu0/JFjIg0aBQslNuQs4OOi8BjwXWYbum/F3+dl8c7IimS6Rjyyr7jdbLmpbAtrWaERAGBeLRRrj4PlibMaJO4xUWyJl1YLTDE5GudHVSL0LsC0C/ItmskPNxQJ6uTQUxGtJWqbn0w1fSwUYho/Sm5r41FVh3hNG1ORdoGsN/IwuDlApNFNUX3x5C9ZqqAAVEuQ2rSbhGZG2FT4UsEtUj93On+ens7xgw/SVbV82UYZIrurfo+2kG3yewc752nPpcJGJFXc9W7jSWBRl7pdoJwoSR9JuBw70tqCxU3opVmjdkqtrh1LqHfbFDefT5Bcl3E3CAgt5EIsYNWIJP2GPm45N1u8roqReTujr552aAt2ZCk2FMIJR3pyh2/8oj3/fIf4xCfsBFZ1GeHHZz+ZgzFBIlM1xv4NrLrDckHoRgFtbUgmslwyoP1m+ziofQgsj/oDVX0JrXcThW+BedVM77O5RuLZbVaqQ53OkylNmyQ++ZQqx0pIJbHkZSy7s1oCGz+sPFAbbQ2uZqOqwkS2jyu+MVITnQCTcwGmqcTnBRDcoA5Gktg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(6512007)(508600001)(4326008)(2616005)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +2P06fgb+kFLi5qvGFnYBTNRgLZgj48aiVfk9m9qgm8zFVxVXoJrq/EgdeCkWmR2UvD3kFFG0ABxvAr65BOvrnd5mPFy3TD7g6CEhklN3osYvNBRUthq5FXvTulMmn2+y/lid+smRuQjdZO/srzQR5TXP1x/BeMoqG0grTYNBMhs8fxcft5qz+wPkUykCUoQJajBIOp0KbHBh7VGEiVxoDi33WQaxMYgm7v51czTcLgqaqYWFNilFL996KyZYsyHuAqtRR0lhdM9RUBjLw3ks06fUJpGBy+AK7fnEWSCpNSJT4qUSxGidpClxCdzKD/abSX8Bs+RKjZlKMcesj2aSFKbOQlfG55hNZ8bYQdR0/vr3jvDmCvHHitODJlfyAHbqB173bg+cBJoGR55IIBmnIz/XogywpfM2Gkc0udPIRWVi2LvqTS2f1c7OVI5hhD6K3y5htu3nY2TSjhjfAN/ETJC8HZuNKFagPho4jZYe+3bULKRzShmoF8i8gZZu/dTAy+xgZineoPx5qx0cZoy2kVOthXCJi+bQ6pJVD2z1UmKuRrQwS0mTPLtbNjBla21sYvUm0Dl/cYLARBIzrmZRZDhkmIYUJCGoLyNHg5sUgmvA4EBBvijPc1YAC+/vuuyUqLT+EJtIb15rcE1en++XjVzSab/h1/UKmXdT8yENZegl7+AWtvpOuUjRUtEsQ0JooFHfQqmb3Zf7KVdDqUG32pV1lVV19+kgfkSF4iHnLmEAKPp8iOQitLd1HoK6MGsYEwEE+6l+Tasxvu1frBSI5QVDAGQGai5PIUvX3ZxzwpbKFFx7HHulzBeE7Gj2jjRt7bJvC08j5gNbO/hsyGL4MO252uV0J9Wa+pRJRakunJ65cjpv3oZgGSuRIss/jpi4xj9yQv3D3elcbmi0qv0sgshD2OeMBJt9Y/zSGgG2CAN7KYgecVM0k4aExFxcnYOIyV49SCEYqIIdj58UM8ZC1qOyVNadO4wbUG9HJlbtlHiTgnbC7excLwdyfvTKbDDCbSMxF5U0ZVYtn+EUDzKTtckT84tYvIuWGLak59XqGW5uAX+DSxjhkMFsmQ1BNn+yv+SBYXLLeAttM9o7jJVLK0GqU98h6GlN0NhK+ypG9R7T+bJzkuJ9ks1g8XrtXyYi/hhQknQVvh5p7JhHROHvu2O8tM/EW8aqW2aG3U1jMl4jhphOMqT4tuv01zEoWVkqr7jpUXPJ97AFPB9QE1fcBMYIpGhCGn19+g3fDIjJ02ECtvYGqxNaheNwhU+cOlPEuUspFQj8dmf1JDidobCFOuHirGbIMCRNwGhQ8drYUkbp1lljYM/L0qVPlCfgeVjcK9YEX4n03ov40nE+Xz4U7Ltvt+VPMuXl6mK+/HJuHGVCzgq3NM10i+Qox86j5PIlpmgVyVWQKHhQ2HLbjUiIgDqtshPWtuRgt+zsC29jtSkd+RylC2W8QpQmdJeZqPY9oj+CYVmemmpa6+b8ev+KzYZoif1BFxbU95HXsBgSfuDhfCEBJSemWd3fJUIVP3yWZLbcxk4rBMPKLTHiqTN2FKb0KMpN47qaAGx/lmu2oIBjT4pv4RxcFnprnRSFzpJPvgLwoteUrXUrmDCvGLMLJL9Ea+aywcvfU/kaUL9r46vTU8gs6mCVhiNvOnedVbf8wq8qRmwbgHlA4ycPwzzEw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4dc6dfe8-52ed-49a4-00c9-08d9d48a7568 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:19.2148 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xBrbJSxqWCB+esTfg4fq16YNHJ78jTOBFqijLMl+vSxURa5bpcQbFVdlaN+zaNvdlA0LkuP91KTq5udH/Cbh7eJdVkT8BSRCz4jfxO6/mlk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: 5_4aYSY45A4Yhgu-LFzt5diVR6ec-NpB X-Proofpoint-ORIG-GUID: 5_4aYSY45A4Yhgu-LFzt5diVR6ec-NpB Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov --- tests/data/acpi/microvm/ERST.pcie | 0 tests/data/acpi/pc/DSDT.acpierst | 0 tests/data/acpi/pc/ERST.acpierst | 0 tests/data/acpi/q35/DSDT.acpierst | 0 tests/data/acpi/q35/ERST.acpierst | 0 tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 6 files changed, 5 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST.pcie create mode 100644 tests/data/acpi/pc/DSDT.acpierst create mode 100644 tests/data/acpi/pc/ERST.acpierst create mode 100644 tests/data/acpi/q35/DSDT.acpierst create mode 100644 tests/data/acpi/q35/ERST.acpierst diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/DSDT.acpierst b/tests/data/acpi/pc/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST.acpierst b/tests/data/acpi/pc/ERST.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/DSDT.acpierst b/tests/data/acpi/q35/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST.acpierst b/tests/data/acpi/q35/ERST.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523..603db07 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/ERST.acpierst", +"tests/data/acpi/q35/DSDT.acpierst", +"tests/data/acpi/q35/ERST.acpierst", +"tests/data/acpi/microvm/ERST.pcie", From patchwork Mon Jan 10 22:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F18FC433EF for ; Mon, 10 Jan 2022 22:44:02 +0000 (UTC) Received: from localhost ([::1]:36366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73OT-0006tJ-DI for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:44:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N4-0004Sa-VS for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:34 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:23966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73Mx-0001pL-QQ for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:34 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJm3Rv026277; Mon, 10 Jan 2022 22:42:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=MlWgGjUkGb1O8eD+fA0YPhEcG/wPilzl8AIn+7rHaHEBaMoEkIDTK9T62Oe249Pw+AIU CkVZa15dp0KwycmpwU2kDAhz/8VDg4XOLOskK+IMwfZn8maxSB1amoxe3Q0xTjwIyJLM stZVphAiXlIc1YnnYBzfHSTWCAb6pMMPA8bVLHVKYetGwARtgt5RPocl42Q5QtGsRKXW 1Zm5KHaszi5H+0ofmLHHDQg/inB0Ty7Rosx6cJTD8NfstUo618vC6Sjitqgn6jNKmuhP wTwvGgD+mpBS6eG2tHkv1oXDhlGNNxNX9QxJTaElWv3vu6ioDENuqn/XIzs9aSIK0+FC BQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgp7nhcjs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:24 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMaP0J117152; Mon, 10 Jan 2022 22:42:23 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by aserp3030.oracle.com with ESMTP id 3df0nd6pc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ge43zRwOrJ2YbXuncP8rhD0YNNCbSVjPwalyDW7ot0nLeOZ+km0t/7GFn6AnjES+0spcSwpj6CslbbPkhk7rmbittpwz9wCjetMNRPyexMUGFf4qv4kaT6xjmyJ8Lw7ZAdgtkYONo0rpfZl0SBSdXlK8HIWEY+2lW8h6G3uqENDTExuRdZKCddFPrHf9wna9EHr7kyfUFfRhRxRkutVFhPcxVn4zZWilkqR1gVYngkBRbAPrV/b6EGKyWVxpkJioDhHflswPEJ+vJ6kZqXHotZOVlvB0qE8YRYFeV3RQHN00XT/7NcNnoQziHYHAgqtz+DS8+fZXJB0NOTpe6zM09w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=ZTE16ZDqwScGjJ/UfLX04/wxzi4c5qmpAEaoPuICsQ1Awwg3v3O40KcG37zR7CNMMDnKd3ySJ3KGbqIiF95aie6A967PiJr8axfOQ4IpQ2I4zzg3ROnjz5FIHSZzP6u1lM20KMFejmqldgBhq1lH5N17aK6mdRUMJsPBFf3VmjgPEL0GoU+FtrdAxACYU+EZ6trCDGMcNzuoD3KnevGC00lOLnBrCY02RO5MAbA0sNBrzo5HEFlB8T6ENnqzldBQUgbuoRN34CbvXRBkoeeAwtfPJEzE3U95PN4u19aHom1h77FOFfhaLYT//k7fgIPoGb/njsTr1cuT/yrDSP6fJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=leiZhWiR9Ej7BdxN8ANcQH04A9JvJsJyzUyqs5tiaQMs1c2y6uJ7Khed/4Rxjl+alhixD/1rUWp7BDEDdWsmP6TiFyLPA4/9QlmOwKPozW7mIHeP5uED1E77chmrWrjP31J70538rjErg2SJfonfvX4UH8IZBPnCZTRFEX2eN5o= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:21 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:21 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 2/9] ACPI ERST: specification for ERST support Date: Mon, 10 Jan 2022 17:41:57 -0500 Message-Id: <1641854524-11009-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd0c1044-90c4-4f4a-42a6-08d9d48a7686 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SclW9Q5xyp8BoJrwsnRNU6WD5EyKPYIlqsCMfecsbaFlHGWtXzfnekYFnz57V3Yj2baUe9jAPLShPoCN2o8GNf0jgPgTMJSGHPaVS7h16WWe09tlnzjv9q8KkeNteEHRdUoN8vBhjSNHBsHkyAYxGsg2H9DiTU66RqGDh15/gYsO4HaSfYamNrgdriSWYAQ9cF6YlUIGFoP+9b86GxUpQmOxQNzpajAfhN/kqYz85+EQ/8Cz8b5AY7pdrjwV5h/Qsct3OejyqzsvqpKdqRynj5ThJHq/nwWsERvU6iBPsQVmivR3iWTb/HvJKx2QbvQd6iVqqsdWquDOdLJdPMMYDCmqEyDxm/q6jHsbWsH0WAD09NV2KHljVbzml/oU87r0JFecbYKECNOwKyRVCID9FdUL6pV4DvPb/T5+/NpC9aHGUIDcHaMwX4XOyd0UzixNQCNp7NQxpkRUZ8qlCK242wwmIyqj7ISgAw+klt3oYMVFLCQC0oMGoTmjdPBfcoeS/YkDj/gZXkE8qc0l64KOdFVNrj4ZYXQnuxJ/FZ9t7gNSTb9K4NfilBSEqosVuqtgHTDDRsm5ZKFezzVrSd/ailB0dr33T8VQkYiBTlm/ZmIDQdTgMH+JPjaOLbs9Arp4yg2F3hY2P2FMPjOIo1XQGqf079vkEptZB2pfBPAVyDGxUdRo+bheraPkWZ9aaXb4AZ1c7WoDb0uDvMYZywHdjg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(45080400002)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(6512007)(508600001)(4326008)(2616005)(83380400001)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Lfb5wE6c/lHMsWNuR3UBjRTNtD08RssNZ7oU5zcKdPs/JFid/WLWQAQI2Jp9woCgUnjOd4bAcLW5HfqJzhCnPuk/eflNTNN0/AxxAcdUcvC4eN9ehntLqfh1Cxtk8OrRymKAnA1fHNPe5x3YVTlw+NXBTMXNflfPW5nzi3wXjgY+DTvgzGqZVVwJ0o0mq2rYiOrfYRaKUcyeSIhMqKYNXuHcPILA/tNI9xz4nZVoQilrwQzq722Fosu8mf5BhtJLV+m7WFQtVtVhUXwuqWU7by+DX4jEw2IiSN+RYEyC6pyZHioDRgRkxW1R3i9D3Wk6RauJLU/SOZ7USfVpqpKbx00LKkZHuIQL1Y5etAxX1kykn5Lb3qidMqFsH+9af6S+By0Sub5bYWqOhN+izUe98hTAdrXr2isaZV7+taIYzUV+rH+24ECTmrreBzuBCrEsvVPM5I9OcV1vcj0xV35YzRjLWFJC1a3+GsE+Y0UQM9sg7uoHNkmuQ3M8Mq64nCgyGlxA6yrnEqMHXpABppSvNSTcGJQDcCpoSKsZhXIHj2krsIQJTjmNhAa4rxQuZE4cq3sDOYCU+Xu/9W5I+JRZrViPIk3QKsJXTMnAXhDXRLPE2NfxmA9hGGgx+q0/ul5ojl4JwmTlhQ8RbZ72Z+4uT6IdJz1Dz+Y2vtJ5MmROfjrZMGciMavXvtBi4C/OcsQv7aHVmMrv7oB4rjfpKFtbqEg9v93h3d8k/Tioyw4f+rMN+LJVQp4IFW0NIyxDsfuVO7os9QCAvwbhSr2z2s5fV74QajqFCAMcFqrqgnaHNEIa6+7y+g41FXY+Qs+s0QwsMNglI72cxBiSs5Bx3kyciFMZx4Mefn9RsrjJWmaSOnXow9A979MdM066BzULwXZAndeA/kV37JhukaVrFrQeIp5rr+P+QyUFfkxs0ob3xxkMxUgUAFu2J/6mKq7s0KYA+KSi2700L6YD+MayUJKLF7yISlxAkssBkTeZTwRSVNxG1GVRR867gI/stlsbtsZ5SnZ0OMtYxJFXRVoWK96kKCbp8RqPsFFh/Yek1AXn0ZbWtiKEFY598La5wTcnYh2ShtQtxwzePKTxssXiwWJMcSe9KS5eIob+KqOzoRUAdQrG8HpedNbeIQfQUKeerB/S73FonTQ8uqTCTzookpyt1NkCWNegqJo1shCJVUm2hkUVjOnCoZaeOWkxhQcvi96OaDasUaT41IvxBHmyBbJSy+QKZRSiZ0VEMnLoH9aEN3bsngq0U17lLjGag/bF9Qe6OC6yR7iI99Jcg5d344I71jXa7x8K+yWJEq62z9/EJLlEqZmnUBSknEwmUk4fRqURyCthQbR0sSKwxWlLkErzNO5Waloqo7WDfudXXf/AW9xTLptY3MEpc/T8mndfaBw/rIEwp0KLHlELyOOJ7YW46fOMpg3ejoTqfks6RgrgJGQ1A4crGBUDLDWo16Y0Mh0AzpoWjrM+SsbeBuCjC5shhEa7H9zXDsVWyOPr4Y7FHLv6ow8SmdvdlVWifxkSwMi1JotaxFwofHLW3T0EuuNKqdSv9r6AYap1j9bEkkR8689IJVtzJVoZk+sSg0DmVqVMcBw3EBx47K3OeD6cLh7q6GaKW37Ihi1a9NCUe2nE83il1uQmv7/l7oX4KIJ/Mitn/tj6qx9bsfsoXjqfsYdDvA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd0c1044-90c4-4f4a-42a6-08d9d48a7686 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:21.0752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /YBk9+BJk7Sxk9wvPCHqGgv1wVhucjacaBhnVmkIxe8qTkoKBaCZFkkiQoWjWrRMS1QrCaDfs0Bbl7rmBm7uRaU+rHLE/JTdeysVtRYnIp0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=501 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 suspectscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: l59AI-2sEl2nGG5A2yBHQbG2YNf1nnEr X-Proofpoint-ORIG-GUID: l59AI-2sEl2nGG5A2yBHQbG2YNf1nnEr Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=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: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Information on the implementation of the ACPI ERST support. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- docs/specs/acpi_erst.rst | 200 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 docs/specs/acpi_erst.rst diff --git a/docs/specs/acpi_erst.rst b/docs/specs/acpi_erst.rst new file mode 100644 index 0000000..a8a9d22 --- /dev/null +++ b/docs/specs/acpi_erst.rst @@ -0,0 +1,200 @@ +ACPI ERST DEVICE +================ + +The ACPI ERST device is utilized to support the ACPI Error Record +Serialization Table, ERST, functionality. This feature is designed for +storing error records in persistent storage for future reference +and/or debugging. + +The ACPI specification[1], in Chapter "ACPI Platform Error Interfaces +(APEI)", and specifically subsection "Error Serialization", outlines a +method for storing error records into persistent storage. + +The format of error records is described in the UEFI specification[2], +in Appendix N "Common Platform Error Record". + +While the ACPI specification allows for an NVRAM "mode" (see +GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES) where non-volatile RAM is +directly exposed for direct access by the OS/guest, this device +implements the non-NVRAM "mode". This non-NVRAM "mode" is what is +implemented by most BIOS (since flash memory requires programming +operations in order to update its contents). Furthermore, as of the +time of this writing, Linux only supports the non-NVRAM "mode". + + +Background/Motivation +--------------------- + +Linux uses the persistent storage filesystem, pstore, to record +information (eg. dmesg tail) upon panics and shutdowns. Pstore is +independent of, and runs before, kdump. In certain scenarios (ie. +hosts/guests with root filesystems on NFS/iSCSI where networking +software and/or hardware fails, and thus kdump fails), pstore may +contain information available for post-mortem debugging. + +Two common storage backends for the pstore filesystem are ACPI ERST +and UEFI. Most BIOS implement ACPI ERST. UEFI is not utilized in all +guests. With QEMU supporting ACPI ERST, it becomes a viable pstore +storage backend for virtual machines (as it is now for bare metal +machines). + +Enabling support for ACPI ERST facilitates a consistent method to +capture kernel panic information in a wide range of guests: from +resource-constrained microvms to very large guests, and in particular, +in direct-boot environments (which would lack UEFI run-time services). + +Note that Microsoft Windows also utilizes the ACPI ERST for certain +crash information, if available[3]. + + +Configuration|Usage +------------------- + +To use ACPI ERST, a memory-backend-file object and acpi-erst device +can be created, for example: + + qemu ... + -object memory-backend-file,id=erstnvram,mem-path=acpi-erst.backing,size=0x10000,share=on \ + -device acpi-erst,memdev=erstnvram + +For proper operation, the ACPI ERST device needs a memory-backend-file +object with the following parameters: + + - id: The id of the memory-backend-file object is used to associate + this memory with the acpi-erst device. + - size: The size of the ACPI ERST backing storage. This parameter is + required. + - mem-path: The location of the ACPI ERST backing storage file. This + parameter is also required. + - share: The share=on parameter is required so that updates to the + ERST backing store are written to the file. + +and ERST device: + + - memdev: Is the object id of the memory-backend-file. + - record_size: Specifies the size of the records (or slots) in the + backend storage. Must be a power of two value greater than or + equal to 4096 (PAGE_SIZE). + + +PCI Interface +------------- + +The ERST device is a PCI device with two BARs, one for accessing the +programming registers, and the other for accessing the record exchange +buffer. + +BAR0 contains the programming interface consisting of ACTION and VALUE +64-bit registers. All ERST actions/operations/side effects happen on +the write to the ACTION, by design. Any data needed by the action must +be placed into VALUE prior to writing ACTION. Reading the VALUE +simply returns the register contents, which can be updated by a +previous ACTION. + +BAR1 contains the 8KiB record exchange buffer, which is the +implemented maximum record size. + + +Backend Storage Format +---------------------- + +The backend storage is divided into fixed size "slots", 8KiB in +length, with each slot storing a single record. Not all slots need to +be occupied, and they need not be occupied in a contiguous fashion. +The ability to clear/erase specific records allows for the formation +of unoccupied slots. + +Slot 0 contains a backend storage header that identifies the contents +as ERST and also facilitates efficient access to the records. +Depending upon the size of the backend storage, additional slots will +be designated to be a part of the slot 0 header. For example, at 8KiB, +the slot 0 header can accomodate 1021 records. Thus a storage size +of 8MiB (8KiB * 1024) requires an additional slot for use by the +header. In this scenario, slot 0 and slot 1 form the backend storage +header, and records can be stored starting at slot 2. + +Below is an example layout of the backend storage format (for storage +size less than 8MiB). The size of the storage is a multiple of 8KiB, +and contains N number of slots to store records. The example below +shows two records (in CPER format) in the backend storage, while the +remaining slots are empty/available. + +:: + + Slot Record + <------------------ 8KiB --------------------> + +--------------------------------------------+ + 0 | storage header | + +--------------------------------------------+ + 1 | empty/available | + +--------------------------------------------+ + 2 | CPER | + +--------------------------------------------+ + 3 | CPER | + +--------------------------------------------+ + ... | | + +--------------------------------------------+ + N | empty/available | + +--------------------------------------------+ + +The storage header consists of some basic information and an array +of CPER record_id's to efficiently access records in the backend +storage. + +All fields in the header are stored in little endian format. + +:: + + +--------------------------------------------+ + | magic | 0x0000 + +--------------------------------------------+ + | record_offset | record_size | 0x0008 + +--------------------------------------------+ + | record_count | reserved | version | 0x0010 + +--------------------------------------------+ + | record_id[0] | 0x0018 + +--------------------------------------------+ + | record_id[1] | 0x0020 + +--------------------------------------------+ + | record_id[...] | + +--------------------------------------------+ + | record_id[N] | 0x1FF8 + +--------------------------------------------+ + +The 'magic' field contains the value 0x524F545354535245. + +The 'record_size' field contains the value 0x2000, 8KiB. + +The 'record_offset' field points to the first record_id in the array, +0x0018. + +The 'version' field contains 0x0100, the first version. + +The 'record_count' field contains the number of valid records in the +backend storage. + +The 'record_id' array fields are the 64-bit record identifiers of the +CPER record in the corresponding slot. Stated differently, the +location of a CPER record_id in the record_id[] array provides the +slot index for the corresponding record in the backend storage. + +Note that, for example, with a backend storage less than 8MiB, slot 0 +contains the header, so the record_id[0] will never contain a valid +CPER record_id. Instead slot 1 is the first available slot and thus +record_id_[1] may contain a CPER. + +A 'record_id' of all 0s or all 1s indicates an invalid record (ie. the +slot is available). + + +References +---------- + +[1] "Advanced Configuration and Power Interface Specification", + version 4.0, June 2009. + +[2] "Unified Extensible Firmware Interface Specification", + version 2.1, October 2008. + +[3] "Windows Hardware Error Architecture", specfically + "Error Record Persistence Mechanism". From patchwork Mon Jan 10 22:41:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E8F2C433EF for ; Mon, 10 Jan 2022 22:44:22 +0000 (UTC) Received: from localhost ([::1]:37214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73On-0007R2-BT for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:44:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N1-0004Is-Sn for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:31 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:33518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73Mx-0001pN-SF for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:31 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJlXpv026175; Mon, 10 Jan 2022 22:42:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=MB8O/Wx44fiOO4tajPhOoi+TPbIywhMH9vCc7AXmJFI=; b=fvxcrk8PI0T7JgqRW1GzPpLTDqaQbcY1eKh0FVvqO/K56bnXYREnFg79cmMHP7tSlCZ8 95seWrGUuri10DR1a1Ubhmf6camNU8CxWJelocZg64hb1Z/ZtUtHA/LSi6RQLKMHhCI0 CXSeNLKdIOobglsBWZIUN1I4XmjDMeCBl61/7NMbfZm4J6/QPXdvgW8OXz7e3U7fRyn3 4NpD/5V0aP6JBvx84JHGNh1/gPWTN3bzFz3gmgZl6vkXbzjOL8my6vIGlK1ZZVgbUvUJ GRTNxeD7xYjU3Zt+waK7EtPyMcYZ5or5lQL9c0T7bzP6bqUb1WlBAmOs4oR+r110zd+W bA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgjtg9uxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:26 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZaeM009140; Mon, 10 Jan 2022 22:42:25 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by userp3020.oracle.com with ESMTP id 3df42kpj6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UB1y5BtDuS1f3Oz0/MGO7DKfWOEDt+OAqd9Ts3JqwxnsIxKpF9j4MSlADymuawQka+p7pmQRgtC2hARuEV8lWu5wTj0+pWq5B4gVP+XzRdmxSDmvCHmuQUepcEC0Kzq+MsZLvgR0GmgJ7rzN0XT7wihuM2zNzw9PaFJ+BTiyBxVf3cYagxBktnF4hGGA6l88+77NO/i8PJnJ6yFGM5WyyQrNcRpOtO3oO/fP/GZSTaMPx3hKCQnTplH0UH1jRYjw/6VDDVuRjVnUM0XodCdti3h9DOb3kCoYToZ36VHpEEgBLLtaUJfbpEygUeZJCYG6jwHrfiehJPvP7x4pZJOCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MB8O/Wx44fiOO4tajPhOoi+TPbIywhMH9vCc7AXmJFI=; b=aQDkY0/U6DWSQlE/ZUgDPOgSwXGUTJzXkWi/9PlFZvRT6zNQWxzRF85+O4/Fdp4ztSbnj7xgoFZLuKzE0kfbvDuzQXBELomO+TWD0vi+SBUDkRrachhwotNAnwtM6ZB0zMeWxjjglYKdQrLdN78org+LQDdlzoWJp2rL3fPkY0YhUDCPlLPwTkoV1PaX/0NCBdEyrXPmh/anOR2GPbGiSMYth6a+N7DXBe69P24DJJ6hdYKePKYDmUEhYzuXEG6I55YYmJG3tTO9v3UBBuEMoun5AiXHgpBmmG9AmzDq5DsftxdPvCkxivKjAMQ4qgJ+P0HbG+mrlEM4oPByyWYeZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MB8O/Wx44fiOO4tajPhOoi+TPbIywhMH9vCc7AXmJFI=; b=UaS8A7CT5zVd2cRL1TefkFEjImVcSjg8GCTXnYk9OQxkCRV0J1GEWmuIiij0Nf8q+vUGMJ4spZfJ6iwxnQhMauM/ckPNAOh33dsiWXRqZdDYlR2cQ4Rcge36OANTyw523hfN6JSPh7Af4oSq2/PrQsZKMJeSoJS5CFvvlrdIdS0= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:23 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:23 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 3/9] ACPI ERST: PCI device_id for ERST Date: Mon, 10 Jan 2022 17:41:58 -0500 Message-Id: <1641854524-11009-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69fb1bb3-7614-43e6-7c33-08d9d48a77b7 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WuKvKB5x44S8sFekMbFIrQufyxW9Wr19cUmb3+ql5z+Ah5Ban0j+n2W+xCe0vGY27ziBsPKY9jS+Dh+0g3Tad/koz+B5g3Y1f1PnZS+sbZMOHRiVt4QILt7G2Cc7E1HpknTcfLcTeE/dwdNjn3ch/tDLFzAmViAj3B5d5Lr1VDfOQDFGf6U+z+x/NfJfdYkwqM6EeRpszcxVwL0j2N8YtlDfLt9MyzaJpXQnIMj/Z1XqYFuGxg1eXzZBsiUQ7hVfDrjPlg/tVowKYVdgH8NauR152Q3q05d9HJYhrravLbokRy727UgoKM6z39+CYlr87BTfMf7EOjhyG8UUbNbH0L1/+bwdJfrJqX6SEmAYMh8O/N2PHW5h4Eu7YPwpCaTYu8t6iaLYPS3TVmeRZJpPaKdcv/aqgyQ/sCYBb/r5M+gd2xpY0iGxROtjGL0QSvznLQySGtMERbKCX+NO7kHOAeqN1hNPdC0jVVGSTXmRrs2EAUHgEHgoUWTGaJSOdwzVOrzN5mkDBIUywWC+TKATomgK4CzP0DDpzspJ9TdBNr5GjNPjCHObGTkqkP+kdRdoBLluo3r6Goz6/rRfQWKzCrUH6uhFdgZe4jtyHHNUzeCAq/q3v6Gi8hMSZuWfub+yF1nZKQl1vsvoXXdT5V7Y7ZV09ZxAsNzy4Rl6gHLwabd6L7ZYVkl++ikqiSlxrCMC X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(6512007)(508600001)(4744005)(4326008)(2616005)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yJE653Y0VN9evPpzzYQNGJ75MjbhJ6B1euiwauhZjw53pFbEnDQ01T2SAKfB6LpxGvdEq7btMIIxjdEyp+1KmqkN9zF/YHSgeM0oYcotoW4RAqZ9MtgjPvZonxLbi8LjKp6vYuMC9XBIjeETMY455RQ5F2yz+uRxs8zpEOG3gLzrqjeiGCD0JiZTQ9Plhb/VnpZKApWWw12xx/L8m0Xl6hcpeebKZ5+8BE+5Kd3Bio+uS39RQ+WbWi03PKJTKmaZx+v3uGeNJ7tF+SsRq6tErK+lo1WKL25LLYpzfTdLs2wcppQWx5D6Il2CbNfQyiIi17FPbTLB0Bc33yQ9XtbbN9Em8CwSrctYL3Z+g7K0M05ycqnLyIheL9Jc9Mw8jr6Op1I2C3q+z344gjXbstLNPm5/VHaXhIA61pSRcrMSVhT6/gW2l7qT4xwcrt8GZXWqys9HPlxSitJXGFroNUOmP3oYmSOnGfbhs51cIFCdzvxNZ+Lxk/0O8Fq5kPxhkBTyacP83e7qrBSTX+Ct+2jpgGHcrgMevjRrL36UERrv6Coj6PAkFO3Cs1xeb2txnteLGgRlGUySA2jFpMtq4b4KhL5Wlpr8M1kipuUBLbYTvqx4rAEJhLh3cgoA1wfNHHvlw6QKeBhJZFvy7rt0WDiSyEanCP8idyzPkC18lhhEoiQPBS0tcz8MogC3469aW5lHtZ2LE/KV/kcVv8HqrYhbGVc989vOoNTHEOc8+UKeONxB0us0e/OiUsP/1nGDZMHfzZyyvtbKtHMJNXyEZ/poEsYzLvV9eb9FhdfYW0ufIXseRVxEXEq62zJwl6rdWi8oio695wTTLxDAizVVrPSTnjB8utdetEpKnMoObiebpWwiuTDOBVTx6ytLJIPhiPE9re618aspzvDesDjPE1FfBGWI0YKyz/Nyqv59+0LfRl37HikoWpSTHBfxNqPTsyOAKbP7hEQ/lQQSrlhQ+FG7z7QVFKDkhhLde0HOh/Q0u5qH+7JUk0nzxUDmyG+iYCBMdTDJeUrZ16ogowybI8y4b72hWVpBxmE+xbsbsy16GbjbijZevBBgIMh2p4mpk5INd+2MiOyct3P/exMsnXUu97T7yaxEQ2DvMvfRhRGQZHVqzuhf6OyGRQJSqtLGqgnAz9gDbMG4lFRb9kz3HVzBT10+ONsXm5OF8tqBt5fS5cDd8yfsy5vai6NO518N5H4VoMdLPn/hNkcLQyFESmDIFgmZ44ANVU9o9UmHlPg6xDfAVP6/xZXS+y5jV6FQQeYfgI290ot49J3LWhOSLChfpIiyXv2uix3d+gC5GDxotion+lDE8EMEf+wnKdawjc+2G7dVRzP2EiWz+F3a3Nynpdeh2CpDEl3IRp9aigXxo03ehRT8nzcMCtN58WcmowmXCqVVCQONnP/cZoEIyVEkalcmHR5/V5wtlkCgduR5WAxg7DjviT/U8zrmAT+7FfHJBxZWcuaPt9VwuE4KAwqgbXF/Ymheqt3hqpPKqJtmYF1RjfWMDXItHKB+YDGLd3qF31SCTsVSQxr5j8pD0bRKuca2814z7HTG5CXIKULrKhuS2ek7CJ79Ss8VoYX9p+1SQ1GW7lHsApvkyjR3UEjSN5/+Xpb4TkLPiWDoPMOJVBZe2GkfapJU1OG50z0ASNTfO2xRTIY3aZeldPidLTQ26w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69fb1bb3-7614-43e6-7c33-08d9d48a77b7 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:23.0911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t4Rlqse7ZT2zzG9xYS0N1Rn1gzxqC78TxAugnvOXgAHZdyxrMV9/4cAMAmhaJfH0IkcpIUGfWFJV4uFrchvuPBt4F5rxRBzO0AeCj9Fb/1Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=958 spamscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: ICVg57L4096oFWgCUN2gY7-ArnvcppQZ X-Proofpoint-ORIG-GUID: ICVg57L4096oFWgCUN2gY7-ArnvcppQZ Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change reserves the PCI device_id for the new ACPI ERST device. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov Acked-by: Ani Sinha --- include/hw/pci/pci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 483d5c7..19db80e 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -108,6 +108,7 @@ extern bool pci_available; #define PCI_DEVICE_ID_REDHAT_MDPY 0x000f #define PCI_DEVICE_ID_REDHAT_NVME 0x0010 #define PCI_DEVICE_ID_REDHAT_PVPANIC 0x0011 +#define PCI_DEVICE_ID_REDHAT_ACPI_ERST 0x0012 #define PCI_DEVICE_ID_REDHAT_QXL 0x0100 #define FMT_PCIBUS PRIx64 From patchwork Mon Jan 10 22:41:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DBF9C433FE for ; Mon, 10 Jan 2022 22:57:20 +0000 (UTC) Received: from localhost ([::1]:57212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73bK-0005xj-Tx for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:57:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N2-0004M6-T8 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:32 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:29078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N1-0001pp-7k for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:32 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJlfJB011393; Mon, 10 Jan 2022 22:42:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=qfXD+5341xsrw1QIBHH/6hl5OrETkYa5BbcpXBk0OWxOkBhwYDlPIDqtjYS5+L8S11Hd SJsZh/xWWUDCqo9kNsw1HyH1T/3KUqiCc2R63/5QtgFe62cdOelS/E7PmFgKzJhsOY4E OInPaJUFFsDOyzHiWCcugj3i2xxZfe6HUz/xIb6rfySft7OR+ODc5w9DMyHtmCmC7lVu 9qNMvEVL0F85eaZUmwrpSf+v+057tuCIS+bBZJQ6jO706i5Fiqr6obP6xrWaJBmn1d9p yYrDlruOza5DLX8qbB9vYe0ntoJNAesCEXd55uJYmcjpyFe7nSPt9JOhmzv8LOijCStZ Sg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgjdbsw4e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:27 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZubN086395; Mon, 10 Jan 2022 22:42:26 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by aserp3020.oracle.com with ESMTP id 3df2e3x2p1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGksPySfb2RatT+4j/YmiCRKff06uHy/jo3uUJ+YeBB5YtTsw0rHX1lSfc9cwV1fMIHJSg0MD2hDlO14IEMprPhbuRs58Ukfx6wCEm28eMmh6ccKuAGxO+rtd3WlbUVQ4F4fPRmi98xKn+LLIsPBH0nyTAeQKwBCA0508gXazZDUs4w0pmuygEsHEtl/NM2HLC0RSj0JEVUZiYetVdmhHdlpJNLBxjRQaqTbqDWsEs3NEKNt6NQ2+xoIn9vBiqPNePQUaPd/DV5qpojX+C7So0jQs2DsO8RWk8uk0AWX5QG9dNfShtqAsHfa7pQuWdFPXUC/7ipmF8npRWDmoGSang== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=YxuEwdoqsTTZrldENNNPyOne10a+GICrWCdTLDLmaVzhdT52tJh/ms1wjT5/8qVW0E2srwUfOh4bA2cwTMiXrwunVN91zdEJPTRhQrb6crauiGUtUN5dJfWXwtYGbrZrez4EpeUKdY6RFnZm8Gkln21aC8vaq9lQOdkNvCldDJb9QkYjLcxGcMLtsFgjRufJLdIKkFvmEh8Q7/tD5notxFQO44e7C87CGgakiEbMK7lVp5tv3Xea6kT4dZOXjggygwYKAWo613p/iV/RS7kFWHZqXZfPg9oj/+trkpDjwuvdBd2ONbrCBZzY2GfIdbD/ayBFE/mzkr1ay9Lu7uj7sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=cVAJNviO6gKfXW1MNnsOy2nf/02w6hGNbK3CGM2Pk27vCmqsPj9ieodb9U0HGaSdgN2sspk3Q2E7LmeG0kBArNhdrmSirX6w+3y11UHGQoEty4v3aSHScyX/GrlZ1aiGTBBGFEghrLpCTSf5lQFQV+SNRVjvB9XM18UCwE1WuJs= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:25 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:25 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 4/9] ACPI ERST: header file for ERST Date: Mon, 10 Jan 2022 17:41:59 -0500 Message-Id: <1641854524-11009-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e8f5e71b-4b14-4055-1a6d-08d9d48a78d8 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RunZrVFHdMTW72GK7g0Ab6e8sAw6Ss5UUEQMinCiajdfckbnPqtStRFGYBW3xtORFElHrA9bACUyAAyLZ3J6uElSY4TZZU4udAHnBgMlqIHKC5F01a2wPNMnKaVEosPMXPFw2s67uPcQ8sSUX0GvQCXuqLSKInhElcJaVJcakm0fskV0Nfq7L0l3f2ku9nI1xTW130Su7VV0j0EsceqEePe/9LjFaQ5hHuFoYx5UckZ3qY2BSRgod4zeKNOHoJrPRr8PnlVaXnPqVK9MCesWbvD45lnmXaXG9tYtyuP5zeTsKhT9dm4FJb0yB7fWh3QD6bxpjIICwFbikIqybb4Njw3DPbIfGWeCAknM38Fan78wQrifiqZ3/5njtWILZe++Yoi6wjAqcrx9gVDGXCQKggvYFR2VlVL3Lk+Q6nshFXnUNOZUus6Uw5KUZRQP0GK2ATzA11BxCNb4QDFMGghhkQLGaIafgBDzi0V8SiBSjayKJ0lRZdMd1f+7cUW+mrFuLSzMwJBn7zui7efjc3kFcUe+XZ8On2SeS+lTcMTepxQq2rLUYhcLiNBWyUhOcm4bfWziZWzdFt3CiiJloS5HyOITCBG3fBk1JbmPFki4lNDj3vcN5e3BHa3JoObcNTlnywtO3enijrsBZWhit9MwgTTJVz0pQQYL0RUgJikzesyl2xWqK7//KNeGx7qICfpBzHVpyhVI0gjKcoNhZGlCJA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(6512007)(508600001)(4744005)(4326008)(2616005)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PC5XCcc/laBRG1kIn2EHBujmbjeeKefgBRNw8lH7JfO7YPjQvg9nA1iYksS9R7oFclW18wKR3uiGDsjP/Yia8VeEDxEdxmkgfne9HrpE00tCUrsJFGmqn0KrLsfXZmiErQZAyLJocoXosC4R1pcRzji9jZ2i1jQwRw3JHy9kyCI36/LrE4JhV3EsQErs3bD9wbTgfNSH2F0RHDdOMz8xiEO1d8kJ5EeVShOvKixyP9Yxa6LOQWlYv40yqhtprlyIj5pyeH91N+Z8GECUU5AL4wfsmnJHEMQxYZfRNACMZKYqupVZW5tI62l+8ay/8C09EcFpL0pKHjh3CNHF0NKQxcqWBh2H31lqSoc84wvyW8tUMO64N4wtdNB4iTk339b1aBzJF0Hsta4lYIeeTnB0LpcQ22SSIF9OXYPoxO44GF0tDAfxtZHhg63PIo3awwnuyM0w25bP5OjVFYk8TDcsxs5YoZMdR4t9xViulnRxoyRFvv8T+kmRPBs7EytUsUSDINyXCNvCDo7ucHsym0DXDDWYQls/88ywuljfC9yQfEMrLlMMTcXarzMJThxgw519v/QKg4e3LhKnFzpVhdx9D9EzTMN0KJJu/2PjtrfQr9d6Q/HxWcOuCIaPpMKx9I13HlCPK4NucHPzN+cFkV1hyG8luj9pPeFXnIXIei8T64gQqPl8MaL6KlmXE42Pwmx7+sx9yIOSjsseWtSrnH2JHmT55Mj2fFRPF9Ijv2B7XncFVP0KsQ/pOP2+2PJbhppjeSO0QH3dDONqNsD1x12zjeGSHJOO4OlGPzxes+KCtuQWe/ghdhiB7IsN4febTnt3R4E87a53O8ebvyKyGEMEa9+jrciDbcc27uhHpNRhyDYlrp83FXf3nBLJE++4GkTS4UOW10ozI1hXbHfp0teqzSEKKv0xWjT9tyDqnYdxTXhSO93nXeLEg8DZMJnIjRmIMw0pCIRzuCNdDz8AuhW5NV150zayZf8nRhZG+azk9hFBNMGays8roUuQBsJSrT8x3IhLZiLDN5EnBYJCJGL/srB+qCu9jJ9jl1qYRLpDofPfqRkDR4JM/dtH+ePGqodhI/DcihN+/YugQVRTHYSkSM3QbFc2NQwrD6bsYIsH099Z9Wm24TLm8M4YAG0OHuKN8FpA0x/GH/QcTsJZ8Hp3LNHI6GvfFgFYIJca+3mMI2G0IYJBoULmNmtIRCr3gbOUDI3gJ8LEmGBzi4T+b7wPfYwHQTdXQE4B/pplWtAimy2a8EJ8/3Bv6Ls+TcegXT9HpWGPo6K7O461MC3eQFXU2qCGG3ttB6MoqibwUO2WcldHmnCqLtWTshnXoAQM/vKjYms7MHfpYe88pgYCpuc9HNc9xztCp8FIdQccNFw12vTcDSLbRCW+86Bp0eDi0vH+lliwnDmwsqEO78kftp3Aj4P0GPyb+2S7fslQiyL2n61zUHtKiHoIHvxPS5CemgQuSmS0AGhIDmG3IXjITo/3Qtxvl2sFMOaYxyOujvcJaOLAwcof/WpJSEP8EGGvmu3cC2YVCQBcQVJtAJuo7644KmZ2j3IilB+i/A7J1rxhzdUflGKu7oZR+s6KPdLdXy5OTIf5HLgsQG0c98vololAYrwkpDItJbcOui3PVDaIoNW9fihI01m2Ax7xcUaFJR+2btuZDX89qyIJnPUz/9QarQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8f5e71b-4b14-4055-1a6d-08d9d48a78d8 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:24.9826 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VFaFIutANyXrM/WKD2p6Jv25InmosoT/Fb62aYeY0Wcws01/xVLlqXD3z2e9ReZRG6WDf75AdTLGpvvFE/erC0WebUFsXORjYmfuQnAAIjY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: _Xe_cGSU1Hi6OOY6I0Y6UttgIc48gt4t X-Proofpoint-ORIG-GUID: _Xe_cGSU1Hi6OOY6I0Y6UttgIc48gt4t Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change introduces the public defintions for ACPI ERST. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- include/hw/acpi/erst.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/hw/acpi/erst.h diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h new file mode 100644 index 0000000..9d63717 --- /dev/null +++ b/include/hw/acpi/erst.h @@ -0,0 +1,19 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef HW_ACPI_ERST_H +#define HW_ACPI_ERST_H + +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id); + +#define TYPE_ACPI_ERST "acpi-erst" + +#endif From patchwork Mon Jan 10 22:42:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 886A2C433F5 for ; Mon, 10 Jan 2022 22:57:22 +0000 (UTC) Received: from localhost ([::1]:57372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73bN-000655-KY for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:57:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73NG-00050U-T9 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:46 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:34918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N5-0001qF-2k for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:46 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJmA5Q030654; Mon, 10 Jan 2022 22:42:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=JCILGRTWKyPtdifM+f8jaJmn2xy5FJWSsmvMkxGMbjMya2uB7eAe7v8kposj6R1gEnLv NNUbVFKYlbKTNiJ5JBEkMmg2UkOFVFVT7tjbeW8VRNVDAA91Pbq1gavcr+OGzc8v4G3N JEAv4bHXsplJYVdaaAgHqv6OuCHaxvTOmVkHY3mOb/+hgoXRGPuRqU+Gh6sWiQzT3JqM DgUlqS6OUJYjAXxEj5NE7t8uEVxyCRQBL+shYP+3hpJGOxlGdBznExOd4m7KmDHmv7BE yoAbxkLFA/nMx3l+6PqY/yr+jE4ieirhi4IgPyCYG9jJAhw5vWDUXLVHhRtHh2O4GhZS KA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgn749fsu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:31 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZvuP086461; Mon, 10 Jan 2022 22:42:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by aserp3020.oracle.com with ESMTP id 3df2e3x2py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CkJZFW+haMLG3HBBG0115ngjzN5YCwTqOOEAzb8KMQzZV7aWaq9vO1jrVe+DWexhs8D9o6JaLqteYl9sA/yCo7BrmPv8vSBjadxJdlVgO6soKNk/0mVrleCVr/cmvfsp9iusnhtLtgwQfZZcG1+DFCEaysGzOa9NTLh5QWYkhlBJnZtQh3YLUCFVcjTO6Iw3Z5KWaX733Ws1VELxBgN6qmZwDmC41ecNtgJIl8rE6ba52LCE51Z5ofj8Lqqyil9cahmlnBY6v5mxxneQihgzc6vdTaWEXbqvbks/iwVCPGJB5dwUFAiq4LlJYuexHc9EMP2hhGkXiyjO6sLKGmgwcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=AyXpoySNyOFy8KJ21GneBRqGdYRLcftPzxgGtOGJ5JjtWbSCWY96AZK0BCybnKJjYVDkbgg+Q+r6qM48Qv3N9YGJ7r2auxAP6VSOzKHVdfaF3P40ZtXRgQ55Z7m2srD8Gopz6KNRm88TetPO2t42IY1WsL44g0Hqehc6wca2YU6RnLemnevRdG8pDmzloJlCELAssk7K7D4K1dPfK+oEj1PiapNSkFreBWR/sfxGxqW0miCTlZglm0dGvU544kB05K3fIBKPL9uNeIxSdzhB1XQKCKXiz3EYMUuUtSv3x/x+UTu9Ys21gnzafifeggrK+DwO0fRajhdj2mjeYg1tQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=pPKYNOhLYmivVd7YKMusLBLg7drBonVTZWIkeDbUGZIraMLTPgE8yI6hM8yw+sJNoCnT4rY7PvNC+dtXhMRLOGqBtbZu0h3CTqbMM7tVtBbJOltaSIsRKh/1YPGtcD3nkPZo4HaFOJ+cHRquplzsHf2xapF2f9sdPy3mToxQygI= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:27 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:27 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 5/9] ACPI ERST: support for ACPI ERST feature Date: Mon, 10 Jan 2022 17:42:00 -0500 Message-Id: <1641854524-11009-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dad91bc8-e093-4f92-8f56-08d9d48a7a10 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yXqXSQsd7+xfRWPN4G7LKg1AIOOImrFIGegjoS7oCOiNmuSRDkbwnLD6XGUo9fzYvgbZmOKgXyQg2FC1y+o1Ja+E4FJ9ZEITPzRmj93tAXHeOmclaVasAICHKbdhS0fRBaqI9VFGhCJM+FnsddsuGE8MBR9ybjURU5zaMe1uwa05gggrvVIByN/8YcWYmYz1ZSiEfnj+3gGNMfSyHPVM8H0UJSP+unhci8GrTFv/jVsPL8UUNUi8UztVfW5AXqxGoBEuu7r+0MVPx1Tty0w9v6Ux6z5UfpHgbnvYU8Swr+lFWnt6UN6DrHPPX6wZUKvdSXNk2JhVCJoUjRKWsKoOaGT/I23AcSUJ7qBLdRXbUFDAKCtTCn+5thTi6jTwep7Y7NpeTNZiLbQqUK+YAG9GaUSTTQ1itM7TlLUqU0JL5EEAJ+zGC/eF+oq70W0TPeZwx5Y+tUs+9yspupKyAM30VSLlKmqVMuCqbEuiVYsV9tvLiXhZNsIAGgaw/ExVK1Q3jrmQWa7tmPm489/u6ixVGCnXkvxzp1SZctCtTi5g2RfYUt9gKI2SZT0d2CNXbBd23owGIAmwmhpKQNBUVcqUi2StCRbnGaNvSN+oeNkEaG7nQtSVQ4ZnrYE8AIFHPf08Qa0viaR2VH2+O8vfQJe3IcJsSrw82rcn2rchlZKAqDqkcvognfQUIY5oZfeOnUzf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(30864003)(6512007)(508600001)(4326008)(2616005)(83380400001)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qf+8Z+pMmIbgi4wn/R78BQG2YfSaY3zxzdj+IH9OW8IO6O+Q32A/dbI++k4bLDMpwwylLihC7It4Dy39k0+j0r8uROHDI+yZdftMr/zyf9GuFTM75H2foo/k0ebkTEw+qsaitmEbrhkt4CzozaGjXa/nTTI3C5b9KB7rrXQCZuwAQGjudo1Vh2uO40Grm8IRXyZCDZyMXPOg/1TQlyuOfomiTN/3pKaprW5vtMkQF9KavdcWJ1OPRhY+SJiumttx9VQdYbWWHCs83oo/Gyaq3kdVXNKNNbQZ1MsZKUMdN8MFhLjH/mw0fAzvgzc2d5/NYmF0zuzCGpGbiE3jtKpJQLBCItv/zD5DNBrcR8HfKd5A7o7XpmvxJDRIPbZfkRE1rUd4HqTTis0Z/5pVvBEcF1W7k/gFnebVhK63qnK1kcaMsSCnV8BGEZFNuIyJRWONP6dFNgNFvRvtFzn2ay05KI49G/tiH/VYUtuvkCIx3QhuPLOUG2h8L5jPRbRMa+jcReW63gyO63vXmwPRkRvt1LrZrhTtrZtk6iLkB7q6UDMNcPXiVoImt98zng7On/9cL1M4gC+mTXaJp6FO8rDAoUXiqOysoQa35/bpnICFP0vnV0FgOoWr0tTMy2fNfeeWEyj4e5ouIjLAIJcvPjWcCb7uSzSljI3OxV5GCB9rKk4giQn267uTL8IdTMBI3uHC9qIinsWzgmN/FDJB79UjFw+Orj/HyYBwJSYJ7jfmUosMY351qgsTAocAnt6GGya36jjElOyfCrdD/P5NKKiVP4Firbb6uZ9uyrCST0rjv0CDsMFfhLBBJ0Uak1SiJkzujUzZVy0QUKpuDlwEzxkhQV4BdTw3RfiQgHV0xs2Kq6ZmU+H1knRrB4gH9I8w9trQZ6o7c1LfLOfUn5oi+68FKWqldlQFSq+e9/NWs6Cv1GmI7EAKoa2pJOVRc33PuREnDzTQlKPHVMNw4KV9B302FE14S6WdMtmR9mmkEp01f66qCNuXLwkjOUWMC5GlqFrmplyD+f3yxSkbTeofSaNFFrxsJuEpyRdmoVabJc6Q46bFSMx0MIrmrudnJaKNRBPzDVgPlLVU6iDX5UhGXZ6l1srre8f1yUFdIY4YNpWab/ja9Uzv9b8uvxQhfZoiVmEpqC9KUs/oOnor+y+/v8OGfpIkaCaLO55MWhWGAjtLvYN608oqN2DZsEA3E34Vh/eah+KdcCZnBkxKkqPhzrGiRxL7w5Lvir3my+hlLO3Gdc/TfkTCtoQo8F1QD4EtJL16ReqmzjZrOD+vy2MOj6fFxyM542TYXxTblHWoB/lv7AOaxo71wkXZgtqgJ6iTB8VY+XUwo4bbriZBRDYSn7GbcIwh6b4BrRjabedzNcs3eCaOLfe6Lg39WIslTzbEtrTP7p/OLqP1+kb22sMkB0iM3B7KFl4CvbdzKI6ETTNjRN13gvcDICKYBRyhBSCXa+1098rZcpKSe0fMPt2eV8lOsa8xyurt5GE/Z7RV8XxqnT3W4J6/pHOPV59rn+KrUndwe6aEojSRRqBaGV/GCbbtemQRpyufZOMiU+N+C6IT+9UOp8XGff+kSQr9ys9BP2zx/5kzUYX0Nsf4b0/lMbVLBJUJgPlt02gy1Rvlmg7iOAEBExEmLu6kTYthWVbbNlOLRfLRmFy8NNWsp6+6pMyM2g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dad91bc8-e093-4f92-8f56-08d9d48a7a10 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:26.9835 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ts+6RjKeB48+zd/zDjLUug8ID3j39GzQCXIshIHOE75gB2F8obADwH5VV35npfUHbXgc1iFZ6YhgfhmQBNnen4stvYK3CU0jshESxDScMUI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-ORIG-GUID: MKtKa_PlUN8LxE5YnodbXtvp6BohjZz7 X-Proofpoint-GUID: MKtKa_PlUN8LxE5YnodbXtvp6BohjZz7 Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This implements a PCI device for ACPI ERST. This implements the non-NVRAM "mode" of operation for ERST as it is supported by Linux and Windows. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/acpi/Kconfig | 6 + hw/acpi/erst.c | 845 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 + 4 files changed, 867 insertions(+) create mode 100644 hw/acpi/erst.c diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 622b0b5..19caebd 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -10,6 +10,7 @@ config ACPI_X86 select ACPI_HMAT select ACPI_PIIX4 select ACPI_PCIHP + select ACPI_ERST config ACPI_X86_ICH bool @@ -60,3 +61,8 @@ config ACPI_HW_REDUCED select ACPI select ACPI_MEMORY_HOTPLUG select ACPI_NVDIMM + +config ACPI_ERST + bool + default y + depends on ACPI && PCI diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c new file mode 100644 index 0000000..bb6cad4 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,845 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/qdev-core.h" +#include "exec/memory.h" +#include "qom/object.h" +#include "hw/pci/pci.h" +#include "qom/object_interfaces.h" +#include "qemu/error-report.h" +#include "migration/vmstate.h" +#include "hw/qdev-properties.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/acpi-defs.h" +#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "exec/address-spaces.h" +#include "sysemu/hostmem.h" +#include "hw/acpi/erst.h" +#include "trace.h" + +/* ACPI 4.0: Table 17-16 Serialization Actions */ +#define ACTION_BEGIN_WRITE_OPERATION 0x0 +#define ACTION_BEGIN_READ_OPERATION 0x1 +#define ACTION_BEGIN_CLEAR_OPERATION 0x2 +#define ACTION_END_OPERATION 0x3 +#define ACTION_SET_RECORD_OFFSET 0x4 +#define ACTION_EXECUTE_OPERATION 0x5 +#define ACTION_CHECK_BUSY_STATUS 0x6 +#define ACTION_GET_COMMAND_STATUS 0x7 +#define ACTION_GET_RECORD_IDENTIFIER 0x8 +#define ACTION_SET_RECORD_IDENTIFIER 0x9 +#define ACTION_GET_RECORD_COUNT 0xA +#define ACTION_BEGIN_DUMMY_WRITE_OPERATION 0xB +#define ACTION_RESERVED 0xC +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0xD +#define ACTION_GET_ERROR_LOG_ADDRESS_LENGTH 0xE +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0xF +#define ACTION_GET_EXECUTE_OPERATION_TIMINGS 0x10 /* ACPI 6.3 */ + +/* ACPI 4.0: Table 17-17 Command Status Definitions */ +#define STATUS_SUCCESS 0x00 +#define STATUS_NOT_ENOUGH_SPACE 0x01 +#define STATUS_HARDWARE_NOT_AVAILABLE 0x02 +#define STATUS_FAILED 0x03 +#define STATUS_RECORD_STORE_EMPTY 0x04 +#define STATUS_RECORD_NOT_FOUND 0x05 + +/* UEFI 2.1: Appendix N Common Platform Error Record */ +#define UEFI_CPER_RECORD_MIN_SIZE 128U +#define UEFI_CPER_RECORD_LENGTH_OFFSET 20U +#define UEFI_CPER_RECORD_ID_OFFSET 96U +#define IS_UEFI_CPER_RECORD(ptr) \ + (((ptr)[0] == 'C') && \ + ((ptr)[1] == 'P') && \ + ((ptr)[2] == 'E') && \ + ((ptr)[3] == 'R')) + +/* + * NOTE that when accessing CPER fields within a record, memcpy() + * is utilized to avoid a possible misaligned access on the host. + */ + +/* + * This implementation is an ACTION (cmd) and VALUE (data) + * interface consisting of just two 64-bit registers. + */ +#define ERST_REG_SIZE (16UL) +#define ERST_ACTION_OFFSET (0UL) /* action (cmd) */ +#define ERST_VALUE_OFFSET (8UL) /* argument/value (data) */ + +/* + * ERST_RECORD_SIZE is the buffer size for exchanging ERST + * record contents. Thus, it defines the maximum record size. + * As this is mapped through a PCI BAR, it must be a power of + * two and larger than UEFI_CPER_RECORD_MIN_SIZE. + * The backing storage is divided into fixed size "slots", + * each ERST_RECORD_SIZE in length, and each "slot" + * storing a single record. No attempt at optimizing storage + * through compression, compaction, etc is attempted. + * NOTE that slot 0 is reserved for the backing storage header. + * Depending upon the size of the backing storage, additional + * slots will be part of the slot 0 header in order to account + * for a record_id for each available remaining slot. + */ +/* 8KiB records, not too small, not too big */ +#define ERST_RECORD_SIZE (8192UL) + +#define ACPI_ERST_MEMDEV_PROP "memdev" +#define ACPI_ERST_RECORD_SIZE_PROP "record_size" + +/* + * From the ACPI ERST spec sections: + * A record id of all 0s is used to indicate 'unspecified' record id. + * A record id of all 1s is used to indicate empty or end. + */ +#define ERST_UNSPECIFIED_RECORD_ID (0UL) +#define ERST_EMPTY_END_RECORD_ID (~0UL) + +#define ERST_IS_VALID_RECORD_ID(rid) \ + ((rid != ERST_UNSPECIFIED_RECORD_ID) && \ + (rid != ERST_EMPTY_END_RECORD_ID)) + +/* + * Implementation-specific definitions and types. + * Values are arbitrary and chosen for this implementation. + * See erst.rst documentation for details. + */ +#define ERST_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_STORE_MAGIC 0x524F545354535245UL /* ERSTSTOR */ +typedef struct { + uint64_t magic; + uint32_t record_size; + uint32_t storage_offset; /* offset to record storage beyond header */ + uint16_t version; + uint16_t reserved; + uint32_t record_count; + uint64_t map[]; /* contains record_ids, and position indicates index */ +} __attribute__((packed)) ERSTStorageHeader; + +/* + * Object cast macro + */ +#define ACPIERST(obj) \ + OBJECT_CHECK(ERSTDeviceState, (obj), TYPE_ACPI_ERST) + +/* + * Main ERST device state structure + */ +typedef struct { + PCIDevice parent_obj; + + /* Backend storage */ + HostMemoryBackend *hostmem; + MemoryRegion *hostmem_mr; + uint32_t storage_size; + uint32_t default_record_size; + + /* Programming registers */ + MemoryRegion iomem_mr; + + /* Exchange buffer */ + MemoryRegion exchange_mr; + + /* Interface state */ + uint8_t operation; + uint8_t busy_status; + uint8_t command_status; + uint32_t record_offset; + uint64_t reg_action; + uint64_t reg_value; + uint64_t record_identifier; + ERSTStorageHeader *header; + unsigned first_record_index; + unsigned last_record_index; + unsigned next_record_index; + +} ERSTDeviceState; + +/*******************************************************************/ +/*******************************************************************/ +static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) +{ + uint8_t *rc = NULL; + off_t offset = (index * le32_to_cpu(s->header->record_size)); + + g_assert(offset < s->storage_size); + + rc = memory_region_get_ram_ptr(s->hostmem_mr); + rc += offset; + + return rc; +} + +static void make_erst_storage_header(ERSTDeviceState *s) +{ + ERSTStorageHeader *header = s->header; + unsigned mapsz, headersz; + + header->magic = cpu_to_le64(ERST_STORE_MAGIC); + header->record_size = cpu_to_le32(s->default_record_size); + header->version = cpu_to_le16(0x0100); + header->reserved = cpu_to_le16(0x0000); + + /* Compute mapsize */ + mapsz = s->storage_size / s->default_record_size; + mapsz *= sizeof(uint64_t); + /* Compute header+map size */ + headersz = sizeof(ERSTStorageHeader) + mapsz; + /* Round up to nearest integer multiple of ERST_RECORD_SIZE */ + headersz = QEMU_ALIGN_UP(headersz, s->default_record_size); + header->storage_offset = cpu_to_le32(headersz); + + /* + * The HostMemoryBackend initializes contents to zero, + * so all record_ids stashed in the map are zero'd. + * As well the record_count is zero. Properly initialized. + */ +} + +static void check_erst_backend_storage(ERSTDeviceState *s, Error **errp) +{ + ERSTStorageHeader *header; + uint32_t record_size; + + header = memory_region_get_ram_ptr(s->hostmem_mr); + s->header = header; + + /* Ensure pointer to header is 64-bit aligned */ + g_assert(QEMU_PTR_IS_ALIGNED(header, sizeof(uint64_t))); + + /* + * Check if header is uninitialized; HostMemoryBackend inits to 0 + */ + if (le64_to_cpu(header->magic) == 0UL) { + make_erst_storage_header(s); + } + + /* Validity check record_size */ + record_size = le32_to_cpu(header->record_size); + if (!( + (record_size) && /* non zero */ + (record_size >= UEFI_CPER_RECORD_MIN_SIZE) && + (((record_size - 1) & record_size) == 0) && /* is power of 2 */ + (record_size >= 4096) /* PAGE_SIZE */ + )) { + error_setg(errp, "ERST record_size %u is invalid", record_size); + } + + /* Validity check header */ + if (!( + (le64_to_cpu(header->magic) == ERST_STORE_MAGIC) && + ((le32_to_cpu(header->storage_offset) % record_size) == 0) && + (le16_to_cpu(header->version) == 0x0100) && + (le16_to_cpu(header->reserved) == 0) + )) { + error_setg(errp, "ERST backend storage header is invalid"); + } + + /* Check storage_size against record_size */ + if (((s->storage_size % record_size) != 0) || + (record_size > s->storage_size)) { + error_setg(errp, "ACPI ERST requires storage size be multiple of " + "record size (%uKiB)", record_size); + } + + /* Compute offset of first and last record storage slot */ + s->first_record_index = le32_to_cpu(header->storage_offset) + / record_size; + s->last_record_index = (s->storage_size / record_size); +} + +static void update_map_entry(ERSTDeviceState *s, unsigned index, + uint64_t record_id) +{ + if (index < s->last_record_index) { + s->header->map[index] = cpu_to_le64(record_id); + } +} + +static unsigned find_next_empty_record_index(ERSTDeviceState *s) +{ + unsigned rc = 0; /* 0 not a valid index */ + unsigned index = s->first_record_index; + + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) == ERST_UNSPECIFIED_RECORD_ID) { + rc = index; + break; + } + } + + return rc; +} + +static unsigned lookup_erst_record(ERSTDeviceState *s, + uint64_t record_identifier) +{ + unsigned rc = 0; /* 0 not a valid index */ + + /* Find the record_identifier in the map */ + if (record_identifier != ERST_UNSPECIFIED_RECORD_ID) { + /* + * Count number of valid records encountered, and + * short-circuit the loop if identifier not found + */ + uint32_t record_count = le32_to_cpu(s->header->record_count); + unsigned count = 0; + unsigned index; + for (index = s->first_record_index; index < s->last_record_index && + count < record_count; ++index) { + if (le64_to_cpu(s->header->map[index]) == record_identifier) { + rc = index; + break; + } + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + ++count; + } + } + } + + return rc; +} + +/* + * ACPI 4.0: 17.4.1.1 Serialization Actions, also see + * ACPI 4.0: 17.4.2.2 Operations - Reading 6.c and 2.c + */ +static unsigned get_next_record_identifier(ERSTDeviceState *s, + uint64_t *record_identifier, bool first) +{ + unsigned found = 0; + unsigned index; + + /* For operations needing to return 'first' record identifier */ + if (first) { + /* Reset initial index to beginning */ + s->next_record_index = s->first_record_index; + } + index = s->next_record_index; + + *record_identifier = ERST_EMPTY_END_RECORD_ID; + + if (le32_to_cpu(s->header->record_count)) { + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + /* where to start next time */ + s->next_record_index = index + 1; + *record_identifier = le64_to_cpu(s->header->map[index]); + found = 1; + break; + } + } + } + if (!found) { + /* at end (ie scan complete), reset */ + s->next_record_index = s->first_record_index; + } + + return STATUS_SUCCESS; +} + +/* ACPI 4.0: 17.4.2.3 Operations - Clearing */ +static unsigned clear_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned index; + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(s->record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + /* No need to wipe record, just invalidate its map entry */ + uint32_t record_count; + update_map_entry(s, index, ERST_UNSPECIFIED_RECORD_ID); + record_count = le32_to_cpu(s->header->record_count); + record_count -= 1; + s->header->record_count = cpu_to_le32(record_count); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.2 Operations - Reading */ +static unsigned read_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned exchange_length; + unsigned index; + + /* Check if backend storage is empty */ + if (le32_to_cpu(s->header->record_count) == 0) { + return STATUS_RECORD_STORE_EMPTY; + } + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Check for record identifier of all 0s */ + if (s->record_identifier == ERST_UNSPECIFIED_RECORD_ID) { + /* Set to 'first' record in storage */ + get_next_record_identifier(s, &s->record_identifier, true); + /* record_identifier is now a valid id, or all 1s */ + } + + /* Check for record identifier of all 1s */ + if (s->record_identifier == ERST_EMPTY_END_RECORD_ID) { + return STATUS_FAILED; + } + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + uint8_t *nvram; + uint8_t *exchange; + uint32_t record_length; + + /* Obtain pointer to the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + /* Obtain pointer to slot in storage */ + nvram = get_nvram_ptr_by_index(s, index); + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, + &nvram[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + rc = STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + rc = STATUS_FAILED; + } + /* If all is ok, copy the record to the exchange buffer */ + if (rc != STATUS_FAILED) { + memcpy(exchange, nvram, record_length); + rc = STATUS_SUCCESS; + } + } else { + /* + * See "Reading : 'The steps performed by the platform ...' 2.c" + * Set to 'first' record in storage + */ + get_next_record_identifier(s, &s->record_identifier, true); + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.1 Operations - Writing */ +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_FAILED; + unsigned exchange_length; + unsigned index; + uint64_t record_identifier; + uint32_t record_length; + uint8_t *exchange; + uint8_t *nvram = NULL; + bool record_found = false; + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + /* Obtain pointer to record in the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, &exchange[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + return STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + return STATUS_FAILED; + } + + /* Extract record identifier */ + memcpy((uint8_t *)&record_identifier, &exchange[UEFI_CPER_RECORD_ID_OFFSET], + sizeof(uint64_t)); + record_identifier = le64_to_cpu(record_identifier); + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, record_identifier); + if (index) { + /* Record found, overwrite existing record */ + nvram = get_nvram_ptr_by_index(s, index); + record_found = true; + } else { + /* Record not found, not an overwrite, allocate for write */ + index = find_next_empty_record_index(s); + if (index) { + nvram = get_nvram_ptr_by_index(s, index); + } else { + /* All slots are occupied */ + rc = STATUS_NOT_ENOUGH_SPACE; + } + } + if (nvram) { + /* Write the record into the slot */ + memcpy(nvram, exchange, record_length); + memset(nvram + record_length, exchange_length - record_length, 0xFF); + /* If a new record, increment the record_count */ + if (!record_found) { + uint32_t record_count; + record_count = le32_to_cpu(s->header->record_count); + record_count += 1; /* writing new record */ + s->header->record_count = cpu_to_le32(record_count); + } + update_map_entry(s, index, record_identifier); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/*******************************************************************/ + +static uint64_t erst_rd_reg64(hwaddr addr, + uint64_t reg, unsigned size) +{ + uint64_t rdval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + rdval = reg; + rdval >>= shift; + rdval &= mask; + + return rdval; +} + +static uint64_t erst_wr_reg64(hwaddr addr, + uint64_t reg, uint64_t val, unsigned size) +{ + uint64_t wrval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + val &= mask; + val <<= shift; + mask <<= shift; + wrval = reg; + wrval &= ~mask; + wrval |= val; + + return wrval; +} + +static void erst_reg_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + + /* + * NOTE: All actions/operations/side effects happen on the WRITE, + * by this implementation's design. The READs simply return the + * reg_value contents. + */ + trace_acpi_erst_reg_write(addr, val, size); + + switch (addr) { + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + s->reg_value = erst_wr_reg64(addr, s->reg_value, val, size); + break; + case ERST_ACTION_OFFSET + 0: + /* + * NOTE: all valid values written to this register are of the + * ACTION_* variety. Thus there is no need to make this a 64-bit + * register, 32-bits is appropriate. As such ERST_ACTION_OFFSET+4 + * is not needed. + */ + switch (val) { + case ACTION_BEGIN_WRITE_OPERATION: + case ACTION_BEGIN_READ_OPERATION: + case ACTION_BEGIN_CLEAR_OPERATION: + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACTION_END_OPERATION: + s->operation = val; + break; + case ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + case ACTION_END_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + default: + g_assert_not_reached(); + break; + } + s->busy_status = 0; + } + break; + case ACTION_CHECK_BUSY_STATUS: + s->reg_value = s->busy_status; + break; + case ACTION_GET_COMMAND_STATUS: + s->reg_value = s->command_status; + break; + case ACTION_GET_RECORD_IDENTIFIER: + s->command_status = get_next_record_identifier(s, + &s->reg_value, false); + break; + case ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACTION_GET_RECORD_COUNT: + s->reg_value = le32_to_cpu(s->header->record_count); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + s->reg_value = (hwaddr)pci_get_bar_addr(PCI_DEVICE(s), 1); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + s->reg_value = le32_to_cpu(s->header->record_size); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0x0; /* intentional, not NVRAM mode */ + break; + case ACTION_GET_EXECUTE_OPERATION_TIMINGS: + s->reg_value = + (100ULL << 32) | /* 100us max time */ + (10ULL << 0) ; /* 10us min time */ + break; + default: + /* Unknown action/command, NOP */ + break; + } + break; + default: + /* This should not happen, but if it does, NOP */ + break; + } +} + +static uint64_t erst_reg_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + switch (addr) { + case ERST_ACTION_OFFSET + 0: + case ERST_ACTION_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + g_assert_not_reached(); + break; + } + trace_acpi_erst_reg_read(addr, val, size); + return val; +} + +static const MemoryRegionOps erst_reg_ops = { + .read = erst_reg_read, + .write = erst_reg_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + ERSTDeviceState *s = opaque; + + /* Recompute pointer to header */ + s->header = (ERSTStorageHeader *)get_nvram_ptr_by_index(s, 0); + trace_acpi_erst_post_load(s->header, le32_to_cpu(s->header->record_size)); + + return 0; +} + +static const VMStateDescription erst_vmstate = { + .name = "acpi-erst", + .version_id = 1, + .minimum_version_id = 1, + .post_load = erst_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT8(operation, ERSTDeviceState), + VMSTATE_UINT8(busy_status, ERSTDeviceState), + VMSTATE_UINT8(command_status, ERSTDeviceState), + VMSTATE_UINT32(record_offset, ERSTDeviceState), + VMSTATE_UINT64(reg_action, ERSTDeviceState), + VMSTATE_UINT64(reg_value, ERSTDeviceState), + VMSTATE_UINT64(record_identifier, ERSTDeviceState), + VMSTATE_UINT32(next_record_index, ERSTDeviceState), + VMSTATE_END_OF_LIST() + } +}; + +static void erst_realizefn(PCIDevice *pci_dev, Error **errp) +{ + ERSTDeviceState *s = ACPIERST(pci_dev); + + trace_acpi_erst_realizefn_in(); + + if (!s->hostmem) { + error_setg(errp, "'" ACPI_ERST_MEMDEV_PROP "' property is not set"); + return; + } else if (host_memory_backend_is_mapped(s->hostmem)) { + error_setg(errp, "can't use already busy memdev: %s", + object_get_canonical_path_component(OBJECT(s->hostmem))); + return; + } + + s->hostmem_mr = host_memory_backend_get_memory(s->hostmem); + + /* HostMemoryBackend size will be multiple of PAGE_SIZE */ + s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp); + + /* Initialize backend storage and record_count */ + check_erst_backend_storage(s, errp); + + /* BAR 0: Programming registers */ + memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s, + TYPE_ACPI_ERST, ERST_REG_SIZE); + pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem_mr); + + /* BAR 1: Exchange buffer memory */ + memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev), + "erst.exchange", + le32_to_cpu(s->header->record_size), errp); + pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, + &s->exchange_mr); + + /* Include the backend storage in the migration stream */ + vmstate_register_ram_global(s->hostmem_mr); + + trace_acpi_erst_realizefn_out(s->storage_size); +} + +static void erst_reset(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + trace_acpi_erst_reset_in(le32_to_cpu(s->header->record_count)); + s->operation = 0; + s->busy_status = 0; + s->command_status = STATUS_SUCCESS; + s->record_identifier = ERST_UNSPECIFIED_RECORD_ID; + s->record_offset = 0; + s->next_record_index = s->first_record_index; + /* NOTE: first/last_record_index are computed only once */ + trace_acpi_erst_reset_out(le32_to_cpu(s->header->record_count)); +} + +static Property erst_properties[] = { + DEFINE_PROP_LINK(ACPI_ERST_MEMDEV_PROP, ERSTDeviceState, hostmem, + TYPE_MEMORY_BACKEND, HostMemoryBackend *), + DEFINE_PROP_UINT32(ACPI_ERST_RECORD_SIZE_PROP, ERSTDeviceState, + default_record_size, ERST_RECORD_SIZE), + DEFINE_PROP_END_OF_LIST(), +}; + +static void erst_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + trace_acpi_erst_class_init_in(); + k->realize = erst_realizefn; + k->vendor_id = PCI_VENDOR_ID_REDHAT; + k->device_id = PCI_DEVICE_ID_REDHAT_ACPI_ERST; + k->revision = 0x00; + k->class_id = PCI_CLASS_OTHERS; + dc->reset = erst_reset; + dc->vmsd = &erst_vmstate; + dc->user_creatable = true; + dc->hotpluggable = false; + device_class_set_props(dc, erst_properties); + dc->desc = "ACPI Error Record Serialization Table (ERST) device"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + trace_acpi_erst_class_init_out(); +} + +static const TypeInfo erst_type_info = { + .name = TYPE_ACPI_ERST, + .parent = TYPE_PCI_DEVICE, + .class_init = erst_class_init, + .instance_size = sizeof(ERSTDeviceState), + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + } +}; + +static void erst_register_types(void) +{ + type_register_static(&erst_type_info); +} + +type_init(erst_register_types) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index adf6347..f5b2298 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -22,6 +22,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 974d770..2250126 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -55,3 +55,18 @@ piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64 # tco.c tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)" tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d" + +# erst.c +acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%04" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_reg_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%04" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%06" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%06" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_pci_bar_0(uint64_t addr) "BAR0: 0x%016" PRIx64 +acpi_erst_pci_bar_1(uint64_t addr) "BAR1: 0x%016" PRIx64 +acpi_erst_realizefn_in(void) +acpi_erst_realizefn_out(unsigned size) "total nvram size %u bytes" +acpi_erst_reset_in(unsigned record_count) "record_count %u" +acpi_erst_reset_out(unsigned record_count) "record_count %u" +acpi_erst_post_load(void *header, unsigned slot_size) "header: 0x%p slot_size %u" +acpi_erst_class_init_in(void) +acpi_erst_class_init_out(void) From patchwork Mon Jan 10 22:42:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8FC9C433F5 for ; Mon, 10 Jan 2022 22:59:04 +0000 (UTC) Received: from localhost ([::1]:34718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73d1-0001Nb-Pu for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:59:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N5-0004Ta-8J for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:35 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:41554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N3-0001q3-8E for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:34 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJleuC021735; Mon, 10 Jan 2022 22:42:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=+UvygCXxynxPtjm7Eqi+LZ0nxFRuj1R47uAXJVNTt2w=; b=Z/JtXYXgTmt8Lmi6k/LpPNKJH1ehnoxoB7pv+IUFqKlUck3sO5BA9b3WZ8hEXJwVjN/u +OaI0on6U2ZRCrRfl4r6mcbztsMdgyFzHvuK0vqba0XAYbU4s1J0JuGyLI8Rl2Li2YJZ v77iDpOclwkdESA1DE3+7yI3Wb2QjjyC7S+NY9vVFM/0W9ezaEcoLVdVHAMVq3++PBw2 Sl1IKCae1olJs3yBMdcZ7x8dcqx7BZAp+1oH7BxFg21EKu+XZ0JjqacxHkZ2sB+BdTCm ZhpObJE3bco9VXCAEgE57tCUJDkw/2PBiXUNq8cf6n0sJcfvnzqnpzSDWjHHY/y7v6AY 3g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgmk99kkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:31 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZvuQ086461; Mon, 10 Jan 2022 22:42:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by aserp3020.oracle.com with ESMTP id 3df2e3x2py-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XueKFT+fJqlqxKXxNavra8TFLuYUpOnttkWgzRHtssUZyb72bUe33/Jy/M7BAsCO9XOzu9yz5Mvcf7eat26rCOuyR0fVKrlqJ9XnA47TnS1azFbolf9xIVxXQLDSYQ+0msYHdtXEKcqb4nDucKO07je18q63y5cFfjaSUymTkWq/0I9aqeZF/+4fHP72KACzgCRc5pyBMUvc2cH96NSSsEak4I7yyQSAdwRnmHy1sDM9FBFCHyKLmGfo41PXS2iSDOwgUAIZWR91KNvLk4/C2h34llOZRsGq95nZnGG3GEUuvJ74+T9FPi2/qiBOq+2lWOl0h+Nh0ZiF4rVfoVXi0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+UvygCXxynxPtjm7Eqi+LZ0nxFRuj1R47uAXJVNTt2w=; b=KKAQ4IM487495qmc4Al8yLC1y1ZH8yRZmuGVDc9C6eEJ7L2Nk97921xjzQKfGTePktdiywi9hIHjV0zXyTgObSjospUCfSgwMrrf2siLeQNHOWVMIOVRJHIePpStAKUqgSgHW/FAoSEJDGZcq2GrGP3P8H26l+a5jZS7LvupJ46bxbP/rrh/RlsBgMkCFkWsYGmSBJ/N7op6nhOKX4UOYOdfA0vhqshonziuxKTvRMx9YDOBXqi5FHQnVUdyhmbXXFDIq42sbO6qipwZRfeySAvmdRu12MXcIgdznlqpDiL4v5vU5Eay7DJlqzwsjxfgKoQQb+wGS2J+fX5g2EtieQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+UvygCXxynxPtjm7Eqi+LZ0nxFRuj1R47uAXJVNTt2w=; b=bUhyYVtKRUKZ+WYLvotjlA+5oHhdy7rIVBdp+2gx6rUAquDq0GPUQ71OFIkhxIQxxR15ocZYiZFJlzwg6SdBlMzAPFwHM+Tcagv7P1Ithbe3XXyB3Kizx3VKlbUJCPz3NS4/ix4fuCnvHQWjP3VU32ldn9104n7nXEZLysN5wBk= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1598.namprd10.prod.outlook.com (2603:10b6:300:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:28 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:28 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 6/9] ACPI ERST: build the ACPI ERST table Date: Mon, 10 Jan 2022 17:42:01 -0500 Message-Id: <1641854524-11009-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 208aa455-62d6-470d-1dd2-08d9d48a7b25 X-MS-TrafficTypeDiagnostic: MWHPR10MB1598:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fC2fbgzQ/H5jZ9Nd0dxjZm+EqMT1gvOifCElwfXo/up8KKB6jFF1Q8eqD2AQbiS7qrzB4Fyl7AESprwAVo9JtKFMU3OFBOnxd0k5QQe+Au0LCZsx+sirtu2S0DOaeUrjKT0yC1TaI+xH+PTzi1gxmsWhaKX/RF9N0JNuvOts1k6fY3X6WGkLZO5BtWuTLWthD7G4rn2rhm/fsi6uLSkGaFoj6n/AhRLAmelZ3OaJdy833HhGHZRWNm2nccK4X4LKoDWID/N3jJAbsRqkMfkgX4G1WnFHLjo+t3UkvrwfZgqVmEmHPV+qTsmrP0yqUP7X5Ew4Cvb8jN9R5kvBoagc21Sv6bf56Zeiw6rLmJdQ+fAV85hYI47VjAqsnNrYBC/0viKA+sT0SMXXNwvdko1Ry+OB6ynX4wJkGX822GxcYqK4foaJHWaqTN8bkG/gywsDEPKu+D8UR6no1b7BoCQorBuYqNixsjcm5Wz9DQPiT2sMCij7c59gt2CROIImXOLayWVmF4reXI4vOoooB6BZhMQfXt4Eei4eF2csJG/GCsuBXETSVQQ+ByHtaevIRACwak6Cq4tu4QzaZxO1oTp85MvTaRQFvqFAW+Bb8RR1nXyRtHMW673r4om6CiCfpKINOu3aLVSozScZEJ0+rh/Lc3QIqjLaOpkz1/DRu15UNeJKAXC/ruzSnzQMYnvz2h1gFiDvKyzq9fKacP3lurKv9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(66476007)(6916009)(6666004)(66556008)(6486002)(66946007)(52116002)(38100700002)(2906002)(6506007)(186003)(8936002)(316002)(6512007)(508600001)(4326008)(2616005)(83380400001)(36756003)(86362001)(107886003)(5660300002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0LQInoxbB8JuaDwzv/BC0zWdU1vktJk7+0UV2azAdWuJpq6ROZ72r4P23J55f1hVEjDjU4ZSFWWR6uGzRHuvwSfZ4pY0EFw2CJir7Xo82IBOvgItrGyFOWGHcmKrYLLIh/BzGpEnz6sUhv1jN94S/XRNoJJdfMy1X4p8VryyT2I5FDEsQ2B+zdLiETrfoBhlHNHgifDPY/wXPefWCrKNK+PnpACHHx4Mk0wxAxfByJ+onHh2/CjyvWKY6y4nLnyLlCGV5aex+n0/5kVVn1yYeLZbvbLgKYCxepkCKd/kVaIXVrfynvH1EUIfmLLI1d3Vmue+33QOJteeGsiz84Ht63c1Okp8v0AiL8zZYyx4SdLgNO1tzwhHBPqUay0BIB6mqOkIy7F+guBFCCWoj6dKfTm6z4xWExhjDjxurQ0pVMGtL73k3q1nYLsq8RRH7H033rofqKa1Vv3LIhLGfwy4ibIjRoHLlKZ98LJBbmBBDCUtRDjLfwAbATB/cMuen/aZdcPezjAYcTt8r7Um0TqFaS968YWZG//d15Z7ZIIWN2Tza4Nkz9ZE0riyZS1dUyROhdDDSfaSGQCQcpqlvOFhAK89NJ9H6Nb7G5lq7IHRTsCTdORrv7FHD7JnSyzF8Vh5JQ/G3DqSybnYImeEVf4Tx8z3fK2KYaoodr97Y/BA6jLT5XlxO5RQnDrO48iDqzhP5h2FDgeJ7hq4RUGWELqnJXSwAoLVhtmzBCEcV9h3GodSb5pQ295MBzo87OF9nGNKuLAlMb2uhW8cFkL//x/oPjvKP0+suIOuU4dvwZC2rQ1OZEqi7Kr9ZOZsr8vz4UFePV0yN2M4aOpuhPubQdCBRE9/TY8GNGeVLjfYsafrwOQbzkFSdyq/kMmuwIxS2QsdP9qyMHMFokgbyejLkeuu9qNHbss7eAhiYyUGYr7XDVN+1sCEj4Y0nIE2cyKlv0U2mkWK8iU2PZYyf1kGcXfmnTcboA7olgDPTtpPgbNlE2QchXSlq+roTu72ovPaTvQrE/78RuUJgxtE78ve7N4Nu4hoVleft2Yx6TleSVSQWAsk9gFURMgvVbssq3Mr/7y6pn1X8hcpAGUf9pD6lVimGgPmCG+T0/NHqsyx/41w6H1aNcTB8hO6rZGJhhfBl+7lrUgkY/mJ7t5o+irzz4JCeXNykIJ3kgJyHOe2Df3Z+sP/YWmOFZAJUhdt2c0lIYrOt1J33BmJrIG2W83/BtAi1p5Xa5Ki/MfpYJQhD6fo+Frh+wqzUNxaOAW15DPmm7x7lonzKeD2J37rKn/PFNIlmlwSTxFkliGoRxIc9mm+O8W/lkIWivmwY3RL//DAUZb9czrxqJHiTDF94UfAGwzRcGZk6zuyXRjG8rfNQmIO4P82liW/ICaM6ZZ6ccXxoCdvlce5Do9OjqUQ0Fz/W3BSF8IgKbBlLkvncUi6583a7caOuynKjE+TyAANnesXJArrdzrXcR7CpZgncv/8UrbROXcAuuTDha68hOlGXpuY8uy1iBwnvoPVDpgTWWdPga6n36n4+0lORp/5RogrOem1olBt4G5iztRVftHjOn9AInzBVGrAIfEBuQ8wqrG6wCC9mpaFznf1cmRFSFt+Ykk1/fJ0pqD9QsPHN5vBAgIS5h9rAQ6pIiyc4zjYJTViYft+POb9immEYp33jUSPqYzWfg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 208aa455-62d6-470d-1dd2-08d9d48a7b25 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:28.8440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hgjCJBG5O+U4JKEGXtRFHpkS+wC8B3bQanR+EWizVYJhGzTlK9nGdG/oF7OpxqakG4aipHkKnlriUF3TlriQ59djHrdF48o+vP4vLk7VkQo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1598 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=966 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: u2KAXAzgRmlg9E6GgEsR2_Yd3iowgYxv X-Proofpoint-ORIG-GUID: u2KAXAzgRmlg9E6GgEsR2_Yd3iowgYxv Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device. Signed-off-by: Eric DeVolder --- hw/acpi/erst.c | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index bb6cad4..00dbd8be 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -59,6 +59,27 @@ #define STATUS_RECORD_STORE_EMPTY 0x04 #define STATUS_RECORD_NOT_FOUND 0x05 +/* ACPI 4.0: Table 17-19 Serialization Instructions */ +#define INST_READ_REGISTER 0x00 +#define INST_READ_REGISTER_VALUE 0x01 +#define INST_WRITE_REGISTER 0x02 +#define INST_WRITE_REGISTER_VALUE 0x03 +#define INST_NOOP 0x04 +#define INST_LOAD_VAR1 0x05 +#define INST_LOAD_VAR2 0x06 +#define INST_STORE_VAR1 0x07 +#define INST_ADD 0x08 +#define INST_SUBTRACT 0x09 +#define INST_ADD_VALUE 0x0A +#define INST_SUBTRACT_VALUE 0x0B +#define INST_STALL 0x0C +#define INST_STALL_WHILE_TRUE 0x0D +#define INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E +#define INST_GOTO 0x0F +#define INST_SET_SRC_ADDRESS_BASE 0x10 +#define INST_SET_DST_ADDRESS_BASE 0x11 +#define INST_MOVE_DATA 0x12 + /* UEFI 2.1: Appendix N Common Platform Error Record */ #define UEFI_CPER_RECORD_MIN_SIZE 128U #define UEFI_CPER_RECORD_LENGTH_OFFSET 20U @@ -172,6 +193,173 @@ typedef struct { /*******************************************************************/ /*******************************************************************/ + +/* ACPI 4.0: 17.4.1.2 Serialization Instruction Entries */ +static void build_serialization_instruction_entry(GArray *table_data, + uint8_t serialization_action, + uint8_t instruction, + uint8_t flags, + uint8_t register_bit_width, + uint64_t register_address, + uint64_t value) +{ + /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */ + struct AcpiGenericAddress gas; + uint64_t mask; + + /* Serialization Action */ + build_append_int_noprefix(table_data, serialization_action, 1); + /* Instruction */ + build_append_int_noprefix(table_data, instruction , 1); + /* Flags */ + build_append_int_noprefix(table_data, flags , 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0 , 1); + /* Register Region */ + gas.space_id = AML_SYSTEM_MEMORY; + gas.bit_width = register_bit_width; + gas.bit_offset = 0; + gas.access_width = ctz32(register_bit_width) - 2; + gas.address = register_address; + build_append_gas_from_struct(table_data, &gas); + /* Value */ + build_append_int_noprefix(table_data, value , 8); + /* Mask */ + mask = (1ULL << (register_bit_width - 1) << 1) - 1; + build_append_int_noprefix(table_data, mask , 8); +} + +/* ACPI 4.0: 17.4.1 Serialization Action Table */ +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id) +{ + GArray *table_instruction_data; + unsigned action; + pcibus_t bar0 = pci_get_bar_addr(PCI_DEVICE(erst_dev), 0); + AcpiTable table = { .sig = "ERST", .rev = 1, .oem_id = oem_id, + .oem_table_id = oem_table_id }; + + trace_acpi_erst_pci_bar_0(bar0); + + /* + * Serialization Action Table + * The serialization action table must be generated first + * so that its size can be known in order to populate the + * Instruction Entry Count field. + */ + table_instruction_data = g_array_new(FALSE, FALSE, sizeof(char)); + + /* + * Macros for use with construction of the action instructions + */ +#define BUILD_READ_REGISTER(width_in_bits, reg) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_READ_REGISTER, 0, width_in_bits, \ + bar0 + reg, 0) + +#define BUILD_READ_REGISTER_VALUE(width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_READ_REGISTER_VALUE, 0, width_in_bits, \ + bar0 + reg, value) + +#define BUILD_WRITE_REGISTER(width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_WRITE_REGISTER, 0, width_in_bits, \ + bar0 + reg, value) + +#define BUILD_WRITE_REGISTER_VALUE(width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_WRITE_REGISTER_VALUE, 0, width_in_bits, \ + bar0 + reg, value) + + /* Serialization Instruction Entries */ + action = ACTION_BEGIN_WRITE_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_BEGIN_READ_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_BEGIN_CLEAR_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_END_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_SET_RECORD_OFFSET; + BUILD_WRITE_REGISTER(32, ERST_VALUE_OFFSET, 0); + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_EXECUTE_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_VALUE_OFFSET, + ERST_EXECUTE_OPERATION_MAGIC); + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_CHECK_BUSY_STATUS; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER_VALUE(32, ERST_VALUE_OFFSET, 0x01); + + action = ACTION_GET_COMMAND_STATUS; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(32, ERST_VALUE_OFFSET); + + action = ACTION_GET_RECORD_IDENTIFIER; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(64, ERST_VALUE_OFFSET); + + action = ACTION_SET_RECORD_IDENTIFIER; + BUILD_WRITE_REGISTER(64, ERST_VALUE_OFFSET, 0); + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_GET_RECORD_COUNT; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(32, ERST_VALUE_OFFSET); + + action = ACTION_BEGIN_DUMMY_WRITE_OPERATION; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(64, ERST_VALUE_OFFSET); + + action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(64, ERST_VALUE_OFFSET); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(32, ERST_VALUE_OFFSET); + + action = ACTION_GET_EXECUTE_OPERATION_TIMINGS; + BUILD_WRITE_REGISTER_VALUE(32, ERST_ACTION_OFFSET, action); + BUILD_READ_REGISTER(64, ERST_VALUE_OFFSET); + + /* Serialization Header */ + acpi_table_begin(&table, table_data); + + /* Serialization Header Size */ + build_append_int_noprefix(table_data, 48, 4); + + /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); + + /* + * Instruction Entry Count + * Each instruction entry is 32 bytes + */ + g_assert((table_instruction_data->len) % 32 == 0); + build_append_int_noprefix(table_data, + (table_instruction_data->len / 32), 4); + + /* Serialization Instruction Entries */ + g_array_append_vals(table_data, table_instruction_data->data, + table_instruction_data->len); + g_array_free(table_instruction_data, TRUE); + + acpi_table_end(linker, &table); +} + +/*******************************************************************/ +/*******************************************************************/ static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) { uint8_t *rc = NULL; From patchwork Mon Jan 10 22:42:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16EB8C433EF for ; Mon, 10 Jan 2022 22:50:34 +0000 (UTC) Received: from localhost ([::1]:47146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73UJ-0006FO-DT for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:50:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73NB-0004lw-To for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:41 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:40034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N9-0001r3-L1 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:41 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJm5TC026301; Mon, 10 Jan 2022 22:42:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=t4WojR4pPgZM7ReGPbmzFpfQeLKcgV8YM5y77IDNGc8=; b=ULb03pO9DLQhqh6kxiYpFy+1pC4DuyN1C+3BrhB14+s0PyYzyh0aJ7OOIdxy2yrz3HQA 29B06KAcRDhOJ0TLBiNkFSBeaVzvqQyJy313SsrCG9KbvEnNn0ruV1VbVgwOew4rfBfr yljgaQ0Ls6gCqVxU4DlOWBWrZzN8L3n+6rX3uVg6+L52pEw2w9iyFiCpqTJ8xh9/1wyO eYB49VyPA+TwYNSNyM57qeDamZM4gA3ple/u0mW73eHBIUmmn53hhKQ7VlJUGfGPVw5C +e72XWYnZcLVMOg8YBJNBoHpGrb5kHhI/IAxLClKcZv5vkdbYfU2XkJMwSBJ+szZbDGT qw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgp7nhck9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:35 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZZ4S009118; Mon, 10 Jan 2022 22:42:34 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by userp3020.oracle.com with ESMTP id 3df42kpj9a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLui457Jt2j2/OctzXh7XKU4OpDuW01eJDv4MM+j6vG9gr8jT+mJQ2sdalMaYppyc1UpIp7c2o0GyjtPXAjazM63GZU4OX5aq6Jn6VxDmNnQssUADQidg5PG/xy5S1MuYMUz8CuK1OJ+vC8uyLqsLAO6JacLrBdl70HQI8eXzZxb7wwZL7fXXD0Y54bPJtBFBwTceO0cZC95GbBFFDtFIlIwvd28TkeEtkk5lYZIZq8q71seeZLP65IZ757gp+/CAWggzadpU5H4wWYgDX0FabI/bdYHAo4tuwsgLPOV7I87pK/ZGdz0OSrh2qakxUeHHyG3tz3btXZ9H+wJP36aHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t4WojR4pPgZM7ReGPbmzFpfQeLKcgV8YM5y77IDNGc8=; b=Givym7iCFYWeRzj5Z9ZpGyx8ntSuKGBv0U6bqa47rEJMJQeA7CE+UitVU4oVSvE3S4dxG2U3Rtx/xH4Ag2LIJ8z02LqxawZMpWvphMr7lB0eK1bnJimS1M2Yg4yuHuDy8EVkKXpRhxwvizMKC2ELuW1Vd35oP5CYkQLKAhdEgl+LkbJsfgeqhKiA9wpZvSJ1A/5HtpTQoh2EMLkvTyqjoYgCgADgmoR0pSo6rn6HaWG9Zl8oLJZPIqa9vfKFkgzCT1VL5L+gDK+7zGZTI5I/Cqxo6nJZLqqKPKALfOgMrAkSNibJefd28sV432KVFXbdVii+WGHZ/DQPb/wrDXR/qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t4WojR4pPgZM7ReGPbmzFpfQeLKcgV8YM5y77IDNGc8=; b=CDG0OFEPVIhRwCWLzM3CWPm03l5SDAxCBui8Ksm6hDE4WxuqRu/2n/qkUqMg1W28AdHGGmHM4D4kVAikiGHfsjg+A9tzBXFuMFcEYGoMxoxX98YN8Ch49KFvrOdN51P+H7jeOnPBuIWtbItGtRzIWivcG1cdcxX+l+gI3DaLJqg= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1600.namprd10.prod.outlook.com (2603:10b6:300:27::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:30 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:30 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 7/9] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Mon, 10 Jan 2022 17:42:02 -0500 Message-Id: <1641854524-11009-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35b4c3a8-08c1-4a78-9eac-08d9d48a7c44 X-MS-TrafficTypeDiagnostic: MWHPR10MB1600:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MgCBePjpI/4nIcLqIhtBN9lKkhN9y9WmBjT4qRa5YYAX7jdz0hZMX/xhDLMWhqbHsFSPOLOy/QOR3U7Arnu005mJ6wRa5HcR2IvYutBBoWnF0W5SvpCwLjU/AMlB69+nyEQJ4kU3gw9/Ap7IahzYmCf7FuDY/gPFjlabtzLqv/t42lhGL0E1tSke17EYnbDYOltIt0qlAQn1BsNxrXjb4FZqWiSR15Z6qizsMVwE7C6tYVgghD5g/vaPykX/I+TgryRK9eupEvoZLobgjh89YmEnLUDlB5Udj3K60tKlBdPJ5EvLeQUe1L3h92seF4t0UTgdCHki4f+V63qGdqP0VsqXs90GaXxZpx79mYY+0NSE37opi1vM6BvhBvn7v0YyvtXBoQw4u8EV6UzS52GMKRQrTUlZGj+vIgFMbQiAs4QZhXCtLNqn062wW19KvyPkoOgFIN3bZXc3svR7xME02YHLas/vld0RRqwFuskSJU0ldR3m6ot8ISzIve+ezcx2grp1mf6Mqw4J+jrQSUu7u6blTZ/DtByClT3898rbA4wNU9++NplDUnrJEGpOxMuRjEPOw1xr9SrhG0QSwNVEaP1JAVzLIG7CuOBbDLfLTA+85GoOYpxrZAU9TNvPvcufSE3WkISAVnvh+q8bAB1XjAvUTEshsHwzcQ9GL3IYEFSwT7pROdPwKqdH73THKW1d X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(8676002)(6486002)(66556008)(38100700002)(38350700002)(36756003)(8936002)(66946007)(316002)(2906002)(6916009)(5660300002)(66476007)(52116002)(6506007)(107886003)(186003)(508600001)(26005)(4326008)(6666004)(2616005)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1V7/Ga2E1PUZLL1H37pyYL3RtBFc9e0sR38gyPu9pfao9Z6j6bU+VJ0nkZbWtmrjQ/w0jLSxN5evEovpiZh0jR3wX61lyf4UIPLM935KNkX4bcU+cek8VBuOSo+7FLoXauqQG8vQSWm1RH0qGuZr7UxSyR1vlOZPCVARsWP6ydoy9mGo2zRleL5FFUEi9kXQz0yoB3vzBBVTjcQcrV1NwTsBEKJpFpHNdq56lJtOaAXCVuwQd6+h3fzZIk7zMwmkmqMxgSMfeual15Ulh6+cNVpQHsArDojNGsrimgbSoEiPvrH2Ytulyi50miFIV9vAcFjKWvS90fdMvIZHUwpLDWK90XJfPW9WMOObXD4xk8Y6V43NcbMOho/Krn9CSQORxR/exEmB9BnNQVMCGPc4nFnd3H2/7Mv47qGwPJJkRXnJ0WKiCxDSmwOafAoTkrE+tCAO3ysRWpfJ0NexSJrDtNQTXf/ZtyaVIfpo7dhOs92L+SpMmq3s/Li9MznU5HfuQpFuw5YDiES6D2H7gwsvYQ//QpxYWiSKcDWmCWXBS+swy00241mbehNsrghRClUZHtmKRFxjyGLyHaIFLdHptAXy+duRqfR53GjD0GAQ8m4BSxNgD+iU5F5nxNBIXbvZVqAEeNpN2I4fNuKWRvJdmhuRkvkgwxyerNwq8qipCdoLNuBnm++mXYMwAzck2JJsaEbaKIGZJRkz51iD89Nh6oTJUMx0M2NeQcG47RofaTO49K2j/t7TCDSqkmO2eG4xXuIb68B0z/rpO+1lW+VlZgorEdrQC7VLL1XuP585SodYzQ9N6gQglgkcEkHCIuiO9rIpiBPOJA8fsLzKpaXjfKJ48qojIN6vnQL1z4qRHPidp72E+vXMF2yvJ+jkPN9d4ewXGtwxZr9n+GcaA394HDfLy7I40nw8+rdQo81ptkazuoinghktfhM8qI0nVzDteRdcUXkQaAr9E9ma7MwRvrGTH2wQiH6/1+d9YYuyoFHliWbW2NI46isvm2UZKJ8T75f11+Jo5+p0Za+6Fyia/8025pE1oWU2L0piry0IMjEkyauHitX3NBk1flBSFdPH9UcrIL0kpQSr6Doy9KSBy3/DqbQn4mtK5aketdKvgKzAv/KkretCBmv94eRG64F4EoS8PA/QWkrS3OCWhySHmE6JWxTtWUsMg6E3IsdM0ef8w/L2/U6Qy7vuazIZxVNzHJ23qLaRgSOVLgMCTEGodTXY+Dv/+gmEfwEJUzjj9itV37lsPaTlZZz017Kv+A8FVEDhJ3O6+NY3/wB0ONx1d9SDJakzyzLNp6YwEW13ZrZK61w1PTZAjOITasYsvPN/8WUH1hpkWVaHudcRM9ZVkCowbRTpan5jNhxwGdceVQEkjuS5HqEGK0dks+5bHL4GB/y4LJBxfhc0N/gIBMK9lc/olQYfHKSVjQO8fU+dEEpus0snQkdVsfSEwOLib19CKEqo24rp6KRWWRWSdFhOQhrwABlPZfnu6bfrTX7877/bBxipilq+Lmuu4wqCOqlxpKD9XXWJ3LYeHcLDmKBSAsZcCGLSdiIDd4EuI4PQhzgmZcX0rIzi2Cg/Ea+e5KoGPbx+GmOszXgxcckWPmktHKRwMMt5v/3E/AW23g3kTDX0T6QVT2+uguyxCKo/NKBJta8jJWnuvAxWtcKQQSdd/Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35b4c3a8-08c1-4a78-9eac-08d9d48a7c44 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:30.7113 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wMqEE6cK+oTtZl8tdNteEqfvykGY99Skju+HrQkUH7uuq5J8BrcrbUfW+BkjgarQgnrf/4uAc2GNP3SSNUqI8NryRko05neZcmODqQ1goMg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1600 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: vcSWHiA3Qzej6YvkKY3o_bako-tI4mch X-Proofpoint-ORIG-GUID: vcSWHiA3Qzej6YvkKY3o_bako-tI4mch Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change exposes ACPI ERST support for x86 guests. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/i386/acpi-build.c | 15 +++++++++++++++ hw/i386/acpi-microvm.c | 15 +++++++++++++++ include/hw/acpi/erst.h | 5 +++++ 3 files changed, 35 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ce823e8..ebd47aa 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -43,6 +43,7 @@ #include "sysemu/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" +#include "hw/acpi/erst.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" @@ -74,6 +75,8 @@ #include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" +#include CONFIG_DEVICES + /* These are used to size the ACPI tables for -M pc-i440fx-1.7 and * -M pc-i440fx-2.0. Even if the actual amount of AML generated grows * a little bit, there should be plenty of free space since the DSDT @@ -2575,6 +2578,18 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); +#ifdef CONFIG_ACPI_ERST + { + Object *erst_dev; + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + } +#endif + vmgenid_dev = find_vmgenid_dev(); if (vmgenid_dev) { acpi_add_table(table_offsets, tables_blob); diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index 196d318..68ca7e7 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -30,6 +30,7 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" +#include "hw/acpi/erst.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h" @@ -40,6 +41,8 @@ #include "acpi-common.h" #include "acpi-microvm.h" +#include CONFIG_DEVICES + static void acpi_dsdt_add_virtio(Aml *scope, MicrovmMachineState *mms) { @@ -207,6 +210,18 @@ static void acpi_build_microvm(AcpiBuildTables *tables, ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); +#ifdef CONFIG_ACPI_ERST + { + Object *erst_dev; + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + } +#endif + xsdt = tables_blob->len; build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id, x86ms->oem_table_id); diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h index 9d63717..b747fe7 100644 --- a/include/hw/acpi/erst.h +++ b/include/hw/acpi/erst.h @@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, #define TYPE_ACPI_ERST "acpi-erst" +/* returns NULL unless there is exactly one device */ +static inline Object *find_erst_dev(void) +{ + return object_resolve_path_type("", TYPE_ACPI_ERST, NULL); +} #endif From patchwork Mon Jan 10 22:42:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2F92C433F5 for ; Mon, 10 Jan 2022 22:48:57 +0000 (UTC) Received: from localhost ([::1]:44398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73TE-0004Ia-Kd for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:48:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73NA-0004hu-Hm for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:40 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73N7-0001qy-Hk for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:40 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJlWGq020775; Mon, 10 Jan 2022 22:42:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=wNCBwsIwJh+aINunDayBl5YJcFgrB4R4o1AgPGpxoMs=; b=twzKh+g9UlIti/zJ6whXSHu6jQIFTV68Wg7WUQ/jRw29Om4NIjN6aj6Eb+3nZHKr2wNF Zle+2D0TjfGjpGBoehSvHefBqNIvQ2ERjXz+ncPVh7j4OQ/kQaiLEU/YYIVZEyhVnIG2 Mu4E3Y7tKSsR+NwccqZP1lbtflEk2B/wYWAw0PNFnNOjEpYPaukOMsmtAdMfrtUifbSn 7lr1WasT/SBUvy0W74ny++SQZm/ubkVG5zYrzyie9fuqQ9QSHeluJLEpnRHmDe7z0yTq kwliXq3YLRfX7Rr+rESU4CWfs+3KYfyTGlUU+oLiEHvdbsdoMlDr/IfBjagBD8hLqjhX hQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgmk99kkq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:35 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZZ4T009118; Mon, 10 Jan 2022 22:42:34 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by userp3020.oracle.com with ESMTP id 3df42kpj9a-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BwmGCBmPQgMVwnCp7x63S2CfLk2Bl1R78Mi357P4Re4UqUidbgY1wPFsrLbfaD5T/fOVaVlFPQUABLMsl5/7aGNxqFitgkNA1KvRS38VhtYT11Qg4s7U17g11z265mBB2nrtnuDnD7leD3PeVurs0ilf0IZijQ5L5ec6+OIH2XZ/gVcDp5AALJ5rZ/AmEjOs0GwLHTRXUpdF3EzF5IIu7kj8qRqUj0qiUM1WOnW/UjlZkuF07N4ucnb6iw/hKYDKMZZidyrQ3lFpjB/hsUJBQRcyVqR/OTUXkqSFFPzT83gAZBmzzvAINlv/O+3XIEPGKSYSvdws0XLYDyjZWmTOzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wNCBwsIwJh+aINunDayBl5YJcFgrB4R4o1AgPGpxoMs=; b=QYVD2GEvOFmwO0s/VMH5jEGlOO5QLEJLHTxbbjcF4YQO24tAT16r6f02WfgopPc2Rt0Mk9Y7W09sn5DJXZ3n3l1XgaBc0OuKZSS//5sbl7ChAPFWp07+TyVHyuqBuHTMkoriB5g0dy1bsSzQY5gsiqW45MD2nUDic7jaeZba7N0Fk2M+pfIj35k9uYSW9HnibAnfapvolW0OWOBUDiXSlD7G5L4pM5kZlDGquOx2vQz1TMkmXG9OxID8emb7fv42tuSYaHNH1kk4PRFwgrnXDCY7oarieYKsH0lq3m+Z351rMgRbram3dGJXNBqPBRdLJPh60zmSIMN5ON/X6ERzLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wNCBwsIwJh+aINunDayBl5YJcFgrB4R4o1AgPGpxoMs=; b=P7ZeZMickBGZYBJRrOga3NAMPm/TjJsWY4xuXb+imD2/nPegOHyfuMmYnUCbF4ifk1wLIa19ox75fCyI5f3pR+2ozFkdKPD6S3xQhJRAw9dKInM14M3un9D99RBQqv1NkvxghbFp2gm0NzSOLWEgRhrgbBRt9p12gms6jLgxQGU= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1600.namprd10.prod.outlook.com (2603:10b6:300:27::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:32 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:32 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 8/9] ACPI ERST: qtest for ERST Date: Mon, 10 Jan 2022 17:42:03 -0500 Message-Id: <1641854524-11009-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8db7d9bd-a92d-4489-f9d1-08d9d48a7d6e X-MS-TrafficTypeDiagnostic: MWHPR10MB1600:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YiMZTf9fFh3NYtPO7CTdrNrAMvWzr2q0vXHaQ4MkItt+vGGNUbNPvHX6Zc7572uZXz+lntFaAHgH2+Am+7pEaaEaPvCYKad9E/w84KxV1KAQN/+7e9TxV/Gqt08tdJjzIO8PsnZgisDOUCsmxv+d4l1wYFUDmucdS5UywjiY1LeEycZFcok+3Kqxq31FUaUU3NrAOHRbM3Y8FsEkAJGn2FLueBNmBQVJGv+VQwcJ/PKqSzqql6yN4U3flj3J5Fu6S7qKgrLClw1M9/ZYt3HlgZ7vNKJXwNt+FobQw00EXgv6Eb5dtzjom21UfYOy/whwNuAw09cZkF1XblU+7eMZKLJjNKtKG5X5w3zgJU+ONRMaFAXGnBzAaGXKtHea7ywth9LlpAO6vrecDTo5z4pGd7+18Wt3jTEATvwGvu5l66f1Bdv8hvPM3KhvB7a2OXzRkYcPjUtb58Vh0Mye2uyNfSmN245MyVIaKjRrx2EZjihZpuaZf6tMBOu8KypjZWQAfidsef2OP/WJ6+bcWFXLnLXMjuqO0FOKM4teVSy3XmIOdRvmqIs6iCInq4PCuS046V7Mcq5vbn4tpJFTiw6hjcjY6E0Uy9L+c3nKYy6PsUaJRJPbJHiygfQPaSpFZi8KiF3FiKpnTck9uzEaUKfvTbInBmBaS5LMkySB7fycv8+AxPnQov0lJ0FjPPlJXm0n0oWDbRIiwMLXtuH1Nkvv9g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(8676002)(6486002)(66556008)(38100700002)(38350700002)(36756003)(8936002)(66946007)(316002)(2906002)(6916009)(5660300002)(66476007)(52116002)(6506007)(107886003)(186003)(508600001)(26005)(4326008)(6666004)(83380400001)(2616005)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Tc3O7UipKujY+oCCy3jiTguklaqxWOdtE0N3w7POLaYR1bliEVbmB26Ylb3NbMq66PaEa1cjDyUiITO3aO7Xx/SzvmoG6/+IUbfTlkV5ULMerv2T7y2BzKfEoTiHoLKn9cO1rbBIWaP036TSkO8nsSwq6F2e3CRFE1WfrMltH2RLDb1/67vsxHi04qI0E7olXN7QYiiubtSxxtgHxSpnqJW6cZ0M6FCBmhZE3KNRs4PiZjDuV0HU8YTbFdM/tCB+i54jR88YgeamQAulTHh89II/e8X8xE7ymL5wxm4Y0fDCUaIuFKFpKmXH2XuhoKOsdxsDQd7g8iDo+Kjlnr3gdhBVVp9e5twOI5KadwBmhZkeMtrrOWRufmy4BjQhiNUAazDqwWrEaw1lmIGEMPqCNcmKwLlnV+pch4U7wD2ACJGqq9EUOajB0Gkifsh03vC8GK1DBuP+MQdHw25h5OO8Mw3d24scDkCyvifWtP8ZFfzPlJ5jpo2ut356S19NlzU++Vm7QniEyfNzAr06ZmNZhAwRyKfOLagkhrb/r83adFlTkrgqsna2sH4D7e1k4xNPqP0v4qBLKYOnSRXSVHGv8NcrnuYq4OqLrJz5X0sEnMUT3Ujhhh/cpK+RLGVTRZ22vMS1mytTBuc55PumachQZfakL5J9/Sl5wbGVeq0PD2lAkmi4xfb4HsT7UZW7ew/orzi+6VvFvOa0GwNzqMA7Y82vuXt7bXabjugK6hKFYR37lgeoUj8vurFzzbAzdpJum5YmEoHOke0vgUd/Ytgk2BLrhxCcHL+MUntkG7rd2YDu0i5BVPgK9S7BYkzoBBF/CgSecwALS5h8nXgKTSO9OqBwlGUQYgMhSNlIjexGM2oleIuOIRYtyrliHkAPmPdwldcHo5C0tNP2BwLe+b37xjvgW0xkdwGCqxfgoYYwa3+ENn3aGFMbhQwX2RpEMMB35vkDDcFwSRCRURgH0unAn9z6jWz4momr94FCmXHaTOpC3n7nVdymnAroXF3GEgu7gixDRPqKvRDFb3cuAGLklupk0QBVEcAsKZzJwRluHBwklLGTjMaqS66tDK7stTB0Gf+0isv9LQOR11znZ0D2ALHBRTBD+QBeciLO4/1iDGQI0t3wfHnclYt5ZD7qudmWW5MfxPG8MOq2ovJF3xGJXvBPgRkE2aQnLG355U5tidsb/+Nc5IGqIOfxsmBa8ZyjtNyFO7XagLTUpCK5vWYvgVBbqH/BywGHWVjbsNqi5R+KMTfxz60sElsURWUWpJ2ryow0c6PVkRYNXHbY85m9WE+wjewl237dEBJdJWLVrvbIbI0UjinKwRDnC6POYCoNe09maCGPcxUQ/H6d3Q8WFHb6KT5/mSUIWJRCzJ3Y8/jn2t6uFDpickVLr8gUwbb4kobv2gpwS6J4jNrtTeVlX+WbyZWFWkWTsfbiahUYMlgAAMskQNZ+xJEy0a/U2j07GllWTja6vZOB+BNCBb3epzjxkXM54uGT/eAfp2vYyPNGy06eOCOxGMsfF+yPXT3d2lVFKuk/c38oPEaoen700a+tlUltgSGlzUPIrnUpBAimt+SXim261SjVQX875n3cHe2niCB3dqO9r7f7VEAjVqGfo3y27zvmHRjsMQYW2+LKcUqRv/r4Xj/5GgoX/+ozP2UnkSKTHqdvHXdCYqLo1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8db7d9bd-a92d-4489-f9d1-08d9d48a7d6e X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:32.6666 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7gI9QB/aNe6s4ACAaqKTQ3nQqDLt4jjzrHJH7u3VmSZKUkXdSo+C0WgJKlpq3QAWrnGoLHuveZSl3vYrdr2bpgKYYp659KRZvIv3D0wyMAA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1600 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: N0-7MEbAkELYMphSh814VqHDLChnnXL0 X-Proofpoint-ORIG-GUID: N0-7MEbAkELYMphSh814VqHDLChnnXL0 Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/erst-test.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 174 insertions(+) create mode 100644 tests/qtest/erst-test.c diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c new file mode 100644 index 0000000..f9ad3c9 --- /dev/null +++ b/tests/qtest/erst-test.c @@ -0,0 +1,172 @@ +/* + * QTest testcase for acpi-erst + * + * Copyright (c) 2021 Oracle + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include +#include "libqos/libqos-pc.h" +#include "libqos/libqtest.h" +#include "qemu-common.h" + +#include "hw/pci/pci.h" + +static void save_fn(QPCIDevice *dev, int devfn, void *data) +{ + QPCIDevice **pdev = (QPCIDevice **) data; + + *pdev = dev; +} + +static QPCIDevice *get_erst_device(QPCIBus *pcibus) +{ + QPCIDevice *dev; + + dev = NULL; + qpci_device_foreach(pcibus, + PCI_VENDOR_ID_REDHAT, + PCI_DEVICE_ID_REDHAT_ACPI_ERST, + save_fn, &dev); + g_assert(dev != NULL); + + return dev; +} + +typedef struct _ERSTState { + QOSState *qs; + QPCIBar reg_bar, mem_bar; + uint64_t reg_barsize, mem_barsize; + QPCIDevice *dev; +} ERSTState; + +#define ACTION 0 +#define VALUE 8 + +static const char *reg2str(unsigned reg) +{ + switch (reg) { + case 0: + return "ACTION"; + case 8: + return "VALUE"; + default: + return NULL; + } +} + +static inline uint32_t in_reg32(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint32_t res; + + res = qpci_io_readl(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %08x", name, res); + + return res; +} + +static inline uint64_t in_reg64(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint64_t res; + + res = qpci_io_readq(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %016llx", name, (unsigned long long)res); + + return res; +} + +static inline void out_reg32(ERSTState *s, unsigned reg, uint32_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%08x -> *%s", v, name); + qpci_io_writel(s->dev, s->reg_bar, reg, v); +} + +static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%016llx -> *%s", (unsigned long long)v, name); + qpci_io_writeq(s->dev, s->reg_bar, reg, v); +} + +static void cleanup_vm(ERSTState *s) +{ + g_free(s->dev); + qtest_shutdown(s->qs); +} + +static void setup_vm_cmd(ERSTState *s, const char *cmd) +{ + const char *arch = qtest_get_arch(); + + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + s->qs = qtest_pc_boot(cmd); + } else { + g_printerr("erst-test tests are only available on x86\n"); + exit(EXIT_FAILURE); + } + s->dev = get_erst_device(s->qs->pcibus); + + s->reg_bar = qpci_iomap(s->dev, 0, &s->reg_barsize); + g_assert_cmpuint(s->reg_barsize, ==, 16); + + s->mem_bar = qpci_iomap(s->dev, 1, &s->mem_barsize); + g_assert_cmpuint(s->mem_barsize, ==, 0x2000); + + qpci_device_enable(s->dev); +} + +static void test_acpi_erst_basic(void) +{ + ERSTState state; + uint64_t log_address_range; + uint64_t log_address_length; + uint32_t log_address_attr; + + setup_vm_cmd(&state, + "-object memory-backend-file," + "mem-path=acpi-erst.XXXXXX," + "size=64K," + "share=on," + "id=nvram " + "-device acpi-erst," + "memdev=nvram"); + + out_reg32(&state, ACTION, 0xD); + log_address_range = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xE); + log_address_length = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xF); + log_address_attr = in_reg32(&state, VALUE); + + /* Check log_address_range is not 0, ~0 or base */ + g_assert_cmpuint(log_address_range, !=, 0ULL); + g_assert_cmpuint(log_address_range, !=, ~0ULL); + g_assert_cmpuint(log_address_range, !=, state.reg_bar.addr); + g_assert_cmpuint(log_address_range, ==, state.mem_bar.addr); + + /* Check log_address_length is bar1_size */ + g_assert_cmpuint(log_address_length, ==, state.mem_barsize); + + /* Check log_address_attr is 0 */ + g_assert_cmpuint(log_address_attr, ==, 0); + + cleanup_vm(&state); +} + +int main(int argc, char **argv) +{ + int ret; + + g_test_init(&argc, &argv, NULL); + qtest_add_func("/acpi-erst/basic", test_acpi_erst_basic); + ret = g_test_run(); + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 37e1eaa..d2b4ed2 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -68,6 +68,7 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ @@ -278,6 +279,7 @@ qtests = { 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], 'cdrom-test': files('boot-sector.c'), 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, + 'erst-test': files('erst-test.c'), 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], 'migration-test': files('migration-helpers.c'), 'pxe-test': files('boot-sector.c'), From patchwork Mon Jan 10 22:42:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12709251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 070EDC433EF for ; Mon, 10 Jan 2022 22:54:05 +0000 (UTC) Received: from localhost ([::1]:51026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73YB-0000mp-Vo for qemu-devel@archiver.kernel.org; Mon, 10 Jan 2022 17:54:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73NC-0004nW-C0 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:42 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:52216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73NA-0001rH-Jm for qemu-devel@nongnu.org; Mon, 10 Jan 2022 17:42:42 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20AJlXq1026175; Mon, 10 Jan 2022 22:42:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=E+rS39w79vEBgcAmwymFGAgyYWbmDO9DbC0xVdIH+cc=; b=gyIXYvJup6uc8p/QwFiN2S0/Ah5NWyoXPJqASiPquGwdda4hEry6zXiIugm9l/ogB4aq oyfOzgfDfuGNgwMfGYulKPtAe5ICshfXwDlYqL5Zn65KdKAPSsmLe1wAgYO1thpG0QWx vNsURVn8rpBigDy8uBurRI6wM8G5wVno2N/1Y7AlRjziXFtCzn+JDHiKRrhxa3r+e99X KYDdvKPGLLxJQVjU8iJi8ctH2thHcm49ixboDISKX11R9MIvXk2hPT4Va4Sveipiz6Qz xIqXVBpOrXbQbvR2sN+6eaCfvqOaGf04uupbsGUIA8NO5s+PeN7Kx56PjFjKel7JgzNG UA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dgjtg9uy2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:37 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20AMZuRL086420; Mon, 10 Jan 2022 22:42:37 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by aserp3020.oracle.com with ESMTP id 3df2e3x2sf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jan 2022 22:42:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QNHSVDSdMnNwlpg8XdrrlpYpXfB/Ru9LxrtcYkhiJA+H1AWGKRcvFpEzh10Ppa4/lUXzyqpkm2100U55ygUWObTExWLQGHF40UgBNRkRrfbcwPiYEKFM1vF3rwZcoWSk9KuNj6Nx4wQDl6G7B9nqAIz/6ws9Cu/9i7YMPBNXifE0Om0LNVpQI/XA0l0GaDof13THrdlaJKctm4T/8P6XGK4G8E9Bc/1p/T5mzW+0v/SSdoL4YXOCEh3pakN2+/a3rdFBdbZNJtk1pTcEMNYrarA2Ae/rKc83VQYSnqSYJHavE8E1YpAe/6dtfd0z2vmMCBGbaPmxsUeYQQiAyhI7Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E+rS39w79vEBgcAmwymFGAgyYWbmDO9DbC0xVdIH+cc=; b=AUly0xhubdWA4OQiklOVK/oJgfTM5X76sRTt3S9iDCT4s53aOrKsk9n8A8/fDWYTEkfc5OXDde5msSOsF52781vGoo46xqgXOfj3RgOo54yDDWDxQdefKvCSQuo08nJnd42a9iapnyEw1jfVKOVZq4O5wNkIHUm0z9km/niikuRIdC07EncnS4OKhI7GZoGYiFZoX3nlSMUJ2UjnKIycLTlTdPydZ6ONvfBTCYkd5EwTmCEr7XwFDbTG6aUsxAJcI8PDUirSQlthilNZvjnsTHfd+hH+mgQsJldGUP18AtXkQNRNPLfK4edr9jYKNs0I03xHV4gIpZRNX4BMgEVcEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E+rS39w79vEBgcAmwymFGAgyYWbmDO9DbC0xVdIH+cc=; b=uM9vloNCwFkBJCStG3ZRD6IUo6C+vbuXUssxHmzbbp+EogWWHhi+axt0p8yj+BockQunb1CIaaGmO5G/XDty2M5yuP7ykFGFfbhGpCq1bhC3KEAVrgVLrOiyObiq5TIrTrVTxEL0P4EuZ4I1sOM9T5fb2vZKfC6n+JhxEr1W3xs= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1600.namprd10.prod.outlook.com (2603:10b6:300:27::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 22:42:35 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d573:6cc0:c616:6f2c%6]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 22:42:34 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v12 9/9] ACPI ERST: bios-tables-test testcase Date: Mon, 10 Jan 2022 17:42:04 -0500 Message-Id: <1641854524-11009-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> References: <1641854524-11009-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c381340-0f4c-46cd-8349-08d9d48a7e8f X-MS-TrafficTypeDiagnostic: MWHPR10MB1600:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:415; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EGPoeQc4s9i+vwOpkaRrlMZ0j4CSCWjkWfE/wzSTJh+L653YLDmqBJMd2rtwbEV7uu1NwoN7FJDxN8yFdUlwCZK1RVewAiBO60BZGRTkX3FRgAgyERrevYYFzeVz3VUJW58pKgcNi93vkpauJJkytNcAB/rD7G+9dHgTRdSxSMNnNoHMvlf6DlegBVkmCcVPv833mvvgQDi+jIpiJg1zgv7RRg8iGk2t/1b+TZR/lWNcnauNZ7qrcHTgAOgT1JhPyR607YzSXxbZiYdlEyQkzgwcSXA32uuxR7eaxgoWTj8F+sEtFcyC3c0p4HF0LUjyRvsAIBJRhUqxVHjdrVNh4zqxxuD4Unr8LIphZJ3wuFbYapY3WxpeOJ0hwmhI6pvTrS5SSZ2XJZhQycNKQiZuUw/4E9iETDq7YRmdUr4mbvm42FM3UrI8zWCmO4/Z955ixz/ZHNVvif7m8WX9fHo4+UHGJeib7f47t5yS/zeYw8ZbyXv22VDhTLxXKGcF1yfkqHh6C3ulIxNNgGQh47c5ZZA9oJ4oLkoFcC7GQg8J8WV+jCjJ1dXBjr90ByWIiuxO1/eByJW/C2zF24Iyzp1aTG9gsL0pW+SyT6hDt/tDeA9+swPRcrqY3VzRZ6GAovDTOioFET75YwHwYpN0Bk9LVBanKnHmWTYyhs4Rypp4Aec+STkkSI3XxZJryPHPcNKslB+m1w/4VdIYGmWE5zj2eA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(8676002)(6486002)(66556008)(38100700002)(38350700002)(36756003)(8936002)(66946007)(316002)(2906002)(6916009)(5660300002)(66476007)(52116002)(6506007)(107886003)(186003)(508600001)(26005)(4326008)(6666004)(2616005)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PXu9mzpFGUjgmFWwruVyAtn2ClkhbrJF5XsEgMn0GdkaVLhiM3IlVQ9daDvJY0/NCVTG97HOSGfhRHlumfFg1CRBM1WM0hAYLat79jT9YfbtZzv7GlmdGtlZ4UYKngZh6OGtrdDnbAqDVDXWFsE8HwyhNTOXzg0EI9QmK0OALT5VHpY+SaN/I+2l5ip+lubAMTDeLxTy9X/vdDGHwXMAvRVhTbHb56QAMXNt5gIakRcK0qmSLaQFmaxGtY9zsLD/RrqYH1K6Fs0T90GyNg8STkZd9SROAOGaHLMlNLE3J52V+slkgHVdipriWlkoRvUaoyCDjhoAs6NpabO9gFiNeQOY25wQW5c//Rd57HX80GB48E1gnfAbiZXEeRbgSgIPXRGd+ZKIzX3aaoy1yDGBCjfQs90QbtCW6fCmZ+WRf45RB4CENlSSI/0llpsAOUokTEEwGPGqOiKfIZqpTNf5YxpZ3cXQua2OTIfIKco3gqNEib4iVKTnWIUGZriCr7kCrPkph6JjHw7Rs2RjesLLb5qlL5Q9AapvPtwPCXgw7UhbTlS6EyauewEtkeh3UNrkGv+MqBJ2nqQWCxuTvgRW2E3EaABuZMuT9ECNRSWcjxyZXKuAliKv+9g5DswnusStj97zxIGpdGwyGtVDA9m6fDJwyikK4LRMisoURLSyHi0O6+L/6OQKv1Hi5ddewNhOJXkLTprRTIcCEGzZ+MYGglL7RyEQiSLDEU6QyhN4rF13LU+X1Orjo6+Tv5XjNtQh7JeF35bSZZWlWLiqWtJHu3DDw5H+nxAE5AG4w7wxkiAd1L6t3VBIvgx4yJUCH5mF6L//JUokTEZ/RKQb4FeTpnKYrkOT77FrNVG9Z9dNix0w54to5p4v3tOJmMPsIu2i2uKWgZq+M3COfPsqDMLpVJTH+D6om/weBRns1lFgV4qAu+qyjL6egv+YNq4xskBBXRFMydGIG5cQ3D9mENO6w2vNALLikggX+kpS0x2iSeTAId6li65Jue0ILgioTewiviCSV4yRq0yw7Yfy2ysu9lp9PQy72sVwCsvyLzpeBCuB0N3TFY5i7yX/R/Co3HJWN071XEvkYr9A371EM+g2HrPgkje/51/Ss0eiewfc8SsPCa9Nt4GtMUuhd72WW6yNyqZpu2ZV96WPuQevA8sGGoowELjSzrrrlZKE05r+RGq8DMjnAtyqYZwYx/EvtdGnuG6W2l7v8Ok4bUW/nevbEbQADU06XF51+70BB3eGI1LYe/ooX+mh0cofNOwDuaVvxDniCf+MVkD/3FqtZwweTESGIcGSpq5MbAsT/nwegHj2WI90A3jsnaW3aq/6+2lIED9Tz4hdzv6JhjvWiRMlz1yxenvECLe35+IPy7nAUjRHJqzrqmC73VmZC1aQCedmQmeTm7R4bz8LWuzxU/pAnRqJdAD0XQ30YLbZLlCYfnJEUN3C0pS9DloBl6v0GC8zJbUdnrKjS7HC97eNFxW0PmqYLi8xOuLMm8DbX1L+9nvCUQQnPkuofhwz8bhZJFVWuDs5XnuXUAZ5QkBmGyLNoNvMMt4hQ8mW4pORWD3PpWSRARRXEhdPFS4HqJhXXWvZX1Mjbb4TNBAjjIOatfpc+TavD+a9Ilipv67JrK28z42HFd3uNPsqYmMtIrriwONuv0Uqy5qpDQcgIex+NA15hQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c381340-0f4c-46cd-8349-08d9d48a7e8f X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 22:42:34.9338 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tQz99agc1IcIxHfSrhYln1E7K+36XETqu2qwY/dnIdjMhbNy2xdqi1DqBwwImzSO/sytFoMtUCWkbslQFC46qmI52rjuOHEUroRfjwmITLU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1600 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10223 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=962 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201100146 X-Proofpoint-GUID: 1P7mjAVd5rmN8qg5HA0Y2SoHAxtCC0fF X-Proofpoint-ORIG-GUID: 1P7mjAVd5rmN8qg5HA0Y2SoHAxtCC0fF Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change implements the test suite checks for the ERST table. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/bios-tables-test.c | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index e6b72d9..266b215 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1446,6 +1446,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } +static void test_acpi_erst(const char *machine) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = machine; + data.variant = ".acpierst"; + params = g_strdup_printf( + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + free_test_data(&data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); +} + +static void test_acpi_piix4_acpi_erst(void) +{ + test_acpi_erst(MACHINE_PC); +} + +static void test_acpi_q35_acpi_erst(void) +{ + test_acpi_erst(MACHINE_Q35); +} + +static void test_acpi_microvm_acpi_erst(void) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + test_acpi_microvm_prepare(&data); + data.variant = ".pcie"; + data.tcg_only = true; /* need constant host-phys-bits */ + params = g_strdup_printf(" -machine microvm," + "acpi=on,ioapic2=off,rtc=off,pcie=on" + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); + free_test_data(&data); +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -1675,6 +1726,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat); qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); + qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); + qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); @@ -1684,6 +1737,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs); if (strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_acpi_erst); } } if (has_kvm) {