From patchwork Mon Jan 24 17:16:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12722523 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 B4BE6C433F5 for ; Mon, 24 Jan 2022 17:29:14 +0000 (UTC) Received: from localhost ([::1]:52080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC39V-0003bO-Op for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:29:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0005Rg-L0 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:34 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:8218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2y4-0007jQ-36 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:26 -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 20OG2mll001332; Mon, 24 Jan 2022 17:17:19 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=HEb20oUKMPIL9Z1BDYrNeiFvLmMH8IQZwxdepTtGUlFJnSI+6PqImQwZXVhBVuYOLcbv qoHpORBOWkgBcJYG0NkshoHlb4ktBptze0oN9xlzSimzIvdX3cIggMw/KHD9oOXRhv/Q 7hm6du58F/CYlNEIhAF+DEognfuqOxXrWD8KDwve4Nysw8gm3Am6k3IXDmDsgA7X0ftS d4EVp3+IjUR3GjIQ3+LSahQScxieFFx3sAqvGKzlM6Eg6pnsPFKsl6K/5lNOvI7Ze+wG jR1F3U9RR4bmqgVSo5g3UbbVW9MC0jhP1WancxgGD61jXz27XEmAD9DMtkz245CrCdDo mg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s0ajj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:19 +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 20OHCPS0087592; Mon, 24 Jan 2022 17:17:18 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by userp3020.oracle.com with ESMTP id 3drbckxt6u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ky03/fQk8uhV+CqdathYdJRC0/+qQk85GJhxWypd/BsYKruRwr47Cq9OaWODE1LQ2ttjvR1plnSEEhws4OZINTBvviVldcm+FOVP3hgXOv8Oz69tlmqoWutGF0sbb19r1kpq5rwCyXl2mjJqrWwTGa8wsZtX7kLOlz+jU2khx9ovNxr1rDNS25sTNlXMJBLnf52H1jLw9Bw3WitAxoaqcHH/Vn/RWQGS7c5zuKtzo5f2cxfFxviPRu8si+VVfU6CnYUSFp5RbjjEP+QBH6gNSiSxUFODTAdalkinzcY1oKz5dVuhE9SyHGMJiwtq2T7bCt8O3kcjg4q82qO7TtyCNw== 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=mo1e/cc7/goSKBllTxvavlBTkwimf3DAPWgBkLeZywotZ9AyuTgFuoAuD+RzEe0NCi+cJKJg4pd7T0b0BSD1gTiAkT8dgtm8w7eh28sHeQZUMle5vt14B5J8KE0sN+iNWK47XVMo8CvJ299pqQEvnhra+Xma68BNhmWrjCBZZltetpaZUmKmOqJ4EgsLBkN3RC/tOXhY+p+x39oTxz0iDJ2pSSKrBgl7Ak9psYshm1KHU3CVSHImI5pm91tlkhjcgDZdoxqmH8DOQlMy5AvmpF834ez0pwfFmrNx2haYznezaiJ+8NWGZFHmoZvvZKWm8By++a++Cf3CE0uQhpMKyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=jj6bI6NI6V2m6xp0ApSl8hLb1Grysjqiwqa9QzbstJ1w3lTBC+Aa/PR4NJiSBBFoF+vVAd8ebOl/vnhhyZWzxUFdnZH3VOfQYCo/BEGJWcPut2uIRjXONpVG11E2l64ZyHcomGqkg/kzzSSMwowe/ihqg2LXTPQ3HxmFrUebvZU= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:16 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:16 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Mon, 24 Jan 2022 12:16:52 -0500 Message-Id: <1643044621-15892-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 97920c8a-7138-44e6-09d8-08d9df5d5e7b X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: 4iqRG85fdMV7o+DKvdiKZ9ypl8kUAEm9U8BVftVTRe4LT9IpqGxHHqWrUh5biHr+HNfxdgkO8dWwUZP1P05pcwQfyqXGD+GoyBDDMGo7KzG1tTi8mWdKMSZhDKMgZ3LJv1P1wcBgauF4lGfWcVRvr2oiR0yMIMO9fPwDdcwAImPy/8H0ecpkpFgJTVcL/9xkjhy4ajvY6YmHrzaUVSbhy7b57BreD2Kwt5NgU+E9o/Po+6y6BpAi1U6D/uUNUyDupqAP8KG9qlkR569VeNvakHLG+ICKw/stdZkyXD4rvVpanHVST6+NiJvJlTsjrgFHweTZe1fp8eN2GmwWurZPWild8Vnb+HXikdPLEtiz+QMYai55Kbk6h3t/Y0aXeRpzRrb3oVRne3U6E5Ifo+HVIqY1WPkzXss6sgEsMrT6NO+uAdwdPImCF0/vmYr86pBDojc3ALcIBFvVuoPEDAXZJr50B7jeRFMc9LzwisEFl6apX0sr4Ol6FhI/WXDNGK2Z71/wLtEWtBANIGCQMe4uebiEwf5+M7lFB30uL8Oqy0cBLiDuk5z65EsvN8UxVYws9VoVI7G3ElPig7GtHy+iE2RCXuJIT7Nlm8oHJEJRAhUrt2VeNckeDi8It9gAXOtROYG1sONI1+9votdBH0HHIeQYULDCPmgmmf6DLHhgdL7CQuOq+xcykoECJul3JC2iHx4tMYGrVbuWGLy098TUxQ== 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)(66556008)(5660300002)(508600001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9t8pnlxwHltci44lh6vf5+zIYsKPwJq1Cdr+2/ZZ9EyrXwxiOso0i496yzsIrBdh63nQ0ku8YY8CHw06a883HrVE+oAc93LlQTXAHhauu51wM8g4CceZDdfSOqvWeJ38qw1FZucQSKVR/elHccVxtQkpeZKxcH9cHdt5DF30LjsQL+XekcybOQL8fGLKDUKShJoyZQJtuN3No8mZhLg6QqfVlzYz7kVuq5qVaBs8xjYLlq2/q0M7Q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Du2HDOSd/8NAywg0XO1F8HBhWOqWPG+wykSyqcfChAUnCOW6Tm1sspV2zQTmwkzCzqDvjkEKJmvb+ke5CeXubrdFxBbZmUDV7fdow1xskpWNt3/blD1tdO18t6lT0EgUk4eW2KcNsdZpr4EdoRS+0Kna2fSY3tByrT3k9vJlcjahZ9/ksaVPNLpocOsJT6p0LKrkn9/X5AdIqIC+MHJNv84wR+q+3NWOztPEs26/azi0G3mIvnLuRgi6cbO4g6R2X85GUpeaARAT9HNvSSCdhVn1WJofVenuyvQN8ctmhWGbqhvmZrhyLXZ4+T1hSVvgZrcQGzUv0e15AYgXjEGEG3yoGg/rujQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97920c8a-7138-44e6-09d8-08d9df5d5e7b X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:16.2209 (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: fOcwUvjtp5hm9qU87QJpTb+4Y0ttJOfX3bpgBexLTWYy4bT1/j3NZYNJ88aWLchPWSFSpbcHfo5d7Ca1hnX65wPOYNBpVLDgdx0+XN87MPU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: ch3skR8NzYU8pHhPagN-zm1qncr6hdag X-Proofpoint-ORIG-GUID: ch3skR8NzYU8pHhPagN-zm1qncr6hdag 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" 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 24 17:16:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12722498 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 4B5DBC433F5 for ; Mon, 24 Jan 2022 17:23:59 +0000 (UTC) Received: from localhost ([::1]:42624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC34Q-0005Sb-6Q for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:23:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0005Rm-Mm for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:34 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:14182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2y4-0007jj-3A for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:26 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20OH5h97005958; Mon, 24 Jan 2022 17:17: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=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=v+K1HX0UC/xaeVj/cJZpwEN3MgB7H/znX3ZNDESjihlrmlLdSbH9WP5K3Aa/5hogiev0 wqU/jtmC/7bXhSJWmF29q1fJiRlUcliDr7OwwkmlYLbtSKUDVB1gwRbFsK71xPnD8S+5 ObLWrITTyjdxEELWFDYBQacTQ91CjIN67p0ssO+PjU60SAPAVKGZgBK3SyAuNr4RU8yZ J1DogT8a34p3HE7SuhYp53ErrSXo/l6iKMlwj7qJrX4bl80LT30zoaIuRJW3fyxQBfCd N0VE+Gjd57+tylho0t5mdiupykLHGLeGcIT6EjMMe6/giiioe3lexCK9c3/ujg7xcTfS Jg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsxaa8hax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:21 +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 20OHAita051734; Mon, 24 Jan 2022 17:17:21 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by aserp3020.oracle.com with ESMTP id 3dr9r4djcn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UEcV6iLxJw4LOURzNEgXbaSgTvsSLF1rNJAbvVTVIoLAXw/lDixL/qRfmsxaBS6NkUca/RjffNIzIzIV/yTY5pfgjVW3On6DBwPC7njPgIZShQ5heZvOM9hD1gLRlDKLEPaKMrVWRNLEPpHWMF4dmvd+VvITqPWY9hXakiXtUkEG147LkWUR28ir+6tLx6KLsNMQWteZtX04URU8Ft8LWzKillKdSqjIqGsezA9zP3tqe2wPIBKUQPeqH0na3Bt35xEXSHYskD7+m26nTpycbZxO4gsiFrdA1XM9jEx5NzlYXJgYA7si21y0i3hU0Xo+XN+NUKVTmOQ5IMg8/lDiIQ== 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=FafRY/IDsTCObIxnHrPVkLJ6uORVBbN6ORgIumuv+F4MBxo2lmCQZHO5hIDqJyZvxSzauveJ5gW0vVeSpbbTJnEjXb1yvbOi1lvnG+Mo1e2S1hiyH3Q2hclXW0xnSL+lN9iDHiauc35qQ/kgQIiJQQA/fYGTMOpcOg3BrZYluubebl1FLErPOAYiV21JcRcxkSpo6ubnocxD2EMp41SlhcEWC8YbBu3BDcLqh3ebsoNM5w++JzA0fONAi+Kb4IvbyCejYJcEIocYAjBELaK09+by//29D7QJ7PzFyB/IxHEI9rHyntoN7AL8wjWx/1ESqOG7vfEZqrVuUkiqrNAKOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=n41DaR331NQnA+z0EkVyBsqMCd/M2n3nQi+9Z3DoWYlXeM3BojP6PAtnIDt/tvrIrHbWc1MWrqX3wx2lVU4QUHM2JNy0C6zvkoxIPTK7WXZmHOhYh+kf8PWvBaoBB/+VtxJfRt9ALSdZVlhsTGsKY6wSVRstt1e58MtkcfF0ue8= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:18 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:18 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 02/10] ACPI ERST: specification for ERST support Date: Mon, 24 Jan 2022 12:16:53 -0500 Message-Id: <1643044621-15892-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 5377da2f-bbbd-4d2c-88af-08d9df5d5fb7 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: gVDuLgOihOd8DlvBEvnlCgKL3vH/F2XapzJuxwn41Pt2yMAdM58ngHJtSfYmGxjzsR01D0bPinjWBfdI5w8BfRH1J2PyN6HWMxcYKZWb9kdDQ2YIPkNWsWjpiu6I1tNDn2ikkVLpG7D79ECjFw6lm+J0HEyoJvla54pZCjQ44e767vlCH4Ut76kbrvBgxycmq/Vgz2McNj/BnV71NusHQwlrzFp3b6kfpWe0wPPlHhwFVyOS08yiP2bqcqNQv3PuEeqC37+9HMBwQpcrptmmUPYgmj6CW/0SeZmw+n1is1KXYTMBO/cLFJbt1qHndfH8FBAnKUAbf2dz8BmwFiKyZxqPFFLtrlPn//njl/IBx6j+Mc6jMPSLICldmAz/LvbjeVFney6vPfGCkF05cYzlTykrl0FCLiuYEEmO039adAPFI4poq/p3udx8j/6HPp9tgWPQEXrQ6m9jbWIDKqfC8PR8x5aZD9/ZOHs+btUfZfbV10/E/97XxzbpdDsoKyHgjcQzzbCnYRbzChOPwaq2Xxvs0a7jQ4nFPBU2I9ibP4toNqxnfqaLlbrqd49HGZyExmB7Tbe4da8VuUqAlbHJxBY5BjVACX63mXvfC81JZmeXr2ZPwbvYdQhLhHpqNsGi6JvDoY57ea9ajc7KZmiN+x/XHPuXSTo+GzvkIccMimkZn5L7i+BT5M1m4IubnbUtMj/9kqzenF87bCVl8DKfRA== 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)(66556008)(5660300002)(508600001)(83380400001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(45080400002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: unGoUUIU10IjzgIK0FAefo3OP9U9mkax78LdW+iLQmaFWakZW9J2ov5O2Der+2daQyB84DISuQrFiK62DNVEtupBVYWFBXS7K0+im8g3dsh06NXX3ENMQIBKhvY84ikIA/F4eracdBd/U2/DFoq62MjmFizhYNO9Y4ksSasAOmJpZoEWZmdh7WVDZb4JAOa1c7lDInnYvCiWfpqu5QBSUL3N1H0mhFe7RxvsKZz/5rKK2SzCfY7TmhQbwyse+7NgncCyoD1DBUe1Ds2Hom7mtijmgk8RKProcbcDqfRj7+NeMl552NPrT5h2hnYDaOV3RE7onR0dK8KrLKHzo3wJ6S7oeX3Brz8AZYJcIsWdsK8IstqXVq5d+vKddcmES5mkPKqzmiJCvYyK2YKasPxPD/OlAof/JS88jeXwhvvpX2Pwsnaemm4v9ox92xUu16GfOTKH5Pk6ef0H+U7IOPQn46suGs/CFSdpDUCL3Dur02zi7NiIg3ouLdC2zNbdIHDU+Db/Lm6d7Ugyaf/jFXPHaXVZ6uuinIDykcpdHrD/sBg0twuiN6Nkybb979uxrq9bvk3fTtSeJzFCC0cC04koIzK8neL5TUiSnteiBBLFM7kbDVm1O+LTnjzZKYgu5KwRqPcRCFFWIWKUMorIGixTRG3jUVRLD9RQCQFgE4khOc9BJskEC5VRyH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ange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:18.1857 (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: 11LbGcndigRNZODk4q+eY0ipDtALC5ztFDJYxlYjp19QBiA7IMYhv8M2b5zJuKHJ8OX8D2r/SWUL3Ligbhv/4IgMne4s/6qYHEnGPwoijec= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=366 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: j2Jkb2rJA_lUau-Ikjjd71dW9EF9pCvI X-Proofpoint-ORIG-GUID: j2Jkb2rJA_lUau-Ikjjd71dW9EF9pCvI 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" 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 24 17:16:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12722499 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 09411C433FE for ; Mon, 24 Jan 2022 17:24:10 +0000 (UTC) Received: from localhost ([::1]:43290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC34b-0005tc-34 for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:24:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0005Rj-Ly for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:34 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:14556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2y4-0007jm-3C for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:26 -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 20OG2mbH001330; Mon, 24 Jan 2022 17:17: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=5bfrGEpcDlwIt34rDQ6Kwj4z0gh6xYDO3jicc/PZcHI=; b=vVrNP7z+p8bHiAbw9sonqlIE5U3ZwuDboZPZbtUTfdEO7XNxbJpmzTQ6lHh9XTZonJrz Z/DHCETTPo5mgbIf2WFRupgd7HISzn+KixXNGYgwRxik/Y0oxKDRGEQhh6qxUwaqsUeW k/2k0Jp6arW6SazMD62TT4jSMceBJ6pkxXjhpRQUAwOnWhOFwBglZP6KNdPiMwsU1Ri1 P+3aM50vOgpXpyBNyOX1UtqkDiaccVVHosJi9npqHSWtzJyHNjmPqP0kwlsVU91cD5tB w/3ORknipG/T+6f1zo8o6tln/30YN6eMJ/4TV+ZdIsF8RSgw6thXhywQJsQNdQtPnfGw bA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s0ak0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:22 +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 20OHAitb051734; Mon, 24 Jan 2022 17:17:21 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by aserp3020.oracle.com with ESMTP id 3dr9r4djcn-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=frz5tlzF3+1QMBGwbbEnQNh+lR2by35elRiFoXkxLRPMZ01W7nS2uSFoo0kYuSSD3bo/mXJc0MGXDTjOfRbMR60VXBuRYlhn9AxQ4V96RrUe/Ilr8qSijZAvfsxQ8xjDvGrxxHzPrrcZTBHPD1YMTbkKSh5vLYKgLDrRbQFYsoRMAm6EeT8j2tDtEu2qJgVA7T5QT9sJUBjqwCx/0DZbQzKdFfclv9r/C9GXeNqjZAkvX4Pst81E55Y0gbGsKEb6ZxLHKUkZipdgzn8mW+7MoFtiN+aXklhur80sG3B58tgX0t0+nuHjeViatkmxh2r0nTdzrHifzNJdp3XRE8sxJw== 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=5bfrGEpcDlwIt34rDQ6Kwj4z0gh6xYDO3jicc/PZcHI=; b=No+rU0uRMdiDF41YTnXUHbIoeTeIk4ccadfuBGmBlg+245JNDbwGnhlwLqFfLPgwSIXbvOeoHE2dgDw0UT44BhmKu2DD7rrPdOZ91JOiCAMcqKKhbU2FsME+sRkD9nUmvsG5Z5p/wXGtrNVXYw+AVpY2trC8Cc4HhHdojvE0lulIZOSTMkJCGR65jrIILGe4eig1noC2i0o+VIbhrnnDj16yqhNjOTRkBPk8vFHQJstXHzSN/SJoi9RXlLdCT7jrJGy3EdMDAJ81Bh9zyTMxJ3NzskJFQ//Jgucc/bLpYoHd7+76nJh2Jo+Dvsj/1Zqj2SwfrEHtDBLMdt3R/GmzqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=5bfrGEpcDlwIt34rDQ6Kwj4z0gh6xYDO3jicc/PZcHI=; b=Vw39s1LGUczzC7ybLFVAX8i76lKPVh5nEzljxnhM2MqQOm/+Lbsgk1kRf4KdCGh9ewgPKYhbIsUd+l2OemhbbzXgnHIxdyw6Zra+VtOfr5nprkbAPHjDL2x6t12FY36KX6O5za7e13iWpMKRd4ixspSdF7D6cjyKW5DgS39dvdU= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:19 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:19 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 03/10] ACPI ERST: PCI device_id for ERST Date: Mon, 24 Jan 2022 12:16:54 -0500 Message-Id: <1643044621-15892-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 84b86fbc-014e-41c8-e878-08d9df5d60a5 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: wzdjkJTIEK0SfnCnxHFoNU6TpRINbna3/akt47VTF650p68sp7uRlM28hzX+/vJUkakwVWtEr6TkDlQZcIWVHlB446Lv/sB7UNLklsK3mfAESIXrnEbFoARlMeY/Zv5bDN2d7OaamKD4t2qiLrfhYmNz4rJC8sTf2Tblz9J/L9hWxEAkDU8859g5GkwT5Pmvyh05Reyfa7pWKmEpWakbX7IL5+m5fw3kSAWvnCfcptjM0XOVMoGfTrRFM3qYl4JukERAr45sTv18WFI5arrQrU+xEG1OKpBsr9k/Atm8gaGQzFHXa+gMuo7LI5or4xqV2rCsc4AuHGr5tIGXhgLvDlYefNZFTgXV8xoXeyoB2oo6CnjHsZrJ8bSSjTaHXmfYd/Jpg6SgWz03Dy6NdutVkWBUwkEoT1K48JaO+i8yILRxZuDLDwU5Tm/GMnHEmIzIzcWg68c9TfaSeaLdLri9fWruka8EzFP7/IqAXDANHN9/Sxdcani5R0VFUkzeGuwFu0FaUvydkr0htaeOXjLzzb20G252Ccwhp93PJamd30YdyNDIxlvnbBlCf7wC1CVJGAVB8eKxTrnxe/IQUkXLUcfrEUisAw4uROAFWQQvlMNtTvTQRs8h9Ctb8hyG7mZqjYrco7jtAztNdRQtpx0mXO+IKfyfuY+++tQz4GZQ/uV0YIBJ1uZSK5l0LuM1qvkfSbiDy2KbBNMMCfni0lAXjw== 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)(66556008)(5660300002)(508600001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(4744005)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /TrqimFM0SAj8nAAuYM6FrFJK8uuz+iQquvBgnPyrjl44GLvcaMeMCdAcU9AyZ2rWuAMd2m4L1Tb5hunoZj/XKrMIP2ieutVDwMaa+67QcPzmVMh4jAIxEAKWJpqNmQNPNtERuwoGv+kgXl3TCIJVGm6aG3uckxexu8hPaBIi/1DT7h5RqFSig7CQ7I8jcx3prSnd/BVqH43QbXMA3GEWAKj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BwUzBlz86DWe0c5bkTZqMtJvBpCDoe6e+RNIhP0qVLt9hKDhJrvcLV3YBnRU3bJIaGtnp57W2bLzyhEIzz9KCi8wQgjDdjPl6dLyN+De9hqs2suP1S7xIeK+w4KgMMoI8CDDr9cKWmQL0KBsb+iltOl4r6UUms/jpLCtTxGVJOzIz8Bpgdgxc7Go0jfptv1ua6lzedm8YQ+/VzRoZovrnt2UsoEmF33mUuuAH6rel1jDkXQzo8abYLuYDcINRGDX53bQezgEQH4Bk/8H1xkT+0edsC2C4tJlcPb5tMltPCV6zRrREL31c2wKmS7zGJEjRYZWwMDwcR9hUdpakqAsQ45yR06zVabWK/hBLQwXswbo2cyykClPPzM12P/nk1OmwyqtVyYkFHA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84b86fbc-014e-41c8-e878-08d9df5d60a5 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:19.7780 (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: LySMTV4uXtOG3wxztX1P+iqf9kx5oQ1kpOtKud0i6BiffjlMojyqdTxRwfvGQ5tf9cMHA1sshaFgeCwDcO8u0PW/5YRAwXzMSDcp/fo3eCk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=930 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: vobi2zSkBeVODJKLCDtWGtIpdZkYtijR X-Proofpoint-ORIG-GUID: vobi2zSkBeVODJKLCDtWGtIpdZkYtijR 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 023abc0..c3f3c90 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 24 17:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12722522 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 87D70C433EF for ; Mon, 24 Jan 2022 17:29:08 +0000 (UTC) Received: from localhost ([::1]:51454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC39P-0003AK-Jb for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:29:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yI-0005eC-94 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:38 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:51518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0007k9-CB for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:37 -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 20OFvXKR019284; Mon, 24 Jan 2022 17:17: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=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=M7shX+udWDyI/X/h9Q8erI6Ila9OwmMPFOJFsBrSp4TxYY7Is7b7hC3a5AuDMBXoyCSW KJEJYp1ktCpBlIzXd5Qpy4Q/pQaWO7LKFdC4fzhN9Fx6OSK9WteHfHvAQApylOF60tE2 KJwjKtE/iq8glAr1LOzwmMEr8cw/k5wc+JwF5GPjgSImrAfLTJWHZP93t8exxSafBEJ3 JY0+2zTWMJ4O27S/MjO2hYNB7S5FDDlFNS3NEQHh1zQRfOawimIn7RrmSfa+U8rks8Gu E2BTWRN03Kgm6yMTSTMPi3rF3eYPrqwE7ZbpPKaUJAle9/ZHdLwydc3X2rzKmdopCRBx 3g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy7arbfv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:24 +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 20OHAiEY051735; Mon, 24 Jan 2022 17:17:23 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by aserp3020.oracle.com with ESMTP id 3dr9r4djfd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bd+ltc2G4vvdTk6fjUUmMvjRkd1aHJ/CaUQCyNYYuFQmR4Gk0oopn1nqNn4Wi4SKDb+xckoDAvKjYsgd6eyhVVSo3CMchkvAy/yOHMX0r8VXJNvmrp0o3Tf4A4QwLGEolPaINyGuxvxBd4FTCVo7glgbATkPxxyJfgrkksy86eWBJ+Yg9Ti0GZBRre5guZZQbUDhuzaTRD0qQYGv4+Gsau2h9Z0zFe0fF2EOepPeYndeyCZH4MIhqO9DNxGATZYRhKnGRFHD+9VQuprEDnvYaKKcECPq2P84ABlVWl7aPxzAYt/itY1xhj8u8EFDyjSn+0m5jiY3dvlybuQLS5DxHw== 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=YsyDz1jI21Wo71yFW2f5439yn5Ie7z0tak2z8N/xcPi44kz4hYdx5b6USYYk9L1MJSNf4DXCRMS/hVgITWuIrlVqDVgn1rRbO1izh2W4XEeiT+GzBlJzszNfZGibQ+RWiCqAa0I+UyJOY66kUcTdEPF4Y9U2Uxte/7fAB/wbfGkCgfdRQB3t9x6wNvtWFdyHt6g5ALoqE5OGuC9lwCfkOU8LyZEN88V0A9aF0gv+pqhYXCgM2RpR61C8H/wAvHEptoDD01JDeRQ02eFkKhlHcxWQ6/JtDwaECJ4HCZJb65nIP3eTCqM4oJCFzGLxow3LVzerh0TBd1FuXDUQzmn5jA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=tSWeXp+cLuTkd/lFREQlvW9Y1afVm0Z84Uxf92ms5CrhfSojd8QLMBlqcSm0r96uBaQUjoOrVU0FytHckieKIcRlC0vnkf2NPxsDcxuBBi3zP8qEbguhROkQwvpY3FndNa47cZ2HqIzQ8CRnPu0LRxzAAb+VlpBxwqButnhhIkw= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:21 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:21 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 04/10] ACPI ERST: header file for ERST Date: Mon, 24 Jan 2022 12:16:55 -0500 Message-Id: <1643044621-15892-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 79ca5f58-23fc-4e30-d78d-08d9df5d619d X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: zL7iEM+cQ5horwlEyWYFZELFOKfVl7+v8Plg6Mss+YZok5QAEkWU1gMSyFbIO4dPpjB/wZ0O6avFVlV5CUn8IdmzZWN2X7N8DXTCJoDDmV8iB3bHf2uDN/dubwTm0HWGQNBoY+oCu/AxsFIKHkzzH2YH3eki5TVG6gwLxSpBPsz0GZEshNiApgQ8asJ21T9hdcXlV+84w5E1rMA8eGwsX6Qu9oGk+x0vEU0Su98HobnsLVPIPl+dMJgbEsHxKl3wVtbaHsL4AmONu7MgjqNvVSTeR6Asfqu8LXJUE2n+HRuunbfYr5z4V3KAfpr7wFESMNGUobg3OurXQtBKv1ri+AqdinD+nwkMzLeo40mYwR1xb00eyv9oKP0xCeekzKNbVgmMYTrd+RS1dyUQAKBH4y+9fEPNW/iCoDSWYLA9bah2yPAJ6JrbaSh8gWhIRbHH0gHbIlW8MxDCRnIRwaQhOFWHmXDOzVEyA3+aOZhCQajFFnZ5dnM25462zufDgmmDlQ/J4Sx115V8CWEOnr/lt/eGFbRg0guxgpNFhsSMb7XkWbWGzOp0uCAg1VdLiunqVwwjX6Gaxn8d4zkK9EhaJMNmXAIiGHYUbclpRd1ORm16g6RCVe3Wdd6/HYpaDpHNC4McRUjMq32WhsP9kVVkzgwDDCOgyEUFiTiyDNJ76WoA+Lo2EX11XoMhZ1lv1nr07/DeUBBqhFCCviUPTWEmQw== 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)(66556008)(5660300002)(508600001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(4744005)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9aVKytjDuOILzLdMAmyXVGAaezHqPUz6/eP55TWbIijcDC/l1t330NTqRnpoNXam5XA5WdVaWB095d5s+bCNvl9wWvo5sLtt1YpQNYpbvNTS/mRq7GSJgEkrGk+Z7Sk4XhoTUapngusFTiCSn4DV+NVqT14Zcx2WhCnAxws2XxXsBry67xuayDUBf9qcu14INHSl9lfbRkK1bkTTEMKrL5VSQrNO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VaRnDWSzVeiiHe47nCuu7JcYQ6MXf3hPonGD7WVObgZVZ2aikSEiTu0xA1kHEinM0Dlhv8s0b4m1BHWM6X5Ex5cWGP2orrHbl+vkvj3Jj5WdM2xnOAvKaom2nMhIkPkHMkIGZr0cG7QwmLKd8l2r2Tn6d3fxY7Yvm2OtxRnG8SXYTw44oz96YdbmqW+su23brq6KPLiPUDwB0Gsve4HmjhfaHmMF1YWA7rn3eGQHLmdPokDm/WAs9u0DS+Ik+Mot+Z7l1czB6g0oADvkX0CA4Q2u1Li5Ea8vBP1nEGLnqXt6ltyxEbTaSIxmFNL1pryze7idFy95BXgnV5f9TbgLnU9sg38Yr2J5YCzqOw3Hh6RnG4qD2qFYFrFw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79ca5f58-23fc-4e30-d78d-08d9df5d619d X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:21.4197 (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: tHrjLOJATlI886ekZez8PgPzCdhGnTTwEQJ90PoVHiHxxv/zrQAXZfIsJXw5Yrn57k3hFahB2k+cJhYsrx5GgHnRXjtLtM7lGA3aYyFmsLQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: GO3M722wwGT_J3cqwxNOAOCAb1fo8T2l X-Proofpoint-ORIG-GUID: GO3M722wwGT_J3cqwxNOAOCAb1fo8T2l 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_H5=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 24 17:16: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: 12722562 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 D58BEC433EF for ; Mon, 24 Jan 2022 17:42:58 +0000 (UTC) Received: from localhost ([::1]:51452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC3Mn-0005XX-Sj for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:42:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yK-0005kB-3O for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:40 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:57384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0007kI-D4 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:39 -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 20OFvXnO019388; Mon, 24 Jan 2022 17:17:27 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=DbhDh30IU41p2n7bIkZvgUFqsHSQ2A16PpZjNaFWGLg=; b=NSBTAQ45XPDy98Un1mfCUw3voQAohCrcA9pV92C3yd3qS3OBtgYlJFFytB2HniJ9L4Lk Fo0k99ypfaJ298efIrrfkn+xbQXzYtXUh1a0HFRVxWgbBkllXMhgsEsczffOb57cUj3C 4D97J5f7YuNxVBTGBIEbM+TjhQXKPZmeLtEFVTuPsdSqcn18SfVMvZq28ijY8L0qsXBV AE0luP2c4b0Iyd7zv+0brYvNWay14o8RZNcdzuHkpzttaETwsgfJpY1m1VpzHJC6lzUM +8GuBJSZw3HlFgbsfzkB6/RuSn1s3SsNJgpBu7F+YrdHuevcJ5Kmcf2kzplpiq1XUhx0 sA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy7arbg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:27 +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 20OHBEg5142709; Mon, 24 Jan 2022 17:17:26 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by aserp3030.oracle.com with ESMTP id 3dr7ye6qyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ha3AXAnvCdl1+MmkDBIkMO0U8EnvU0a0+Up2Rv6cnlS+3AjUnCJ/f82WzCmV3TdKk8zOPWegWO1rXpqWA4Aj7+9Li9nB+pk521VxhJPYH9yE1AueQmflmUBApUwHhYsLEgULmfeSamoe9OKNijUpXIBwJjBqFUzzlITHaWeOGLlHdPufSp3oh9pGCrq33Zh5BprDVeDRRs83xLxb8Msfzo25CiRmv6tS2RNPVZ0EUiKC2T1GriIEStabqVy8WQHtiJMFnliw5hiAORRittTBMO14IK+qrFYmTfchkMQJcuXsUP3rxKvAukEutQnFB9Vr7H0IwDkM91KEn3MwSYyYdA== 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=DbhDh30IU41p2n7bIkZvgUFqsHSQ2A16PpZjNaFWGLg=; b=VKGwGgkXAEFCs6JA1TTjU4hh+MwncxCbU1hszt6m8lZaOK8W8N4r5PYWdq3hVOrbkfkEzcKpAirpClZNfKiP4alXPcPjapsM2TqfhosF7F+L/PXFXFs4YoaVLgvAETEtq9fLpkIUCcetl18Gn9KM5O5ffYCQDuM4Z5Euqcc3zwWCsKWwCN5BAFFh0SxNKI8Bw/hCsCwdCO9D/18LTgoo7ZCTWT+ZXwEcdfWzV1kENp+Yv+2bgoiGL66hVecLxH4ML0PTavIzWzbEK1pLRBVOqCOVXZl0cPzBo5A5YD5xC2BZrYtJuKlSJBh4MecWRonTxiNd5VaOfhe7PhvcT37S0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=DbhDh30IU41p2n7bIkZvgUFqsHSQ2A16PpZjNaFWGLg=; b=P0WZb2zzSjiLjqbqfPSKCtqo7V2Fj5BCi2J6nc1QXMxKTiHOgcKIBEdm23KaSZQRRf5ykU7rz5XBOmDADOIroO+AlkMBvnCpnCI0vKiQOxpctPaUUEH02idfISvRUaBHYPy7X1PWiM5nffxok+Bbz24/BK/iwZ6+SFH5BWJ/cRg= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:23 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:23 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 05/10] ACPI ERST: support for ACPI ERST feature Date: Mon, 24 Jan 2022 12:16:56 -0500 Message-Id: <1643044621-15892-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: bd421f17-3f92-4818-1af7-08d9df5d629d X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: t//AjgtSDfg+0MiOqKNh0s8vengM/2n+jAxf4wuiz2mfkDk+52xnt9BcHUkvUzd9sSfCsg5vnLSnOYcpC4lXFQp1TnB0871IKbYtBdHNG4C+TWueQY04PG/qdKztztGyWCpIcDIrCX6n6pQFkNM8auzQ55gArxJkPTSmnp6kNr9FNc+VjSTMFFbWTSHAqT/fjZGxAwCVFKkBseP23pDzkW+rz4CIm1I5JxJLogegwdM6GMdR8hGb/OlrPYkPrs6b06f7NVH6F9iWH2ANRGdxDkPZ5n/G+Sz0ww8Xv4gRHS3vnZivwn+ExELbaQmW9gai96yznKE2k6/uNa5sXf4jGfxT7TmGdDFYYjN/6GdK5pcarsa4a6kSz+oJlk9wEZjTEK9GfWKK1MHI2PFjbSsCYgyVWqIa6BPzaWGFFEUsUjmINnMGFI9IPcYZt9bvceZ6FiVfjUZqoEQAg1bJLJ282N/mRbPKXvvz6vQN21ebh8W8C6nko93XbV0gC8XYpOS0m7Cucr7wc3IwQS9m05JM38f/43TH6jf7dUCHhEy9X7uamK4qDWNS+sU3oc0hsLPXpdIp0xHlj2yIJRdSGHZ1V2cQVaeFOj0e/m5eO2svjXJJ38Elxukx93Fy2orNDQxKR/lhWIfQKI9pcpi80R2B4wbsJ50cb2H048w1AXmdJxk5ewGGxWa3XBnllRhm3Nx7 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)(66556008)(5660300002)(508600001)(83380400001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(30864003)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wCPuM6c2c8qNgbHj3xZ+MLN1z74O5GkSsCU0boixbFF8lGkbGiOxeBWTbB8zU3+5f3PmaW/jkas/OK38X5ddrnjFAkogooquGB/8Zvr+DcfeZHRZABuILWZToz6clt2uD40TFeSsTcVhwz5DWrM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Exuy2/MUkxvs0sz63HCEMPK8uaqFaeIn9r3iuAy1lxM6FinXeIEoN9cYrNyl7uiBp5ernLhuiOfbAp4ZZA1LDm8HLlt+fPZUrYOLklAQY9VhcFEJCwpWSBNYaN1Ac3uaNAIodtVD3QZLVrs8+MafTsVlIaCiO8cPQ0jAw93v64WnogJL3pg2gRzuJtR73luS3md3AheiKCM8LocuUVWAu38Xmx70fV8jxBJTMUKQUHqGOCPKNswK4vpg7CTwRkTsqKGO0EQrDUsEcmqW65DNrjXoRZLYY4o5W8UsybUicDArzUsSAV1hr3FR1RtkF47XjhNLnzcXrMks96QZyG1X8Np3RBgxWnU31ej8jXiFAPTYmlYR/k+yJ6kZK8BXrIBUPtBbqTTHbJueC7iLKv0OEnYdLGxvv73Z6y1kiPYHYDyJ3+WKxM797tZjkKqQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd421f17-3f92-4818-1af7-08d9df5d629d X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:23.0926 (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: rNnvTux29X+30nA2ejXc3Go65mBqCbx7HokxSZVKg+EQ9QBRaLjyhZNWrSjHHI0YxXKqFS9T2LuOC4dYL7MspVUORG10AtPF5Z6p+m6gY0I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: DxuTfosF3XXe1A0ltcsgvJHZSNwW-HJh X-Proofpoint-ORIG-GUID: DxuTfosF3XXe1A0ltcsgvJHZSNwW-HJh 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_H5=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 | 844 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 + 4 files changed, 866 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..fe9ba51 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,844 @@ +/* + * 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: + s->command_status = STATUS_FAILED; + 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: + 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 24 17:16: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: 12722468 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 F04D0C433EF for ; Mon, 24 Jan 2022 17:21:53 +0000 (UTC) Received: from localhost ([::1]:36328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC32O-00015A-TE for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:21:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yK-0005kS-4b for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:40 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:65336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0007lh-Kn for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:39 -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 20OFvXKV019284; Mon, 24 Jan 2022 17:17:30 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=TT4tb+FKWv2PAwxiQdEwMAt5XD8HqI8lAEczAlMG6sc=; b=LJVY3Qxca1sfSlFPkmZK3Dvb9gukaiZnAjtZOzUkPmAmIORpC4aUR/omO+Hfdnfk+PIu yHIuR98lGaLyE9PQ9HglaCkaMqnmlvjHtMKIq8Hxeha8dbazktF/onSdqS23C8qLlve4 qKcUec4hlFxcPTLAatHCeeLa8Xc186adAyk9Q0V5Gf2FYqXxcQCIEa1kxqVMqLjRwQjF zfdWY1Zj97mgJvoCi/G46dips1p+kUJB0Eccnvq9xkJYorO4N8D/Oi9d7UplGbvjq3Y9 iXRPEYQ6qOuaag9EdxmRddgVaZ4LPfHXDFaDvm8L5FOtznn7Qa+9E4RQxEujH3pSb3i/ PA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy7arbga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:29 +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 20OHBEg7142709; Mon, 24 Jan 2022 17:17:28 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by aserp3030.oracle.com with ESMTP id 3dr7ye6qyj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CAZapL1xXTS2foY/C5Eccevz8gGWwXj68nrgFFqR4+YS7/t8Z3weVbOgvf+gqbIeBgj2b3Nvek9o4EgGdD6+jmA4h8Ze6/koOBXDdadLfIWTwMemn6Nfzg81Qsvkn4ZLrfGI45ZbIfVNfS+/PjavSj26Eu2y7tC7R9QSk5ewoVXd9u9FWUM2AgfW2nARj6kuY7eaRiVI1LrvpFW+65Br8SB1pbvi/gaPAejL5BWXX9XQCzrcP9/QqHYs3SOU3lyOT2QyZFwBg99rdD3UbTCq3yjo7AEWwp6WAm8ZIW6m6BadVWVND7h096KJi2jrDOHUY68z03wMkpjQXaLeno2PJg== 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=TT4tb+FKWv2PAwxiQdEwMAt5XD8HqI8lAEczAlMG6sc=; b=cbBINe/Hv3KS5jUv+g6meNRWhXw/v7+0Ucmqim7tmAAEo+NQp+YJZlcNbt21Y1QfHj12kNkBU5JcBiUrZ/pJVk9x+6f0LdIQe/WN7EGvCsfC9Hgv+EXRA9qzzkM3n7Hu2J5AzZT/KH0eihq+tJcHWaCMPw+u/zcZAaQirmrhSsIfHurDLlF10soVSY1+DziFBlQgQubClqHtQWdZ+BSb8JOmq9w3pWrt/WzRZSm1Zx61u7Zr1FoKM8CvtSxqWucFGjfgyAtPJi37F8qgjEEML3gkQJFLFanSRCTmRBoSNXVyRl2v83hC2z0hqYxAwWnZ2gDx4uHyEvXXGh5BPwSi8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=TT4tb+FKWv2PAwxiQdEwMAt5XD8HqI8lAEczAlMG6sc=; b=dnWnHth35N8En/f6K+UJgT1NrLht6lrXQvXFg/EQi1B5quJm9M3RLjekqLCVtq/AG0HX0wA/ivxBC6ze8xd6W3jV8B8f6iRR1ovO0M4gguAj7lg8TyXNqLTu9fHHFFVjjBLqrNYR8kVcYIj0hpFyppB1+QeVUBmFqXGDcLJCNvo= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:24 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:24 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 06/10] ACPI ERST: build the ACPI ERST table Date: Mon, 24 Jan 2022 12:16:57 -0500 Message-Id: <1643044621-15892-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: fb2abdd0-fce0-4c49-38e7-08d9df5d6395 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: X5af/tZGV8obAIM6q9tVMdbMRFOcBUlyEzy5IyJA9rN3aJvUhxN/vqmqT3ZjqW2VkVvIdDDZcqnMNEtejyvf9gI9IDF3BQf3jZAlo9kD09syoLxTkDdLotejqgGy+1nLcBArNR1C1H8ldlXP9udJjDrUGNsjggnIg8HVnM5kCJMz6Q0Cn1zKP+ken4tbaVsVXxi4d/scLpS7eaphUZpIODuLl9JCxsEhMsqydQUCgeE1XcZNopHuSzzWYnQt3j+fAc9EJsHfe4Kvjwjg9Vb6T1ruycjcWQ1XUTD9+wEbVlkbSB5QwUEUZoQJh3UIDGPtyYiNhJpr18ok+L/6Ees5DHjgRaUna9t4Db9EdfSL4eLO83b0vJyhCXnhd5ygvUYQwaBQzbJzWPUMKr8CzmH3SNgW9UZr2twHLhUAm4gwIGlxBI7BTqmaWPmEXxPDuOXNk+V83WBmluYEMfWvXf3OfF92jr1tjAGIMhbY3l2gRXU197ipy+uHX/FR+9O+ECBD3CeTOy7xwALIdNLmECGGpmQS61N2J6XZEtV1ZBcunNNRMpmc90CJLppTB1QZ0tdAOSGPU5Uf5HH7X1Z+smRr6ffCyunXQ+ca76xrcg9HxTLeLPjSa0YIFUmDwG7W8Lvdvan5grjGdzyUrq4nSVJskLYlSnfxOMiG7mldPa3nbZ3ESJVBOb3ZsFtRU8iAvmOfilXFkEhQQbDKA/lEyPzNRg== 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)(66556008)(5660300002)(508600001)(83380400001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oZCRwsArERY2japX6gObuA24nU7XqY2f/3IzeLVPqWyaHpIdTNfcxepq1lWThiXmHAe1WIAnEmGrNQ2W7jm/LuCJf5/lt2e9j5r1CGEA0+JFWKahaP1sDnEosI331basKLb82EaCfFN/p8ATbrf5vwk8v+2nqwTM80dTwrGbMk/5TuDfB0J8Peysmfd3qNHxwctO7Mz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9+Ynjt6hc2Em88AB8gvpZchibTX0lz+AT8but17No4l/b8jZ/J3/w6qkkoFWXpj8C5nxQOBIoOM7WFvJbaRa2TqDhpUYaDL3JsnT/Q7gJfcot+XMuGPI0PP0EHNDZubmPap5WlYZxfkC6TUcxQ80l6vuKGT7qe0Ld1HBUz0uRN/tXzKg9/fEXj/pjBzzT+Tb7bNWKckyiqMPvHm5T7ZadhJ7F825VQghvy/3YCAV6Mw667+no/IgBqdiF7cMgfnhG8GthERM7PY7E7BWTY1kO5nao3X6/QmKZJymuX1MZQaNbiLWrtIiVEV085KeATgf6BwPaU/Wao21XXHn1eE6WP1xz0YDWGcUCZKBfpT3jSTMoUentI/gymr/3oclEjEd6TN1Aj3O2CvUv9u1M12FeRA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb2abdd0-fce0-4c49-38e7-08d9df5d6395 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:24.7645 (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: cbredJ5cLoElTsGm753EUILE5A++8Oc6Dj3c7g/XFBlkT7hWJgRWLxQRSMPCD+++a99HU1W5iJG1wvHAtwM2T0He1GXsBX05SNeVWI9kXTU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=898 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: oVYhujGCjVk6OTF3pUpT_zfg-T9iuUGz X-Proofpoint-ORIG-GUID: oVYhujGCjVk6OTF3pUpT_zfg-T9iuUGz 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_H5=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 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 fe9ba51..b0c7539 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 24 17:16: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: 12722540 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 226F2C433F5 for ; Mon, 24 Jan 2022 17:34:01 +0000 (UTC) Received: from localhost ([::1]:60582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC3E8-0000yF-1c for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:34:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yI-0005eA-96 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:38 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:35780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0007lc-Cx for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:37 -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 20OFptrA022861; Mon, 24 Jan 2022 17:17: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=t4WojR4pPgZM7ReGPbmzFpfQeLKcgV8YM5y77IDNGc8=; b=PrWkRivDcI/ENN/kEK6v7mLrr/WEfMpFpocWqQ6w03ynU0mo+urAGcdjnhHAGF9xwjZI zjWPvGrj3wuwoWEMq00ksnChh5Pp2WkiXNvdzw7uzDPrqXv3jsQz9nx3WXPZ9CLf6Mx/ uH6mq0N8II/v0hKRQjmKat9huB2zGFy5KWabH6SgTRmss6gwD6qV1/0rn8eZybC8bvL+ 2AnsfD98M9ZA97NdkzwEedcDPu1AhjN/20FC1aRFOxaZJIVJA2VEKQey3b606/6zNHh+ aRHpR8j/m9IELxO3yFKEk8vjpkVBV4x/Tz/ef4ZS+J5v4QjsyEsaZ32jBdI+EKPZjCBL 5Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmj8uhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17: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 20OHAiYr051685; Mon, 24 Jan 2022 17:17:30 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by aserp3020.oracle.com with ESMTP id 3dr9r4djpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DBFw1RDM7tL1u672i5FguRmP6oJKLG61F59+I9qez+BW1nALDvz5dUSv+GcyZsIU9D/WNk68EzR+YDQVfD7fINFCSGSpKhSM1Uxe53383BLsyyiv52/O2+3xnVcb3z81twnKFgbpwNBE+fgBbBW7mXCr6hGvpLOQsSHWFVEi3aC6J2X0dVNMie45TLtzbdzgHm08R8BA4XJHm38C3lJ0x2RD9qKEomEXptYKHVvB+8O4zeGfiez4lnglALGG0SDjn2WRwnkG4iEj74nb11LDSE3rgo/xMzhcQBzEOE8jlLy13uT0BhwT7g4YpeGyiAD3IIWlcs8q28uZjV4g4kYhAg== 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=KFFZGRxav6iWIqcc/k+y+JKtzkydECxfd2ToCWAPtFoH0yftT5DwAyuMIPAHNYUysq5c7UiVZfXYLLIm6xLzeXrfRxl7NfLGEovQkjYwsDzaTKBRAhbKV2OeHrSxr7fKrK8M0R9cYleY+tQBVkO/ThB6eUaI0ugTScQJoKN+cDrqLXzVpDgibM5IKnPtahaMfTw8UBH0tx5ynTYgWHEuEs/ttZAPOktzOkbclmdu0M25rxsG97UwsfefKcyP6Mujx4RHL7kxWDDl2hODVis+KI3TqRauJQ0BNui9JRmHgk/jdkNB2nCfbUePAZRstIOgjjECvlTu0azzafb3AEgHkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=JiBkBirZ9dD32U1INl2naDK3yyhQ623musQtFKt0v4XXGOi0Rw46HhsVU0Zm8F81GLgzYsqaAJ5KyLecMSJRC0Rk4LCdT9prIRGZ48A2k3vg6e5+3pU20u6CptXd11eYlbO+wHJQibdeiW7dvPtaFFTJdisXoDlHYgS+CPLsWW8= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:28 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:26 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Mon, 24 Jan 2022 12:16:58 -0500 Message-Id: <1643044621-15892-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 9e33598d-c69b-4eb0-52b3-08d9df5d6494 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: 6qteDEE3Au3TrC00wXf70ktPYAvKDB78d88QwUQu6iDG0OJJtz5IygHorWdKBUQ0KZzr6dS/M1VmATwGVxZz03llxW17c/R0nzT9PsXFpS8Eo9EQxQYGgcxNZETt5w89oFg2ZCzDm9owYfyH6lh5VMw7A7EvdeSWg4c2NEzOJxxm5tqXKLQ707FYp1MQhtmBQm3fqHPIlVLVZxxC764aiLfPch/mcoP1FcxCbCVDyB4aX8vq25JqTQ3JDASZYoH8vVDMWZ+z1ekhFaZJmztdSCg86EmbICpxYPn+quP/kL/txIG069AqF/fetrfpOVCF3pjbHWrDlu1BA72ih5jEJmz1vqgp17ey9WDx4xtaUaBXagwQezErc1/DTNmLndPH1K5DTbHXy50Zujk2eTX4MyjfT1szwfGUj9GTBEte8KML/7t6L5Z5W7nsRM4dJYI7+HY7DrgGGyWvvSasg7cH3cT8umkqn43Lb6qto9d/6phaVCqbc1fQFuYOfoqfm38SQ3fEVRS51mVoZJltgCaNOPtOOfhu7UlJcn5AK9O/eIGociva6ZB7Ha0XvY4Vo30pimKUFRcL2C16OO8ooTqNOJz/O0+hWTLiWyMjeucQvVxaVcEYo4pI7qaW4CyVBdU3DfyD7UDp4aSSBxTEjJK9lzTZejqJEtC0f6Vo7Q9lUhao+tDVsI+QSin5o7vgrhsue1qDCTKPfC606aCQUxOOdA== 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)(66556008)(5660300002)(508600001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9jHk6YwAnYubopFbSsSWE7otFw955US2kJHqLcFLbKD55f0zfGp3BLIiMl7v3xXYWfATROSxZsGwsbXmcNaSTWNOX3MzSbo6GYsAofzYdQJXWfku7i82Zv4HAHEFXPvLcLMu28r2VvUTSl2AJuGUWCmGp/Ho7ZWci5sbavyY4frixRp8A4VS+Fs3JhlT5EPd1N8wquiWFHTwQn4SXSxPN9kEqCZm6C5qzxciUfuaOKOcBobyXxZUzwll33KKfyV8rz8NB7CV0etC07Vdi+OEPkwfzU6mSMRMmgCXeysWZFXJ+1ZMxKbJMnQRzF/Rb2shfj4MYccArlU3FyUkyMNdnT8AHZf8NB2+xW+tJ2ZSoM7hICWhyoREgm9zED29ROBYr9xGTwHULkviHQToklIGqvXPsGMnNNTFQm7OKucV9JwUHkNxgY62ZKRf8Eh0URV7Hot53xRZBuvleEaU7JJFnNjJDnNvnpZI+FEDezvulehzlsSpN3Z0T95PR0VSTzzJ3ddCLtAewTt7o5RotevPZnThtsolLGQop/tz65MCE4kdizjaoCdayKaIPq5oD89MjrtM0UQjwKtKeZhxVTvaXrhdM336WTTIk6AMsVmUF4rWs4eP+KI1WBZZ2SQKBT0P7l9WLUfLI+XlMeo6N+MfCpq6233qvvTaoctLKYsIW8R7fKwkKwAQ86stIgaVR4DvDrq9jOTI+4RsRJDdU8AYj+zQz9zAwM1J9h8alPjqu1OadJXrNJnbFruFG1CUj5Pl/xTT5m2GIY+dk/nMfSc5bOIsCg8dNw13cM0qF9Cc4kJKC2pb37AJNu2W7ifaQjLhEON4HCH0ZPl5dLTakMgboT7yL6jfsVsPlhsy2yW2pDmTOK/msIDDblroT55D9lSx3klgcDfBgZO1IdeZ7MyCK78w456P08iNZYlUHPdJ0Tinvf31XS1RTfT8r83qBxyEWtA4iCs15SOkqR3Z8dNFBgO5lr2Qo344kT+tkXLf3UC32CU7cNjzJ4wgq2nvhwYG2iTeEHo8AAk0+aZQlyVMjeJrj/CF0ACwpEhk/75kYb4rJR1MEs3Jdj5lY0XoAoBsRPtz3C75o+3hFYbBWCJtqPaLnai1ZGYr7waRYTmbdo19xkuw5eCif80oAuxAduGk7ED/nuF/w94weEjuH+6yVqHqYfTrf9spE5YN5r877FRr47ewO2a4NeFC3XrwgI3MRal9n5QXh63LRjA8zSdnosQAJDPYCqHqv3c3D6KVKKUJrOAj2AY3cWEjreoai5s13p4Q1lskD6769anq1AAjA4HJGmOmc00+Um0DzgEDTZFdXjCOjw1jcK7bAdvyyKaFAZ/tfxCx7/0wgVYBNauCCRixy9ZW1g5D70wZMa6m8UHaV2nMPuAFRxdk38XUgcBkP4A5h98KDbZvMq6HQgnNoblVyKr9fKhEEuGL2yMYxhAaShxbVyaURbczweVDD8lpseuDxP3WSm5dikR6xIBEssWuVBD2HcjnF97lkrx/AHGx9KXhjHIE5zlwPBjc1hN3n/QyjH3hW5OEnUwg49NmkmAbwaYH6z2r4tBgtRECV0pp5uPw9wm0gh+XymHVFIMM4AFXsMQZyCb0TjMxqirGvdQjXA9p7Ur+uKUbfrN10m5vWcPR4kro8L9+6I8pO+m7KY41Ly/90KteQqDQS+IzSg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e33598d-c69b-4eb0-52b3-08d9df5d6494 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:26.3748 (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: wlxX0gtuJ84jM8zzjykBSpDL9RDDUDAmSUSzu6Z9CliZfcp7miXxq30JvFJ6vraaUfRkbYqFAulEatlQaU7T381LBe9BSsoQB9ApZilMbw8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: H2WMUI_RnUqi-rZDpXCacxN-mkPMYSnf X-Proofpoint-ORIG-GUID: H2WMUI_RnUqi-rZDpXCacxN-mkPMYSnf 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 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 24 17:16: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: 12722541 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 2AB98C433EF for ; Mon, 24 Jan 2022 17:34:08 +0000 (UTC) Received: from localhost ([::1]:33026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC3EF-0001R7-5n for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:34:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yG-0005YU-Ir for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:36 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:35928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yE-0007le-C8 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:36 -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 20OG2mlw001332; Mon, 24 Jan 2022 17:17: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=yNjDVR8eJHn+lKawALImTWMalVxYrm0AX21gFo67b7c=; b=K4Fq5Uq7O6cE0VxxkojLfneNXlS0IRAxDLugINl+fa89pIdywKFBuoD9LiWyqeNGVIoo XF5tXYfeqOsSWXNmtk8WRvXFTm79qxJcaK5QZS25JPL6osvtmaJvSn1xsBu/PlhbAI/4 ELZbC+joJfkfgtW+ikV/H3NUdtPituBRhTYgEJlfn5D6XdgAqE0tR/V5uGgfix0DnZSr vsbnzG5G/ebL9/kaKTN7lRYwiktnP4you6EWV4mqwybVbrfDZnct9rIem6Xc8TbZF0IV L71/Lgt/szJy3n7EVIg+betsb8kWP7QAu/VyHZYEzAoFL3Wl2rUuKvf2C1Gc3+KFooxl Aw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s0am5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:32 +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 20OHAiYs051685; Mon, 24 Jan 2022 17:17:31 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by aserp3020.oracle.com with ESMTP id 3dr9r4djpd-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSV6QAnicu3bESTfksu1BgaYamo6NCxrtMttY5ip3cCNMOF0SNQDmxkgGRZYj4C5CGO0I3LbyXCjvQ88XJPYIPkJY0WC2qROaMO7Ja44/fp69YJmV14aSlCnoa2K6LmAFRTI9M9mZ509+NZyYWQoN5UOWi87u3HB+18hV5YC8ITegay+myE8EIuoT38HFQYLxjvrSy05M09Kotwyq2+179e43zVaUq8kK5X1u7ryRtbGUdSJaAZ2BB8qZQL3ksixDMLZv+/sQbppEJiIwpf+mAAt4xBcUxaaenuz77VL691/7ddzuDmoeWN3j2yg+qgJ5zy4FyEkjcFaOU/emzk9aQ== 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=yNjDVR8eJHn+lKawALImTWMalVxYrm0AX21gFo67b7c=; b=jDolSizvXDuviuFhRIu9WpSC4EEfpur++nFMRuutnpntqM8aH2PmzGGY2vMw4RmDhB5P7jT+Zz1HzsgHFvUCEPKtEzARGTjuFu8ORLhcBVek08tIb8zOgDTH7fgL6MxsX6d2WdglI0IAZhqmgCD44qieKe9Q+em8dbkbcyxWFxlJSjF+WvT8E30zjLw5OXadYrjg8tQhkYfy/lM5HTiEXCTOjFXpNyvGf/0kZuf0dGMI9oKF88ucco8oV/gDk/hexUWHGFFXsllelgD7Y+tPVAA4U0YG/oYOImAwU1SF889Ai2AuwJBPkmfnBWQ4Wsuh96Zq1uqZrovGTyOmc0+FvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=yNjDVR8eJHn+lKawALImTWMalVxYrm0AX21gFo67b7c=; b=QFp3JSbw4cjbmHFM3tVwXXxmTLKI3KqDVaV895QB0k3A43nAmm6dtCrMw0Tifg/u2LwNBS44iwTfJM69dWgLRnit/ZAka6gV+Ml6VGUo6NdejcZXPDYKexAlAxkg7iTxg8UXoDy0lVqR7Bq9wGLTqJcjD8nYWNIx1nWITs8/+40= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by DM5PR1001MB2265.namprd10.prod.outlook.com (2603:10b6:4:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 17:17:28 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:28 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 08/10] ACPI ERST: qtest for ERST Date: Mon, 24 Jan 2022 12:16:59 -0500 Message-Id: <1643044621-15892-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 7ad0b0d5-9fa0-4fac-42a6-08d9df5d658a X-MS-TrafficTypeDiagnostic: DM5PR1001MB2265: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: 0vLVwqXb6Eet3pAYjviM1b0mUt8D5ky9LJILedDOv9/6TxTFnFAUYh1pz1dcNdgmTl4VQamCO6gbjxhFddBIZhjV4km88Mm2FaT2WzmR/15L4ftAvkJRnR2wlaumk8raPkWyZI3k3r9197oKNArLKnUe3/rsPiPjgnD6mezFVeH2qjWoDiL9N07uBXZQtLmCbsSLErey3kpmMjROH8Mdp33ueERSD83hhv1LwlXs5M63ciAvtGairH7wXl7G4p653fd8tAVb/PXFn8K9xc0viRFsNalzGk6j3psy6kvRutjU7kqozKqiOtsswAQMd2P/Hu9e6L9lrPiMwvL1YMp+MWnLmyp7vzcv2VzufmEmJx8P77czUhFSYrXox/ddg9s8aVJxj8IEIgKBtBdF2gzdIVnCbAkd72XXoImbiaiUHS30KQ+oideHCnwBBCylgJm/xDod5PayYXzdfnkSgHVQiHIPo7o4D0+SNhs4OM+KHXIqAVkfNff3TVQBBJBxLVyRg2cl2cM873WK06vkH4MBADgoiJfKG/h30IM8MwIMLoG7YiGmgIZ0zpPYxncVP8csUkUzeRwGXsB3DprBuIbX/vdwrgfNneVlmhLEvwPjAe7UMSGrXFGgXJpO91XNjk0bAYWj4486E9Y5jcSLWrYchgOKU7k7XUg6Djl3tDm8wkHKy8YhutnbFcZfgQ8UHHJSOEGJgSosgBqXK6I0FnnMFA== 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)(66556008)(5660300002)(508600001)(83380400001)(6486002)(316002)(6916009)(66476007)(186003)(2906002)(38350700002)(38100700002)(36756003)(52116002)(4326008)(66946007)(6666004)(8936002)(6506007)(8676002)(26005)(2616005)(107886003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Lb9tUPEi6kaJToGZk/429qOBJExodoSpS5J6E3hfbQ2q/Dyk74TvnijzDnORWJLTXq85v2QueMC0wAVsW3Ztk29wPEjdCA/naTPX9HWVYP4bN7UhA5yQv8nXgCKCzc3mrVGu6GXVSY3dEzaRl+fNHvTjp6dEvQKBMUdpdASpRKSX+Iy+bG7Wil3qncQDlVlq8xn7tfKEhMOpkEzMOBpz0FtY9Uegrdowo1EYy1W+bEy9Kh/4U7ifSXhD7vkjOlixXMhyGmCJzcX+V67rMFrXllrN09mEin4jDBu3mV9Ht0+PXyrgRs2G4NJEoRW1gnWdUzNLg8MyFhSBCrabRv32AsLXVkUsi90yyrAF8YlD3vBlyZCHRWCHl7LBW0osUSlZdk37tX9VDU8mJ9kVZX9dyQTEh1WQXZpdvfLvgvrrA/1NVpIqJ195gnQ+6WsfvWwsOOzeZSSsgmBzdSlcY1RBZqfeFPZClC5YKVzrWH5F5you/I0ogEjxbwgh4mkNgw1aoZV61Ur7l6gxawwnfdvQapMbBHUpfsB+hWBtwGuu6Ub3sw5bTEklyc/5b0IcHmn6COyIDEhYPXQRVZh5WbW1SUsnVuFZID2t9/2kZ2I53/Kuz5oaLbYHeXrLPpB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S-Exchange-CrossTenant-Network-Message-Id: 7ad0b0d5-9fa0-4fac-42a6-08d9df5d658a X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:27.9554 (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: FO3lWNlrXe9kCOCqO19/uox7THlWRtEx7dxY6WvSKUK/b5VyqFwD7Ecv0ViJegXmnuJlyLtayymQ8Kri79WRuua9yUn3IoNIMq6xxkw+bOk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2265 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: VDFE8F0yslpoBefWaOfRROs7ztJQ6ulx X-Proofpoint-ORIG-GUID: VDFE8F0yslpoBefWaOfRROs7ztJQ6ulx 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 26937de..581d217 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 24 17:17: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: 12722557 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 7F888C433F5 for ; Mon, 24 Jan 2022 17:38:37 +0000 (UTC) Received: from localhost ([::1]:41770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC3Ia-0007Mu-A0 for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:38:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yJ-0005jl-WB for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:40 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:5184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yH-0007mI-1f for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:39 -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 20OFvXKZ019284; Mon, 24 Jan 2022 17:17:33 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=tNfozHwmR/eyFA6yN/CTv/X7Sw5cSoD/rsKYGwtU2zXX04lOSeBdUcvsyc/MXwTXkFKZ H7+LYt1ASWmZ3nJiqcmATyfzmwIjKPolq3MbaFfa7pIt73ODY6HPP60bpiXXyHX64U5O fBXFdGWU6a1JNyihQbMrIxryc5mC9ykoY5U6K3L1Bel7TJK1fYn9w5vNNpnEMod9RiIq uaj0Qsl8u65Gpe3n6rfBMpGZ0ElD8CIcfGjyrnCpVk+qBqzcDQQziCEPsu2UHmyaToYF eImlzydR5/gM5eiTwvOCFWkYml/PFIZ/r8cUd5F72SATcd9hKEo3phfvvJnPagdy9iZ/ Mw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy7arbgk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:33 +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 20OHCPLH087617; Mon, 24 Jan 2022 17:17:32 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 3drbckxtre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BtyJoDFZ0OiCl5SFBwX4WUJipgfMQF5bv3Yhghd1iFzT6bSM4CQav/GveAS/JjPiwiHaVzlEPYFubOJpT8eHaG7WZZ18i3g2ykh4Qys5Creq4iwVeomtYNjjoHlothXUdbk75qhh0OSmE+Ve+7QPU/Zf45YPWCg8ICQ/YXia8FXD41/57zoqe9qDOMNyN/iVDTdt6o4Sx896EqIN628AN4+VzXCYtngpuNDmLUvPw6cjeoLxdsKPlrByA8l7fVHiy0mNr+Cr8RNpyYKJ8inFCDe4Gd/WF5yuOt/0blIOOgiC3v0u+byqSYw95M1RRbvW6gMl2pFbzTw4osTxUf4O9g== 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=iJpA9m+5BdUpiIboyIL/d5jdcY0XWH4Mlbwj2nS3kuYvPD7f3EaZTx6c6jUMp3M/ZZ+DpWogYJQPMy4jPKcTEkWTg7TVk6lqDYj+1BVMfWq0jDAXcfbSBcTESOlwCQFBC9JFqWQ97bwjGhGHHVpFEFyDk4quN/K83VugUidvlPgPBKbmP5ks7myIr8DSqZjXoUMyJgD4BAyfAehMqCR4/3VeHZX0MRHwMz4geG5/n4laMt7t/8oP6RrCXyHDev9yCLQ+nzhCK/puHK+D1DHqXrFwyoA16vz2KYh/1bmHAbNbu+BWttS4uf1rsU/Uv3QJnCOQ5F6iu+f8TsaipsN64A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=dKyCXbI1/Y2H8UZLNhxwVhbd30RhaAVdN5JhZfKHZzL4D3SDF8K/uxyzNA/AgYzyYwJXs1kcccemdnhki2oBtG4PEwspoBY21ywZULqIK8vxF+lneMIDQla9/yrQ1QVJ5HJjQdaeahgTpOliVkw5Sj8QSgDsYN0YVh2//lzI4cI= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MN2PR10MB4398.namprd10.prod.outlook.com (2603:10b6:208:1dc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Mon, 24 Jan 2022 17:17:29 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:29 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 09/10] ACPI ERST: bios-tables-test testcase Date: Mon, 24 Jan 2022 12:17:00 -0500 Message-Id: <1643044621-15892-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: 8b0099ca-5dd7-4ea6-66da-08d9df5d667d X-MS-TrafficTypeDiagnostic: MN2PR10MB4398: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: Fkf5fRGzCSjEmJQC+wAV3vbE0wOAE5/p+HXsv68s5P5Z6CrAOaxP/WG/C3P7hYDg3q3YwcVJbToVIaiZlcJwxIC0YFPDnEp1uyudzco4AtHAMtwt8WUOjmlWBDswtCTkBGi92rTkC3QqMxRzumdy4mwwKrGFYzGTbYQMuRIZsxv9R+1+vT+l9g2C6LPkQA2T4+o6r4tnrZKGDyZ0x3ReiNW6BymaV8/h3/+epg6wNWcNh2y3oM4aDQRCs9EtioJivaUeEnYIHihOeGx0TbS5cSaWoSKxYbu+lXKUhQKLQJ9fMbnCbXsnANQLY5hP0uHDbmkRzVMJkEdKVE+5a/4kc+W2Pk6GApPXI+DQ36r7tQIqemc07h25HJPWu0SVZ21/W5N8eKP9XGodDP/5pJx2MZMVg889ZQ/8CRxl1cF5iYCcqdNakrT5DUSUD9pXnTLGq1B2scArrV3/FGXddAEZDvBzEaf+X3LqEwIe8cnS6uXIildQkRJY3k3XLMG+tcR7HcMfq67CUHlyAv7oSHzzTv8/HmEtPG/c4fFKqxQue8H+4eFd7WBHW2gzlENXRVknkHRta0/gR+YBEIdMhoWuO2eo4tg4siaJMF9RL5B1tj4J4P1gUD2TfSEYuIbEbTPJU0E2NHOvvm/Q1eQ3BfZqU5BI2/fVAdBECf8jRQzteSMi0G5kNdhH3RJ2KyiGfMKFokNbJSgED9S8tNrshTGJIA== 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)(2906002)(6486002)(38100700002)(316002)(8676002)(107886003)(86362001)(66556008)(6666004)(38350700002)(66946007)(4326008)(26005)(66476007)(8936002)(6512007)(5660300002)(52116002)(36756003)(2616005)(6916009)(186003)(6506007)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cb1A0SsGIiwjLyTXQIwVIFt7pl/vNRpJBaCYfpyTOnmNZkU4SppRpkiu243mr34qksMo/F/ubnAAmAlU19ZrvEPIiJa1kSCpJT8MU8jG4HcBYwgUU7CTVVbK4UmCXhCzJIty7Z6Ml8GHZmXlYL//HOB69fUyLhkWc+W7Gl3hDftFp9T4uLSQ3M00xnJ4zl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piL8TQYebcOuQBafXhuejjO+L2qT90KF+LRNbClJ9FzzEb4zyWivjPbgwd3FCPR6ZYIQSjwF0m4bEnBVn+C0y0ZnN1MkteWj2IZhSgSNzFVQpRADpuE8KdkV0pS3NJLjIClz6XAK1UKpl1UX7YxWhkBP58vJWWP+4R3JJ5GXDrYziHppKxaVTAI5b4JMp4Q6hb0SabFgrzxKzNlaZbJRaqXpw9fVyhaIeYv6rxmZcuwXYHXU/JsfDwcLrUl4TkBm7rN5WCWrZxE0PY+Ps4ynwcss1q+qvZ3CXad/S05nhzqjngS5tfUkgwPPCe499ORigd42Qa/7XRb56/HGZvwAqgxaSiP70qV83TECbqE8+ItxT3TlzMc+THTHsvHavvCHgIIEl52iBOujnt61S5nz8owICSCQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b0099ca-5dd7-4ea6-66da-08d9df5d667d X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:29.5957 (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: fOYbJjHUUvRkSvnmV7fsIDmayi1R1g9HsyaYnny+TV4X7RkC1Pn8/DC2zZW9N+CaLBHoBfRYZI2KcZmETuS3w+OMKQC7kvhNPwVEJVcXD2c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4398 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=913 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: JxwWKLoQN6wBnBSJB5b766XlT8xo03mu X-Proofpoint-ORIG-GUID: JxwWKLoQN6wBnBSJB5b766XlT8xo03mu 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_H5=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 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) { From patchwork Mon Jan 24 17:17: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: 12722500 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 386DDC433EF for ; Mon, 24 Jan 2022 17:25:58 +0000 (UTC) Received: from localhost ([::1]:45220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC36L-0007AO-2x for qemu-devel@archiver.kernel.org; Mon, 24 Jan 2022 12:25:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yN-0005vK-K3 for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:43 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:44020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2yI-0007mf-AQ for qemu-devel@nongnu.org; Mon, 24 Jan 2022 12:17:43 -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 20OG2k8i001281; Mon, 24 Jan 2022 17:17: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=c4c5KObO7oRBnumMNrHVFFkxX/jmu0e/m34/qfm8GcM=; b=J9B8EHwJpfLlBjn+y5MEyiLj1w94bTIW1LliSHbnxyeHLbNykwEo9plYD8LUPApCWJTg 0LY9oX7hUdooP9MRkp4dmkvxZdTIEdNEpU28+6VwUiOAG8ouITfUfl2PDLNR+U2gPbt0 fSL7lPNHn/5L0pzq4raJDUFBR/XJvUNHB4RMeyGfP8HBiP72jH4q8KTPMVRGTUHpaV32 3R6LFUIXkcOI0KBemzDbWRLljP+PCgGTa9JmNoLQkq2Qd6k72kKI2m1I3dt340Z0fFU2 XM2O/zgHnr688uRSzMART0fqQ67EZaSVmsKr3Ut0HEkf8Mpl4jLsCR5SEcfh3WyOme37 qQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s0amf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:36 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20OHAtnH097571; Mon, 24 Jan 2022 17:17:35 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by userp3030.oracle.com with ESMTP id 3dr71vx4tn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jan 2022 17:17:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RyQw6SD80sPZ8eNsG2bRc61MdqX4lHWheeNoVmBGI4gD+DDcNo1mp7m+e2SgXIWGw5v0bmmqI1clWz8Z6r78GkzYW3gih5mhaEr5RM3r/hFtYWHg7fX9lu1+nFOBcwrLh9ePqk9TTnC9m5gLNHCV3iZDv3+GdcTFXAzfczU9OPAYHBbnXYVYvoGjMnMjklwlRSDHKzRRKjRO2WBtLnuCNeRKHiLhUxz2wrLksA39CxjtXADRtGSIPMnmzm8Q0dll5UhkQJ9q+mFdZrBjMk3met4cRnogtIzZlmyjyVzTVsemEulWcySYM9mtQhG665zl3epsvp1AQj/qUxrU5fuzpg== 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=c4c5KObO7oRBnumMNrHVFFkxX/jmu0e/m34/qfm8GcM=; b=lNVRz9KWQoSMRzd/l29veaZiGkA9JQmRYDZx700edpiD3w0FCSybLqCrx/Yy7XA0s92HMPUMRajw7ESEMFYJe6VBjtv8eFegKEBSLj7O7UjCnlvPGqkUyl1HogdcESvt+fwsUmOzxuHGvx3aNugjtE37MQMq+2q0hnvUmnaZi95fXlfDP34pGwM3u2qYQ2HYdzCh4OTioRKhk98zzAy/20LShNmRPxk+9Y271g/xEXp+skGLu2UEvYCEXwFGmSJBiaJiIhROOe/ELsvJ5nSgRD9mc2F9RlQEPX0vIwUew/phGr/XAA97pvZlt/W1lZRL/feTqEHM5fjSq1W1b3LlnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=c4c5KObO7oRBnumMNrHVFFkxX/jmu0e/m34/qfm8GcM=; b=xQFSYrOddoM88pW5ztb1vMX9w0v2Kwjl6ku4h1dUGRPknYNAatlX3kpxHWAkS+Ex7pH/6pydc9ThoY1Te4+Ff2kFyBH9vXFAX61SsDXKPBXVPcS7vnrHrbF6ov9N50yZvPTFyO8keQo4w6o+maiYSH+guH/5/uCxJ5cdKf4LuVs= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MN2PR10MB4398.namprd10.prod.outlook.com (2603:10b6:208:1dc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Mon, 24 Jan 2022 17:17:31 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::ac06:be4:5723:771c%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:17:31 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v13 10/10] ACPI ERST: step 6 of bios-tables-test.c Date: Mon, 24 Jan 2022 12:17:01 -0500 Message-Id: <1643044621-15892-11-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> References: <1643044621-15892-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0055.namprd04.prod.outlook.com (2603:10b6:806:120::30) 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: fa8f71a8-d8cd-4d46-ae2d-08d9df5d67b5 X-MS-TrafficTypeDiagnostic: MN2PR10MB4398:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:177; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uc3DE+3yo+JcQm/v67MA36cJpmJGgCaMYoB1OUfS8wPcYDZH7K4dV/Gr/vCGmD9VZSD06mq7WE7NngADLtbRXLp+xS8uMICvlG7MHFlTLxI0e2r87MWocKC+2hlZuA2uSoUxHLTwK65qoMZMbHv4ExzXBT4HKgnA52bksC4ESPXrSqz6dltYtwLn1quW7R9QIThGXPNHuKQIOz89ir9FEBrIuKDHGdHWXHLPk0hk7O+OH/3CeEZnqfH8B18Q4Bvw1RPkE/AKGQ0G5HPYDy6KLUhdYnnarQEEK2LC+rjxBPLvMuiWSA6BnWdFu6Z1pBjv7vVn1IOL49vgrkZADKuzY18JU8ONQAaa34WvTEqxyXDbByzSLfjIyr5ClAfoyMPzxzeHGRzFAy78f44J42n38tBLSdpAvcPbnTiwBtuTl7NlsbHRnxkJQ9L92l/QalGZLdCBIYOoz+iPNr5/J9qaVfKDwC3vd1ZUvnlZnfZMoDJidtpe+NC+ZxGu0eIuC7XFcoI/T/IVwlfFKoCnZP/SEm3wc/kJgOT0+/5V3lTbpo+oO6V6EnLU7sAsvtNohQlUCtrELX9S1rOFtFRzxXI3o7PTofDI+qbK0lA+h1tuOXXGsqhepy15+Za/8urQw25SrIf4wi5iaWvxLsyUjP75k/qocFeh7qicC3I90TyN9QprzKqx5njegMo0LP2Gr1HBL8v+v0qIP/EOIpI0QBNtwg== 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)(2906002)(6486002)(30864003)(38100700002)(316002)(8676002)(107886003)(86362001)(66556008)(6666004)(38350700002)(66946007)(4326008)(26005)(66476007)(8936002)(6512007)(5660300002)(52116002)(36756003)(2616005)(6916009)(186003)(6506007)(508600001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +/Va6aQX2LP4kAv19IBliPe3y/hQBwZ/ANkGg9REpiZCkCVu2GySvqIxe/UT7EsHqsnuqb07kNgJGsWWUHI+ukPi4bAHNe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irg+AeRKAU4GBolJ5PrVC6Zr1SNEPsBFdY50CLtICS/nNLlMkqiXpgB/5D4MPHt0BBhkJJxOczc/9JJrYXJpAn7I7oyBFycte1Dbg6Dw6oWasMmBCg2eOi+q6OfcXFKJsQ+ny32uvVMEgVoXNH86VhiZmhThInyfiRihV077JlM2jLLgbIhIVX0n8une1YZFTOdvDlFkfrgUBvBGxJXQ6hHeBsDZfqhIJyuLFiC4ugL6wkPlDhbtWcMSiUbgsKPvc5JOWUFdVKSYPCpav9wZ3WXMTnyrLkseblAnZV35tX7shtd11uB3ch/PZS/l5yXFO80Uuyb7sWWIURtsFL9YLuiXPSDepEVxBa6cXfLX+8ObBq3q9UsFss9KkEnTvZsz4iJYYRZQ6OnAKZTz/uGuFK0AaWnZS3B6GaspdZMO0mw2GRLFt6vuKCxP9DDVUFrZXFy6uFQoqHqfTT/0BqB43ycDw1UIAkvYTvVwX5mM24qcLTRaaMg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa8f71a8-d8cd-4d46-ae2d-08d9df5d67b5 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:17:31.6422 (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: MMSfUGBkD5eLw9gsDY/1gdxIr0AwrB+egkl49EVBFqlwo/iPdSTNgMidy7fSBtXsKWcn0BzeWHPEIx+iqyOvWbt29PkMbcwHd6gRuMJI8Q0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4398 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10237 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=740 adultscore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240115 X-Proofpoint-GUID: uLdI6XsN5El9JRwcYA_ozwczEOYaWr6B X-Proofpoint-ORIG-GUID: uLdI6XsN5El9JRwcYA_ozwczEOYaWr6B 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" Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6. Below is the disassembly of tests/data/acpi/pc/ERST.acpierst. /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180508 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * * Disassembly of tests/data/acpi/pc/ERST.acpierst, Thu Dec 2 13:32:07 2021 * * ACPI Data Table [ERST] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "ERST" [Error Record Serialization Table] [004h 0004 4] Table Length : 00000390 [008h 0008 1] Revision : 01 [009h 0009 1] Checksum : D6 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 4] Serialization Header Length : 00000030 [028h 0040 4] Reserved : 00000000 [02Ch 0044 4] Instruction Entry Count : 0000001B [030h 0048 1] Action : 00 [Begin Write Operation] [031h 0049 1] Instruction : 03 [Write Register Value] [032h 0050 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [033h 0051 1] Reserved : 00 [034h 0052 12] Register Region : [Generic Address Structure] [034h 0052 1] Space ID : 00 [SystemMemory] [035h 0053 1] Bit Width : 20 [036h 0054 1] Bit Offset : 00 [037h 0055 1] Encoded Access Width : 03 [DWord Access:32] [038h 0056 8] Address : 00000000FEBF3000 [040h 0064 8] Value : 0000000000000000 [048h 0072 8] Mask : 00000000000000FF [050h 0080 1] Action : 01 [Begin Read Operation] [051h 0081 1] Instruction : 03 [Write Register Value] [052h 0082 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [053h 0083 1] Reserved : 00 [054h 0084 12] Register Region : [Generic Address Structure] [054h 0084 1] Space ID : 00 [SystemMemory] [055h 0085 1] Bit Width : 20 [056h 0086 1] Bit Offset : 00 [057h 0087 1] Encoded Access Width : 03 [DWord Access:32] [058h 0088 8] Address : 00000000FEBF3000 [060h 0096 8] Value : 0000000000000001 [068h 0104 8] Mask : 00000000000000FF [070h 0112 1] Action : 02 [Begin Clear Operation] [071h 0113 1] Instruction : 03 [Write Register Value] [072h 0114 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [073h 0115 1] Reserved : 00 [074h 0116 12] Register Region : [Generic Address Structure] [074h 0116 1] Space ID : 00 [SystemMemory] [075h 0117 1] Bit Width : 20 [076h 0118 1] Bit Offset : 00 [077h 0119 1] Encoded Access Width : 03 [DWord Access:32] [078h 0120 8] Address : 00000000FEBF3000 [080h 0128 8] Value : 0000000000000002 [088h 0136 8] Mask : 00000000000000FF [090h 0144 1] Action : 03 [End Operation] [091h 0145 1] Instruction : 03 [Write Register Value] [092h 0146 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [093h 0147 1] Reserved : 00 [094h 0148 12] Register Region : [Generic Address Structure] [094h 0148 1] Space ID : 00 [SystemMemory] [095h 0149 1] Bit Width : 20 [096h 0150 1] Bit Offset : 00 [097h 0151 1] Encoded Access Width : 03 [DWord Access:32] [098h 0152 8] Address : 00000000FEBF3000 [0A0h 0160 8] Value : 0000000000000003 [0A8h 0168 8] Mask : 00000000000000FF [0B0h 0176 1] Action : 04 [Set Record Offset] [0B1h 0177 1] Instruction : 02 [Write Register] [0B2h 0178 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0B3h 0179 1] Reserved : 00 [0B4h 0180 12] Register Region : [Generic Address Structure] [0B4h 0180 1] Space ID : 00 [SystemMemory] [0B5h 0181 1] Bit Width : 20 [0B6h 0182 1] Bit Offset : 00 [0B7h 0183 1] Encoded Access Width : 03 [DWord Access:32] [0B8h 0184 8] Address : 00000000FEBF3008 [0C0h 0192 8] Value : 0000000000000000 [0C8h 0200 8] Mask : 00000000FFFFFFFF [0D0h 0208 1] Action : 04 [Set Record Offset] [0D1h 0209 1] Instruction : 03 [Write Register Value] [0D2h 0210 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0D3h 0211 1] Reserved : 00 [0D4h 0212 12] Register Region : [Generic Address Structure] [0D4h 0212 1] Space ID : 00 [SystemMemory] [0D5h 0213 1] Bit Width : 20 [0D6h 0214 1] Bit Offset : 00 [0D7h 0215 1] Encoded Access Width : 03 [DWord Access:32] [0D8h 0216 8] Address : 00000000FEBF3000 [0E0h 0224 8] Value : 0000000000000004 [0E8h 0232 8] Mask : 00000000000000FF [0F0h 0240 1] Action : 05 [Execute Operation] [0F1h 0241 1] Instruction : 03 [Write Register Value] [0F2h 0242 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0F3h 0243 1] Reserved : 00 [0F4h 0244 12] Register Region : [Generic Address Structure] [0F4h 0244 1] Space ID : 00 [SystemMemory] [0F5h 0245 1] Bit Width : 20 [0F6h 0246 1] Bit Offset : 00 [0F7h 0247 1] Encoded Access Width : 03 [DWord Access:32] [0F8h 0248 8] Address : 00000000FEBF3008 [100h 0256 8] Value : 000000000000009C [108h 0264 8] Mask : 00000000000000FF [110h 0272 1] Action : 05 [Execute Operation] [111h 0273 1] Instruction : 03 [Write Register Value] [112h 0274 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [113h 0275 1] Reserved : 00 [114h 0276 12] Register Region : [Generic Address Structure] [114h 0276 1] Space ID : 00 [SystemMemory] [115h 0277 1] Bit Width : 20 [116h 0278 1] Bit Offset : 00 [117h 0279 1] Encoded Access Width : 03 [DWord Access:32] [118h 0280 8] Address : 00000000FEBF3000 [120h 0288 8] Value : 0000000000000005 [128h 0296 8] Mask : 00000000000000FF [130h 0304 1] Action : 06 [Check Busy Status] [131h 0305 1] Instruction : 03 [Write Register Value] [132h 0306 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [133h 0307 1] Reserved : 00 [134h 0308 12] Register Region : [Generic Address Structure] [134h 0308 1] Space ID : 00 [SystemMemory] [135h 0309 1] Bit Width : 20 [136h 0310 1] Bit Offset : 00 [137h 0311 1] Encoded Access Width : 03 [DWord Access:32] [138h 0312 8] Address : 00000000FEBF3000 [140h 0320 8] Value : 0000000000000006 [148h 0328 8] Mask : 00000000000000FF [150h 0336 1] Action : 06 [Check Busy Status] [151h 0337 1] Instruction : 01 [Read Register Value] [152h 0338 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [153h 0339 1] Reserved : 00 [154h 0340 12] Register Region : [Generic Address Structure] [154h 0340 1] Space ID : 00 [SystemMemory] [155h 0341 1] Bit Width : 20 [156h 0342 1] Bit Offset : 00 [157h 0343 1] Encoded Access Width : 03 [DWord Access:32] [158h 0344 8] Address : 00000000FEBF3008 [160h 0352 8] Value : 0000000000000001 [168h 0360 8] Mask : 00000000000000FF [170h 0368 1] Action : 07 [Get Command Status] [171h 0369 1] Instruction : 03 [Write Register Value] [172h 0370 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [173h 0371 1] Reserved : 00 [174h 0372 12] Register Region : [Generic Address Structure] [174h 0372 1] Space ID : 00 [SystemMemory] [175h 0373 1] Bit Width : 20 [176h 0374 1] Bit Offset : 00 [177h 0375 1] Encoded Access Width : 03 [DWord Access:32] [178h 0376 8] Address : 00000000FEBF3000 [180h 0384 8] Value : 0000000000000007 [188h 0392 8] Mask : 00000000000000FF [190h 0400 1] Action : 07 [Get Command Status] [191h 0401 1] Instruction : 00 [Read Register] [192h 0402 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [193h 0403 1] Reserved : 00 [194h 0404 12] Register Region : [Generic Address Structure] [194h 0404 1] Space ID : 00 [SystemMemory] [195h 0405 1] Bit Width : 20 [196h 0406 1] Bit Offset : 00 [197h 0407 1] Encoded Access Width : 03 [DWord Access:32] [198h 0408 8] Address : 00000000FEBF3008 [1A0h 0416 8] Value : 0000000000000000 [1A8h 0424 8] Mask : 00000000000000FF [1B0h 0432 1] Action : 08 [Get Record Identifier] [1B1h 0433 1] Instruction : 03 [Write Register Value] [1B2h 0434 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1B3h 0435 1] Reserved : 00 [1B4h 0436 12] Register Region : [Generic Address Structure] [1B4h 0436 1] Space ID : 00 [SystemMemory] [1B5h 0437 1] Bit Width : 20 [1B6h 0438 1] Bit Offset : 00 [1B7h 0439 1] Encoded Access Width : 03 [DWord Access:32] [1B8h 0440 8] Address : 00000000FEBF3000 [1C0h 0448 8] Value : 0000000000000008 [1C8h 0456 8] Mask : 00000000000000FF [1D0h 0464 1] Action : 08 [Get Record Identifier] [1D1h 0465 1] Instruction : 00 [Read Register] [1D2h 0466 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1D3h 0467 1] Reserved : 00 [1D4h 0468 12] Register Region : [Generic Address Structure] [1D4h 0468 1] Space ID : 00 [SystemMemory] [1D5h 0469 1] Bit Width : 40 [1D6h 0470 1] Bit Offset : 00 [1D7h 0471 1] Encoded Access Width : 04 [QWord Access:64] [1D8h 0472 8] Address : 00000000FEBF3008 [1E0h 0480 8] Value : 0000000000000000 [1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF [1F0h 0496 1] Action : 09 [Set Record Identifier] [1F1h 0497 1] Instruction : 02 [Write Register] [1F2h 0498 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1F3h 0499 1] Reserved : 00 [1F4h 0500 12] Register Region : [Generic Address Structure] [1F4h 0500 1] Space ID : 00 [SystemMemory] [1F5h 0501 1] Bit Width : 40 [1F6h 0502 1] Bit Offset : 00 [1F7h 0503 1] Encoded Access Width : 04 [QWord Access:64] [1F8h 0504 8] Address : 00000000FEBF3008 [200h 0512 8] Value : 0000000000000000 [208h 0520 8] Mask : FFFFFFFFFFFFFFFF [210h 0528 1] Action : 09 [Set Record Identifier] [211h 0529 1] Instruction : 03 [Write Register Value] [212h 0530 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [213h 0531 1] Reserved : 00 [214h 0532 12] Register Region : [Generic Address Structure] [214h 0532 1] Space ID : 00 [SystemMemory] [215h 0533 1] Bit Width : 20 [216h 0534 1] Bit Offset : 00 [217h 0535 1] Encoded Access Width : 03 [DWord Access:32] [218h 0536 8] Address : 00000000FEBF3000 [220h 0544 8] Value : 0000000000000009 [228h 0552 8] Mask : 00000000000000FF [230h 0560 1] Action : 0A [Get Record Count] [231h 0561 1] Instruction : 03 [Write Register Value] [232h 0562 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [233h 0563 1] Reserved : 00 [234h 0564 12] Register Region : [Generic Address Structure] [234h 0564 1] Space ID : 00 [SystemMemory] [235h 0565 1] Bit Width : 20 [236h 0566 1] Bit Offset : 00 [237h 0567 1] Encoded Access Width : 03 [DWord Access:32] [238h 0568 8] Address : 00000000FEBF3000 [240h 0576 8] Value : 000000000000000A [248h 0584 8] Mask : 00000000000000FF [250h 0592 1] Action : 0A [Get Record Count] [251h 0593 1] Instruction : 00 [Read Register] [252h 0594 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [253h 0595 1] Reserved : 00 [254h 0596 12] Register Region : [Generic Address Structure] [254h 0596 1] Space ID : 00 [SystemMemory] [255h 0597 1] Bit Width : 20 [256h 0598 1] Bit Offset : 00 [257h 0599 1] Encoded Access Width : 03 [DWord Access:32] [258h 0600 8] Address : 00000000FEBF3008 [260h 0608 8] Value : 0000000000000000 [268h 0616 8] Mask : 00000000FFFFFFFF [270h 0624 1] Action : 0B [Begin Dummy Write] [271h 0625 1] Instruction : 03 [Write Register Value] [272h 0626 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [273h 0627 1] Reserved : 00 [274h 0628 12] Register Region : [Generic Address Structure] [274h 0628 1] Space ID : 00 [SystemMemory] [275h 0629 1] Bit Width : 20 [276h 0630 1] Bit Offset : 00 [277h 0631 1] Encoded Access Width : 03 [DWord Access:32] [278h 0632 8] Address : 00000000FEBF3000 [280h 0640 8] Value : 000000000000000B [288h 0648 8] Mask : 00000000000000FF [290h 0656 1] Action : 0D [Get Error Address Range] [291h 0657 1] Instruction : 03 [Write Register Value] [292h 0658 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [293h 0659 1] Reserved : 00 [294h 0660 12] Register Region : [Generic Address Structure] [294h 0660 1] Space ID : 00 [SystemMemory] [295h 0661 1] Bit Width : 20 [296h 0662 1] Bit Offset : 00 [297h 0663 1] Encoded Access Width : 03 [DWord Access:32] [298h 0664 8] Address : 00000000FEBF3000 [2A0h 0672 8] Value : 000000000000000D [2A8h 0680 8] Mask : 00000000000000FF [2B0h 0688 1] Action : 0D [Get Error Address Range] [2B1h 0689 1] Instruction : 00 [Read Register] [2B2h 0690 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2B3h 0691 1] Reserved : 00 [2B4h 0692 12] Register Region : [Generic Address Structure] [2B4h 0692 1] Space ID : 00 [SystemMemory] [2B5h 0693 1] Bit Width : 40 [2B6h 0694 1] Bit Offset : 00 [2B7h 0695 1] Encoded Access Width : 04 [QWord Access:64] [2B8h 0696 8] Address : 00000000FEBF3008 [2C0h 0704 8] Value : 0000000000000000 [2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF [2D0h 0720 1] Action : 0E [Get Error Address Length] [2D1h 0721 1] Instruction : 03 [Write Register Value] [2D2h 0722 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2D3h 0723 1] Reserved : 00 [2D4h 0724 12] Register Region : [Generic Address Structure] [2D4h 0724 1] Space ID : 00 [SystemMemory] [2D5h 0725 1] Bit Width : 20 [2D6h 0726 1] Bit Offset : 00 [2D7h 0727 1] Encoded Access Width : 03 [DWord Access:32] [2D8h 0728 8] Address : 00000000FEBF3000 [2E0h 0736 8] Value : 000000000000000E [2E8h 0744 8] Mask : 00000000000000FF [2F0h 0752 1] Action : 0E [Get Error Address Length] [2F1h 0753 1] Instruction : 00 [Read Register] [2F2h 0754 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2F3h 0755 1] Reserved : 00 [2F4h 0756 12] Register Region : [Generic Address Structure] [2F4h 0756 1] Space ID : 00 [SystemMemory] [2F5h 0757 1] Bit Width : 40 [2F6h 0758 1] Bit Offset : 00 [2F7h 0759 1] Encoded Access Width : 04 [QWord Access:64] [2F8h 0760 8] Address : 00000000FEBF3008 [300h 0768 8] Value : 0000000000000000 [308h 0776 8] Mask : 00000000FFFFFFFF [310h 0784 1] Action : 0F [Get Error Attributes] [311h 0785 1] Instruction : 03 [Write Register Value] [312h 0786 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [313h 0787 1] Reserved : 00 [314h 0788 12] Register Region : [Generic Address Structure] [314h 0788 1] Space ID : 00 [SystemMemory] [315h 0789 1] Bit Width : 20 [316h 0790 1] Bit Offset : 00 [317h 0791 1] Encoded Access Width : 03 [DWord Access:32] [318h 0792 8] Address : 00000000FEBF3000 [320h 0800 8] Value : 000000000000000F [328h 0808 8] Mask : 00000000000000FF [330h 0816 1] Action : 0F [Get Error Attributes] [331h 0817 1] Instruction : 00 [Read Register] [332h 0818 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [333h 0819 1] Reserved : 00 [334h 0820 12] Register Region : [Generic Address Structure] [334h 0820 1] Space ID : 00 [SystemMemory] [335h 0821 1] Bit Width : 20 [336h 0822 1] Bit Offset : 00 [337h 0823 1] Encoded Access Width : 03 [DWord Access:32] [338h 0824 8] Address : 00000000FEBF3008 [340h 0832 8] Value : 0000000000000000 [348h 0840 8] Mask : 00000000FFFFFFFF [350h 0848 1] Action : 10 [Execute Timings] [351h 0849 1] Instruction : 03 [Write Register Value] [352h 0850 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [353h 0851 1] Reserved : 00 [354h 0852 12] Register Region : [Generic Address Structure] [354h 0852 1] Space ID : 00 [SystemMemory] [355h 0853 1] Bit Width : 20 [356h 0854 1] Bit Offset : 00 [357h 0855 1] Encoded Access Width : 03 [DWord Access:32] [358h 0856 8] Address : 00000000FEBF3000 [360h 0864 8] Value : 0000000000000010 [368h 0872 8] Mask : 00000000000000FF [370h 0880 1] Action : 10 [Execute Timings] [371h 0881 1] Instruction : 00 [Read Register] [372h 0882 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [373h 0883 1] Reserved : 00 [374h 0884 12] Register Region : [Generic Address Structure] [374h 0884 1] Space ID : 00 [SystemMemory] [375h 0885 1] Bit Width : 40 [376h 0886 1] Bit Offset : 00 [377h 0887 1] Encoded Access Width : 04 [QWord Access:64] [378h 0888 8] Address : 00000000FEBF3008 [380h 0896 8] Value : 0000000000000000 [388h 0904 8] Mask : FFFFFFFFFFFFFFFF Raw Table Data: Length 912 (0x390) Note that the contents of tests/data/q35/ERST.acpierst and tests/data/microvm/ERST.pcie are the same except for differences due to assigned base address. Files tests/data/pc/DSDT.acpierst and tests/data/acpi/q35/DSDT.acpierst are new files (and are included as a result of 'make check' process). Rather than provide the entire content, I am providing the differences between pc/DSDT and pc/DSDT.acpierst, and the difference between q35/DSDT and q35/DSDT.acpierst, with an explanation to follow. diff pc/DSDT pc/DSDT.acpierst: @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/pc/DSDT, Thu Dec 2 10:10:13 2021 + * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Dec 2 12:59:36 2021 * * Original Table Header: * Signature "DSDT" - * Length 0x00001772 (6002) + * Length 0x00001751 (5969) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x9E + * Checksum 0x95 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Device (S18) { - Name (_SUN, 0x03) // _SUN: Slot User Number Name (_ADR, 0x00030000) // _ADR: Address - Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device - { - PCEJ (BSEL, _SUN) - } - + Name (ASUN, 0x03) Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method { - Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN)) + Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN)) } } @@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Method (DVNT, 2, NotSerialized) { - If ((Arg0 & 0x08)) - { - Notify (S18, Arg1) - } - If ((Arg0 & 0x10)) { Notify (S20, Arg1) diff q35/DSDT and q35/DSDT.acpierst: @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/q35/DSDT, Thu Dec 2 10:10:13 2021 + * Disassembly of tests/data/acpi/q35/DSDT.acpierst, Thu Dec 2 12:59:36 2021 * * Original Table Header: * Signature "DSDT" - * Length 0x00002061 (8289) + * Length 0x00002072 (8306) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0xFA + * Checksum 0x9A * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -3278,6 +3278,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " } } + Device (S10) + { + Name (_ADR, 0x00020000) // _ADR: Address + } + Method (PCNT, 0, NotSerialized) { } For both pc and q35, there is but a small difference between this DSDT.acpierst and the corresponding DSDT. In both cases, the changes occur under the hiearchy: Scope (\_SB) { Scope (PCI0) { which leads me to believe that the change to the DSDT was needed due to the introduction of the ERST PCI device. And is explained in detail by Ani Sinha: I have convinced myself of the changes we see in the DSDT tables. On i440fx side, we are adding a non-hotpluggable pci device on slot 3. So the changes we see are basically replacing an empty hotpluggable slot on the pci root port with a non-hotplugggable device. On q35, bsel on pcie root bus is not set (its not hotpluggable bus), so the change basically adds the address enumeration for the device. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- tests/data/acpi/microvm/ERST.pcie | Bin 0 -> 912 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 0 -> 5969 bytes tests/data/acpi/pc/ERST.acpierst | Bin 0 -> 912 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 0 -> 8306 bytes tests/data/acpi/q35/ERST.acpierst | Bin 0 -> 912 bytes tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- 6 files changed, 5 deletions(-) diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a6d0cb783831ebc18972ec57bb6c624438ff150d 100644 GIT binary patch literal 912 zcmaKoTMmLS5Jd;doACJehb6cK12OSWBYwCn7ocm^-rA|;CUz1YmosPDa=fm$hY?9$ z^LaU~(|o@yldVKV@Q&x+UZ@>zwpS)GZ(sO?Lc}v64j-jFC7yn9;D$INO8pFiUB7f+ zf49KN&wPvW+;jDxe>nP4Iq`z#7tC?s&HniOCHcA!tc6i7Z+t&KoWCN!@(t>{e2`4% zZhiFB_p5lnFb*Ui&1&BGpsO$pT3_)pk?J?$-jLiezjJ$6`=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S87Q`#ts;JTa>Png~+QvKOAg( z=l%H)^?9Gb?Lui47fY7Bv8_MKSPiRTs@3YkU)Q{@YvnKAT;;J8U>fgQ>9qeF0+gJ! zS_V9pumOy9sSU)%^lS1X17&Pw`o1`MA>W^ePI^H@E*S%`|HOx^c$lLHVkhwcpCba771jDZ#SdZmhM`3K=q{% zNdudV5*`|Tn?lmSM!~R<_iYsI+Q3HPu(0YhlR~GImZVAKI~h z+O@D02|KpVC?DEYlCeYxd&-j!?Kerrtt;#;Pd>DJ8RM1`cI=OKE&Yg{vc{!8uv6Z~ u5j$m$OK@OMk$l8{6J=Z)1AB{Pv}@<7F~|QN>AydkHSF$IS^vS{(*FTuhT2R3 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/pc/ERST.acpierst b/tests/data/acpi/pc/ERST.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7965ac2562e7b23bf1dc2caaf00ef66453c4f47a 100644 GIT binary patch literal 912 zcmaKoOAdlC6h$9Upg{N}4xO+BmS7+z&NSk{Ww`+N;?C6GO0l^KeF>#Er>E`f@jBlg ziAb~?&(mq{$NOdKO+_MtIsSwBP(BS` zh6Ua)#A*M6_AiN-%#j24ugI^+uZh>pkpuT{$ZyEEIpDYCx8&O#=&vKcBj4u0`Con^ B!2tjO literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/DSDT.acpierst b/tests/data/acpi/q35/DSDT.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cad26e3f0c27a40a33101155a5282ed9bcb1d441 100644 GIT binary patch literal 8306 zcmb7JOKcm*8J^`!tL0K!Qk3OaY{E(UN|8`@UTx8!W+{ zr+@MJrMD_~fBw&3-hS0e0dO9FP5iwO(II>Q|7$G zoVF=c*370~>q(Ucw2`X*UeoWjna$X}Z?i1bzv)oC^kS{!mHe(ZC>5U_1icE2s3nZ3 zY5U#Ka>9}Q$uMNYFgqR}u+hRN!)^AvZJYi3f9V5uU@eNi<*kJe=czCEzGW%K(3|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9TeaHFJgMyi|5*8Nm5IsXzNQv{a2e+ZW|787=D||1vS!-|MF*;9ZZ04#xcG6Co z-r~+i`ZC|zYozHe_V=?vxh(dKF(f|<%Fl}ccg$cg<6zZe*tEpSd3kbyPWmvO)tCru Lf)z9L%&`9h*%QBN literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/ERST.acpierst b/tests/data/acpi/q35/ERST.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7965ac2562e7b23bf1dc2caaf00ef66453c4f47a 100644 GIT binary patch literal 912 zcmaKoOAdlC6h$9Upg{N}4xO+BmS7+z&NSk{Ww`+N;?C6GO0l^KeF>#Er>E`f@jBlg ziAb~?&(mq{$NOdKO+_MtIsSwBP(BS` zh6Ua)#A*M6_AiN-%#j24ugI^+uZh>pkpuT{$ZyEEIpDYCx8&O#=&vKcBj4u0`Con^ B!2tjO literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 603db07..dfb8523 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,6 +1 @@ /* 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",