From patchwork Wed Jan 26 16:28:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725440 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 1C0DBC28CF5 for ; Wed, 26 Jan 2022 16:34:43 +0000 (UTC) Received: from localhost ([::1]:42216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClFq-0004SJ-0b for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:34:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAE-0005zN-Ml for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:54 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:16768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAD-00031f-2m for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:54 -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 20QFod7N024352; Wed, 26 Jan 2022 16:28:50 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=OcSEaLREzN7KfQ4FLEdP2iSVunSFgv/szECVc+AOFH8e2jdvw0CHoVae1meujRfPZMaT jJkEx0v2WeVqw8h8jTecZ9yhVhsGWDbG3INU7buFjZ3BMUB7JH6L0zqRIJBkA12Ypi56 aubnGF7XYHqEaeo+NIrS0o1uCBtSI7QF2XsOM9L8dXhNf/ld40WYYbdgVFfsrj31KH6F 1EVnfzHoMENEsYkZclffRifJMFM5E2XK/lKPSZrH96I/fY+Igvcgh2474YlQanzzNtHL GSk4eRu5SPxRb7Byoi3Pgzymhek7OTzN0W8T6GZRfQCry9l9sx8e9RyOet8bD1lj6blG eg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s6g5n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:50 +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 20QGAWIl153457; Wed, 26 Jan 2022 16:28:49 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2040.outbound.protection.outlook.com [104.47.73.40]) by userp3020.oracle.com with ESMTP id 3drbcrey3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hA5BT2CHiHNkKpUsc/vB7XaUVGUek/xyNMNiHy5rGKoYNvIgGYSDv5x8raSOEPPKFY4Gs/j/jRVmrzTO3pMG6czM16nX6D1fD6ujag2oee9qTrZHIG/O5X3Ub1nc5JLi9wdkWVWOA8MnxSq3hL8qtBMnEyJ3upWjZqG0DZHO2ZA9STsSK41KIQ03gS/JDVy4annneQZ1T1tK5sM7DkBrSqK2XlBf0zBPaCLbhzyTx85Mo3MuHfi2u52m+4LYgVOd1TQ34/CsyM5iszYILKnbS7t1g4Q/UlQCLlS7rTzd5WZklUguJCUfsw6BQ7HsWjLYgk2ASKmnmBEpcU7DkZdx/A== 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=oBPiacKNhj9gAMNi/CSr8J8unzZkEkpUI4rsf3gjnrawPXvsvcSLvDqfQDvr7LeH1BFNi1Owy3Pqphs8TkeiiSP8JgBNlVouxId/Ov36z9uD8X57Qoz0jzS1M5BQFKkvH4CA7Nhudkh7PkjFeauvTeTJKzDjaenOrQtxjFM71HdsBTNytOUvI/4wXhPmUc0mKhnBYn7CgjotBc+xZDC3Ka387fQy26r2cMnvnGoE7Y1q5u9PmQL97vHgjZCgdiYyAYGPEQpYl/KMDI5up4gscC3p2wapwBAY19ljKeU7C1AeHJaNdCNlZBeoA5O6BePdf2Dnk8WB7liOA1mQIRk9ug== 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=o8uIlZKoj6kqjS7NHHnppBBLAg89NkScfvfG5BdGM3m/onJi5RlE4AnWRwwJyC+flRX19xldjK9kB/D9cWrhAp2tgOfWw8N0c6+Nj9+he90fkX78iIJ3grfmrmjCf1sBsf2+llyrYVSrMLiKCryVo39ByjYFZT/Ph1WJXFShMD0= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by BN6PR10MB1858.namprd10.prod.outlook.com (2603:10b6:404:fc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.13; Wed, 26 Jan 2022 16:28:47 +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.4930.017; Wed, 26 Jan 2022 16:28:47 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Wed, 26 Jan 2022 11:28:25 -0500 Message-Id: <1643214514-2839-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 2ca16239-9ca8-40f6-c9be-08d9e0e8ed4b X-MS-TrafficTypeDiagnostic: BN6PR10MB1858: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: 3b+5n+L2jjoZR9F0hqVVZ2xdL4WsFXVzF9h1qsZALjRTGCDo1mdtKtfrapdxTPIpj5gjG49hPrdki5uiFhJ/MZh2J2V7kLiJPAcArmdchuC4vRufCDgtu9h5EcKytC5hFDXSdnqveu2NB+tY6jDIWI8KSWo0PC/UpFb1ETI3aIa2lOAbFjD6oXTUov+4DFnTrNqNygz7Rxe/Qa6t8c3wLc+5hWPP16KpMKuJWdRFKs5K5pPkGBaaoyUC1lvqP5PDSez84CVr0BLhlaFIm8QqmVS0YGVov7XbtMuCmGmtRqURVgqV43CgjnpFFYTHlvBOtt77WwY7i4oj4luv9kcOkGcjfnrB5zFojlZJGiGh6PXfT1Q876By7NG6UYrdeyizZMti6yHnlIESfnLtN6gxnpeNLLHkVthEWiVY6ebGfi/1h2ymfBVrT3olynS4EAPzduT/42kGYx4WtfdKaRA7h4jEtbDOoODYD0SH2OHps+C7sDn25phuhLuCWFi/5qlJh/IkzjUq9/M1t5SjRqDTOnFx09qrPYP93SNPP8wvHqJzx/jPS63sCNeuHyTfSWIepeIskHvOQ2Y85b3c32HHCMyaF2gWU7ZDuvEBmPW/cv/c5MIoRlqzw0uD9otLURVKyvt4LaeI+wNHxDBVAL6YTFLH7uGbfPa03+Dnr6Zx8z8K2Ldbl4v6W0nYKSZxCOoZhmRt1b/sK2GhR95QhHmQVw== 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)(4326008)(2906002)(6512007)(26005)(2616005)(36756003)(316002)(38350700002)(38100700002)(5660300002)(8936002)(6486002)(66946007)(6506007)(66476007)(6666004)(66556008)(508600001)(86362001)(186003)(8676002)(52116002)(6916009)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XcsEkLs+k0v83qWAqpjsV3zvsqzCGQqCZTzhjkXWUS4Li29iS/jxCR5rTJ+Mb7F5epkb2BTdKYK0Fr5564QA4lS+MWixE2+EHY04p9nzERCnxXHz1ysp02MWLQfkadOugLEz8aab0kumLk7O9IclU6BE4NKu059HYJpEe08UVmJLHkvPQVT60ocEoYE4Y7rXf73PN3bIjoOqNcyws6rbJN+v0y4+Ec64ecxyvS7+dgzN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CYYqgmqyZOm5j7qC3HxoQXQSPFXGd+nEKZJ+Qj5onWGeDq+odRwFxr38l+lldbn+MBEyC85AzzrW8hf+ydBc6ptBXGNvRGS8nbEQzMz7qc8TP6gyJ+pqNME02OsQ0LXa16K0R5bNpSgOn2cB5XPbjIqdAJTHbEf+2wFghpwJaVaXj0cSgcwVCnKwD4qy9D3oCToWi5FEn+lYeyT22ZNqBu/fHnJMkpLCz4ury77bUMS45efF7QtBN8hEeOetiH+N9v1VAmDAQpDfgucg8ig/Q+okSRnplQMyhJtNd5i7IZzzTL/+J/R0fjHmMaX7DzzeMS3qXDKpiUJTlxX6lQDe2Njmcgj4Ak3kkK33NTC1g+nEGjY089NTkwnHPwg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca16239-9ca8-40f6-c9be-08d9e0e8ed4b X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:46.9555 (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: ygqMfJWgje9MHpoClTf1FyqX/4jeGIdDuQ8Sh4oEI4EnEKMGRb5SswZcRlu1jpLHQI3JFqe1GrejIqRNXY6DMubTSf55+2buCg7aMiMup/Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1858 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 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-2201260102 X-Proofpoint-GUID: fMrZ91D7JNZXVHT2NAJc93ai8j0xXQkG X-Proofpoint-ORIG-GUID: fMrZ91D7JNZXVHT2NAJc93ai8j0xXQkG 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 Wed Jan 26 16:28:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725441 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 0CE34C28CF5 for ; Wed, 26 Jan 2022 16:36:11 +0000 (UTC) Received: from localhost ([::1]:43474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClHF-0005Hx-UF for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:36:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAG-000638-SR for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:57 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:21556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAE-00032L-JU for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:56 -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 20QFosRv022417; Wed, 26 Jan 2022 16:28:53 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=Px6iohd6/GeVl2wZmwUBx/P/pj3AzHmJvCc5TQ97mKDBP35JhDNdIyfJ9qJYmRRX77CO IEPMDZ4NqybpJVS8lRD5Ow3aafXG6yGrUGGd7UYBEZz2IBvQpnHzSZoVTedgkBymMXox GW0QW0AQ4dj8DXQsbqxe6mgLfTwWgSpMbhq48o1T5W0XBu87R/OUxRuYh8kUOTqd+KvT uXOGl12b0KMP7iO0uxkSBnffvm+YNJRWpyaeHuskgf2m6PaZCkUoYFn0QDtMiMo2vprS uOpVlTR1bhcFQ45EjY9RO+YlTZcoMNapiBX7KVHS7MSnbjy0PDWo473AojrYwRcuvyPA +A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3qk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:52 +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 20QGB3UP148885; Wed, 26 Jan 2022 16:28:51 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by userp3030.oracle.com with ESMTP id 3dr721gta6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9opWwT5/cV9pr2mfa6MqCUfWOPAwANkkRNxekuFO4LXovRn0m5fTNlgIrOHY/C7E0y1i7t4rMKje0HJZLK4H3px8KRa1FuXLDKMdiS84UcLX+Ft7DcbYQLnv/H2vPtKdAlQQnLlfsF8xJc9ZW/p6dXRPSpOxGfSWKhl6QxXblqUgVrD/AJTz80kAt9XYFFAtC22KxoRkgRejR6dEB+OasG0BwOKEbMr4fVvw+gnsbMCsq4AJ5+XqpspUntQILHBS1moexbVfVM5nZLUJNWYH241ZB2aZdx0HHruxc/m9quF4wLD2v+hHkw8mbS+zT0gRx1+aGUVnXNm4ex2FTOKJw== 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=BklnvDSMmtFPisRH8EjB2cYBunBj6nH+mpqckrPWoZ53P99C96VM5VuJAKnmTm7JRFe3gHMuao+CJyxMbRLyM6NzK+MU6/Xf+hOGdOlP1Jdeuq1HtL4DVQctsYGfNiJ3FVliaQ6NtyJS+O/suIpIDw8yJfkECoawel+DNBe6crbrB7liBGkxEuMT8CFVHYb+2Px9uVIHn3GOyWv0O0cW5ItbPvjupV41lGN9AAzzkgmX5oYn5TGX5Req7OMczAGqmkyy2NipgKEjJmvPjwCJ+QHZN77SQxL0w5AK91a8NIQJxU7a52GFObWA3IWn1saj8S2IJv9DjynL07UwKoU8PA== 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=JO8jmKQvn9KWvaWH4CUlp1VewrU7EzeLPmLqEU1OimRHJesd6T+42+Xo4S/U+jo8hHTZvZ0HrOsNYJZKgr4ufD3Xy4HT1tAt33YApj3alK5YGov12eobu9lyxhaqnY5F3iX3pqD1eE8tFkM/oU04Cqk/oXfVzR44AnimelWPycs= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by BN6PR10MB1571.namprd10.prod.outlook.com (2603:10b6:404:48::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:48 +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.4930.017; Wed, 26 Jan 2022 16:28:48 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 02/10] ACPI ERST: specification for ERST support Date: Wed, 26 Jan 2022 11:28:26 -0500 Message-Id: <1643214514-2839-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: b767afe7-d1f7-451e-8fc9-08d9e0e8ee5b X-MS-TrafficTypeDiagnostic: BN6PR10MB1571: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: mBAFuHyX6t0eQN9h6vJfUBqnWevsrj8Gqyqdqn9yM6JZP7Vohu1F97bb+gBJWSe0s8Iu6vikwUR55PuAauwR84a8caUk4C7JeYI7XPXpPq44WYSmau3UX5t852VnWdNtjor7LldamlJtzxq7RGnLefagws2PqAHIyv/Ju0Kmd3vQFR44XbfvZhIsAYEw9TzkN4foIJlRPOrirAVhNSSF6C2QGzZNUKzQygIt0XP5tC+yg2KJK4yKGVnNgtBa0Il1C1JCsQR/L2Gh/9QP8+bNntXpA9tfKDOkONay+NzV6xnGYp19flTxJJRyKZDnrjjN82iRQfx35U1TRdCjHQe6KmKXgZq5WOcmPgU9jz6aSsLjuZP3DpqllleNRCQ4GiwrsyCnyyWojUWLXxmEM5hiVdaI/H755zZ57ps4OJ167Z7u7u1OmRyfRmsUuToXD+yeiAsPyBLiQ1hUurcOjG9vkUjcjnbOejfZ1Feznr75epAO7k964VeklqDC+RXrh6FBYRB5MMS17rsuIOck9UjcNts9DYpHnGoxXlM6r8aDvBx3I/XIyaVdhO5j3tOoKcCkomnhCWP7FW8OsDfsPp1b9K5dAcZZJ6xrtigKSsOn/Yc8z1wLz8tcNmEze0hXufnV+Ld353sS0slwRmmQlTeoecMHuT/8/0nGVhK6dGDRo+LVxtSjRnKWcsRtAIt/S09Ta0ZSDdgSAwPsRTx0qOoLbg== 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:(13230001)(366004)(6512007)(66946007)(2616005)(6486002)(36756003)(2906002)(52116002)(6506007)(45080400002)(508600001)(5660300002)(6666004)(66556008)(4326008)(8676002)(8936002)(6916009)(26005)(107886003)(316002)(66476007)(83380400001)(186003)(38100700002)(38350700002)(86362001)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T/6EAqoLe1Wd50jD2IdfjBtQoqxrUvoT4EdW0gKBmW1ET/v5KeDlJ7mRiNCSNLe2vYQQwBM9zjk5swc6x68qM/Aaim1n7fF9VEFHTlYpfnI2Z2CVjVCTqJlBFvVUkAcvrMHCy0Ih65on2f9/CpQtHGIWXHPAo3aY/VAjXdN2aUxouAQgNs7XosqkKCRVFiPMsN2XATmVBHPo0C5BnAgUW8MoH7yDx7WPQlQSJt0MRca8YFlxgv3iy5IKrpOg7NtJX1YMgRia+xNH2+Y8inEFDU4baODhgAG39xAx1QL3rJOuzxssJpb/cIlgRZpXNyt2TygYcc0sIBdOX40iDh8/aUv1FgoOOOrHygsTgAE2mgKCvnHgD3V3zUbCep7ul5vJWQrqs+NCQ2FpZEwCYSJ8Qt25I+xdvOUUYkEBq0rdjZvW+H9uaduhUCO74BZZAp38XH+9jThL7O9ipbQNy6RdQb2Qil8sT/wrVR/jQg3245ACbUNsmt9v2K420gZuMDUA2LuaVG9EDc+K4YWDU/5gBAKOdDMwu1VX/FdXJCsBs3ho4WTk9JVD19ecNOxG1VxaHFudqiyBtqyQ4OmFmStAcGp0nkzq4PGe+2BoHAkGKh4QjDdjFN0L/bg1savlHpwp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-Id: b767afe7-d1f7-451e-8fc9-08d9e0e8ee5b X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:48.7210 (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: 331/tnzqseRxRoSkAzfBVXdIdZjlJczxY54a6sLy65Iz+pgjTq+VEAjf525+0Dz7k/O2t0sclaBMVbExBzHgZLoI0AmR4k/BxvhFs3yK4zI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1571 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=363 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-2201260102 X-Proofpoint-GUID: gChkKXEV9kQJG77s1WBRDx90izFqhYKD X-Proofpoint-ORIG-GUID: gChkKXEV9kQJG77s1WBRDx90izFqhYKD 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 Wed Jan 26 16:28:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725435 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 F3740C3526D for ; Wed, 26 Jan 2022 16:31:48 +0000 (UTC) Received: from localhost ([::1]:35694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClD1-0008Ua-Om for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:31:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAG-00062e-LT for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:56 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:21852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAE-00032N-Pl for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:28:56 -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 20QFotfB022427; Wed, 26 Jan 2022 16:28:53 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=gWy0yHc4EsC4IczbC9aGMtwSxNy0YOHQ0VHtUpOAnhjL2MsZFiRhIsZcMc2ZPK/SmNBU ltIkSHjP2ZsOaAYkuiZpwQ1Ttvjp15GF+VGmrmiw6o1u0FcwYQVIeHpjHOKgDOnG5BzX u6O4PPv1rN00igkCl1hn/Qrx/sxBAJjrM9uc7C3SV4Hw2FG1lyr7ZTg43XEWkvv7BErC vD2r7CJrOXAEMaIQinsRv5bLz6u13FwR8faPZCUt0YO3BKa4lxNiAZhaeVxYnXhBwtLo ivmRgW/1d5HP9cddnmlBH+Nd6eLgZsFoC3kbLWNIysCul57+AgAHMAVkj+nmjyn6HWu7 6w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:53 +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 20QGB3UQ148885; Wed, 26 Jan 2022 16:28:52 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by userp3030.oracle.com with ESMTP id 3dr721gta6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jng6p0l4EO/P+1wKjvKfWtt6AXRIDd1c/vUxsye3wwXRPGS6jDIIAqpopDGrYQdsisxgi82CUpcIbbWw+vfwuETlS32YuEsh/eOaOcUhxkSE4fLSxvPo+01px5m2RAK8azni8yEAbe2A4g46l1X4exJFD4M070+dml9/bKpJvRMP5H0zGi8B8V1cgNTqrhCKJt5MSqAbLwmbBbxxzNpdFsD5BbG8hGyV14Aq6zffJvi+C6VRg4A4ddQTCAsyhrkh60DhQDGNO9IsIGg8ZpF40v+jDqQa5ZCAHnNfuIb6cxZAmNLtk419uGy5VffdksGpRFgKEzR3hZmvzmhshnd2PQ== 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=g8JnyXboflcllXO+/2xkT/3r3xyycRFylF7ZshaBYNOMTg51UdjUzPu8QfRN+UvbBWxBY38FZu1tBuOybnOTgZrTpK4T6vwRQrAoTRsrXfr0yzwkzFybo2sfY7qtn7lbawYrXBReeon/32JXILwwO7SIFUKqIstcO5fv0Q2cYr7JBq9L+GyY9U7E5Gjt2AvMX2z+tVFyLEpSudk67Ri956uzA0VHEIo+qOUFaRaeNs/YPB6zf/wpp57Nf9dRXldpEIMbYwbd29xKyqoZNIgoMkaygjcfGMsAr3iEev1alf96Zqt3YDXb8iTChSE1/CGLL7mZ37A8uklFjv6VaBx4RA== 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=jJPQF5sdjAMaWDUxTONqkVKRHhSRCk3fFXkONhNjbJrlHibHlsIuBSqxfxAnG6PNPCrF8at7bhJxA8JT/IPTq/ByYHB2ihIlv6TyZk5h7QY3R7iyCA67swbQl1m+pQb5NXFpcYp6fFrwhjj/f967RoSOp707kjV/ye0n86iM4e4= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by BN6PR10MB1571.namprd10.prod.outlook.com (2603:10b6:404:48::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:50 +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.4930.017; Wed, 26 Jan 2022 16:28:50 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 03/10] ACPI ERST: PCI device_id for ERST Date: Wed, 26 Jan 2022 11:28:27 -0500 Message-Id: <1643214514-2839-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 5db1ba0c-e908-4f30-6b17-08d9e0e8ef58 X-MS-TrafficTypeDiagnostic: BN6PR10MB1571: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: Z7jVp2PDb8VTqr2P4twiPUdiS3sYdv0LwH9ukN0dF+nferAsHIHC0yJ3RMvtZ+LqKYFd97HfxNKK3pePuz6Alp9YdiMYY3doAcIekxJCiBo92F6RD8o6KbYhRPxc/HID2I8x0lWrvpaVbpuV/RusC0kEypZXcVQiLelgRwZyxR1QlNojaTwMjwJP/B1CdiCNLmcU34b19u+uXf9e/+rnS5amV/MrVIuA8XUhca6atoFFmasE8tE27iQkkgzniel/Xe1GZD4rDYU49Rph8cVI5wiGe/BND29rI8bwdX3KDbe1IavSZZOZkLgWfqqfvyM+zoOxl4F0I6BAhHtVst0YeWXCqMMemCj6fKv9AtDFLML3Au8kMdMuhwhZlRvJSmHz5+0Y53eVefZcjScyczpnUdvQYCpTPL9K9IHkuLenaU8T2oSqPey7Dzw2IKBxjoYKhDWVJxSygn3pom+R+tHfBg+B0a7JgR3ev4MZqSdhwfUfetTqoM6cjhzly1tu+vrX/Sl6q72jjRjc4Pwct0lp1afqSuiptXAPAPRR8nW/wKFgVwZrKVbRv0jkoX0mBaKOTgM8J+oacALQjduvz0A/ih70WNbGVN9lZSu0aoypnNLWvYtCKLPRyA3aXkYJXKjjioIYxx7cpghOlTaV0WAWvZ1/2BugcMjF8mgeoPWh1jiCKC/K3YN+SakI5jhq8SxzgBUII1XILzf1L7x3yRO8Lw== 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:(13230001)(366004)(4744005)(6512007)(66946007)(2616005)(6486002)(36756003)(2906002)(52116002)(6506007)(508600001)(5660300002)(6666004)(66556008)(4326008)(8676002)(8936002)(6916009)(26005)(107886003)(316002)(66476007)(186003)(38100700002)(38350700002)(86362001)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ny8iAhJMHPxWXPgtycPiEjn2tNBxVkPxiFUu9G5iBH0mPaGZRmtE0Wllkclg+6WvGYlplqs9Pnh73PtqvUAn3y4TmtOs+C4MN8raSdNx/1FaGER/L5aQ6B8rnTODdL2iL65YxnFVFHUKsXlB2XXDsj2+9Iivl9GiHRlE64i5XkEbmia8udxInKTS74TpmEKQyWDe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aMW85uNiAvUzcOAYLyknctYlzsQ1H80HqjnG+e3/ww2forvw/IWNAdhmqz+XVIuKTaPxoSX6ffuFRpvqcRq3NFoI1tPRrRReD2gcTTSJePFNAROtyDW1YiNgUxiUp6BewYRrVCoy0tRnT1qtdzPtloM3HD0/Zos2ebjUK2GAfx+0BuFBU2NNeAM8Ub0Ga9e6IQTsPJZzGtq04DvZKu5s/w+QcWp8jCgZUgFu9dHSOr+10nPXu3wA/RaFV+qfQP/8IlBkUz8LXcxumLIp98oRawKSFAZq3aA1tTjz1+FoG1heWwk5cgnJWKqKIlct1VwZokG863igfRObQmfw/3buqBH3CztJ4u4zxC4AtrCx4CdZgcvaPHWVvGk7Iau3j18Y1RLIoXYS0PguIFQH3fskNRb/GCKDRkdDOctI3Tr1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5db1ba0c-e908-4f30-6b17-08d9e0e8ef58 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:50.3641 (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: NVEzhxFVz4eH3D9Zjt6bnPw2ziMEK2EQnRQmuFavVtyHxcqbm4Xb2sxsDcXsu3pti6uxSHA8m5YUTzDM+461PFhzLsgm+iPIs+H/SU1ba/g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1571 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=928 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-2201260102 X-Proofpoint-GUID: OZCZbRtPezsUh15YYF3F7LO7ah1lAsWP X-Proofpoint-ORIG-GUID: OZCZbRtPezsUh15YYF3F7LO7ah1lAsWP 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 Wed Jan 26 16:28:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725449 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 3D1D0C28CF5 for ; Wed, 26 Jan 2022 16:38:34 +0000 (UTC) Received: from localhost ([::1]:46850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClJZ-0007hX-7k for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:38:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAK-00069Z-Lm for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:05 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:29454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAJ-00033S-1Z for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:00 -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 20QFon0c028822; Wed, 26 Jan 2022 16:28:57 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=EgXHMBHiYaf5xBaD1xMt0/gHgbeuaToeyaaX/arcrPn1OnVb+lCm2wBrazrlhuo/6lzI T1LAT4dMvEmGVh5zdmkr11A/Hb1kMANDWBgc0AFlPgG40SVOYMi+KqdiBSe7LfufDWNY ucp0Wysrjf5VRWMcihJlAyU64hE4Ld33/I15rQCCGTHf26p9dQzQKJOMyh73+G11ekPa j4PkXnqkpW347qrIysHsY5ICAd4PUSAy71Bh8eHUXKpQFKLSAP5GCFGIi7iNJKuvAI1U l9d5UKrJB7RRHIrTF48OPeODV9Km4uaaAtIS8cJ5iYA8bX4A1yibIU92oVJXaA4+GnVx FA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsxaaej16-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:56 +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 20QGBLVD033512; Wed, 26 Jan 2022 16:28:54 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by aserp3030.oracle.com with ESMTP id 3dr7yj2fgy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i42mS9dKNhMbJRyUD+iSAwaKhin6Je8v583cEibQck+b0xFsnOVA73U7T7QLwTPjjFyj98Lmhj6s2fpfdMiKEu2c1kvbOnNKAXE1gJz0v1LAMKhbXwOpXKYpxd+rmsmHUr/n9KHyDOhaNKhOMpZVdVY/NK49FWscp/dmUfabwMxxhEonebXh2/nffEmpOwiKK9utWQXXokHfRHExDh/aHbKu2QxaHRaMguh3lcuFspfPzqAZgRkYXLeRBuhh3UCaRB18PSDmPmqbrJ7/FLhfZkCRgMSwGwxSjEl6xaKH4xE7vODfwmPtvxR9i3FNp33RxuwUhvE5hqka/ajea6VtwQ== 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=CHmH4kNflZriIcr6kxiox0VmAwfYanGHBrtABHQtFAqsrSy1d/rCH3k6gCwD5Jc8IOfMhl1mya5OslFCVDoaPyqkCc8EaYhv6vFfmwEOIBU7jd/g2TBTQP2oWfKqr9goGMH6l3+UIr/tKLJQ2UV9P/O3x5uxlUmX/rL7hC16YypJ7evXjQf7AQde7jWD3oTQFgKLyNNfdJZLNxeec5oQBvLPpTsGKg116je/1xGehpG6dmNTdn02Dbk7yZkVGme3HJsoapZsORjRIV16bqzlLobuGI3uwZoof2EdN9F+/gQG75g/Zc234VK0lYxnCHPYMNfdt78CmqoEoVNfNlyZ8Q== 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=MCb4DOne8NE8/xlgFKqaArZULM4/E3fhNYrg5VNYFx4CpbTkTYFpJvJTF8Ep75PbtsT01KIlWORNlOJGNji7NOaMMiQPh24h/FCfHgKsMru3fnCz5Hst1UcSKQ8q2jxf4jl4cGqbv2w+u1CRGWMrlclvMuFwQeR6T4DMQHK1ihc= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by BN6PR10MB1571.namprd10.prod.outlook.com (2603:10b6:404:48::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:52 +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.4930.017; Wed, 26 Jan 2022 16:28:52 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 04/10] ACPI ERST: header file for ERST Date: Wed, 26 Jan 2022 11:28:28 -0500 Message-Id: <1643214514-2839-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 2595358a-fa9d-468a-d024-08d9e0e8f082 X-MS-TrafficTypeDiagnostic: BN6PR10MB1571: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: lialu7Fi1gyz3vqHuCDa/ivKkRbfnwX0aS68w0bu/jg/Bg56+Olbhj9q+tcj0uWRwThiwv8p0weHaXyepe4TRkCBqbc5FESvhv/ElRooQXcgbAJ5NH4FT4M8MBV8bHa2IOdxY37JsTpDyu2acBzX06PqbgB0uDTOvfE2Op6yzHH4CXnhzRkzD5A8dB+26sNFYv+48WkHqmkuO/tZhj4tnj1CdDxKIoh47sJDDqZE0SD1pesr+itVOGQDG3/TdPvdzQIkL4I3HxeqSthy+3J1C8H3+5QIMN+8dqeox6Lo0ZjQPyfR3CcwPHeC+/2yLfzgWQ2REAXPPIt7ewwrQaDf6HFbk9Ehhv8WzyyzK+emtcGs/OOTRMoGGpBZiao8cddLgrgW4eWJ0SC/7PTRc2nVf7p/kBmSPqJLBYelN0ZrsEU5ROJFwqOSlewPn58ZDU2f9LfzHpGtw1/oHWCPq0HTFu1hMGlQG2BJk4r8V3J2l2iYUJowojPXNR6JJFrFya/BcjxyqldIxs6KMMNujzN6npKWR5rQltYW+4bzUXA9S2yUdzEitUJFKYGrvuxWizWPJ7KC5oZYHA5jpzom21v+9CW3brhyJGMVLIKG+MmyXX6YzDmM3hGbDh1O7RAoxvEL4YZ7JWEpBBn1rFcifftvzOwR3yLpzf70p91QuHsej55kMiWus54rhCNWP1wloI4PVDt3uTr4MkmZJPQ5e5XwmA== 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:(13230001)(366004)(4744005)(6512007)(66946007)(2616005)(6486002)(36756003)(2906002)(52116002)(6506007)(508600001)(5660300002)(6666004)(66556008)(4326008)(8676002)(8936002)(6916009)(26005)(107886003)(316002)(66476007)(186003)(38100700002)(38350700002)(86362001)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pHD0t6v/Vai6YaGIU9KSvmkZwBPlWZyk5xzikhMcOvkIuGooLqeGp368zLFqmgej7H24b3lAtplJCajvdwHLO1NwB0eHI/eET/QcfFhpbtcw/XJT385V7NnXzcVV47e0kpTWPd4mF/W1rTI7Fez8BPKhsunEUwD3lyKv5FIX0wGTuxweb4vzRlRrds7apMW47wYqZKaTzSVYB99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LA/b4fOgyRm9S2ZXCthY4Rp2utyiULpXKM1GjsDyuQjV+Fm602Ft/q6Wxn1twHNqVp5Rd4WkCLl2hFCw06OG05gFD9RQv36QlhDY9y+KI7ufoEEePr7CwrtlkHWBr4NXpaNU9sT5FK4o2SrQ8uXWXP3abtFK7vO2n0m4zICeKlnOy45nUhTE53ZfldU40As2SnnLr1RfWCFcfFIgXww7/kfNVhzjlVdx5lCIRPDkeQqNBej3Tsv+xEX0ay9Pj6vc3tVeJxyUUut62SWJ2bbo0llmtE+N1+HLxJaCXc5dVAON7skcSxyo3bxlGZtvr5vN8nDsKbiamowHzvaSg+7ShysYxARxjEWX6tu6dgAnZiME+oWwyL58hnT+1TWSxsQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2595358a-fa9d-468a-d024-08d9e0e8f082 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:52.3493 (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: 3zzen3isAAUumr9T0YrZ7Hq0BtlntXS+ZqVOIIM1OKDnvSR34lLHAN9zqzR8Qk+kEV4HCNvenMxckGC6nkcWef7avdT1WE8+GtyUWJ5hHeI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1571 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 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-2201260102 X-Proofpoint-GUID: eO5RmcXKy63q_8Hrz2Ovlu7JRgVa-cpU X-Proofpoint-ORIG-GUID: eO5RmcXKy63q_8Hrz2Ovlu7JRgVa-cpU 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 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 Wed Jan 26 16:28:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725452 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 036DFC2BA4C for ; Wed, 26 Jan 2022 16:42:58 +0000 (UTC) Received: from localhost ([::1]:53846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClNp-0004Ed-T7 for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:42:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAR-0006DT-Gk for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:07 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:32116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAK-00034D-Em for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:07 -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 20QFosYe022414; Wed, 26 Jan 2022 16:28:59 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=ptfJj5MDd0UIOm/l1yfcbgxrtCfzdY5BEnfZXBRpVDnkCKu6FbNVunTDglQcq4+PLMDm 9DwKMTJr/3GGn+NaxX/GEIyalGgnDstCxYyxNkl+PxsWh4tbceVQ0/M1hP7GuTpLdW69 AQHpL+3CcLFRahSMUI6ZRCiIZ4+HpvIcZefaO4P4aLzwq786r64tZx1lZhyoMUiDVNKB 5k34cZOdEe4hnoCpOyLrgK0ioe2sg9NSejyIyHw4u5Au5xsJzx04BBhlYDZEJii+Mzkq MZhNxcOX424VjYGL9LqfhjLMzmma5NLnGo+LGv3JD+Haj1kXENFWhfgL/5TOVu1VRiqc rQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3r7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:58 +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 20QGAnAt183810; Wed, 26 Jan 2022 16:28:58 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by aserp3020.oracle.com with ESMTP id 3dtax8qprr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DfCAchx3yorehplIKtq7RwjiKTCjBPDDb3faWYk+/2tKetC7FauoGQ/UY6jNB0u8+vLKeugsNwNSY1fPYpoXJMRr9W8YneyAJTBgqk/CyYyqaUDVkAWE4XrGQD9w8sG2w4d/R2coHf+hFExeIkxHaa4dvA19WYrMPEgq6a1+uuyIFT5ssrfFWbzT5fd33STY+wGdypXH8/zMPgOJ32yJIC3T/xSEqCtuXfOLYOJaChMdW9vjSWKmeeZYJq3LYgbPb1SN04lAVNMOLLs3KzNs0/4rOjpWGUWTKFJVUBodqOF17UGR5Hb/MVIHKsHfdi64zOiFkyTCDJbqm1ytMiAfEQ== 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=ZKyqdFX2687FGpul1n4P5Nn9iiIvBqkJsjRXYZFfNRrdUb103EjBOeuHLe1duBosq2vSGH3MxD1HNPidOv7iVnEfR1zn618k5ugxrdSZcvWNhEZvfjmTW7mu0ja3sbnbAHzMkysXvXMOZ83zV1hl8hGk5pJ+Bu7gEVha+NwMz4XMaG/k1RjZP2dK1JwbHazvPh+kT1aDZTZk4AlXoh8ZLmmNLYPNHeIX5Pjgx4EGEM0fC6jar6o4wOCUU9ZgmsM7q6hrTlt4x5u1tMoxrvDv3ECQtFrwp0HoDMxwEtemlS+vR2EdXB8crb4eNKCZqIeOvnTigMuCDj/6XjXsqyhYkQ== 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=nBzckJTvJTSY9sPbgsjUk1zEAt1ZVVd/BtURraIu2FNKidD/K8M8f+2ce2xMq+uwE4r2tAvLY+ANYcNh2wVvkEuk49EBk6UH0FxAo0rIk+EznoUq897oc1p+Me2c8e03QQDmNUYa5alWnaBjMwVo+MexdRtiaDg0iHBQggiPA3s= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:54 +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.4930.017; Wed, 26 Jan 2022 16:28:54 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 05/10] ACPI ERST: support for ACPI ERST feature Date: Wed, 26 Jan 2022 11:28:29 -0500 Message-Id: <1643214514-2839-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 9d3e201c-5398-4d32-5ae5-08d9e0e8f197 X-MS-TrafficTypeDiagnostic: CO1PR10MB4450: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: wAZOPNc24za5Y+4l+ZkNA3rj+4Fw1yOhc57KkS1/Fmv0rppM1+4Dek/5/Rm8w5aE23DRcKcUd3ZINo51uxs1TLWd9CgrvIxbRnD0MZHpsCphPlqoZshhtda5UKosFe6hlTvZwhoTx+u5EKUpndYTu5bsUH1117h60bCpkzzMtqELbzCn7EE1WqyBKE1S51c/smXJshmUqdX+s1dG9lzBcoB4iH4MUJVjvgux0qI5QsjQUeJ0W7BK6xF8kCLUIL8VvmezyHYJXA2DtNc5J+C83Lg6A9dhzOMAsdVqwK5HcS/dz6GjoM9+q4tEF+oUOXA00e7lXLwgKUtnkNsfSxECOFjTYp/UyRXigLPLp0db4bJwoLgvXZoWP/5li7IUmVSQZsqXZztgDB8DtG32VpvGP88byFTYJ9ckgaXoqaDZ+pMPLVfjr833krQF8Y9CqdWOWR1aQ7QHGdd5DukNDdXR7QKGavueg1IGZu6RNK2eiUyK27BP5kLfRwx6mu00Q3ONEV0v1ZEePAzN5mSxjHcbzRciKTRQR3085MU2IGYdXhwgjDhxMLlnrOJ4YVkeRjfcp4XnRYZIdUHEylGXRCSd2dsQ290VOs9PlPD0r3yzaWqa6c93onc7s3NFWDVSBmlOVMEbiof2DcW9gzNwzTb/HvP0G0mGoksumf6T3WZdpGNRGXfP7CyyGp0d67Q59P+K 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:(13230001)(366004)(30864003)(6486002)(83380400001)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a1qPWW4+681mEA5a76EKHpVQOr5YE0VyRDW2pXtkCHKMNdGyYwHITdFrPAp2O52xhwNi5VL4XY8IBl4ylqu1xO8Y1yDw053m+bxThmidFbu3kJpYdUjIPpHS0To4j80/XaYC4WhYBsMQpZN/yHAUZK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rH5R4GdI0kffVBwHxjPgRGjGl/hJvAB3/36ERRbSBHy34wDLb4sBe6/yE0nT2uuNnCQlHfYsvxeNdBykVic4GC336MQyBso6GRxjgRve/7ZdvGbChjexpvgCnmEB+SD8MJIZrPZeewoaCbsLfJZSx8alrM07Gq+n/Hjcx2eYVT29+G1eK3Qach39j8pNIBGcpiatfnGz9LVbqfYBfrU72SAnn4pnfE+kadblIqz7q+363sBj8nAGpvCI5h+HU56weB/wp8PXAVwAAyl+nlI9SyMiSaTowhDI8F8HPf+AwoRxAddlZPV0V3oBo/ud1B6LAhdf+Z0v3XZeaWAYf1Ng1SPNdHGrA8RlHJwxQze9l882lrcpaoknp24UcgH9LVyj8gMO88mTk26ELZr6lCAzo5n558xm6izWuSZishO8e0DbgVv4NUT5VhQcZo06+Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d3e201c-5398-4d32-5ae5-08d9e0e8f197 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:54.1460 (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: mhopqX1RH/a6M2xhfN5G0HnwiYJDb9FKXSWSHlmA9GWQE2vZl7VpX56qiluH0f+PpM3KAMwIh+Li8tun/UyhaOw07BQJEWJ2wr1EAOhThHo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260102 X-Proofpoint-GUID: L1WEbIuH2cNPnajFHuGDeYMgpeRxA82v X-Proofpoint-ORIG-GUID: L1WEbIuH2cNPnajFHuGDeYMgpeRxA82v 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 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 Wed Jan 26 16:28:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725451 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 81085C28CF5 for ; Wed, 26 Jan 2022 16:39:55 +0000 (UTC) Received: from localhost ([::1]:50818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClKs-0001yI-KQ for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:39:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAR-0006DU-HW for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:07 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:33522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAN-00034V-SS for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:07 -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 20QFotfG022427; Wed, 26 Jan 2022 16:28:59 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=Jynh+DagfBJTrcsVSkQtjNR0NYsSruAMsPsuay60iQ0=; b=X4yx6QR+5FWH0j3MU80WY4o/Fk4FbObygFPxM3Q4RtzsnT//eOr6uzK1cxZxwEmNQyIn Fq+oQENogavfowg9l7DZviRb3/TE/vfFWmU7JRO2Q0S8kYjYKzrCaA3FYdStqLiKGCqe 6zwCiksWYzdEa1xQMgpI+39m/2281SKZ88WX9zGLLEmWdzKW2R71k/3jxNfMr7/n22dj Pjz+cMCrESwu1sja7RiXpq1Fj3P0DBzgQWkkw9Lh0mrF8S9Wqus+QsQlJxrE4lC1SsEI 3ibgGWbjjX58jP9tw6cmHmflz2NvL6wn4X77rhrrzllexzAO3s2x3UCXaaCuXyzSaxl1 fw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3r9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:59 +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 20QGAnAu183810; Wed, 26 Jan 2022 16:28:58 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by aserp3020.oracle.com with ESMTP id 3dtax8qprr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TMz07fComcZpGjQUJnBP7ZmYyXziDXIB47aJ9udRPMuAlFoO7PGRXe3+dCrjPogaV4zsS6RDIPiEtliTcSu2b2rWdRSZoE6YHqHrPNtwgPKSGlzgA3cNKH9wcmRV4qLAB/UCw4sWoHdWXpVp5gXQzB5G+z2TRNCXX0WTlnoD9v4PFcO6Ml8Yn3l2EqjkNMApWTE2S4d+0OgD/Q/C8GoN6c7CGih/awLgXH0CUy3N4IgeqKZ/0fhiR+Xh7ZEiRAvwNYtGKUl8FdeBfbe+7AD8hupbgnuplPdZgtCeOLhBXM/EIeB8z9kGhg70DsKRhQca9Q63oRmwcFmUYYG7dDO1ew== 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=Jynh+DagfBJTrcsVSkQtjNR0NYsSruAMsPsuay60iQ0=; b=WGeDhYZ4858iS4P7zIqYHKfKbpuzaYAsoD0fXpf2C+AbdKuRZSZA20fyKGRxR5AdS9XKjuaci7WAOnTIAJjXUe/vAbZC9ye1Bo0etqoDGdMKMQF6Cjpjd2b3/4X+vAvHXBi8fDdjUj2CC2rCG4ep8BSk5L2aSAh6MoTH51uuz7n4j1n0GsHmILPF1GpWwNaUad2GzLzfc1O2ywD2cSEGwLJesyYi+/IWvLrzDzkZ5Ww4vWNFUiTi2keUmH4A/mndichEcjyN2ytAnq7K8m6EofXBj+PiY+PHleAl/PrJ0cub8SCGuK50hDEgS83Zowj2Oe+ZQ8Eb2AFDsjY8g+3KfA== 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=Jynh+DagfBJTrcsVSkQtjNR0NYsSruAMsPsuay60iQ0=; b=rHMmVfLlb1rJp75D5Hk02tRznY4jLiDYU3ivAsF8jsrxT3xiRYh25PXTOK/Mq0HDVKEn0EydqD6lzgz1KDR8IQ02UhYx32xX7eXXDTyVa2hs4iRhjZxN1hPtn6tKisrEr8utt+J18OY6S7sO4poHZEvTG9EIBM03kyiFXd6RuYg= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:56 +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.4930.017; Wed, 26 Jan 2022 16:28:55 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 06/10] ACPI ERST: build the ACPI ERST table Date: Wed, 26 Jan 2022 11:28:30 -0500 Message-Id: <1643214514-2839-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 720ad8be-7939-4034-b93f-08d9e0e8f2a2 X-MS-TrafficTypeDiagnostic: CO1PR10MB4450:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gZhUhHh3ZWSkdihBvDjpeCv0LJKnKyHa3TG0xZLTJDCs3S/dumycz8qScrJVR41MDZnvDyVvMqX3KXWIZLbHpUcf206t2u44AqGl7h6snMy+zsOd8K257wrSWPJYJ53asuuyGNqAaXMZXw4hWgXDYrP9MWdWsfYqsrdxoDaGs9BdPAYdRPq5koyBmy0SqjAzDM83oc9MZKgRYGz00tltVJtEpOKFHRsTlKstyJIxSZLuQY6E8Ng2iuBbUnq9T6LoWuleKU5seeKYTCsYx3lPWyywDDzfmHQPR8u1BG3EKGv0wEoKGLW5NfXZyYQtMSZfvjdkdu6TkL7h00rY5kg3htNM5n2xhuS6Ng5aMZ04lJfjOMRcbueqbm6ychy7VRwO2Ki3vE3xrcTI0+tIWKpwWOWy6c5VYKPUrX3+jjRvKICu/XcEhTbD8sjgWWFXf9wboxz2KzUBq/OsNZ7UW4uZ1HVQW66s0sCojSKZStwUV81ErV0sTymEQ7lfFJ2cNbN6GdSRcPK1liVuUUWDqngrNpqbzI+2ST8RdVfvGIruvveCgRumjZ5YrE7RaKyubHh2OLWEznzgjzSOSptojZ8KdA/s9lkjBwfSfxNgFBWvv4WekACQGiIAnH1M0o+f9c4qmb2ws50wGLH1NYH/VrDFhI6/VojkdnnUx85wxYDghK0ipOVnyDPpHm6fjvEf8gb/ZdfWrGr589q3a5OF8kXRQQ== 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:(13230001)(366004)(6486002)(83380400001)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eAHR7wcJSWDLxdeR2SIuBHglvSamzbr/QO+oKvpw58OAOL8fvRSn0UF4hW/fsmu8q941Cb2a6QBjpT1LkJ6pSmMddEtNbBaHcD5vkBpzEFbPlJ5n0xCgDufYJv9AVC81BVHonXamP+I198INQvMgvwq7KsISLoq+I0jIMT/riPszhjKFNqgXwBZXUl51r+mPwVIEAeW5HAbctNfahGWCw3NTvpHnkJumSE60gB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02Rpms+w7cXITO8XkKPP6OkXJaacbXvJwxYfa5/N6NmuceYWnDhxts/jJ6nUy173Yj5/mGu8Gl+IpUD0EtF6Mx1TrUq4ny070FYKfEG8USE+rMOt/mou9O/ePbh/vCTvTFiuVlhf//GiFXXwQcciiCXj/+Kqz+pS4qFEEGskZOApx7fNNxOxce0RuOvgdnVoh/NxSC64krGMvGLaLKqQT/BAUqXM+nk/zWWfMOi/aNyadcyzftCc0tzj4+ZYIlkfhYTCDdCX9ag484iYAUlMoA/OqLKEK+tJ67djHTingShifxHa4vrvsSyl0OV2zYEfNAKbHJqukzWyt9NdX30TWl7seVbMx/PkTAwgvY8k4Ec8bZDwuxm/3CaqGQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 720ad8be-7939-4034-b93f-08d9e0e8f2a2 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:55.8826 (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: LFgIWVmH01/JyAjHwAZxsOdjcdZp1FWaFT4Rfb/93ttFUAuj7u7fXNv8wLdYDK84Dh+3iPwajSfTWtNRqz1hfzezb+XHjIwnkcDt0L00F6E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=955 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260102 X-Proofpoint-GUID: yA_DetnjiFqNOafRGYf_HJkZgAWOuRN7 X-Proofpoint-ORIG-GUID: yA_DetnjiFqNOafRGYf_HJkZgAWOuRN7 Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/acpi/erst.c | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index fe9ba51..5d5a639 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,210 @@ typedef struct { /*******************************************************************/ /*******************************************************************/ +typedef struct { + GArray *table_data; + pcibus_t bar; + uint8_t instruction; + uint8_t flags; + uint8_t register_bit_width; + pcibus_t register_offset; +} BuildSerializationInstructionEntry; + +/* ACPI 4.0: 17.4.1.2 Serialization Instruction Entries */ +static void build_serialization_instruction( + BuildSerializationInstructionEntry *e, + uint8_t serialization_action, + uint64_t value) +{ + /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */ + struct AcpiGenericAddress gas; + uint64_t mask; + + /* Serialization Action */ + build_append_int_noprefix(e->table_data, serialization_action, 1); + /* Instruction */ + build_append_int_noprefix(e->table_data, e->instruction, 1); + /* Flags */ + build_append_int_noprefix(e->table_data, e->flags, 1); + /* Reserved */ + build_append_int_noprefix(e->table_data, 0, 1); + /* Register Region */ + gas.space_id = AML_SYSTEM_MEMORY; + gas.bit_width = e->register_bit_width; + gas.bit_offset = 0; + gas.access_width = ctz32(e->register_bit_width) - 2; + gas.address = (uint64_t)(e->bar + e->register_offset); + build_append_gas_from_struct(e->table_data, &gas); + /* Value */ + build_append_int_noprefix(e->table_data, value, 8); + /* Mask */ + mask = (1ULL << (e->register_bit_width - 1) << 1) - 1; + build_append_int_noprefix(e->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) +{ + /* + * 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. + */ + GArray *table_instruction_data = g_array_new(FALSE, FALSE, sizeof(char)); + 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 }; + /* Contexts for the different ways ACTION and VALUE are accessed */ + BuildSerializationInstructionEntry rd_value_32_val = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_READ_REGISTER_VALUE, + .flags = 0, + .register_bit_width = 32, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry rd_value_32 = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_READ_REGISTER, + .flags = 0, + .register_bit_width = 32, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry rd_value_64 = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_READ_REGISTER, + .flags = 0, + .register_bit_width = 64, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry wr_value_32_val = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_WRITE_REGISTER_VALUE, + .flags = 0, + .register_bit_width = 32, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry wr_value_32 = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_WRITE_REGISTER, + .flags = 0, + .register_bit_width = 32, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry wr_value_64 = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_WRITE_REGISTER, + .flags = 0, + .register_bit_width = 64, + .register_offset = ERST_VALUE_OFFSET, + }; + BuildSerializationInstructionEntry wr_action = { + .table_data = table_instruction_data, + .bar = bar0, + .instruction = INST_WRITE_REGISTER_VALUE, + .flags = 0, + .register_bit_width = 32, + .register_offset = ERST_ACTION_OFFSET, + }; + unsigned action; + + trace_acpi_erst_pci_bar_0(bar0); + + /* Serialization Instruction Entries */ + action = ACTION_BEGIN_WRITE_OPERATION; + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_BEGIN_READ_OPERATION; + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_BEGIN_CLEAR_OPERATION; + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_END_OPERATION; + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_SET_RECORD_OFFSET; + build_serialization_instruction(&wr_value_32, action, 0); + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_EXECUTE_OPERATION; + build_serialization_instruction(&wr_value_32_val, action, + ERST_EXECUTE_OPERATION_MAGIC); + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_CHECK_BUSY_STATUS; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_32_val, action, 0x01); + + action = ACTION_GET_COMMAND_STATUS; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_32, action, 0); + + action = ACTION_GET_RECORD_IDENTIFIER; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_64, action, 0); + + action = ACTION_SET_RECORD_IDENTIFIER; + build_serialization_instruction(&wr_value_64, action, 0); + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_GET_RECORD_COUNT; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_32, action, 0); + + action = ACTION_BEGIN_DUMMY_WRITE_OPERATION; + build_serialization_instruction(&wr_action, action, action); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_64, action, 0); + + action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_64, action, 0); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_32, action, 0); + + action = ACTION_GET_EXECUTE_OPERATION_TIMINGS; + build_serialization_instruction(&wr_action, action, action); + build_serialization_instruction(&rd_value_64, action, 0); + + /* 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 Wed Jan 26 16:28:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725442 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 32B54C2BA4C for ; Wed, 26 Jan 2022 16:36:12 +0000 (UTC) Received: from localhost ([::1]:43504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClHH-0005JG-5S for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:36:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAT-0006Hv-7T for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:09 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:34336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAN-00034Z-SZ for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:08 -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 20QFosUP022408; Wed, 26 Jan 2022 16:29:00 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=pfxB+VcIR29m0kDhwbS75MnrFcCajGGeGLUlra3zisWlSGR3PC96Cbfe71bE/6DoIvmr ShHu76BRXnm6ZjSwW8bxuIihjBxqN4jvrJqT0ENrVrszdWhmnMTWP7kEM6R+1oS3/+7Q XSAzg3+MbT2XjAs9rMFuB+WYPSfEGFMiQD+zpjR5cOmvm+UOVnS1MurRYmzjXNEua1GS pOuzWyB9Qa+Y8xaB2uNV9pGxHSsUIKwcnQS3GuTO1CcIDEsfC9o3CFbaeHMUjLwV1jIw fwzncHigmgSvZUpaN3T89Qd2+oJCZmLKv2IiuLI8CH3EtvRrAkBoPj/OrSTF01ofrpJS Zw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3rc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:00 +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 20QGAnAv183810; Wed, 26 Jan 2022 16:28:59 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by aserp3020.oracle.com with ESMTP id 3dtax8qprr-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:28:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kaHOnmP/cE+uSDi8wEQM9kLszddoh3NDWU8g8rcyNS58hi6RqrhOrCigaS2q231h+thRnxHKjw5PAW7o/koWvMh99MugXsRcx+2XLHkh3VNfTUdn1Jk1pYMnPFHAVg53khn4W0WCih+Usobvv4LO+fv6QnkXOoqbn3EZHv46tcP4Z64Vx7sd4wpAnGvB+SCosX4tuLl8+0HFSoXEKgUjHgsmglOt1nEuAGHHqYg3KgK1Hu611Zp0rcElRMJC29/XPQY1To/oZOa4mACPjyeA42TGJijKEZj/Z8tolT0w9nvzdtF2Mbh61fBasdNaw33SyUf4R1iaf+5bpeMRA1AUBA== 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=SYDhtk2550OicEIdV4lXJL7qC1LYE+m5TmVw1zjXH9pIHP9e92MxaaqZIdB6eBbBc2BZQO1UTK4Kb2uNdwq3QPOBMAwNDMhAYlVAGAbimn0X+7Hq/Z61r4JgMu1UV+ku0GU23RYw0t4chHRRA1CCVYwbGhLngAdvJFX9GSUusCGbDfLJggBuolSCohsZZjz2WeyxcHWSg1gFUPQarOy9X6iQS8CYmpc+fT5+h4ZLLmTIrfvEhPyVkDJEOdxVb4TqgzTD7IDh+YpGNk+a2OcyTVUfeWMXAd/XhTPoKuPXbrwjpFoem2q+3ea7C64F2Ki7IJiuJCEIi0iKlDBGsKaG4g== 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=VCNDu5C0LVZBjyRa83gIKwYmrZpaszxBtrcp0j/WiMcxRqiA0ieR/OSZ+q0l6gJfPT3Y3yt3IOtuReN90KeAKGySCaxoazMUU5oQeDOlpYddMqJim7g/QRyIGRDUBpVEvER8cMrhhH1cKCP9CkvDB2hEzb8PLWKwLe48+s8BR2M= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:57 +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.4930.017; Wed, 26 Jan 2022 16:28:57 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Wed, 26 Jan 2022 11:28:31 -0500 Message-Id: <1643214514-2839-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 816b7041-d1ac-408e-1c9e-08d9e0e8f3c8 X-MS-TrafficTypeDiagnostic: CO1PR10MB4450: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: HtAIFmxKGZ/qHLwmGcF/ZjqX1VF4oSxXoo/nOWzAG/c4D9KtUVhDOI3gjhjjUx0Hah4MZYarc+sSQ8BZtfzC4s7aurY1Pj5nHVQMy0vRZuL5EYya6FnmJ5oOam+tpxB/r//tActfMkV5AA6ByOjWp6e0DWUPxQbWK4UgIBzGKXE/Nge/xXT8rOxj6hSaNvOpa3Q5s6QRVXpTvv0jHeDJ+KZoZSUIW/QsSMZ7lOkFC98mCjHnXHDRaUtdzhynUGKGG7IRSkg8rVHhdN4ZQO4F63fHfGrbmoH5uMdLFDSvsWUF2v+KFLv+SZGtxUWrbMf9rhr8VIPVS6noNukGBKZi8bTLewhq4RzytT85ZXsBenDcvVbjPhQYivgm48pCTjrWjNsoDykbDF7Kol9yzvVCyIAuHhCzeP0viDhvqrYiS/ua6m5bcPUElfYaawm+rGASk5RKZP17iqcYG3tNfcr/xh3v00e+pr6lQPXCw7idgkmjHrrAMB740UVasNtqF5eeKaIjWHJZ/5RxZzy7bclBIBhZT2BeDBMvVHOKun40oGsVZI+awgRMrzxZ7qxCMDvIidEfFOmAac21GLsGuume+m1jB0/AB65MVLRrs5KPBU+Mhz0bEilVlGqEuXw5BsE7yOYVCVqUPHEqK6baip+ffXbbL22GDKKJj+58Thn8ckYxcbrPahNtRO0scjY7vwKO 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:(13230001)(366004)(6486002)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kxgepdxGwMxsuPb24bFcBqeEvg91mqJwIzZi+ofDCjnwC2nhSzTGzPLRNVbfCxfg4DSJjzq8HrtaWnoGZtHfW347v28mHkDM/xLDCT7H3zfL3UIU22EQDRwGe+psR9QzJuBBMnfMPwBKWAhs7C1crNPx6z2+23Oi1iE96qCF+s0o5XDu5LndzlUex2D5ns3CQ7MOsqFbMz5Ux4HzD7LJ2m+S+YrRY8/dSMEwvcSjjhesNnGgaIqRdF8Bpy/PJ+LgtbUXrn3RnWPaFrueZECurcqsG8iitmCe2UaKwK0NJyoDbevTjcvdGm8UvHYssXmXLo9XB+fAzPdrTwO04aeqYeMiLfpOf4oYIu6lO2I2rGH4il5x9uVvHG7EwuFfBP6cZhbkumklf0foYcri8MxTNEuyYpAVDLnagm/RpdlWvulgZgZNw1imJ8p3Lj/6yWa0+Z1e2yXpYdDNldbHhOqD48PEmUnp4RRuDi7K8lOqvOU2lT8thmxQt27I74iXnDRON2r9c8Z7r/MfSL9KfBp5uyHxoH/BdPTEbufyV07vFpOGS7eaP1ZfT3Icr5KoX0saI9Kz1Jdjn1OWMmvEM/iUgoA4qxFKUHoHH53qfYv2/ZBFZ3LVVQsYpAjnBt5w0ohe9orjyeKclbRVISDg6M8AqWpzmThGhjNBUV5unuiD2qJrxHXqWnhQ1lQeYySiKaKmplbCHwKaArQvTXOaYvvhEkN3o5FOZHS6pN1+AONqOuZ5VOIcH8/plK6a11c5CbEtM93ZQel20khQmUdXvt63MvqyMAz0COQBUqsnfMYgPjY5WqV2tZln1MDSX5Ejz1AtVocjrgyU3PfyWudx9qz+LQJ/JZlUVNU7neZU13SEs3VJHRcp/B0b1KrCCKz0zpKKeXGl0D1gWzTSCXZrq+TXnKODezNTsmaiB0CfP+RIzX5DQIz/9KvbEtFsOWbDEixppvWf197X8efJt8axXFESmq9/kaTRKQQK1uLKxRg8kGxTIaOQ8jjg5JPd6Q6SZ4eS29toEmbxpnQw0lWkIv3nwCGZg0X5/samtqOZGaXrBXlG39jZk1FtD30+G2RYz2DpcYgboJcC2lvHtnLGBbyR1kU243++VuS5w07N+SJlPmzbaaJW26sgAQFYUGhheaqTHl+a4LEYO2wWsA2fP5vZbVn89NYgCHYFPeh1nlmV5EwkKj1QjYvZbaYyjSnfvi4NsGVPrVRI3f3xgSvTLl75XDMvGF0VH08/ZakEixIxutt86gR7XofDOLv7zLcc5rizYNCFi1usxgXppc1Z1Fbe/WXRfxu97kGKrXDrFHtMZsrxWNCxFghsN81k4b93y8hwqh5LIvdePjMwaqD87ipTA5+d3UUJgpj21D1p+hyCfCkicNd2L5zCIOfRdC+jHy1Chh1XlhSgh/mUAOKTjpWcbwnZo38lH8GK4i6W7eEgBw38TMDxAArFqyPRbs8B23LGAQbtllwhehRJoww7szE0ixujQR0m9p12DcRLjaDzSrilDf1hzzKTAVOkO9OdlttS6aXaWcQbntVm5I9XABwWylqWJyYl+yJjqIUV/9Dm2zpT+JHR3pFAAwuEwR1lvBYv3XJNNbuj5E3YfGqf4mqi4Trqay6AI8z2dw3KfoYxkFRH0KsLL2M3QfPLSg6f6KBH5Y1mRtBQ6/gwCKebipAkdw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 816b7041-d1ac-408e-1c9e-08d9e0e8f3c8 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:57.7741 (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: TGAUh44MEtEaN6OL86lJoafsGcJ2dJckw6p0cvWf6ZABCAzEE2ji59JyAto8XmumaAaqW5T01Y7ZMcvRYN6sVqJTAoeSOe7Ew08+JRr3qAw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260102 X-Proofpoint-GUID: IKc8jUzyF2b973JJR0mgIgS8uxxLS0lB X-Proofpoint-ORIG-GUID: IKc8jUzyF2b973JJR0mgIgS8uxxLS0lB 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 Wed Jan 26 16:28:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725459 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 6893BC28CF5 for ; Wed, 26 Jan 2022 16:46:50 +0000 (UTC) Received: from localhost ([::1]:58772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClRZ-00081n-AO for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:46:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAc-0006Zx-Ih for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:18 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:53664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAV-00037T-Q9 for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:14 -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 20QFon7A028823; Wed, 26 Jan 2022 16:29:05 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=bFTW1vkAsOlCFlVSIrEPl/DmjyZ27TyPMCq/7hYUefh9pBaZIPed0dWyoF42gvJ82U3s SGmusgPmLxXXTJXADL77z7NPrxycTQnAR8m/TtyUna06stRgwHVKDvfmLrHtdsXisNBo Yfd/2sQv7F20xlDk34wnDDwxzPRogqm48BqDMe95weKSH1aFBZktJaBhquqifmNO6K2k hpPrICQ8WgmfYzRHUzVqS1BOStMp4MWSbnT4oa4rmbP66l1/mJyEPQsmR9Ay6YFO6wny K5NGNuhsmMLoyIQ/KyciOfI3rdOjQNguEmwarfNi1ETVNUEgXZ8CRc5M5JSAsYvtwTk/ dg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsxaaej24-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:04 +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 20QGAU33153273; Wed, 26 Jan 2022 16:29:03 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by userp3020.oracle.com with ESMTP id 3drbcreyd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LStpELkmnAqX31wNdcPaz7Kt8TI7CMrEGLFiJMa74d35sLZ7qBf2ti66fNGhmwLBrvtRzwA2gN/Sw0uaX2l5FC2Qq23yLXddPsGJmNdaBOM0ZnKBNG9PRD4MydahBLJxK5/Hpm4oDf+NTNV7v6kMdL6xhA/eF/LYRoRH2ZscpsVxl7WT3Eqm83O3ME9smlBIsmMqLv6EQC9pVtXUgT61VyBQ0UlOPOUZOMzZFgFBc66LSWFwhyTfxor9MYyYHFplZ0S8/Svo5RcpJG4HGeaNlaPZEda4TmnmDOiOyTsX37/zMwhy2FGwfCfE/UgH0rl+V3Wpz6WS1Eoffnzvle8fpQ== 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=THLdzoo2HnHW8KdGqF/xI/VUd8R9P/DTtZY9P8XI7WBcTGekA3Owk3xElBd2zavWdkxvM9ajObBSw9lAUoe0ytmNpd7Ywg+QYeNebaW1YRe1tTab1pHyDyXQg09vuquqwCflw3R6Jd/ca0wjHOzxCZf8AJW3CAuBD/eSt2Fmm5x3KK7rcDrV0ismyeTexxWn/rlioY4rcB2D1pXxSlJIVIQ+quF9CIYpQ97T++DWuHfjrbjyOOxou2OCJw2QmZbOuz250cNj9MskaXLre5joIBlD9gTAdgm/GmllmkAoxbpTC//HBvM5ylsfu9wupX6rxdO2Ng54AOsXm4OjNG+6iA== 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=a2qDDAUUsOPL3DZVUdl5n9sSElcpWm1CsPpyCbJfqacC2/q572d/+Av1i7GvpOWsWbWW5BjnI9wcqYpyIVy2uwOIfZ5e7uFwJFtHllelSXrMIg6nH6ZHmw6H3HwvcRwPgTF6QCYJPf9cGvEf9Mybpx9u7C1sGSSEhm9HyAAFcC0= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:28:59 +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.4930.017; Wed, 26 Jan 2022 16:28:59 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 08/10] ACPI ERST: qtest for ERST Date: Wed, 26 Jan 2022 11:28:32 -0500 Message-Id: <1643214514-2839-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: e96e2bf6-cf39-4387-781c-08d9e0e8f4bd X-MS-TrafficTypeDiagnostic: CO1PR10MB4450: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: cX50Wwu3IArZTixkbj8NEqYrrKBJOjPoaEDO7UGjzXExE/xiFDNJ+n+TvPDazLTU9blhj3UD0xnvc/Ef4Eka87A0LQdkR73ERUzmCqNE99hxFOWUV6TwODrICMFDOeIKGYu7V3MuEbdWmJgsvwA1xeKMonL8qva37LbDni0SJnoLgvwkFBQCUxhcuDSkTmXBapqvNUmGeKl6LIhsUsb9SHgBQdldUdQHh/bl7h7JQ4yz50P2S3anelzsYsI6kXWh/eyvDwTEfJux8W5xGUQRKlyT3jXZkzlvCiYZwWsgBFXOmMReGNg4sk1hukpYeJLPi7xJkLE6fKWvar+Xnx/QZYjmNdoHgYRlq6t1Y0KKP7czaJ/XGIMCp3lnqk7XnlWQuMmTwaObiyyzPFA5k5INwxpcbJCCbhgretXS+4I9R9I+rtzqra1i9g+bbnoNDldVAftkS7aaMxZIpfzXzAtUu6KahoCvortCscwj8wYr59xjoIxqn4IYwHBGPGAh3R03mm4exzpYnQMaJOEM0J2qUTaB/JBwRKO6qEjI8rMZRsE4kGfZkyHi7Zaxybsc7kA4UWmzGE/AhlsOM+5OU/V2hkngyxavMIgNYJS+uKdCWqY58uBgGPQp5tbmhiUV3WMc3I8NyixYZp4FWFPrckmpi+DpFT+PhQe1tj7yQ+GiMm5WCirXP2BjwiW5AgtOR1D3aZlCr8DptmAdnx8j/2wa9A== 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:(13230001)(366004)(6486002)(83380400001)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0iuYfbqM2NM5Uu1PPDvZwBD3T7bkiL4ZaO0Mo24sVx/fpVNz7RFd6YAhtHbVBgQDt+5wC3BV+ueQ23+YHjECe0Cum/rR8ExRCS9tD2LpzPXgbk2g5g72xtZG8EyXGOfkGslx55Nk/jBb7PPUg1QmEQK21YK9I4J4khaqbr5/pFQXyu4JZe8KK9yxXZX6gw0nM9ise78QSUjUQxYKuw2rxiqUUpDxpEcOmSqHRMCB7PErNsMgVQMr+ZxUAsDCLhfRz6MpqHpXbMhKOIsIYoprB1Go9Js/ILe7ItF7R6BzN9ubIiYpcImGVv1uThqeIu1Msy4Zw8sSTqlUdXjckZvrVtuZIliMp4i0MsS+UI3246bMxKbLk5dzmOAK3XiO2JiALK2AAQbns3Sf8HXPz1vKWk59BWq6SmxMKQ8C0Uo93Mb0ja13/AzIbYdlMsvIU+RhjuHAT/gSUP3bBqxh4LE8NwfSzVTmEBcIbYn4/did4yY6W+p95MTmK455GD/eLst3pwYA5RXe4kXIysBt5m88o8tA7MNhyG5QIlo4K8UCLZ2xFEXq/sg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RZ+oPL1CkzrX8sorrTzolj9PQnBIAGFQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e96e2bf6-cf39-4387-781c-08d9e0e8f4bd X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:28:59.5085 (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: 4kbdIqBznUxj77Xho0nADos7isZ5Q2EN1VzGtY0gtAfdNDAhyInEyIyo5cEsV4ZpRsCOabVQHIDH4zNykMIXczYlKhk06tPPVoWdD4Km8kg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 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-2201260102 X-Proofpoint-GUID: VK-o7RTwsduYOzAdxl6yYOt3TJShz14F X-Proofpoint-ORIG-GUID: VK-o7RTwsduYOzAdxl6yYOt3TJShz14F 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 Wed Jan 26 16:28:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725450 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 BB434C2BA4C for ; Wed, 26 Jan 2022 16:39:55 +0000 (UTC) Received: from localhost ([::1]:50842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClKs-0001z8-NG for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:39:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAT-0006I6-9G for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:09 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:44786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAR-00035O-7O for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:08 -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 20QFod8Z024349; Wed, 26 Jan 2022 16:29:05 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=Vp6zQfVtq0eFvyh3pbiGmanEYAfxKbMIqL5dQwyq+2shgGO/sYiNWeZp7DrjvAA3pPlN YPPXbTgY9wpXKZC+gPjMWQLw8NAs6mesomFP9/IL104S6iBw0SQpQ3mBvDAZmrsX6Rz1 EXiQsP2r/CznNOvV4W5/n2gK5yzB/fy9OcVkPPyVo/dlcBfiC2NrBvVRhkDwOBu/oFfP z6pT3BZzL7BXjm4wBzZuc9MhKwuuyCKW3WLqavrOPpr5g/AFd1rjy+tu7YEcnPG5PpFS Jg1lnC9T1tgrNfR3M9b9DnTEEuJuLkuBXe0p5mLYbqrYR1ZZSJ4GDwYXYfOb5FW2IJ/p DA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s6g72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:05 +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 20QGAU34153273; Wed, 26 Jan 2022 16:29:04 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by userp3020.oracle.com with ESMTP id 3drbcreyd0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTM2CwSnYPpd0E+6h/DKkDMhT46rv9rjqb2+ShuXfOA8rBz3KpTrPiDi6hz6Al+ysRAvJAolI5Yxpao6/ST0OE5nkiHNef35rYztMlyZz+zOYlQv3sQn2G7zejhwrdGBxqEZVxX4P7ff0HQuhEwtfENGLA/ctnt07B6fvgV418RyySgOotZe1psF4MFAW5v97bK4ijyOiL+Vs+bMdgwm8WQVwJh9TCET969hXJg4k3fuJPseEeBpMZ9L1oX6uWFWZkUF5+27hE2XAv+rKbihcWSfDXYk3TvUucb2zoSw5PPD0D7IKbuuEU4oA7H+ajFHn9bfQCYpzUk0MEZrvjrByA== 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=JRuWjZF08Pn6aRgJuFgSD+ou1ZAOLB/rkaVqY/OjNT60794nQOZJCiOIRHL0FGMrLu6xYg3G9U7NVv4mN16dDJyB+GwrWXLfvDBR/5w6RUDQtRJOhQc8kDXCqu3j1QnkGawWZqW0gjbWoz7w+Ol3ns4EiEvzxFUZSOPFvszpobx2mH6T7RihbAJJ49wYG4tNE+p/XBbxqWdObbSPRoSSGuFsJSfAwXOidxJteYhPp05UUIGQ9MZgxGIEYi0XIKx2Yl71Ahc8ce7kWPyaYAjidt2BwHtxwTdwf4hFGEaNuogy1YJ6czY9VonlNvXSv1wwCeyPmuMv+9sXrax0XbWqTQ== 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=yljLppXEtj+RwBsl1c42m8Kn/wqDqzuW1QPZvEnZY05laj0pn1UtMB9OmBYe7+X4BeJngi0zw0qHf2hQavaXfnU5Pd4psD1CXdYzI48sPsF+HnePaLO03UL4QM8z2Jc3ZYaVEbWxD4yj7G+DvwzXnZG0Oxn0RugeO4k4FVDbgMA= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:29:03 +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.4930.017; Wed, 26 Jan 2022 16:29:01 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 09/10] ACPI ERST: bios-tables-test testcase Date: Wed, 26 Jan 2022 11:28:33 -0500 Message-Id: <1643214514-2839-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 9ba7ab96-fd17-4deb-e355-08d9e0e8f5c3 X-MS-TrafficTypeDiagnostic: CO1PR10MB4450: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: OSM1oYURSFRQA0tf5wV6RruwfHR/lSA7sxwwktrwtUNJpcz+BKRuCibqHGWFrJxaFRgGqnrleAWG4j333h5CHCbh9aVdCvn4JZ50CciAufA3wMkpwXSboxH+T/YPf+9mzOzJVfzV08iV5eQxjh/zgaHXQwXVTR5vhBM0tnkvmnXMa+YeDOU3w0Cd8xSaLvkogZ5rue7LbAyELwVlLxRXcs2QblPiQBPYuZdFBqoF4cwL5w/rZYyxGHN6DHYorLX0tPs6U2pEi2D5EwYq9Po1PJnV2qjZ5TcVxdOhaNtioryxEJXqkEQ6ebbW7nweY3MDnk+x0C0p0G3YIAwvf/if3WQEHsIS2SZfBee+aDUqhEId6nvFsozFEgeSJUdaoOSmUYxYN3e6RhQ+ZMYhszYOWv1knJEUSWKljWmIkFVQhqLV+EJoBGGVqubpLBiPqhPv1+xG8l0hN30diUzNpjruZaIqL0Alk89KkDdUwl581PtUR+8RtYriqLkQMp39fsXxMPW8eGda0WdsO/hguhA2lMXgngSG2M0CuNsT50BvlIt2bJ4xq9KhJEBJYL2dZtNaQxThODJa9BpXiqRedHEeNReCnOjbT9DMMtU3zUw/MCAf9k5wJlt9TVzLJFdWGbWE8Y//Mb5UKQJHP3mKmktrGjq9gyCY0A+2H8M/uhEPTwBtkmRzkr277jxwrUuiwcEZkZeZkMPEuZJY+BUaL5qw3g== 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:(13230001)(366004)(6486002)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: idW4999FIayp5opZp+b96PiA1+cb/YKYIgXmoflATvsku04O8VPckt3ftF/vNncp8t6FnWHLJMpL4ll3MjsvK1/ORRJoUcXart5LzNbx5tsDQfePWDAYHotk5jcr6JgfrYUIeq0qbCnIopqWZtdPNTtN7rQw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5SJxnFsZWdfschxfjNtkHaE1Ye00ST2FloTo11eU8yOt8Q/d8JiE4iLSDSKzW8cOX1hI1xYKfcK13MnbL3PVukbrsHk2NEJTFzJ1Lw7l7DgSebmLN6/QQSjHQIBjHSdBK267PNTKmBaTkgHQwXTGc1tgqPof7thBZCR1JtgK+Uixrrpecp6aJEnl1N9M4trFnyqFbMCCBMJt0OH4uJCI8ebU6UVofEEc9Qr07DJKrayv3dCIYw5exOAG71U8FHbtTQ8a2b2scT5gV8eO+vhjNNf5d9P+UmtabYPr8CUtvJ1lc+ArzVkJHleet3y4QFsxrOV9uc6YLN5QtQVtJDh22JXNpgLOYwrhtAHCmSP5Lig49QPsBMyOc/iUP3tNuTwB1zeK0bXFwBq+B1AuCr2Ph2uryZfCpxMxlpJcZYCY0Zs0lVPX80KKgZ6BTAqtA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ba7ab96-fd17-4deb-e355-08d9e0e8f5c3 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:29:01.1488 (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: iBPSa+DV1xoAVnlLa+FVyL+LmBDOtDwR9XxCyPQHSikrplSJGpmpJ4Qw24JBvrSKYqQoDoESioa2Purn6B2qrZOSWws5lJLcD9JELTclY/4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 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=912 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260102 X-Proofpoint-GUID: kE6byWfHuGHwi0VkkKlxnAtoORqkOEIm X-Proofpoint-ORIG-GUID: kE6byWfHuGHwi0VkkKlxnAtoORqkOEIm Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change implements the test suite checks for the ERST table. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/bios-tables-test.c | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index e6b72d9..266b215 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1446,6 +1446,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } +static void test_acpi_erst(const char *machine) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = machine; + data.variant = ".acpierst"; + params = g_strdup_printf( + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + free_test_data(&data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); +} + +static void test_acpi_piix4_acpi_erst(void) +{ + test_acpi_erst(MACHINE_PC); +} + +static void test_acpi_q35_acpi_erst(void) +{ + test_acpi_erst(MACHINE_Q35); +} + +static void test_acpi_microvm_acpi_erst(void) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + test_acpi_microvm_prepare(&data); + data.variant = ".pcie"; + data.tcg_only = true; /* need constant host-phys-bits */ + params = g_strdup_printf(" -machine microvm," + "acpi=on,ioapic2=off,rtc=off,pcie=on" + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); + free_test_data(&data); +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -1675,6 +1726,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat); qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); + qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); + qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); @@ -1684,6 +1737,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs); if (strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_acpi_erst); } } if (has_kvm) { From patchwork Wed Jan 26 16:28:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12725460 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 6CFE0C28CF5 for ; Wed, 26 Jan 2022 16:47:13 +0000 (UTC) Received: from localhost ([::1]:58978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nClRw-0008AX-AM for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 11:47:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAX-0006Ul-2A for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:13 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nClAS-00035o-SU for qemu-devel@nongnu.org; Wed, 26 Jan 2022 11:29:12 -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 20QFosS5022417; Wed, 26 Jan 2022 16:29:07 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=PcP4Vyznj0amzaWsx2kHacAQdG8SloatmLcqjktA0fwKtXOWUOdzm1sGkhpLPhisWJ0M sP4XvRk3TpumC0HeaF17Lfm4blKVXm1zgMVhBN7XNtSCASymWG/sd67YkjyF+LotURe+ TQhJmt2aKDD/pzJffpUH3U0PwO3jEKwwt/L6Sm+uyYoIoruRuQ3IXk001fn/RVT9uaNY lruP6pGpNG2SSeE6diTSp2XihSewVnBEshvFyi9YkqJIy3ohNR0WLjduoyrLgJJGCMfY iqULh2Pdlbin2yv1ErrkXxDUwrQAJk4F8Vj2NWjgU4UM1HgpFgAvLxt0jzEP3lZA0sBK Tw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjf3s4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:07 +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 20QGAoOY184064; Wed, 26 Jan 2022 16:29:06 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by aserp3020.oracle.com with ESMTP id 3dtax8qpyt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 16:29:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBN8eNAkcjLggL6q99QGyl/4vvcN0+RZ9MijzlfrD30+H6d42IzADo7esp0OPu/D7LR2aWJDPSPgrvCJpTHSkgjlW5TYReYFIw3IE+xfRV11VUJjtzdraMjT7WSG9BVGcGPktC4jQ+XwwAPep46OKOv9dx4GkcHF5DyZa6EkLv+y8jOeWUH5/+4Evj15YayK5T077qygBDBxuV9iB8h2v84h40zQk6uCL5rlQBZPoaAH8qAIkMLksaLEy7QA84Ip8CUQ8hNANfQVJPSomY2sQ9O5/T+/D89LPV7kMA9JCcr+mUUmnJWCRizg8+LCdbYa1djAGnP3MxxxwZV8Gdi6YA== 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=jWlUzQoHlXzvywbbDPGpDjq0cCVF9fqxyCtUQ2m1f+6UpCsrt3L588c0rcqNVYRh7rvKNlP3ERcLZORiK87uNb51leASldKWLILYs0jOayqS0yoYoULY6v/F5iuhn3DgPTiu6YOKhl6Ua9PNcKqcaViC6khL9T8FAjLi0Pg3xPeN0SqTkltIzp6+ImiP4FOJBV5d5KUCgUCkfne4fVEc3Xh3j9zHPhPKzGP6BOIs3lIPTLZikPRlj2bEtQ3limJ05grDRloeJwxT2ja7NkRtxqLxjxtf/pl/6bvd5PrmSNyvpkBRESoygDd7i6peC2m14/9VHQe2e/cvLz+qZ6a6xw== 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=wXbD9nbPYzCOL0meZhj4hlG8Ps6NYiUmFbikVXNBrwucZyrHIKWAsFI/yLUIuMZYwm8wT9X/J7LRrns9Snqt8kuz4CEYIva1JDhh/x+HZ/h3MAa+W4rZJqOSiFKi0mq9q2Eh3Y363PCF9O19GqvNcIUscgTbmVqJNxB6Mm+AMjs= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO1PR10MB4450.namprd10.prod.outlook.com (2603:10b6:303:93::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:29:03 +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.4930.017; Wed, 26 Jan 2022 16:29:03 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v14 10/10] ACPI ERST: step 6 of bios-tables-test.c Date: Wed, 26 Jan 2022 11:28:34 -0500 Message-Id: <1643214514-2839-11-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> References: <1643214514-2839-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN7PR04CA0223.namprd04.prod.outlook.com (2603:10b6:806:127::18) 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: 4139e5f9-19e6-4269-4f00-08d9e0e8f6ca X-MS-TrafficTypeDiagnostic: CO1PR10MB4450: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: Sts2QkpduTBJYUjTOziP2h39MHGXJPZs9RZMN1ZTZz1UIZ2on6OrKdgzLa2WqtM2h7pUaQyYbuf3Pdyt8QH5yrLy3/fDgj4gALPLFp/cNGuQw3rUlXnKHBw/snpbnZ/Pox/dtknY2uNYSsEYx4nGkFhYD4W6bjZ8bfhSI7vW7K0qEDAqYBV3U3l6r0zMC57o/O0eFwyNjNM83VrCZ4tg6Ljhvuw5eXqt53+kZcVgDRRcHZPqyH6qGcGeMjCQSXNYLyhyt5VQIw3n+IQMR7tvCz8oqEhlde3W3ZmkW5NlLPQMOqzv/+eSAsyuchJjc98hYBCASfnvoflQALGnVsPjbwkD8s+7c21bmZXW60phTmW5JjHvVpoqNdO0ZIJtLAUphXcoUsVLmZavHFP1rjU+tt12ER/YH7hTdVIh+KXmXlONwNmId+igRHWqHxBump1uImCBkf0N2P2aefbKMTkDLeoID4agoQxuFGfcNVmz2rZ6DfAWs3zv4wr7+WtH7zbmqXR89wxuTp5UWj9+1FcgGHt3x8+fiALV2zZWbHckCLB0ASqYU5V6kP7KwBtv3HFPj9XYkUq4jR5rY2EwWHIYVvpPpXJOm4ssW0yajgLOp6Ey5LDybj2ldOCALHqqRFAUo6/V1GpXZ6KyhNl6KZJdJPXDTxaoiVa32lUtj+MsqD6PW5ZWjiZI72Xv4sJkTeKb 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:(13230001)(366004)(30864003)(6486002)(83380400001)(6916009)(66556008)(66946007)(4326008)(8676002)(66476007)(8936002)(508600001)(86362001)(316002)(5660300002)(6512007)(107886003)(36756003)(38350700002)(38100700002)(186003)(26005)(2616005)(2906002)(6666004)(52116002)(6506007)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RQvNG9O+WuHfw23Zvrl6/91sZjElLoDCjvVqaCBnGpiYVJe6b6B+Kt64P7munHKxjzWn4jtEwW89QKFQW3J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80b0SaQrDQKXEDlSPetW+9A4H2JjF9Bm3RAse8Dce/RXoA3fmy9u2fSWzB+bh8CGzsAqx/RY0F99knGLiSYNCJ1mRoWj3bbFeW2OGwjY+wXQrkZqxNlmg/BXVFJw2i+KIkbeW7/s2lRN7bI08mhPFhcCpnareDuMzqdozg9dAZTxTWaJ31CGAnp/JceZGQ6hnUFxUAZtHUl+qTPMQqcdc4g3w124Q6FtyxHdbIN00KD+HgxMSJI+6nftiujmtz/kT5XG4Rmp+wVlwtqNN+YGurlChMfL2ad6T1j2BOofFwvGkEYlSbRp8Zq6bFLfm2D96mb1uoNjnYBhgarLGVMzcCwZTzP2EIFPmeFQoTsJeOEIhxavA2lCNCYjbS6p1xvnw1imfqGJn4L6qy9XxaOV2Uzbli4ZDgs3lUJ/6d7EyQQ4SU1j9hRiCcHGB3yNm5tTFpO1lLN5QUmRrqpXTDAxOZNVOzazlMLOehgPg8dYWpOxXYp4GsrtD0z2IPYm7xJ6s7wS7I72iIQbDD88Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4139e5f9-19e6-4269-4f00-08d9e0e8f6ca X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:29:02.9154 (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: 8A0RjbCvBZfg07MFfE9+VzBE2lbOpN95Wt72ZeN/mJkA1bM2eDaocs106LKbggllLjjaeXPeSzKgzLQVMQdtK7lxazSRodhtlrPgeYzd0nU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4450 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10239 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=739 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260102 X-Proofpoint-GUID: y4QaEZZEwYHAls-9L2l_ufhC1LxDHybl X-Proofpoint-ORIG-GUID: y4QaEZZEwYHAls-9L2l_ufhC1LxDHybl 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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ws_1bncmXfi8SEC{UBmF!TrD{!GvtiVS87Q`#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!)^AvZJ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Hn(=;}&UM$mYa7S0P5HyiC?8xH z6f!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",