From patchwork Fri Jun 11 18:31:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E333AC48BD1 for ; Fri, 11 Jun 2021 18:38:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 84DEB610A7 for ; Fri, 11 Jun 2021 18:38:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84DEB610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm34-0000Lz-IL for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:38:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwk-0006Xy-6Q for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:58 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:34202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwg-0007dd-7Q for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:57 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BIM6vS003206; Fri, 11 Jun 2021 18:31:45 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-2020-01-29; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=wKUu1sCJX9BEUciZEGDETaQvSotMwFvpncheK13ggy5/s6a5+ULLijTdl5OR4HcYbmGe Yo9RD5Dgumm0tGDlfraj2G9O8aHfsDpFaGHPUQoi8YQra30jFmieFspvNGMrREJmlEwx xi8IaXrxXxSvWm4RrOt7AuogE4uXmuu1AA4/KFi8saqYKIynGAl1EpaPVxHL4HerlH+j UoKYx5GFWkZoLEVw8r6IZ71caXR8oVz0c5pMU+EDdO7ih4sr9cqn+4yaBT2z6OvMw9Is qEblU/MKSBZ/c8FaJ9b82wnbqWk4v9IJXant6AzWV2fiQGwkja4xP9BxDVckQ+ojWate Ng== Received: from oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3944a1g5qb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:45 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BIVhQt015874; Fri, 11 Jun 2021 18:31:44 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by userp3030.oracle.com with ESMTP id 3949cw8h2e-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DOmSKGePh/ncJIj1H36njTQPM2Kl+uZ1fqvaUed9V4GZRgx9r3VgcRiFsA46PlQxLdwdfCEOp+6kcyk/9gwX3kHDXrAnKPNfwZQNaz7MgC0Dn3lHy1rI0DmHgkEAC+D/gsDlrKHjGIPWgX+oGJLqhQiPtim/fSINUkTklct0aIUCPT5i0Uk/VlYorJTzByPvBXKyx9mD3rMQ0YDfvszRx2p3uSqrJz11kw8Zm1PxLACX6gPwHJlBNcV3ZswavBlwWdhP7F08viBLRxRvlPc1w2njoniaZclwRDKqyFgfEwqrObik63Z1qoMBvzEKdNvHhyyrZJWkONn5vyB1NM4Y4g== 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-SenderADCheck; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=koOvGAZvRRDooSXxNZr8iT/Has3OiQ4kKmRKLBeF/l1rqx2++9Aqqf98XEVbZnWZFaqZpuOUrRmRbiK+tBUuMmzZmjOtnwBA/bk8JyxA/9crfQZFm579vMOYLlHQFcXxNma9u7LaFN7ejJIdW2qnM3tUeOQ7BCCS8G/Y6reEV3o+GHxPPsPaYqm5M1HOrM8iFeK8vJfA58FasFPxbfqHvziq3NrXAkL5z96PqzxX6x0pUIPe7FwxepV3CudA+aBSOlVJ2R2jsWmrfmEQN2MNsyMOygxc2wC0VFJzdI736EhGW2UNKxdFmTh/Dk0nIiMzm6obw9U7EF5BbICe7LOkDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=Av4PK+73TU2moWzy6yYJFDPdpu6pgeNgbyQXO9WYPrct4KmNLR7H2kVtqffI05tOIbRj1AGswFS6g03WDpybh4vN29wO7A8QpQIKGr6dIMPYzV8a2XckVZm3JdsR9G1H3qAMPF4kltR4qyUK2pI8zffDfOJbiPFHha9iHDOUK8A= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:43 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:42 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 1/6] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Fri, 11 Jun 2021 14:31:18 -0400 Message-Id: <1623436283-20213-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea36c1e1-4ec1-420e-1542-08d92d072917 X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KGHQG7Ed/TGLdtD3+ysr4gl8UMg1yMo6ez2dOo+YysKjhybfFRaP+MfDviLPOjdn9dGaT/wRNyt8Nx+nrPewXM6VXD/eKj/9uCmzd7/V0U5pievGGQAeLnHSLm7pC/m4erXvY1qKwbVe9uBOothXnz/at0vU4OE1c+MbzfP6SbYqU0djtVEcPelcOqwH6LAIxesSc6O+x1BHakdPgEoUINJNhCeYmGt33u1OflQlmZfemyoCHU0gXwREs35g8f9ZNhOyY+t7DIB+MbUOUoaQ3GlxWfTEVHUkdN1CFklgrjzxMyCOHFfiI9Inqb30qfLni1EKQnCucbnaDyEaVlUftmxThpVTEuSPEFIRDH8JS+hDbuEwoLnTZxnnG4mVniJpA1PwNwarA3mi9u8wGIeHyUgDF6WIaXMq4O7ijvErpFOjzJ2lT933bACjmE4Ehln5vH3ZgNejlqsioLnnjwMKXgRIFHVvSa/OASSX6tvlnnKzxSL20cLAgotMJIRbwxxJyyLXA5z2/+LeIpyQ/BTsweYMfnwuIyaAbIqnvb2To/dDZt2MSLbgXJCESxk4nqbMmlivKiKUDjF2zGoGuVnKnJnafw05eOM3bkZGwZ9xvtUBRuYHTLCga9jRdod86BH2qCvbVCk1AoGYj2ziLJeDs+FmlYHFwCWX5wp7yVKSW8U= 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(7696005)(8936002)(26005)(36756003)(52116002)(6666004)(66556008)(186003)(6486002)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(38350700002)(956004)(8676002)(38100700002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1Y/qT55qI98bmfBtpRgbP4lbldcxmBDeR5htKgKw5rCzIglbS0ZIVgpQDYzLY4/YQV1oqoDqmeohFlT9VgwIyNWKWQzDIFlykUJ8bqJ6+EzQnijcClWzpfb97V0mvG04L9OJNNqPAHgIG8nSP3PbW2W4yNcslkZfCfwuDph5J0Q4ZzYutOD3xBrRsEHA2x4QSu8fVlWj16OfPLVhXYdYa9EGzZV97QLbIBjgso+1c3vvAhN+tfwSn7JJBl4gHPa2hMVCyptWV4+MI66GDzctVk7eQQguodD8qGeCZm9DuugK9aV38TZG0WkfC/zuIJJxbds9Gkrn1np7QYKyywbCH1okDZV9Y+okaJps8463s0xJWZ1r3go81iEgLKbXcRisIGoCjNcDRdeSTSMacMm3XhZ6XviCYaYlC/pEzhDDrGQCiMFyyNjryetoHMl5OOh0mL6+OYJwPSzHCVL2RDUDJlcg5WzWBfqlwtgicOhWnycmlbzXoiDiIKaojUZrsUlSB/LzDspGCVHLCsVoM9vC3k7alfOCf3MomM5wwnw2l9rdnhvetuui6AR7+JRvV3bPmDw2u6V+5XpS7tQ3xXo3Bgli62vutUTY7u06qbdWCjDy8jciqRw4NBzOhnIjwGOE0sWqIu7ksqbHrEhpLhaD23QgGRn4EqGjN6HCYqhoFQHeyuBiPxC1jlwLwYDBLTh4NnHpwqZshX7TJPgziWZwbod4Xw1SX/TLi3EtpPa4/eRD5o5qsYRCcywCsm+A1M/UixrppOF4pFc7a7ZeadVgWfImWgs4r0Sy/qr6VB2RGYhBAbnS2+R1Z6b+NhWnM7FQlVmMYdK6abrpjVSOUncDi8J6by5OMsqwxlpPHoZKwMvLuqZtOF2Wv9FabiCISDR+SHxbazwcrbViU89nPyFI4ODQe2+Oa9F1uyLiLtXglQly8MSrCOOUU8yEefxuG/0kGp7GeV0qgikE6tNzbF58LZ+KSUo5NvtSDAHr7Svhav3BHchD0SDkSPOiUJouxct2QYZ9WeRDkZI0fRihWAQWjpXNPzxFL1l1mmp/7+RRVQ902WPoq+310B5mxD8+Aoo/12hWh59ld/muqZ5GjxrfEVE9wNUhiM5XkFqVY+5MF0t0792+PnW8zSFpUc8uXPRAcGHc9UcEA6Wlm/VZhrj9RIUeGQZLzcgcb/nGfQyyR4MPN5g8ZM1TqRlHm3EV1n36EY9CL7NZkkjr1eI1ATMdyIUIN/LxTAttCAkwgSgYObQIQV2pDgPMxja539lp6lV6Ywpf1zE+mWUbJmxR2wfoMliJKMP5MxQ8aNp1NaTYaLZC/DRo2REmXuptea+YWkoX X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea36c1e1-4ec1-420e-1542-08d92d072917 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:42.8548 (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: N48N6RDxoqmin8eH3qWG6061c5F0fK/EDRSVmTGTZxZxJ5Hjznpzjv7ldaOpSoYCoi+esey6AEnwEp5GbW05EzTeGa8/xWIC6eKUp33CiXM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-ORIG-GUID: eHI9qlzn0W3oMiMEu3GVp8hB50VD3NuS X-Proofpoint-GUID: eHI9qlzn0W3oMiMEu3GVp8hB50VD3NuS Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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 | 0 tests/data/acpi/pc/ERST | 0 tests/data/acpi/q35/ERST | 0 tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 4 files changed, 4 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST create mode 100644 tests/data/acpi/pc/ERST create mode 100644 tests/data/acpi/q35/ERST diff --git a/tests/data/acpi/microvm/ERST b/tests/data/acpi/microvm/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST b/tests/data/acpi/q35/ERST 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..e004c71 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,5 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/ERST", +"tests/data/acpi/q35/ERST", +"tests/data/acpi/microvm/ERST", + From patchwork Fri Jun 11 18:31:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UPPERCASE_50_75,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27D18C48BE0 for ; Fri, 11 Jun 2021 18:36:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B1DC6613C6 for ; Fri, 11 Jun 2021 18:36:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1DC6613C6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm11-0004QO-Py for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:36:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwi-0006V2-Tb for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:56 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:37374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwb-0007h8-QD for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:56 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BINE22001571; Fri, 11 Jun 2021 18:31:48 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-2020-01-29; bh=LWyBhLI4gVSl1BnA35ms+70L524JOlUTHq93xbXgYAw=; b=bxy3Hrs0In10uVUDEv1Khn1f5YMna9vzfqXj0RkQeEmHNwg3amQ7X3gPatiA9n7WepZF xsf1yTMclBNR/5i2XvCgDdSfoi9Yan3L47kb1Z9EJp6g6cJ5JdvqNp5Inh5GrqONkIhU ehmgqISm5B0HZR4kpBuBRJZJrFx+ak1+7/HlMhcanyKXGrEo5U3w0TUr1W+hqDfk6bN4 4RHigZ+VeIiuKWmGk+oOi+AN3YHbf2gp3G1WpROkE5mw8lRHZClA/HIHcvXUn+td2v6v K3ktpMtpD4YEDVXTnm499Vm3hlChUN1Yos3id3z3QclIBqVrZyx/oo9HynmKGbY9f2QR pQ== Received: from oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 394a04r291-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:47 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BIVknL015909; Fri, 11 Jun 2021 18:31:46 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by userp3030.oracle.com with ESMTP id 3949cw8h3c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f2B+i9et4WEloQpm/GlW87c+RHlGUUdms0Ha+IqUzuXYcqPqCCaMSz2as1zvkiPxKFNfTeWKkVeJZJm2tlHGBTELK25b37OKqPXkTZ5/CAvJCzwW9RJyaNC4NIT6XVOT0h3n7vmf4lMDnQiLStBz3XoGVJdsK2uyC5dT9HcV4ihl3q6b3ZQJieUR4e4CLauAnsAO2PI8PmJuTayR7sbL3EAlDgaO/noBwOTyIddKQPxrlg/wfV2sEdWWkMUvgjJFQQKBe2gpsHa5r0BQEm/g1o5tuoUxMHyL6jRUxbrt2k9zleF8XdwnELNwpjTiT5wHdHZ83Yxhrx5KMub4qbpuEw== 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-SenderADCheck; bh=LWyBhLI4gVSl1BnA35ms+70L524JOlUTHq93xbXgYAw=; b=GbO0SG1H4G+pOaHJ0dm/8jLJ7hLcoYsc5etytdl2451K+WQMG7TEs9BrdPbf1J55GCyMCH4a1siF6aQL0XOXG66v3eI5l+xjDFj6VhENRoDbAMVzOE52NS32TtS13Nv0rQoVPSaRKDO17POmDSXqWjt1r5zW89uiRpNY2Vt12vlsF6LFNvYM44pt/5P5JTPsIMm4QTFx9Rlvb6ZhQqIqgWYhRoCI+FqtKRbCb56AUAC+TsROIgrLD9RPtW5Q2xGaXRHBbjUyzbQY6U6KKMgT1MkE/xIFaiNyIN5ocoheBRkUtmyRWzY9Rb8CvwRSGSRAfDjwmdO4rdsEQ5qNwsl85g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LWyBhLI4gVSl1BnA35ms+70L524JOlUTHq93xbXgYAw=; b=qWsGuwk+diGJLa78cLqSYg/NDs89+tZfvMqKRjsNm9kMmZ2bYQWmxa84EoxtT6hxVo/bH99me62xoG7F6L1mT2daOoWi962G+Wxc3zuo7P8ULX5EcvdKWSyCM3oaOZC/Bnja+oCfNb3cMfLenex6rlcn/1ytNHjI8f6NQkRwzww= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:44 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:44 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 2/6] ACPI ERST: header file for ERST Date: Fri, 11 Jun 2021 14:31:19 -0400 Message-Id: <1623436283-20213-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 603d5121-7a0b-4a21-6f47-08d92d072a05 X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tzn3lXvhP1Tcyop2gOTi4Nu/BGnsccTRAjIHFhFV+ej1FSU3QTaw0McE88ahEVUeAgCRyv0w9yl7Z5n4ie75hJ2G/p18WJRlrnLMDdiXlwyyL7qvZdFD0UovdIKTQZXuLcuWpTgy5rFyafZRQuLBEV/Dd0/35kMbNK/KHvkRulw0tkOexZRhbKhWenkvr2BZVm7+gpU2SwbYzxZr57w3E5b0NRQP//dstR19k14EzsNF+7uSj/15V/Hym5A6xohCiOnqRRzW+zxD/iirn1s8HxgcmFoalrPzCYsjjTJZAx60n/BeG/Q8YuJpO/KnAtbdnBt2fqkkDzk+rHFljpgygb9nxc4bWwM82jCQgOaSJYnNERlW6lHEPH/vZkmilavU+Py+Jo2k2B4A+kkJB2ncyAl8OWad3fn3qNX8J1Y3Jx+gRthsNM8ewO3UJA8NVqkeeiTpA5EJs0zOUYeSsqLlpUupla/m9coT4ZA1UeGFit3AlQnBNv9r2hBKgC98qJEvQRmOJXC049MQVMrMji5fyOBgqmx2XjPBYv0dcmqSNUvI5XtITQV0hxNe8GJpu8IjZlNclwazDCz4JIblYaviXwMdRcfYg3pE2R8hf/SO1ApLoPae9D8Hyv39pE6VP1V2vA38bKdan/nIs0Ok5Fce7OeV4rMJHJh65OYIErKPmdijJayvGVYcx77KLCBclJncLcFV+wTsaZhdqaTZF22tosnGkUil9nSUorO2ZVEicRoY6i6PRxcAoB3By/GrsRuniO1hQ/qb1sPrtM7LTJE3cA6MBeMlaMSbVR5SgXV11Rk= 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(7696005)(8936002)(26005)(36756003)(52116002)(6666004)(66556008)(186003)(6486002)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(38350700002)(956004)(8676002)(38100700002)(107886003)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TsAGMK0NVEhpjO1SPEJCAA+ND2QO3p4+a2CTg2lCJS2AlfHfD2BXgzL5Yr6sw1ZKI70tWLr1Y+eUvw06/bob79gLeor0jDm9LZnVSC1lP87+I47+pgRIYjWJJWZQkbyflGee9dxJll9z2KqSNSuk6yg0ZbKLaxHK8eyLOK2dgaJ/vFPPiO0e1KG+zrfh0mMw8qo36z0qnQrqzeXofQ0C6oVrx7/G3cJDA3Wz4ROdmJSRi/u6e6yQyqDs8fnKDn6c+IWS0JnLHwDQiIsXDA86QPC1qZgpuF1ZuFaHAqYaaVNW5yPTDX9nvOp01Y3rEMcsWrz6rna25dvycKvRID9usoRE7a+6kyA2ooIDAPrD/EUXNKj/4zpxyIbbOEYfc0aXsbFKISkKkCApCB6rExv5Y3opeQoIISEEPZqk/NyHxaNK7YpAglISAO0Gwdh6HzeJgC1Us+O+z9wfn3iY1xssAMH4yjAmsORIrFJPUqDrgQ/Ax1SI/ja6/v7MZN8jABZ0AZjn7WqsUSaSHivJMDB55HI92iOQaKuQRUU5ed0xhJ/slpT0+NXRZMxhPsA5EoNKhUHUgp1Z7AfHwGJDuDsSjoS36QhnAJjULblOj/Tdqk+7HAPWweTixox56y5Il88ljOzoYsG5NEe2TlhtgBS2L4bw1X/pc+006mw9dJajgdE+Ddi5OaY4wJg8Kbrd6Hx+gh/3yas6cQ82XYXeNq7xIK8S1oKB+Go4HYjGMn2SzNXsSJ7HQNOH8I4SjTJP9mj5pjgXUxvgdNgLb7NwjtQRS0V1O1/iCgAh2kZaHDEsQf/FsUBIShtiYUA4j8CDfqkBq0+mTRdajQck43bkno0sQ9CNreACwIb/pY2R6w04wTMStc+Q0TMXbc+qK7G1ewNtxp6sgPK0K/DR669W4NeNHbcL9+1aOd1xgJx1Ed5Qx3fVtEkw4/eq2LOtPpNuxbsJZImGeSHVY5X/Faa/ccuGwaAu03FzmG2oUQzay6wCme4ny0g6aViwbfidcTyK0LpzrojrdoBPM6YpRMx24Lny2+Wy1lB54vrYHEIqT7+xchun0L9lfOXQAC+pr1ucaWRzVZQPCQCBEUkNCwCwIrBmbHs6cTD+04a6em3KZBfD62l+cXzSdPPqVd96t6nc9JLiC5SJ07czZAF8OdHcjaGg27ahVNG+yGT3lobuf2k8aqtj+iTWLQsgpow4AkHKj/7d88E9ekRilH2lz248tzn0AIyddsGZYcs0oQJ3h/lIxgro4Xf6j2qK/m3lCO9PjiL1P2aPvfo28EOgzLl3dcVkiJL27tM1I5YaZZOZFw8UFdVCbM5xUJuOwNg3Brq05JcH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 603d5121-7a0b-4a21-6f47-08d92d072a05 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:44.4139 (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: 6c4ZOxUNg3MfV//mq6tksqAAwnGrQ17BbZvpG+hzyoQKRttbx2yeOwnnABKx4I0X+dKtnbwpEUQYniYxeb7eZ5kkVqwa8iZ5ijleAINJCUI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-ORIG-GUID: eSoj4SeYh64nr4Nec0OQbd-cZFITWEjQ X-Proofpoint-GUID: eSoj4SeYh64nr4Nec0OQbd-cZFITWEjQ Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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 defintions for ACPI ERST. Signed-off-by: Eric DeVolder --- include/hw/acpi/erst.h | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 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..a18d58e --- /dev/null +++ b/include/hw/acpi/erst.h @@ -0,0 +1,79 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * Copyright (c) 2020 Oracle and/or its affiliates. + * + * See ACPI specification, "ACPI Platform Error Interfaces" + * "Error Serialization" + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ +#ifndef HW_ACPI_ERST_H +#define HW_ACPI_ERST_H + +void build_erst(GArray *table_data, BIOSLinker *linker, + const char *oem_id, const char *oem_table_id); + +#define TYPE_ACPI_ERST "acpi-erst" +#define ACPI_ERST_MEMDEV_PROP "memdev" + +#define ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION 0x0 +#define ACPI_ERST_ACTION_BEGIN_READ_OPERATION 0x1 +#define ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION 0x2 +#define ACPI_ERST_ACTION_END_OPERATION 0x3 +#define ACPI_ERST_ACTION_SET_RECORD_OFFSET 0x4 +#define ACPI_ERST_ACTION_EXECUTE_OPERATION 0x5 +#define ACPI_ERST_ACTION_CHECK_BUSY_STATUS 0x6 +#define ACPI_ERST_ACTION_GET_COMMAND_STATUS 0x7 +#define ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER 0x8 +#define ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER 0x9 +#define ACPI_ERST_ACTION_GET_RECORD_COUNT 0xA +#define ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION 0xB +#define ACPI_ERST_ACTION_RESERVED 0xC +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0xD +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH 0xE +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0xF +#define ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS 0x10 +#define ACPI_ERST_MAX_ACTIONS \ + (ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS + 1) + +#define ACPI_ERST_STATUS_SUCCESS 0x00 +#define ACPI_ERST_STATUS_NOT_ENOUGH_SPACE 0x01 +#define ACPI_ERST_STATUS_HARDWARE_NOT_AVAILABLE 0x02 +#define ACPI_ERST_STATUS_FAILED 0x03 +#define ACPI_ERST_STATUS_RECORD_STORE_EMPTY 0x04 +#define ACPI_ERST_STATUS_RECORD_NOT_FOUND 0x05 + +#define ACPI_ERST_INST_READ_REGISTER 0x00 +#define ACPI_ERST_INST_READ_REGISTER_VALUE 0x01 +#define ACPI_ERST_INST_WRITE_REGISTER 0x02 +#define ACPI_ERST_INST_WRITE_REGISTER_VALUE 0x03 +#define ACPI_ERST_INST_NOOP 0x04 +#define ACPI_ERST_INST_LOAD_VAR1 0x05 +#define ACPI_ERST_INST_LOAD_VAR2 0x06 +#define ACPI_ERST_INST_STORE_VAR1 0x07 +#define ACPI_ERST_INST_ADD 0x08 +#define ACPI_ERST_INST_SUBTRACT 0x09 +#define ACPI_ERST_INST_ADD_VALUE 0x0A +#define ACPI_ERST_INST_SUBTRACT_VALUE 0x0B +#define ACPI_ERST_INST_STALL 0x0C +#define ACPI_ERST_INST_STALL_WHILE_TRUE 0x0D +#define ACPI_ERST_INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E +#define ACPI_ERST_INST_GOTO 0x0F +#define ACPI_ERST_INST_SET_SRC_ADDRESS_BASE 0x10 +#define ACPI_ERST_INST_SET_DST_ADDRESS_BASE 0x11 +#define ACPI_ERST_INST_MOVE_DATA 0x12 + +#endif + From patchwork Fri Jun 11 18:31:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46EF9C48BD1 for ; Fri, 11 Jun 2021 18:39:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 90087613AE for ; Fri, 11 Jun 2021 18:39:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90087613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm42-0001QO-Oj for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:39:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwn-0006hg-HC for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:32:01 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:40784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwg-0007i9-9I for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:32:01 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BIM6vT003206; Fri, 11 Jun 2021 18:31: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-2020-01-29; bh=XPPEVQ94uEm3VjXlv03rrTzIl6c42tja0FootmscntU=; b=HW6fcivSrcwFimeio6fb/1sEXtpUdjdbQOkmFJz+f38aQZs7E10U3s4nGcizkOJy60wJ BxQ+JM9y3gbstor9WrVZ1lHgxSCY1kdewWCCKQP4JG+vCXbvw23Ebyzm5lXdSjjTqfUf PaJLa2HZAMOfFIidWsSn8qBRoCi0RpkzT05lrQ5oNsLNGpZ2LzMV59Nb/ykoJrnyLB+X POIOWecYn+aHQinSAdsYp5HRXSSL3tukottzjPdVTrXJLn65dkKuA4uHnzr/yVGm1B/N AVeDKSQtLvmtY1sJ2yi4jnyltV4l+vv24ifDrdXguapP3zzDkjXF9PqNMGl55gUbNmIK bA== Received: from oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3944a1g5qc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:49 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BITjXd011790; Fri, 11 Jun 2021 18:31:48 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by userp3030.oracle.com with ESMTP id 3949cw8h3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tj0xzAyHF5ZYH1rXDoJYIZTRbRAmihD+WiQ92rn8bwUHbeKkQXiV7gOJSohMa+wf1mBOYVtG/R4xsRxkiH+oxdTOjn38sT9ikbx0NjU/AkDpy9KB1zvahWWlm+m79EWbZHkzGRfZ3390VzqtgxeQuLwKfYyi6okVotAg4HnzhbvRYL4VoIR9+/Rjz/dyE6Pxr4vCsudSEIbNRMz8VtqeIuDtRW/3BtyN2EA76UNKfh4WFsIRG8dxBU3U5klIM/P1mFxYzBZHYizb2iaqvn3MpuAHrfpQ8zCRiTyfQ2NiqsZi3vvbAjry+zKCHlSq7jxbEYJKMhvoSuAR75Td9sS34w== 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-SenderADCheck; bh=XPPEVQ94uEm3VjXlv03rrTzIl6c42tja0FootmscntU=; b=imWKNlRXFUkoht83IpQnbtEyA02TqzRYSdsB2JTl7PEAw/tu5+JkyrMr5WvCqZl3KE6GrByF1cwC5FIGhMFYAQru9J5XGTu4iNX+Kf/pWf7mcbJcPGwlx/hLr+QqIbkeKi83RhZ+K0yxda3b1DXE3A7A0ur67Qnh991TJ4Rk9A9NLibdwAOM6excd+adFN0YUypYMRIgh6YN1JP/H9ZpVnLp/g3nuMyRBZRjRvuCniuf1SZSPQOiuxnkweWJoiu+LLOI7mD+7suviJD6bJPhU4SRtHm8iMPhAjzpKp3y+wOPkuGb/g6UfHbKymuuWoBKUEzaEL39L0PHl6CSNBvHrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XPPEVQ94uEm3VjXlv03rrTzIl6c42tja0FootmscntU=; b=f+6N9Am7fl9y8BHUC98HzUSstFiJyqCOjp6MQb1uaNXdH81kZMzVhzBRnoWSM8FxutKo7I+cojWovVzQZg1EfzwKfon5r7wzfVlt2+GiVeEGNROOT+gM01/uwxNr2QSs8lrSTXJ1LPBvubOc2KalAmfz3dkaPz5Ibx9jSKO+diQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:46 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:46 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 3/6] ACPI ERST: support for ACPI ERST feature Date: Fri, 11 Jun 2021 14:31:20 -0400 Message-Id: <1623436283-20213-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20e00ba1-163a-4fbf-af97-08d92d072afb X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uVPhh42T6S9fC9pWugvz2FsIQiWod0FIZTp4TU7G1mkCvifrWoJxm2ZeRsiMRz7WW4ed/5axfsQwwXtjsfwSQyhvGdM8l/jWxEPKhcCKlaDFyx92GBQpyMl0Kaldkgdg+1JzqfwRWmH+XmdilzrMBWX0G6lOzhbNLJXfl3yLVW0AcPIQTjGKfoO+4DDHu2Ru1XAgVcKOyZNYoTmNHreCBLDdrAuBeIL77NMGxZ350b0AcxxXMJj6sSoXlKS7dv6N2a82WRTRW8QXXLo/X1SaNghQcVmHgXG7kocWu1/OeZ5bjDIpl2jHrOO72JmcpaP/ZbCIAAmtXvtnD0LBTMaMmW6Lms3GnRWLjyi05NrNEQsW7a72TxnE6EZWoX1AIHKEIsK1VVpphnw8yttWaFQ9I+p9CzgPlXfNsPSMoIEKcwW/3Y+19b1/58yqOgvfjrf1XmmwCGC3YbfYhmdCr9QdFf1Am79xwnGOeG6Vx5w1+R+VeCemmMcpwxEZPuttOBD7N11dk0+uBBxDnMaxnAE7jIUQrslgGCL0dbJBPXx5ynaMy+VNBr7kJH/nAZQK5Oiu0Ci6TROcxAIdFxHWbwXM9La3FOV0bR1pNotUds8QHXKalwrD0mcyLZELP72KE6nE5ff1wVS2hRoZtke4tsPA1nfHoOE2/bY8sTsvbjBiWNq+5e5Bra9Evn1KHqbiLathmIghSru0nPuDKiFpUDQevsg8hyNrTu1TxG01ibY9BUr593JlYuXN3J+xBUbWE+zgWW5DHnAUCSKm9rfnVRxGd4Xv1xf5seLvDVTWG2kvGiErh3GLrmVgFMDvXX06cdgNj59gYql4XIczXWM/F7wlVg== 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(83380400001)(7696005)(8936002)(26005)(36756003)(30864003)(52116002)(6666004)(66556008)(186003)(6486002)(966005)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(38350700002)(956004)(8676002)(38100700002)(107886003)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zlD76kHIEUKAZ/frwMbSgYtfRtfW3PclpdeVMeArc3KgtbnPlsDwN/HIei3AAaz0KWxovA5wOVPdYMQ+9WnfX0Y3GejKU0Q6UfRTlbEwnMRyJwLMVbFmE68F4ktAbJzlklkeq6RueACYasanQKIWvfAvVK2TJod55ZdU9DEjgGbnWOOb4wFIrfcjM35lXDgfbDbFQ8RPUM5EZ+mIlYxboTFeKqyXtEsp77ewXDRs3BZH/pVUarPuVotwwgutwnc/uDwfCGcYSLzJDpi454QkHfMhpqdlVhv3rnkJGG638I+8oNQObTkkajpOknxhckauLYNjITEct/vwNw8VfMUkzWPpIXwWPijItVgNxUXA5nI2K6YaAOpW6s6IEg0f2sSeNMsrdX6m2bIy7Svz10kjZfKz+ij92NXmXCCv680waUPNYKgo3PnpY4HrUu7z90PQx/t0i88yQsQZ37bVbMxHx6swWSJESAwJbgMfjItgGgWxMdgu7VT3nAGUwx81Z8dyFLF1OCtjSD8DtEg8ellE9O8YQS7qoXi9R1xaxK0aIAbc0+Eu0Lo0BGMOJUF5bViSDb1c48XdLCDxwckk7VOiGU4In/Ombpdh98w8ZRkCYpL7GVhP5Vp5IWdjndO0AFnJG9gHRf8ZTEUPbZMU35U2A/yVuunrv/LCOoGvAUCal6KmqPFdxUWst9d8YMnXx91QvHkymO/IUz73ZkN0wV5Homdw9at07iZePn2BDLeczLrnl8C7T0kDH2G11no/mDM6jE6565xBdKx0Tcgq22Q1RL1FWsP2WBscbRO8O6+LmamMht1x7B8PKbrc8UctSacVpMJsf42vTxHQq06dAQMUJ2ddJpI+K+FFAeIGaF/W8s+oycfsYBlcHqwDTt6JY+s2ORdmNfb/sIvAmNyb9wBXNQ2iGAAclLGvY7UrKLPsFy8a4utqIM6aTYzyzULAQfBg8dDF6uov9+g//Fd299RpMoN3EbqieTu5/rA6ZaeI8iweIp4n8ydu+wW+zFmWpbZh1gSYOcST5FYWYMLd8Zt/1DuSlWAZTS0HU5alQyKh13jpzIIkf0/XNktTTIkFB6/h4ChU3S7PEd8BcMBKFMZ5oETZ/fvTW3F4DU1nzQE1Ql6iHKd0TItMl+qyLh09oGpPYrqGGhtIenoYZZxFii27iRbX2KFoLt2D8U/CwNi+ATd52LJke7cHFHmM4rCS0ZzStEmnyRyoGtml/SIafJotRI68n2+aFYv2rPnD4D0m/33KGU62rsrXBLu6N/0/DJ4jYN+/N9wl6jdrATCZAZtppxxECsI+wU2phCJ4MCQXBLHTXKAYmHaiY+n3dOxLfO+A X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20e00ba1-163a-4fbf-af97-08d92d072afb X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:46.0466 (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: p7VeKz0f7qsw4+E71FpcoGbAip+dvfESocXnYi5UF9HERhAOFxf1A4ruT403PX4s75KI8ICCa+vZO2wBR5nRr/x79YDoj78quTWMwCDtQ7o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-ORIG-GUID: 3hJUVYZJ5Ono--OAk0RWIdcCdWWLdG4e X-Proofpoint-GUID: 3hJUVYZJ5Ono--OAk0RWIdcCdWWLdG4e Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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 support for the ACPI ERST feature[1,2]. To utilize ACPI ERST, a memory-backend-file object and acpi-erst device must be created, for example: qemu ... -object memory-backend-file,id=erstram,mem-path=acpi-erst.backing, size=0x10000,shared=on -device acpi-erst,memdev=erstram,bus=pcie.0 For proper operation, the ACPI ERST device needs a memory-backend-file object with the following parameters mem-path, size, and shared. - 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. - shared: The shared=on parameter is required so that updates to the ERST back store are written to the file immediately as well. Without it, updates the the backing file are unpredictable and may not properly persist (eg. if qemu should crash). The ACPI ERST device is a simple PCI device, and requires these two parameters: - memdev: Is the object id of the memory-backend-file. - bus: The name of the pci bus to which to connect. This change also includes erst.c in the build of general ACPI support. [1] "Advanced Configuration and Power Interface Specification", version 6.2, May 2017. https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf [2] "Unified Extensible Firmware Interface Specification", version 2.8, March 2019. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf Signed-off-by: Eric DeVolder --- hw/acpi/erst.c | 880 ++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + 2 files changed, 881 insertions(+) create mode 100644 hw/acpi/erst.c diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c new file mode 100644 index 0000000..1a72fad --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,880 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * See ACPI specification, + * "ACPI Platform Error Interfaces" : "Error Serialization" + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#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" + +#ifdef _ERST_DEBUG +#define erst_debug(fmt, ...) \ + do { fprintf(stderr, fmt, ## __VA_ARGS__); fflush(stderr); } while (0) +#else +#define erst_debug(fmt, ...) do { } while (0) +#endif + +/* See UEFI spec, Appendix N Common Platform Error Record */ +/* UEFI CPER allows for an OSPM book keeping area in the record */ +#define UEFI_CPER_RECORD_MIN_SIZE 128U +#define UEFI_CPER_SIZE_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')) +#define THE_UEFI_CPER_RECORD_ID(ptr) \ + (*(uint64_t *)(&(ptr)[UEFI_CPER_RECORD_ID_OFFSET])) + +#define ERST_INVALID_RECORD_ID (~0UL) +#define ERST_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_CSR_ACTION (0UL << 3) /* action (cmd) */ +#define ERST_CSR_VALUE (1UL << 3) /* argument/value (data) */ + +/* + * As ERST_IOMEM_SIZE is used to map the ERST into the guest, + * it should/must be an integer multiple of PAGE_SIZE. + * NOTE that any change to this value will make any pre- + * existing backing files, not of the same ERST_IOMEM_SIZE, + * unusable to the guest. + */ +#define ERST_IOMEM_SIZE (2UL * 4096) + +/* + * This implementation is an ACTION (cmd) and VALUE (data) + * interface consisting of just two 64-bit registers. + */ +#define ERST_REG_LEN (2UL * sizeof(uint64_t)) + +/* + * The space not utilized by the register interface is the + * buffer for exchanging ERST record contents. + */ +#define ERST_RECORD_SIZE (ERST_IOMEM_SIZE - ERST_REG_LEN) + +/* + * Mode to be used for backing file + */ +#define ACPIERST(obj) \ + OBJECT_CHECK(ERSTDeviceState, (obj), TYPE_ACPI_ERST) +#define ACPIERST_CLASS(oc) \ + OBJECT_CLASS_CHECK(ERSTDeviceStateClass, (oc), TYPE_ACPI_ERST) +#define ACPIERST_GET_CLASS(obj) \ + OBJECT_GET_CLASS(ERSTDeviceStateClass, (obj), TYPE_ACPI_ERST) + +typedef struct { + PCIDevice parent_obj; + HostMemoryBackend *hostmem; + + MemoryRegion iomem; + uint32_t prop_size; + hwaddr prop_base; + + uint8_t operation; + uint8_t busy_status; + uint8_t command_status; + uint32_t record_offset; + uint32_t record_count; + uint64_t reg_action; + uint64_t reg_value; + uint64_t record_identifier; + + unsigned next_record_index; + uint8_t record[ERST_RECORD_SIZE]; /* read/written directly by guest */ + uint8_t tmp_record[ERST_RECORD_SIZE]; /* intermediate manipulation buffer */ + +} ERSTDeviceState; + +static unsigned copy_from_nvram_by_index(ERSTDeviceState *s, unsigned index) +{ + /* Read an nvram entry into tmp_record */ + unsigned rc = ACPI_ERST_STATUS_FAILED; + off_t offset = (index * ERST_RECORD_SIZE); + + if ((offset + ERST_RECORD_SIZE) <= s->prop_size) { + MemoryRegion *mr; + mr = host_memory_backend_get_memory(s->hostmem); + if (mr) { + uint8_t *p = (uint8_t *)memory_region_get_ram_ptr(mr); + memcpy(s->tmp_record, p + offset, ERST_RECORD_SIZE); + rc = ACPI_ERST_STATUS_SUCCESS; + } + } + return rc; +} + +static unsigned copy_to_nvram_by_index(ERSTDeviceState *s, unsigned index) +{ + /* Write entry in tmp_record into nvram, and backing file */ + unsigned rc = ACPI_ERST_STATUS_FAILED; + off_t offset = (index * ERST_RECORD_SIZE); + + if ((offset + ERST_RECORD_SIZE) <= s->prop_size) { + MemoryRegion *mr; + mr = host_memory_backend_get_memory(s->hostmem); + if (mr) { + uint8_t *p = (uint8_t *)memory_region_get_ram_ptr(mr); + memcpy(p + offset, s->tmp_record, ERST_RECORD_SIZE); + rc = ACPI_ERST_STATUS_SUCCESS; + } + } + return rc; +} + +static int lookup_erst_record_by_identifier(ERSTDeviceState *s, + uint64_t record_identifier, bool *record_found, bool alloc_for_write) +{ + int rc = -1; + int empty_index = -1; + int index = 0; + unsigned rrc; + + *record_found = 0; + + do { + rrc = copy_from_nvram_by_index(s, (unsigned)index); + if (rrc == ACPI_ERST_STATUS_SUCCESS) { + uint64_t this_identifier; + this_identifier = THE_UEFI_CPER_RECORD_ID(s->tmp_record); + if (IS_UEFI_CPER_RECORD(s->tmp_record) && + (this_identifier == record_identifier)) { + rc = index; + *record_found = 1; + break; + } + if ((this_identifier == ERST_INVALID_RECORD_ID) && + (empty_index < 0)) { + empty_index = index; /* first available for write */ + } + } + ++index; + } while (rrc == ACPI_ERST_STATUS_SUCCESS); + + /* Record not found, allocate for writing */ + if ((rc < 0) && alloc_for_write) { + rc = empty_index; + } + + return rc; +} + +static unsigned clear_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + bool record_found; + int index; + + index = lookup_erst_record_by_identifier(s, + s->record_identifier, &record_found, 0); + if (record_found) { + memset(s->tmp_record, 0xFF, ERST_RECORD_SIZE); + rc = copy_to_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + s->record_count -= 1; + } + } + + return rc; +} + +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_FAILED; + + if (s->record_offset < (ERST_RECORD_SIZE - UEFI_CPER_RECORD_MIN_SIZE)) { + uint64_t record_identifier; + uint8_t *record = &s->record[s->record_offset]; + bool record_found; + int index; + + record_identifier = (s->record_identifier == ERST_INVALID_RECORD_ID) + ? THE_UEFI_CPER_RECORD_ID(record) : s->record_identifier; + + index = lookup_erst_record_by_identifier(s, + record_identifier, &record_found, 1); + if (index < 0) { + rc = ACPI_ERST_STATUS_NOT_ENOUGH_SPACE; + } else { + if (0 != s->record_offset) { + memset(&s->tmp_record[ERST_RECORD_SIZE - s->record_offset], + 0xFF, s->record_offset); + } + memcpy(s->tmp_record, record, ERST_RECORD_SIZE - s->record_offset); + rc = copy_to_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + if (!record_found) { /* not overwriting existing record */ + s->record_count += 1; /* writing new record */ + } + } + } + } + + return rc; +} + +static unsigned next_erst_record(ERSTDeviceState *s, + uint64_t *record_identifier) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + unsigned index; + unsigned rrc; + + *record_identifier = ERST_INVALID_RECORD_ID; + + index = s->next_record_index; + do { + rrc = copy_from_nvram_by_index(s, (unsigned)index); + if (rrc == ACPI_ERST_STATUS_SUCCESS) { + if (IS_UEFI_CPER_RECORD(s->tmp_record)) { + s->next_record_index = index + 1; /* where to start next time */ + *record_identifier = THE_UEFI_CPER_RECORD_ID(s->tmp_record); + rc = ACPI_ERST_STATUS_SUCCESS; + break; + } + ++index; + } else { + if (s->next_record_index == 0) { + rc = ACPI_ERST_STATUS_RECORD_STORE_EMPTY; + } + s->next_record_index = 0; /* at end, reset */ + } + } while (rrc == ACPI_ERST_STATUS_SUCCESS); + + return rc; +} + +static unsigned read_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + bool record_found; + int index; + + index = lookup_erst_record_by_identifier(s, + s->record_identifier, &record_found, 0); + if (record_found) { + rc = copy_from_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + if (s->record_offset < ERST_RECORD_SIZE) { + memcpy(&s->record[s->record_offset], s->tmp_record, + ERST_RECORD_SIZE - s->record_offset); + } + } + } + + return rc; +} + +static unsigned get_erst_record_count(ERSTDeviceState *s) +{ + /* Compute record_count */ + unsigned index = 0; + + s->record_count = 0; + while (copy_from_nvram_by_index(s, index) == ACPI_ERST_STATUS_SUCCESS) { + uint8_t *ptr = &s->tmp_record[0]; + uint64_t record_identifier = THE_UEFI_CPER_RECORD_ID(ptr); + if (IS_UEFI_CPER_RECORD(ptr) && + (ERST_INVALID_RECORD_ID != record_identifier)) { + s->record_count += 1; + } + ++index; + } + return s->record_count; +} + +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_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + + if (addr < ERST_REG_LEN) { + /* + * NOTE: All actions/operations/side effects happen on the WRITE, + * by design. The READs simply return the reg_value contents. + */ + erst_debug("ERST write %016lx: val %016lx sz %u\n", addr, val, size); + /* The REGISTER region */ + switch (addr) { + case ERST_CSR_VALUE + 0: + case ERST_CSR_VALUE + 4: + s->reg_value = erst_wr_reg64(addr, s->reg_value, val, size); + break; + case ERST_CSR_ACTION + 0: +/* case ERST_CSR_ACTION+4: as coded, not really a 64b register */ + switch (val) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACPI_ERST_ACTION_END_OPERATION: + s->operation = val; + break; + case ACPI_ERST_ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACPI_ERST_ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = ACPI_ERST_STATUS_SUCCESS; + break; + case ACPI_ERST_ACTION_END_OPERATION: + s->command_status = ACPI_ERST_STATUS_SUCCESS; + break; + default: + s->command_status = ACPI_ERST_STATUS_FAILED; + break; + } + s->record_identifier = ERST_INVALID_RECORD_ID; + s->busy_status = 0; + } + break; + case ACPI_ERST_ACTION_CHECK_BUSY_STATUS: + s->reg_value = s->busy_status; + break; + case ACPI_ERST_ACTION_GET_COMMAND_STATUS: + s->reg_value = s->command_status; + break; + case ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER: + s->command_status = next_erst_record(s, &s->reg_value); + break; + case ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACPI_ERST_ACTION_GET_RECORD_COUNT: + s->reg_value = s->record_count; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + s->reg_value = s->prop_base + ERST_REG_LEN; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + s->reg_value = ERST_RECORD_SIZE; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0; /* correct/intended value */ + break; + case ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS: + /* + * 100UL is max, 10UL is nominal + */ + s->reg_value = ((100UL << 32) | (10UL << 0)); + break; + case ACPI_ERST_ACTION_RESERVED: + default: + /* + * NOP + */ + break; + } + break; + default: + /* + * All other register writes are NO-OPs + */ + break; + } + } else { + /* The RECORD region */ + unsigned offset = addr - ERST_REG_LEN; + uint8_t *ptr = &s->record[offset]; + switch (size) { + default: + case sizeof(uint8_t): + *(uint8_t *)ptr = (uint8_t)val; + break; + case sizeof(uint16_t): + *(uint16_t *)ptr = (uint16_t)val; + break; + case sizeof(uint32_t): + *(uint32_t *)ptr = (uint32_t)val; + break; + case sizeof(uint64_t): + *(uint64_t *)ptr = (uint64_t)val; + break; + } + } +} + +static uint64_t erst_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + if (addr < ERST_REG_LEN) { + switch (addr) { + case ERST_CSR_ACTION + 0: + case ERST_CSR_ACTION + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_CSR_VALUE + 0: + case ERST_CSR_VALUE + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + break; + } + } else { + /* + * The RECORD region + */ + uint8_t *ptr = &s->record[addr - ERST_REG_LEN]; + switch (size) { + default: + case sizeof(uint8_t): + val = *(uint8_t *)ptr; + break; + case sizeof(uint16_t): + val = *(uint16_t *)ptr; + break; + case sizeof(uint32_t): + val = *(uint32_t *)ptr; + break; + case sizeof(uint64_t): + val = *(uint64_t *)ptr; + break; + } + } + erst_debug("ERST read %016lx: val %016lx sz %u\n", addr, val, size); + return val; +} + +static size_t build_erst_action(GArray *table_data, + uint8_t serialization_action, + uint8_t instruction, + uint8_t flags, + uint8_t width, + uint64_t address, + uint64_t value, + uint64_t mask) +{ + /* See ACPI spec, Error Serialization */ + uint8_t access_width = 0; + build_append_int_noprefix(table_data, serialization_action, 1); + build_append_int_noprefix(table_data, instruction , 1); + build_append_int_noprefix(table_data, flags , 1); + build_append_int_noprefix(table_data, 0 , 1); + /* GAS space_id */ + build_append_int_noprefix(table_data, AML_SYSTEM_MEMORY , 1); + /* GAS bit_width */ + build_append_int_noprefix(table_data, width , 1); + /* GAS bit_offset */ + build_append_int_noprefix(table_data, 0 , 1); + /* GAS access_width */ + switch (width) { + case 8: + access_width = 1; + break; + case 16: + access_width = 2; + break; + case 32: + access_width = 3; + break; + case 64: + access_width = 4; + break; + default: + access_width = 0; + break; + } + build_append_int_noprefix(table_data, access_width , 1); + /* GAS address */ + build_append_int_noprefix(table_data, address, 8); + /* value */ + build_append_int_noprefix(table_data, value , 8); + /* mask */ + build_append_int_noprefix(table_data, mask , 8); + + return 1; +} + +static const MemoryRegionOps erst_rw_ops = { + .read = erst_read, + .write = erst_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +void build_erst(GArray *table_data, BIOSLinker *linker, + const char *oem_id, const char *oem_table_id) +{ + unsigned action, insns = 0; + unsigned erst_start = table_data->len; + unsigned iec_offset = 0; + Object *obj; + hwaddr base = 0x0UL; + + obj = object_resolve_path_type("", TYPE_ACPI_ERST, NULL); + if (obj) { + pcibus_t addr = pci_get_bar_addr(PCI_DEVICE(obj), 0); + ACPIERST(obj)->prop_base = base = (hwaddr)addr; + erst_debug("ERST PCI BAR 0: %016llx\n", (unsigned long long)addr); + } else { + return; + } + + /* See ACPI spec, Error Serialization */ + acpi_data_push(table_data, sizeof(AcpiTableHeader)); + /* serialization_header_length */ + build_append_int_noprefix(table_data, 48, 4); + /* reserved */ + build_append_int_noprefix(table_data, 0, 4); + iec_offset = table_data->len; + /* instruction_entry_count (placeholder) */ + build_append_int_noprefix(table_data, 0, 4); + +#define BEA(I, F, W, ADDR, VAL, MASK) \ + build_erst_action(table_data, action, \ + ACPI_ERST_INST_##I, F, W, base + ADDR, VAL, MASK) +#define MASK8 0x00000000000000FFUL +#define MASK16 0x000000000000FFFFUL +#define MASK32 0x00000000FFFFFFFFUL +#define MASK64 0xFFFFFFFFFFFFFFFFUL + + for (action = 0; action < ACPI_ERST_MAX_ACTIONS; ++action) { + switch (action) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_END_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_SET_RECORD_OFFSET: + insns += BEA(WRITE_REGISTER , 0, 32, + ERST_CSR_VALUE , 0, MASK32); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_EXECUTE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_VALUE , ERST_EXECUTE_OPERATION_MAGIC, MASK8); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_CHECK_BUSY_STATUS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER_VALUE , 0, 32, + ERST_CSR_VALUE, 0x01, MASK8); + break; + case ACPI_ERST_ACTION_GET_COMMAND_STATUS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK8); + break; + case ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + break; + case ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER: + insns += BEA(WRITE_REGISTER , 0, 64, + ERST_CSR_VALUE , 0, MASK64); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_GET_RECORD_COUNT: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_RESERVED: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + default: + insns += BEA(NOOP, 0, 0, 0, action, 0); + break; + } + } + + /* acpi_data_push() within BEA() can result in new GArray pointer */ + *(uint32_t *)(table_data->data + iec_offset) = cpu_to_le32(insns); + + build_header(linker, table_data, + (void *)(table_data->data + erst_start), + "ERST", table_data->len - erst_start, + 1, oem_id, oem_table_id); +} + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + erst_debug("+erst_post_load(%d)\n", version_id); + /* + * Ensure nvram persists into backing file. + * The vmstate_register_ram_global() puts the memory in + * migration stream, where it is written back to the memory + * upon reaching the destination, which causes the backing + * file to be updated (with shared=on). + */ + erst_debug("-erst_post_load()\n"); + 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_UINT32(record_count, ERSTDeviceState), + VMSTATE_UINT64(reg_action, ERSTDeviceState), + VMSTATE_UINT64(reg_value, ERSTDeviceState), + VMSTATE_UINT64(record_identifier, ERSTDeviceState), + VMSTATE_UINT8_ARRAY(record, ERSTDeviceState, ERST_RECORD_SIZE), + VMSTATE_UINT8_ARRAY(tmp_record, ERSTDeviceState, ERST_RECORD_SIZE), + VMSTATE_END_OF_LIST() + } +}; + +static void erst_realizefn(PCIDevice *pci_dev, Error **errp) +{ + ERSTDeviceState *s = ACPIERST(pci_dev); + unsigned index = 0; + + erst_debug("+erst_realizefn()\n"); + 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; + } + + /* HostMemoryBackend size will be multiple of PAGE_SIZE */ + s->prop_size = object_property_get_int(OBJECT(s->hostmem), "size", &error_fatal); + + /* Convert prop_size to integer multiple of ERST_RECORD_SIZE */ + s->prop_size -= (s->prop_size % ERST_RECORD_SIZE); + + /* + * MemoryBackend initializes contents to zero, but we actually + * want contents initialized to 0xFF, ERST_INVALID_RECORD_ID. + */ + if (copy_from_nvram_by_index(s, 0) == ACPI_ERST_STATUS_SUCCESS) { + if (s->tmp_record[0] == 0x00) { + memset(s->tmp_record, 0xFF, ERST_RECORD_SIZE); + index = 0; + while (copy_to_nvram_by_index(s, index) == ACPI_ERST_STATUS_SUCCESS) { + ++index; + } + } + } + + /* Initialize record_count */ + get_erst_record_count(s); + + memory_region_init_io(&s->iomem, OBJECT(pci_dev), &erst_rw_ops, s, + TYPE_ACPI_ERST, ERST_IOMEM_SIZE); + pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem); + vmstate_register_ram_global(host_memory_backend_get_memory(s->hostmem)); + + erst_debug("size %x\n", s->prop_size); + + erst_debug("-erst_realizefn()\n"); +} + +static void erst_reset(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + erst_debug("+erst_reset(%p) %d\n", s, s->record_count); + s->operation = 0; + s->busy_status = 0; + s->command_status = ACPI_ERST_STATUS_SUCCESS; + /* indicate empty/no-more until further notice */ + s->record_identifier = ERST_INVALID_RECORD_ID; + s->record_offset = 0; + s->next_record_index = 0; + /* NOTE: record_count and nvram are initialized elsewhere */ + erst_debug("-erst_reset()\n"); +} + +static Property erst_properties[] = { + DEFINE_PROP_LINK(ACPI_ERST_MEMDEV_PROP, ERSTDeviceState, hostmem, + TYPE_MEMORY_BACKEND, HostMemoryBackend *), + + 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); + + erst_debug("+erst_class_init()\n"); + k->realize = erst_realizefn; + k->vendor_id = 0x1337; + k->device_id = 0x0001; + k->revision = 0x00; + k->class_id = PCI_CLASS_OTHERS; + dc->reset = erst_reset; + dc->vmsd = &erst_vmstate; + dc->user_creatable = true; + device_class_set_props(dc, erst_properties); + dc->desc = "ACPI Error Record Serialization Table (ERST) device"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + erst_debug("-erst_class_init()\n"); +} + +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 dd69577..262a8ee 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -4,6 +4,7 @@ acpi_ss.add(files( 'aml-build.c', 'bios-linker-loader.c', 'utils.c', + 'erst.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c')) From patchwork Fri Jun 11 18:31:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C180C48BE0 for ; Fri, 11 Jun 2021 18:40:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D7228610A7 for ; Fri, 11 Jun 2021 18:40:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7228610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm5B-00039L-22 for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:40:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwl-0006c8-Hm for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:59 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:6914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwg-0007i5-9T for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:59 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BIM6kD009737; Fri, 11 Jun 2021 18:31: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-2020-01-29; bh=BSfYP5a+0/RcRkZPG54hDqmJ5uXlzfoHv6ZT7w+a8O4=; b=PPdvh56wBer6tRMfJb/rqeWvgjjwj+dPMj32A0nG8t4IgG+kBh0qqAotSnbzlHd5QIsT 4l1OxL0mACbrC0g2oTIykr/66aWajkeYO/UWuN/sIDIQ8hgBfg7DhWl8NSiRi0Dx+NXF ndufo+pXqIsJzivL8zq/QXVto0fKp3cZsyj2RsQxBB0hoWkPQ4BrfjD8hIJu4Q8o0T+9 GyQAIXmJFjNfbcrEWCE6kVig21yyqHPb1b3FEt1StdWDESB7jbqGBQNCdFRfMUl7nv44 mAZIt11kJGj+pjCh3uJExcr7w7CzEXuXcHAVb5jUnPixzMXUvD0CQxu5YhJlcLNn4neL yg== Received: from oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3944hn05jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:50 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BITjXe011790; Fri, 11 Jun 2021 18:31:49 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by userp3030.oracle.com with ESMTP id 3949cw8h3r-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRx25N5jbrM6RuUNT7XigcgmJr+UIaaz2PkzF9Ymjo6ZdW0f0G062kqaFCecQpt8eGzlrOmxQ/Vo2zDd0im1vsMmj+6wXQy/l3boio2NY3onnp4bwtqrToqaGLRUq/B6t/Jpn9btX5HbQ1xbMtmdq5Fj1dJSKk3y12UpJAly3MZE0c7RiB/yuD4YRYp5KeGfROwtAtoe+QsCRX9QxZ7818OjBHMjLP560mXBwxCdVNqrVWeVWpwCfz0/QAiKZPJFzGnldUYq4t+L55hHkUN1N+ss/ul2UrbDROdBf6/72jQi50EVbqghgwACCG5mcZ9Av6SN49CiAZujpWZ9K88G4g== 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-SenderADCheck; bh=BSfYP5a+0/RcRkZPG54hDqmJ5uXlzfoHv6ZT7w+a8O4=; b=TM6qk+OpApCTSfAaiJvNrjyN6tNHQGHl1XzndEAad2J0ugCvuArcj27iSlGuFlPVl/hvXOQjdTBixH6qgAJntNbWDjUxvubevJF1/u5avraZFFfZ+9l6uES5pJgC9A3n/Js7ncTRb2hA3ftamXnrC8wVrmqig5JGwgksXFzogdx4KCAA2b0Ti274w61iRh+rWYqIlwYzzI6RGTlg3Oy32zH+Sfu7S4SGN7T14rlrhMn2Z+IyiA08tzfsBOqgWhOZWTWmqNwifgjxc+irVANg8Dlvm5ybTHq4ge8Z4H7JH9U0djWc5dky3hJ5FfI7z10WEExLF1NyYzsu0ABAxChfCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BSfYP5a+0/RcRkZPG54hDqmJ5uXlzfoHv6ZT7w+a8O4=; b=ej39MfcMJD2VDKMbWX7aJMF4+gsEyd8r5afevRouwcnukK22ThbKniRHu4Zt8bkTkm035R4eDkZQqHi0C8q0X9fK0/arcRjv5KIs5Fz7EeT2kA4zk++jvMUwrSf0T02Popeq2kl6eCYA1CE4dGhb5szJ3oyi344mx8HEmpeUbGU= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:47 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:47 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 4/6] ACPI ERST: create ACPI ERST table for pc/x86 machines. Date: Fri, 11 Jun 2021 14:31:21 -0400 Message-Id: <1623436283-20213-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c98c7ea-f427-4d4b-6b00-08d92d072bf0 X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yU5a/pX8k6n9NBv59u3CFhNFCyJjpaBQvYhzDMLbZo+RjL5B7QqgCBb5j4k3Gax3R87LGCQO3+1khWeOFsjxsHV35nQAUokFqoCb7STDV7xSKCVXQozw8K/wwcMDm9N97N2rjOpfFEiwx87Cniy5kwokT1Rzpt38MUcyE9gxOelDYOHeShJ0lp9W7E/My8JRbLWrZPkTef2GwAHmDqa0adxHK2LFcq3ILe15JT3XaU08CkKM2hMeWq149PiuQZnRnaaMHx2v45HoGgDmrRa1Ef2AbDYG7AMCxCVG052F9dT4z98/CI3V+9fN1s7ORGZ8TOzFMRQmC0sRacOJdfukXAyejdsq6dK45ZDYzc214sj2pGBqPEc7JcHdl4ZF7dwLjfnIUi7I87KPsVmKxoT21BIEObMZgHZyhLuZF6+2B5NzcoCpjil1tc1m6G3kGWZIvntA3UcMStvxp7CwRCGqM+l5aygPS4wNx7hWCmYMq53+M7Fa1M4bwAMtU+uJ3mS3CBwtLcU7dNbbs++wbOi5Keno9bq/pbX8WMci7Zf3vzfBTo9QZhwvSISQfioXcUMNNC+wT/eKW2WaWkHHDfDUkKsK0lhcjLwYwnabDsQ1MStEN9y25VvUlqkfywDEa4bqgOvcqanvi4Qbe+cJNCD73f26O0MMw4WRpZBcXVDV4JQ= 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(7696005)(8936002)(26005)(36756003)(52116002)(6666004)(66556008)(186003)(6486002)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(4744005)(38350700002)(956004)(8676002)(38100700002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pUSGcKmJb4b7DHOn5clq27ZUmG+8ZMx0bKaUvPsw9kXhRxBO5jC0uWlXWpoPxaeWIQNDeRH8PsLa3bv71v8rSswp9R1A1gxGOk/1hGhOPN8Pb7np4kP6gJ8+AvAaQW167W4lPLgOxheAb2UFXzScEHErvBf4MiPoqHiIzrYQHmh4zaJnak0Q78lI2ET5xSXBtqpOPy0wKSYV/Okh2gk3W8Bg5ckEsNQg5bj/60h5QW7ay7xtStAbOU7DvnWFZiZ0z+c1r3sv4B4c2vmi9oRUC4My770tNvWHMp0+XZwJIfGS3Z+mipoxyvbD2HyobToUo/d5rDyx2DufqxD6o7hrZmw+qqjZCW1SL1pqyGfaOK2qunvcqrwnyrry/CPZmIUJ2TmhrjWD6eD4doAHaKqbab1tNDeb82/tWa+tHOjbH9f69MfRScIl6ZGb/ZtHnNm0umTeey0V2/wNC50Y2DmJLaXU7r2dNbfDndTt8Q0MfoBCUHZ5un65pMjyEXGf8/3CzOtCDjxOoGTt2jfQSqS49UVYA0IJ5V5a0q/ID+rosRycsFGU4kc5rml9ATEeGdonTEEAZnfwSY2CcjhiBhLXT3CmTb24eq1DlWnkLiFMpelxA+v3taywiVpzWx5muNlC0z/bQfw533Vp0Q1XYp9D3O6RMrmXSmP/10fbaDgkXFgp1H7NrKbHBQsEiF8k/eV1gSAX/ZNs4qVwpreCohR2ibH9lGpWbZlCXgCVRoN5rWYbBSxBpdF6PPwi1bQATK8B3V3EFd396ysBiPfGOcLToObCK+T6oUKL5KX5WuEFE6EPwWdpgBaGMbMTnAyE2kIB1EN+bwecu3rUy+AYGBL/41du+tPDGcIYG3KcCDY1T4nEIU/wH+yQuUns902IZVWeoJePQkDxkMbBSscqzUJlUw/QlDpOA0ELFvxTC8tx1xNzKwtUiEYC47HFqET8ZhMeo7VpecF+RKN+vPvStlP9tENb7sKw8okRXwnaqya8pfd6yX12lt4KB/h+XMFBqddQsw1Vwsfb2S6WsZqwc/I8S9/735JNrx6dGuf5f88nAENRRScUkca9YidtPHmhmBVAjbtV0zZ+dsHlBIllgF41g48w4+flrEhh0jVAX51DM5XoIWxTAF7iW1ePBQbtlrnIcC9fBp2kkjAqP6ARYsruouGI5lQ/BlAAIY3t8YMV2XRO4wQMXioNJ46wElob8PTuLMVbPOAW7h0+VHOuKrdfkve9r+HjMSTxj+1hU3dFSesYo8fXngqHLmbA8T45Ji3ZBHSYTA0kJF/OCpTQQ3tlY2HAR5IXCevpCXE5dAIiR/GOkLTQnTRkaVpg++K2CZbH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c98c7ea-f427-4d4b-6b00-08d92d072bf0 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:47.6366 (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: 1exfeeumWoQ70OAZE61srlt8hrZvcjgdfOOWvhWgGQf7p4HuMpqNJ/ajGrUUBUBkI421ElnzXBNsH3J0FFTHL4crs9SQfj5PwxqxwegvKtg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-ORIG-GUID: wY5RcntA4LcYF-NNPLWu0s8AYLq5_QwQ X-Proofpoint-GUID: wY5RcntA4LcYF-NNPLWu0s8AYLq5_QwQ 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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 --- hw/i386/acpi-build.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index de98750..d8cae69 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 "hw/boards.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" @@ -2388,6 +2389,10 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, + x86ms->oem_id, x86ms->oem_table_id); + vmgenid_dev = find_vmgenid_dev(); if (vmgenid_dev) { acpi_add_table(table_offsets, tables_blob); From patchwork Fri Jun 11 18:31:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BF6AC48BE0 for ; Fri, 11 Jun 2021 18:42:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B6BCE61285 for ; Fri, 11 Jun 2021 18:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6BCE61285 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm6m-0004z4-QF for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:42:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwo-0006m0-PV for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:32:02 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:44966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwh-0007iE-1L for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:32:02 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BILalu007218; Fri, 11 Jun 2021 18:31: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-2020-01-29; bh=+secDQTCREvhT2Ov5DNwF+3Bdernw8WLFLBJsu2DSrY=; b=j5HSj45dBsGzWxVC4v5Dfo8Odi2pFbZdRUZWg0tBJ98dB4c72Bip/9nv28bM/BgMDVYH 0c50RjNDK+wkC1sLJneSFH1gwh3gEEQOCHNWo+2/4N3LhWC/bT8LVSBqdbs9gbNxbPd5 g8+CGP+D+YM7PauBq09VJO4SVNcwX979MRBi+0/Qdy4H6MhcSTcuQU6f2I0LFdL5pUFv C3SThf+oixrzmdMXt313zsvQNRaJaVYSf4Q+8LCCtdZv/h2w5placsUgc/WUF/HrEbPq 8NoEmheLz3+1GWLKiMsjXGkXar3XuSfb4EvNH9GBo2yZ2du+RaL1HIYvTbtgDPtfK6ek IA== Received: from oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 394agy01wh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:52 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BIUw7o163567; Fri, 11 Jun 2021 18:31:51 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1u5ava-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ob7/DVbTmiKcOzlpXfm+Uzftzhhc4wHikRoT48Do8ZXC43DGyFiaI5Jh8+jXIvAsWomoYwvPgM7c3nqhculgLLkINGunPPQP0MYXlV3aCObcSTBidWKoKwpk82xtiySmWSsqUx+d5WLdNV8+N5kgmaYtRsEQG2+TsrfLbz/r/RqvC9/eANYfNr+8GfhfxduxYuhW6DfA2hpjJxasUzcyDIkjCLsnxPnek0twLwQPUy/a3uHugvbzuiqV+je9rqa017MO7IBTJWXdpGRIMP+pqmhOyHcxexSBD+6VLu/PDEcBWn9wofRUbjm/H5JcARlXWbz1ZvUB/DDNrnsakcQTSg== 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-SenderADCheck; bh=+secDQTCREvhT2Ov5DNwF+3Bdernw8WLFLBJsu2DSrY=; b=arUHTgH5323g3xhr1m+Axp0lBsF7zKaPfaiS1akkiBj+8y64FEyQeUt8HAuDsxUNbPir9XPTL3AmkdRUFXoapukfOyAfUUeBgW/Jg5CG2a2z4naioUhUG/+I4mGidJem6R9Q4x8RQfKHNqYX4X/ZGne+MeS1lINzgg7D6yUF5+E5T9kHZcksV3A6np9/8nQLTw26VSC+JQsHAAkmKvozwvUgAmR7hhN5HuRQ4+CmbNiwMiZSbC63eO/PL+kHizFcV5KfK3ZRgIPTPYgVDN05jQu4oeCmiQ1LOFN9dWIi4lnzFqndMdFYPtMz47nBZeYDJRf1T605cJ/p+qY7xVgrOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+secDQTCREvhT2Ov5DNwF+3Bdernw8WLFLBJsu2DSrY=; b=NJUSDuBT05v9tyzxmWJ6qriooj4O+CndiY1btHy+e1uT7mDH0whlHTdJeJpXo9T1iHz+uovntdTjrACBVrIsO2oaXq6vmWq40Ne8poQ44/gb7CKMd330sQDMTy8JGFXh5LAABn8+dCX2AcRTw71KZAF67OKPvtNsNnuU6wQHKzY= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:49 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:49 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 5/6] ACPI ERST: qtest for ERST Date: Fri, 11 Jun 2021 14:31:22 -0400 Message-Id: <1623436283-20213-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7bc42345-3dca-48f8-b87f-08d92d072cee X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J27dl7GFETIpF4ZJaFyKk3H+Wwwsk++2GLVjyWGAAOwTkx79jicirBeAMfUPNOvTWvHli+MblD2X4Ctwj2r3ukm2Kqtqp18l2/ab6DTeqPZuLdGkrU1NDv7VpYz4MHQXEnVlPiRbu1ZGgQvfYkdWfW16oRRV16JRkSvcnOfw6AigimO5eo+n+FS8DdVFbrwa322N2MUX8pLJkOhtNq+p0pzIJCjBikpNdRgSAmpGAOXQA1bSLZOVvs2IhM4ytxqJ4Nn9XOI3kxvaaaonA30O1Ju2Vw4TiQ+57Yz4o9BgRTOWwikj+TIGQyfq50hZ3cObYiAOy7XFrl/mPLmZ3hWx+UrNH+rDtZMWiWXgQMzYY7VK2pNwSKcpSlHrwETZQ1/EGjLcEvdikuLo27YYd1FaHtEh8GXLFCESEcZNk77zbKIJ/wo6SPKHhNRxu4hYqNUh2fHk7tqw8I4H3ULYXcpB//rT2wj66lvLBvxzaMX7K10lCobU1gtXVYVUT99IoLd+36INJrNQyid8f5s5bouTEEC/9qI8MDWCMIFwnFjgvSfdND2cBqXPjNaaNIoeN+6iymM71nsI8F9QN5aZyQsoa2D8mGUDvHpvcddKysyFqZ8uMUuHAxSQD4SuxlZXYnwfMH8EcQlm7nnjebHyluFhFg== 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(7696005)(8936002)(26005)(36756003)(52116002)(6666004)(66556008)(186003)(6486002)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(38350700002)(956004)(8676002)(38100700002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hEGVEJB3AaE5alEXP3eUOTIrFSM8dXbTZyzt+43xZNaWT1musKh1GhMMK4sFU2B8cUGpirPGFY3kTUKmjEvjRkTIadDJTrgRUUcU8JvIlLcBJQFtroA/qzIhuzhNQ+Y+1MEb3WD5HX7gUsWCCNde7euu5URDwwSjra+AhFFY51AsUbvuSTmVXvGxLvhsKZllYVn5VKZfkL/j0yjvBoCcSfB0/eeZedoDpUrkpWnzfqkejcYhvp9Uo7Um7loJ0NPgBClqycqjOHMrrsj7sv4tnn5olgUp5wFpiyhvTHsimkbsLvWEvUwslVPapu5BvQs9UJTqihjFu7fdFPw81Pptuzp9ZsC/HLwBJ9fBhCp1WN9hdQnhf9OCRmO7qiS7C4tsvAl5KurUisf2B9WsyQiCu1TesCDGZq6zqV14XloIX7OWo4B41X4JTZ7QktJw7s1oai7CDyqFtJNPacS+pwajoGNtrbozmYIGRCvvGma5/bL0iTqcgcC9WooDdubgWGvLkw5usbCW9FUNUa6ALIPGBHTrZPIiwAuLiwgftnxqAWLnrYbCjCysOohHhUaPOa4jRsatdwV0WHUlHehi844IXO/9ZZjH33hZvDqPecC0dOu04ZZ58oEMFbofbC3SkJawBuUlj8kRm8NzJE1Dpw8ndLg21seACaAZQOKUZlgMaxBaHThNlCumuhXZVcI5pzYYGNvaWSZpo3YXoXnF7WD0t4G850Kws5Rb1+cAJqGcL4Hg3fMk5pMD9+L/63ZnBgqj6iPktxNpUwcr+4MPBIMEgtLZaqcJf6ndI2EZzIxK0/gWpZLXfR68zqBvgasY8r14p42W51IwGq9myaD3Vz9NwqZhyTDvowUBHTYm4iI1tiefNEaCjyTrPw/Nz9cF3kU4kqw6qtcN+DpLFbCtpW6YZWKD6NvEXeX7PjkWc1d93CbTRSf4xJK9IO90u30hJVld3C/T+pdFbUHiFUqmtLhM2d1tYsg4KhJZROK5ab+lAT78Zw1lRV9W6HIiY0JudaIQw4p+MWCUDUQIn7w/MtsRK81jKGghh+P/IJ5SI8ea4El6t1cXToplErK3nz5WkAA+1HI5eNtbLcyWEhoIdfN38HnjDwBewz3p5V9/RJgEM8uZBsfAdldvZWezCTRS5mPvwYH465YH2/P259d4z5fE/idSNHpgOF3VD0ro+qdd6veWtPV6n1Dj73Q7XC9C877nqewhobUSO+ArBcv7zD6ygqX7q6BlkBB9dOY/0N7kfYODQsn5F0QAseP7x8cR86v3W1P2LSUtZG3HT5QAM0BMm+Pw3PjVxjEgqLsosElq8jr1oLwTuYMRB2RiLqF8P9VR X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bc42345-3dca-48f8-b87f-08d92d072cee X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:49.3470 (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: vKfZpA3XG4Gr8g+shEM4lMUQVwA1pcpgyaraO9qZGPU+19CzBORMDDS3NFNGDEyRE9qRwxC/2+sXPB8cMmW+nHAH6ywl0BdQHvpE+6qsLhA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-GUID: 3_OYOMLe3ku5Z_0UNezvl1lHxymALk7j X-Proofpoint-ORIG-GUID: 3_OYOMLe3ku5Z_0UNezvl1lHxymALk7j Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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 --- tests/qtest/erst-test.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 111 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..7d97d62 --- /dev/null +++ b/tests/qtest/erst-test.c @@ -0,0 +1,109 @@ +/* + * 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 "qemu/bitmap.h" +#include "qemu/uuid.h" +#include "hw/acpi/acpi-defs.h" +#include "boot-sector.h" +#include "acpi-utils.h" +#include "libqos/libqtest.h" +#include "qapi/qmp/qdict.h" + +#define RSDP_ADDR_INVALID 0x100000 /* RSDP must be below this address */ + +static uint64_t acpi_find_erst(QTestState *qts) +{ + uint32_t rsdp_offset; + uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */]; + uint32_t rsdt_len, table_length; + uint8_t *rsdt, *ent; + uint64_t base = 0; + + /* Wait for guest firmware to finish and start the payload. */ + boot_sector_test(qts); + + /* Tables should be initialized now. */ + rsdp_offset = acpi_find_rsdp_address(qts); + + g_assert_cmphex(rsdp_offset, <, RSDP_ADDR_INVALID); + + acpi_fetch_rsdp_table(qts, rsdp_offset, rsdp_table); + acpi_fetch_table(qts, &rsdt, &rsdt_len, &rsdp_table[16 /* RsdtAddress */], + 4, "RSDT", true); + + ACPI_FOREACH_RSDT_ENTRY(rsdt, rsdt_len, ent, 4 /* Entry size */) { + uint8_t *table_aml; + acpi_fetch_table(qts, &table_aml, &table_length, ent, 4, NULL, true); + if (!memcmp(table_aml + 0 /* Header Signature */, "ERST", 4)) { + /* + * Picking up ERST base address from the Register Region + * specified as part of the first Serialization Instruction + * Action (which is a Begin Write Operation). + */ + memcpy(&base, &table_aml[56], sizeof(base)); + g_free(table_aml); + break; + } + g_free(table_aml); + } + g_free(rsdt); + return base; +} + +static char disk[] = "tests/erst-test-disk-XXXXXX"; + +#define ERST_CMD() \ + "-accel kvm -accel tcg " \ + "-object memory-backend-file," \ + "id=erstram,mem-path=tests/acpi-erst-XXXXXX,size=0x10000,share=on " \ + "-device acpi-erst,memdev=erstram,bus=pci.0 " \ + "-drive id=hd0,if=none,file=%s,format=raw " \ + "-device ide-hd,drive=hd0 ", disk + +static void erst_get_error_log_address_range(void) +{ + QTestState *qts; + uint64_t log_address_range = 0; + + qts = qtest_initf(ERST_CMD()); + + uint64_t base = acpi_find_erst(qts); + g_assert(base != 0); + + /* Issue GET_ERROR_LOG_ADDRESS_RANGE command */ + qtest_writel(qts, base + 0, 0xD); + /* Read GET_ERROR_LOG_ADDRESS_RANGE result */ + log_address_range = qtest_readq(qts, base + 8);\ + + /* Check addr_range is offset of base */ + g_assert((base + 16) == log_address_range); + + qtest_quit(qts); +} + +int main(int argc, char **argv) +{ + int ret; + + ret = boot_sector_init(disk); + if (ret) { + return ret; + } + + g_test_init(&argc, &argv, NULL); + + qtest_add_func("/erst/get-error-log-address-range", + erst_get_error_log_address_range); + + ret = g_test_run(); + boot_sector_cleanup(disk); + + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 0c76738..deae443 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -66,6 +66,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-test'] : []) + \ qtests_pci + \ ['fdc-test', 'ide-test', @@ -237,6 +238,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', 'boot-sector.c', 'acpi-utils.c'), 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], 'migration-test': files('migration-helpers.c'), 'pxe-test': files('boot-sector.c'), From patchwork Fri Jun 11 18:31:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12316387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6A8AC48BE0 for ; Fri, 11 Jun 2021 18:37:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 56570613AE for ; Fri, 11 Jun 2021 18:37:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56570613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrm1s-0005wo-HU for qemu-devel@archiver.kernel.org; Fri, 11 Jun 2021 14:37:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwl-0006d0-Ts for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:32:00 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:12136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrlwg-0007iF-O3 for qemu-devel@nongnu.org; Fri, 11 Jun 2021 14:31:59 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15BILjXr026773; Fri, 11 Jun 2021 18:31: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-2020-01-29; bh=VHZgB9/JCcXHC00Els2OxK+syRNbbpXiV/qIe4aV4Uw=; b=GdN39JCtyu8KbBy4JIosKfTWwrPHJ+yt3fUuFkwPRNuq/PP8BwxM4gXJQ2Jy0TcwYaCe tdMdj4FpkbyrBVrPJzdXmEf0rqx11utnyXB50EMBun+0y8w6UIatrO+4haAw46GZNl+a y9Gel2AKKMouhVihj9Vhck8tIZqh0onbv/mLOOLM24Fos5xkQUxd6yjPnzWhrZktTC97 GxsrTJGMseMBLJTRfmA+h+YbmAgyUJUiHocqgzVB/z3v1Vui3ouc7ZWp5kkabGfk5OiX /PD5fpEPuhWwifo9dFi3aNnPYAsExokMy1z5p6YNBS2T07QVwekkidypyFphASK/2L4h oQ== Received: from oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 393y0x08ms-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:53 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15BIUw7p163567; Fri, 11 Jun 2021 18:31:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1u5ava-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jun 2021 18:31:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BliL1cvT02YQ7l4V4Kdou4kb7Gi6yV6E4AmcKgEC9dcmsdi9q5VLpsfZE2NRRw2McKf1p0EwleN5YhWgrE+QxzWgNKlYuHStQ9dhCHxJIvbW6UHrl44tEVeRHgbgt0U6lONIlrCpn4St/dzIZkPBRaUBHMJVpf99zRm79OuXLJqmqGWff5LAMLWDYCH5U2JNxwp8k18j76ZRyE2eRRlmhiu9LVad8lq+4PIutQG8m3/vXBG0l0lHfR9K+ZDy2GXZZhxY9JgXcw002Dq9lP1pOQ46RIii+QtcXuCbr62HjEtFK5hr1IL8tv/JXNXxz3olNmBbWY9youykGzEhbQeOng== 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-SenderADCheck; bh=VHZgB9/JCcXHC00Els2OxK+syRNbbpXiV/qIe4aV4Uw=; b=IHLhFJKmkXO9q7Kb0GrGjdPsuxEkXh6f9AX7e5pi54hrCaDnKKmqeR4IqVs/l0RHicP/8cvcdBg2rrN8wirlOnLFaFSiBkZNUpLVbvQABJ1O72zvawSs6raNjRJI74XJ0UqCxh1tWyIxKXzEt5D8iWaeqF/AP0C2RE7lfYCJoepBWFe1ca6I+Dd6c8FDazlR1M4ynrJJvBdWQ5hitf6f0d6QMeyA9HhLkj8CLVNCag+P85PhRqH7hZuXIeS75hrlIUDyiURde7mN3VXaLfZl/C9SM/XREKhzyL0izXvMt5QMRRTFPaVciCLLQOIvsWVlnP1mWdQcEThK6imlc/faLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VHZgB9/JCcXHC00Els2OxK+syRNbbpXiV/qIe4aV4Uw=; b=sySgtWsYG9xyFQIiGOQV2ApPu9gVfZ+zpyItHpptrU5eYkGirMLS9EnGxDNKGJKJrcNDA1ux/2oBL1VmdtN2QFKdPK/K0V7VG8+LVZ2kY+TC91G5Egg4eYty+tipAS2W0Zk83d40K2dijNqQuhgr75bZuH0OwVVlNB+yrDX0gHk= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5457.namprd10.prod.outlook.com (2603:10b6:303:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 18:31:51 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::a0af:e69c:6e81:b8fc%7]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 18:31:51 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v4 6/6] ACPI ERST: step 6 of bios-tables-test.c Date: Fri, 11 Jun 2021 14:31:23 -0400 Message-Id: <1623436283-20213-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> References: <1623436283-20213-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.201.23] X-ClientProxiedBy: SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0097.namprd13.prod.outlook.com (2603:10b6:806:24::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Fri, 11 Jun 2021 18:31:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd858114-7611-4537-6d88-08d92d072de5 X-MS-TrafficTypeDiagnostic: CO6PR10MB5457: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZSKYw6mGDcnpG9Uf4Itv9H3vUoThrez/MWrIhi1iV3Tk5D5mEYXJGpPF5iTZ2s/H/98BSS4itNXAcYDb19cL/CgCJmoE53p9sSKWZt8f+w+ihPBmwrbKg2WIu7rDWbpSLd7qV8DDKlqBvHPm1v/NFYkNW5fhV7M96E11ZE/4CGnUjvtQU53VAQZ0nY4j/4xNOBTfupZRH6a6/rkAyVwsmrPlWrNz/ZqlyEGnhNh60gryxyIkdHoyloNM/CkTLYFAC4eaCjPJ8uN6hedHLUlraP4fHcYOyEi7xsVqE+lYnxddCRjX88YSp5xV6WNvNIhGOY95edjNLuDIwAtPv6lcYmmLeSR2BUmmac1doppei4MDi0OU7ua16cdsQfw0jm5zG1R/fukaBGCS6xrkbYn+SYuKSf8RZ8H3sOQXnilSroOkCXLs476xNiD1rt3ihtOOWOdclsE900WtfVCnAG5tf2bLPF/cBpqkkHp1iijh4txjKrbSG6bjzBRK/nPyMf+LlUU0HwbOPSXQBwN5FUTOAf6r7QhmhX6Pn1H72DjWiYG6GeMRDEYIGBHkbsMbrcKG6ZJUDpz7WSOZNaWCrn5FNRSQqruSjKOQ7M9F8L17EbSfKU/FDN1go1IqlaAEHmm50J8sHnchMdu7e0UnjqiYlA== 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:(376002)(346002)(396003)(136003)(366004)(39860400002)(83380400001)(7696005)(8936002)(26005)(36756003)(52116002)(6666004)(66556008)(186003)(6486002)(478600001)(66476007)(4326008)(66946007)(316002)(5660300002)(86362001)(16526019)(2616005)(2906002)(6916009)(38350700002)(956004)(8676002)(38100700002)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u8sTkJoZkenJwDZxbGZbzYi3l/eHffWd5OmPDnfhYA2k+gKaVRXsDlDxEnqOP968SvynUOXiJTsRXZB5RkZ9I31drbViyDo2ENY3zqHQnqEn+t7HKAMrpQGf6uUVkkTI6AAoOFPupCG0WS3WvU9Ty8LPjnm0nYYXnJ0hE91SSSUQs05L6UL5J1h6V8+ANn/d3tiD/GqIYhisJxvtSmmQfThzigc/IwwuCb3Kndunp7U+gNjS5bw6Eo5G/0Z8TELq6CrnII0XMJ7S1tzzasp+EYcUkEHyHW6yMOfXHOwBCy73+Q/FrCrS98sap22Dza6WvRT81g6Dg1Id3zKC4YtR4lo8IOjiHA4HjMRqAsEDX8yDSGhC27LFI+Y3+mYFFlMa73s7I2tMTGOkH2FOkyj/lg5ydkZpE3Tbc/pUfwI/SPQ129foC3+L0+HThA+ByY5KBJUycb/X6nRXbSfAHQWv0CrSeG7IYs7UP47MDBetrFWKINrANJ9VdoC1QqEfeu3wZgOYHVN1/m6YXkUaDq7W7jIoFjpa2DYvZna8SjeqsWeEEBha1SexZ2PADzO6bam81idOz2oz4SIUlCNm96ojMykHULW5cyWKVeSfWwXF3zgWS7aF5oDXFXTMFwoIx4h5ERKbG90GAOhX2Vo9rRZ2/d6Xmr+LcJMOLRIPoA5yz2+bY+azVAwYC7SrH3zofJS4FYefhyLmcvdPMQrsHBoeFRbhTGdzx87c6x7eS3OZai7Q6e3vM3IYlPZ7FH5/OKkOXj1uBP4vWuHyppx/eng7td19LLpo8oYfm6sHW3PqmfqaW9dl30K7McH9FBVsBEdk5Hyu+RDDEyLL2tedbViUqJbxFewtYxgrdnGo7GFv2pr4k7FursML6TKaoFwajrQ0xVjPfwOc5j3gV+q/w1GmdAGRK6hS3YZW+pawWVj51oM8QAG8R9ct9cjdGtNUM+H8h+XOp7PdDv91zkCWaNQbyHyP+K9GAJTFD/oZUTvBzuzANObJLtqTZjnSnIbZ6T+7tYR9C6DFDsv4xxKvaBx08zmVfSwFZYJKNsGlWNFZVmqM616FySjK2Hx3rc+dSVxDqbZM5RoAC80f1o5IYC8V4Z45BMCsevTwQq0zLxypJ69p8UJAotP66d4RMOKzAfdV2kbEzvl3G+r3Jb9X3RZqnkAcX9/vsrbcOJAV2mlJIjRN/TEcgfAoTEdVR7QQj9s4bJoekcECfpH/jU1R3JwATotOTl+NjbpK2KDg7is2ayj71a7eKrI4vIU3NMoSZjPQTqo+PGqWsmDu2L5983F/A8rvQQ6/GueuBF7GwsUC4ii5JmgnUb/a4mg8sxCuS1KT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd858114-7611-4537-6d88-08d92d072de5 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 18:31:50.9519 (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: Dj+KjxuXkrj/2ktvRDIzi2LOj9dvhMp7YVX5FchL0Jzrez7zHz/zthNZix0W4r7XTUfhXHdq1re6nzPcXRAOOX0+3io5fxpBkJGgD6JdOfU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5457 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10012 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106110115 X-Proofpoint-GUID: vnRcd-RkYG3eySHR9N5s27tJbkEEdPrW X-Proofpoint-ORIG-GUID: vnRcd-RkYG3eySHR9N5s27tJbkEEdPrW 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, 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, the re-generated ACPI tables binary blobs. Signed-off-by: Eric DeVolder --- tests/data/acpi/pc/ERST | Bin 0 -> 976 bytes tests/data/acpi/q35/ERST | Bin 0 -> 976 bytes tests/qtest/bios-tables-test-allowed-diff.h | 4 ---- 3 files changed, 4 deletions(-) diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7236018951f9d111d8cacaa93ee07a8dc3294f18 100644 GIT binary patch literal 976 zcmaKqSq_3Q6h#Y^dE9^rOK=GWV&b1h{BUvZ#VzQD#NN_})srw9ZqJfYH@yl5T!0*@ExA}PsmTmxA~y7^f&wF z`=C;Mzb#Jlr!;>?JY$ah@BPi%Ksot29-5NhSucQ c)srw9ZqJfYH@yl5T!0*@ExA}PsmTmxA~y7^f&wF z`=C;Mzb#Jlr!;>?JY$ah@BPi%Ksot29-5NhSucQ c