From patchwork Wed Dec 15 15:38:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF5F1C433F5 for ; Wed, 15 Dec 2021 16:09:04 +0000 (UTC) Received: from localhost ([::1]:59562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWpz-00079e-Q0 for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 11:09:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMb-0000V8-KH for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:41 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:32228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMW-0000RZ-4d for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:40 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEKA6h010344; Wed, 15 Dec 2021 15:38:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=CryZaV3qVrNwy8F9v2NglfJiTWLO9qhe6EpI9iO8An41/3CQ8mVFhsT4n85XK8z4s106 VOKv8YnKGLQOwabFDvVtwX1BCcDwG4ZqjZc+1YXEAhkLwBxxxPCxJYF/vEIHcpUC/v83 Qn53Af8hBhjLmQRkFJVFlHeVfQU0zV/6qQ3/hDccNzINsyjE3j2REGrDBcV3kz16hpfO ay7IHNznSLUqdKek0aB7+JP5311KOvr5HRCsHtLZ/Mw3PhDuB06XHHqzBK6vPFBXk47T GeErD4s8D5tpEL+6OMJO3pbRoaSOk+M3TAHJoFbKrCvoubI4hJvm7f4pdNXj/o0TXUCp Og== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx5akey6q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:32 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUXT5094314; Wed, 15 Dec 2021 15:38:32 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by aserp3020.oracle.com with ESMTP id 3cxmrc0wfr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8WX23wVdtn5XQW4/pVu9WrNEIxerUZO7UjA23CMfuAIXWJTilMnWS20O5MyKvj+3XGF7oRPSR0fPdUV9i8CFQ3D2LFtY4r5hG2vdttxuWB6DMNB/NWynMbFbcF0NDNP86SITozSYpn9VyPHVjHouM5NVHtHYOLda/CxRWVTtkIDVfTiJb1aFw/Wht/f9mpPqhidcN8U5ketaB43N2abMJUWmNwDZOJB1uT55huZ8dcYFR46wX5jsMUp/32pEJJZq4DVc1anDd1s/+5yHYQCdS4SU/8b/kC/W26yRirgrpmvtFVxYJPndk70I5KzRBlsF80RjatW3vGPrGUAbw6EKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=WGlRvrtkAZQlh17tkoiGG1gIbrGXYWe2dyAaOOsASWUqLhZZKTwYuE8ac1NpmPQbI/O4jA4AZpvLcoV3WZE0PN5PVcIQ72UuMYqyrCzOYcMZVzXX88CD1H1BR8Uk1iG8ElIcNMkVAaZr5jUoldJMZHKPkbo2N2rkf+x5zFnRtvMzSPuWUOTriZrEFJE/ekIBfAFfo4lxwdby1U5a8FSdJZLF4KC6TZlp4Cfi65R5mZvsdRIcl+vL+6wClQUFErVq+/bV/vAHN1L9HHmjU8oVF7iWIWzmLM4qBv4IbqHqM3TyehhwJaDXcK59Pi6n4wYJJQgB9zw7pKJSlcSNG0z1vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kw5zRb6fcbfjGiIjU/ZOl679L3q3FAE7+fmlUiHRVQ0=; b=Zbgl5oTxoONIyE089iYri86N43z/4ISoIdQQ3zwp/eo0khYPHV99cuWAuTXjDnt8dxivddoPLln6IQh5QdVHP3h+guZXUbeJtWEcjTAybllZHBLkE2DYtJtAGhT9j0LJjrxQgPZTBqlTsPjbaSTKZiFusAmRYALglGr2/9u5PhI= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5441.namprd10.prod.outlook.com (2603:10b6:5:35a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec 2021 15:38:31 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:31 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Wed, 15 Dec 2021 10:38:06 -0500 Message-Id: <1639582695-7328-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f98b2785-ba21-4e49-a30e-08d9bfe0f223 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RmgA+Hw3BYj5kkHQaDcAcY9wUUsYM3HL8yaiX+FjErL0XVctT1Zx9tjsgLfgz6LPCsvAOXHKwNwHGeFclU2yh1ipVGJ3MLLWeJE1TKdHerQQWvRyE5HljcMAlwcSeVeQXRA8Gw8omtLQVe94U6uUZVkYl5B2QyCqf4HdtMbASPTQgwlQMtaV2TuxBS6nQYsogR27L6uVQfjKWHuq9KNQeBZQZ3SRqr30+JHUjxyq31WVuywWCQxWOK439RRQT8XuswDvDu2U2ibvZq2XmuTyx45dA3D1VKaeD3/7YM75Muq0hPzg1Z1mJD6sxEZzEszgDuMw74MBUKRP3GTr7M+BSrtRtSGz6iIOihjv0vFHHCTLcPJUIb8KQ1Ol3Nbfv57EofDNCVS1PcUhK1LViCqz/iHDfiiBApEC2UXPucwzRYAOCIoDiR0SdOlmVw2mcJSOwMWmdtYGLt3QhusaIQ5RouAS9d7RKYCWfSOI0qzDLhepWeWWlfkQ4hXPvx9nl1B37yPqZSiSUYFoQzfTdZn7hHD+Oqekq1+FlpXV3Dt5P4EG7JXSRy1xAqjXYFT/jnZEHV51nSRy5OeynEnhkwEdgN/SK5OacYP9AZvk5OhFB/b4vETZ/oN1zBbwFE17Dons1I7z4DdPkmTep7df6eK8IgqOi8lcTZuy7NssavupURziZZuUYLD6Dsnl9AzBfAvUIQFYWqDFsTwqoYCU4TBKRw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6916009)(86362001)(38350700002)(8936002)(66946007)(52116002)(316002)(66476007)(66556008)(6512007)(6506007)(6666004)(2616005)(38100700002)(5660300002)(8676002)(186003)(6486002)(26005)(508600001)(36756003)(107886003)(4326008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n+PeGPPQL0N7B2apYrmYBY/CaMEPPouDXB2DzcpDANgjj3dMaB81lryq8rNk/qCoudC1o2+/bIDElIXTPInx13Xx+koB5x58+AsOOx5UtxSsfgA1KwX5Rx2W+3Yhf1WX9jnXpJQP6UyHCPLjNabuQZzxi0HsF1U/1AI/oGOARQ0QtDvFpkzLSOHNER0WzLPH+QZoBp2LyKunDjM6Bw0hhLjRSCKvZBrVMJVpuqhUdLkl0EppBsSJhnd38nakZtkLeP8s0zLCiYl5v9VGFiYyKMwN2uSYBfwawl/OnIbeqiseQq3mL/VW6O9a7y0m/At2pg73fgPULfS9jQegMHVRvNSlYLSSF1N+Whp+3o0CallN+AD5U+s6tA72CH1xsCcyvzcMXfqvmjtf2dhF/PwWNuoy3pjBmaNIIokCUsUo+88nAyAN01xSRqKTgAJk3N1vw9X0AxvHDYn1v3dTb2uC5wCGAVGmjSGnrlI92dpgTJbbisloGGvTJeznhfm8bdR3QvnG96xhNEacYxBPaU4+Sw9DVD6Cnl22hetqCdEpM2EX9PQ/7iFWPOJg2rLnhIGQlLjzkytKTlcjVmbR4W7HuLJ6n0o96XuXVJxwufLPchvAOx0pS1NQZQK/o7GcG0Wytbd1SgO056K2Cf+v9vKt8SuUZFqD5IPb5lbrO9fIYue2CTJNBLZkayB4hETEcBuwDGuneke1GEUAHRRLrcLeuU/5443v5+b+070aGNI8xFssRhlZlEYmjcnJkolyNoxMHOE0KDzzb0OCCIlMGTBzVWwdCqgCtpOJyOFu1RLeDTq4Z/NVgPl7AqKIom+LINSWDL+a9TCMPuAmsOEG3eF0QehZ3kP1xfZOuHzf15vPHwVVkwL2k2IUOE9WZts+Nzs8rEtKLY4hKZhhBzre8M1axo3KxubkthDGzTZ5jdC6zldJQNpsz0jLfu/SuA03zXLKK5j17Mjwif/zWGibsCEhivQJjp11TSuELJNRHoLL7DZC7nqLtq4ZgYPWWMlFJ7f5yQACSRlipF86WdKH9ucBTU/u6kQ+JltmWxHbjOkBf8nVlVJeO19bt9CVtDNCsFzFmeqqT+Aq0CchBgLpuAfsiPB10AI4SBOl98rD0FFLaF3/xbU8S6X+ge1OsUMiI75p2LYjxN0kA8ZapXnV/FyRya0/aters/w/5LWvqgOVXj7NTDXVikmAzJ8ZXoUvb68I6eWTbrWWKpSNz10MJEZZN7CIJS/CjY8g9hi5lvBwpVtZWl7aKkQ9wHrDwfjJm738O13a0hvsxLgGMdMhyCOw4/vD2i9PdYGw9eqLU66/gqSugdgDW0KefL6utCkoeOMIlSgZ3Tkyz4qXOLzaJSwEI311gHAQf8fabh0sSrLEBN6PYpk39OrH8LHlQL3Y1nbWLJOurmgvtX1W6rcxsmn3XjiESKloc/Y9cd2bukq1nfHu1f1ffKNE37MFGuU50Fek+7nIAjkv/0rTyP1emBqJJ4gIJRHMgUSJlRnsrX7BW9IbioxjGArhqSSDxZ2dpdfAo98iayIEk1yFReZlemc2KFQgPNRTLL9qoEYlYq3cGZf3hMOwo+DYmlIWAtaK3Q/mSnF88GyTfYnP7fVMOIlhh7vXPDDd3nn4Jhz+N5l0+NAs44nvcEkEa3FdcpA5BzkLL9Lc1bkFWPkC7hTJb1St6g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f98b2785-ba21-4e49-a30e-08d9bfe0f223 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:30.8437 (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: DFXFjs6LaViNH/B5JAyoxOZ6bLIJQr0CYlrykyDx9hURu1LQTtDjT7r5mEybfYQVPsgMrUlYtHUPTGbvzkMQeVTjTeK72tjxzFXB0EDhB9Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5441 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-GUID: YBQNR0PlNARd1jL2GS-3DzOklr8Xp_td X-Proofpoint-ORIG-GUID: YBQNR0PlNARd1jL2GS-3DzOklr8Xp_td Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov --- tests/data/acpi/microvm/ERST.pcie | 0 tests/data/acpi/pc/DSDT.acpierst | 0 tests/data/acpi/pc/ERST.acpierst | 0 tests/data/acpi/q35/DSDT.acpierst | 0 tests/data/acpi/q35/ERST.acpierst | 0 tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 6 files changed, 5 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST.pcie create mode 100644 tests/data/acpi/pc/DSDT.acpierst create mode 100644 tests/data/acpi/pc/ERST.acpierst create mode 100644 tests/data/acpi/q35/DSDT.acpierst create mode 100644 tests/data/acpi/q35/ERST.acpierst diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/DSDT.acpierst b/tests/data/acpi/pc/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST.acpierst b/tests/data/acpi/pc/ERST.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/DSDT.acpierst b/tests/data/acpi/q35/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST.acpierst b/tests/data/acpi/q35/ERST.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523..603db07 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/ERST.acpierst", +"tests/data/acpi/q35/DSDT.acpierst", +"tests/data/acpi/q35/ERST.acpierst", +"tests/data/acpi/microvm/ERST.pcie", From patchwork Wed Dec 15 15:38:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74F21C433EF for ; Wed, 15 Dec 2021 16:15:51 +0000 (UTC) Received: from localhost ([::1]:42688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWwY-0006qd-0o for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 11:15:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMw-0001Bm-LU for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:39:02 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:37006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMu-0000WT-Dc for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:39:02 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEYwDE008125; Wed, 15 Dec 2021 15:38:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=qY40UZbBhL7F6PMz9e0T38FGJ6bPGZLxI+tlKjRmfcoEXg4s9kRFpeEYgffL/Y/+e0vQ qhhgI87w4gQ12L86Uo6I0dgT+nsNWdgiyQXuqpRN1cS8kQFN32WH/ilMrh8ohvW4Ciqf egd0yj+IHu6W+9EH/CvIZcPBdfkvS9gDvC8t6zqWOFVEcn35HO+6kyh3zRdG/GACsPgC zQ/j3ptGCwh/z2+SgVM47Ixc+EyAOReBDPPxz8sIAwNMkWCyxUJs+c310XGiBraqKQm5 pAIQ9zjkQyueJmDzJCCOp1mCEMYWmtUOUwRqU1xsrMFn5PY3UX4V1Ya4Ox58lh+ywOkz kQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx2nff7bn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:58 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWh5094224; Wed, 15 Dec 2021 15:38:58 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by aserp3020.oracle.com with ESMTP id 3cxmrc0x2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cm0rY0gS1uBwi78W4Rv8GnbL6AHkYnbuPB7QGBHugsHMMLh3IeOqz/WNRwVwsFX5YX5cpE6VOmxdGXKaQTwAAW3sBi2tTBpjK8dRjSDp1vDG6f1pfIia0epbpFDZzmoBRC7dzmh0Z79h7HytdwUCRRA9wXmH980qezPO7GgFWewk5IukMZWolb9DThAlRY1oIEly2pgxQXnAxO4tzceL0KlsHmWovAwWSCKkpXNfPRCT3mw4S3l5Dt3NlpbrDDCXE7FN89fpulMEhmeTY2mUvOwKPtb158b/6zKH5ErAXB26xChGca/3UnJ4MBJYo4TyjmdqaibApF8XJMJGYQAXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=CFZrWT9GiCp4c3Lp9+BdEhzWBNVFQvmy2HYRaY4pn69PWCN6/ndojDjuIzRsqtluQ6Ikch1NppW/aXuLVIoZ2ezjmTWfw3ENLhmND0iE/wF2ZM5JbcrYOCOSAeIZQvb4N4Z9cHUiycgxYQP8hMDVFuxDzuuDZEl+yRs8dDPmLU+P81ZrvoJrpYXCmvVxj5jRTS74Ogl6j5pxYdNLbJSSJ1S1CYvf6W9kgykeAMkSMR+wNAcU3v5cvjK6MSXCIuv/4Gxy66IYmD/4gUk9CN1Y229hW4+alln3Zi0A2o7Y42iIZkmCzAJgJnG5O0TigSqcdmItAsbjpJ1KbBR5M7ATfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=LShTSX4W/3hiMKqdgL83rb66hekN1w78GYab0I5mI3AyI7Q599guqRLbUtOtWnAgAfi2Q35EpigFZGPLQM90q+l0/ye1yWcfNhnW5G3ced69b6QPrvfaffO4UhcvsZfWH2ztA7BI9ozUe4qnlHq8fOmS4cXzuNu/zOB/xneS2Aw= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:32 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:32 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 02/10] ACPI ERST: specification for ERST support Date: Wed, 15 Dec 2021 10:38:07 -0500 Message-Id: <1639582695-7328-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05816870-803f-4251-d960-08d9bfe0f348 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lgfv5z5WiniMe96cn1EmcsJsZ9J7iZfo3vAUmsIr6d3H66esW+03z6p8YYOhocmVQy6nT88rc55Um8EUKhDvzYNo3NcfRS37+A0vjqBIiMIEP1G/89jf8pE/Cn9tCmdPoBqdNfGINYMuYAE668g5dON8dfb5H0vaUocWm+zInnRIE3k5jbQTpgMysc3orIgTLIWKH49tjAhHu1HBQO+imYe1VpWOUxm3L5KEyR+USL+m4ujLCwmGIVIYT1fw0ZKdT3HaRMJBvn1NJjRK5D6SOOLDXR51hu1FmKdzDa2Ffd6O9YYUnZaNo6ZU+LVs8yV/lCPjIOX0Wm0fNYk4rHMYcbU6czcVh4EzYo35T2Mnm30t4HrbZj+DD6Q0yri8hYD6XRJ7/V/mOKckUacXNNC0rvVeug/PTdVLsKOvQd5TbZD7uVbNbWCI6Nx1/H3UP7108icF2iXdFgjUsUrrrQ5gp33CX0jdNWRHbJBuCvPx7tEml0vvGTXYUFYMX7Cv0sL7Pdq56l0fUIq9HviJvIfV06FGziD0NM5kcZnE9O/HzUlSAqp9QCq2kFFZCL03wPReLxEOlZci07HI8EuiHwk8c1IrXEWOVY8naULX8dD3w9rd6p/brPpQC0T9JJ8eJ6GFM6YR8iNBe1qsIW/8WrvtDCWP4ebRfl31grKA58EP3QjYOAifBCzsRAZ4+BwR0cRJn6Wg1LZy3mh8jbQTIuT/1g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(45080400002)(5660300002)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ezqt8kP3960OMVs/bk4ozFH/Nyg6tOydtEZSk0TTSZ/1RFxOeoc/03HoukPpTekvOLJvk7tePUMHQqLvQqwe/pIFP7SaYwmkXKr0xFpRiWgDHeYCTnw7DXuFb7zY082N1aG3k1cmwoZ2yGAViTkaOhnNYzJn1Cb18uL4lpjKnUDaCnX2XBmqyRV6UGeF6p0NZJZr1Q0f6y2f/fyOkNy9eXhxrlUc/+dN0rfTyEf5hrdVgwEQ/G7mx7zPM98PQci0iYhUAVvfJJ6T+WLgCJPW1g4oxiYT27xu2UBj02XDOUOVFVOpybVYwCHOsjkSTnuu++enXl9B0voAzBazBgf43Xx3WLwSXokh57/uh8i6enm5ahRKvXM9gS6F83jbwlH4hBDHFc2nVDat6w1n8MGiQegqnDPjNnj5VFlEiqryqVAXqIlj80pn0f0Pyrhtd2qQYyQgvqZp/oKrx60O1gHyyASr9UwH9zQuT3BvfKz8vLve/phqsCr9YmJWYoVbPLJMkiiPuL0Tu9NrOlRNYJLltDhR/djeLRJ+IoS+c5hZz8XbB/gTyjgK/FphQS4dVJCsUWWTPTSQba+y8G0fF3x8w6AgNjVCGIU6QKbMYRw7LY5r7+Y0kyqo2c0gylY5E7i8riKcekCQjjlwCP3ctlG7TpGAlxVCEfBabT8z6PUyB4A1Ta2NBYX5tUZasMxd7RzpA0UFIkf8H1CQNwPeFs3/Lt1dY0SqyOMGhypz+B9pq8/JBxFG9qlvFqBND2WHDb8UjPYGHsXPANqbAneSvf4VlLz9ijGGE9+HWgjsYUUEEDKCEMk9g4zeS0GuM4GhHkUfQZArZcN+jts9wNUyxi6qL72fdmuRgS2xAf2ASK07kTdtkWf50HQiE60VnqyEme2+UEvYbvPsS27JetBMuPYvlHcWWGNAEL14PNNSqHG3m7Q1VesXHaJRCd+GPsnTBFPwWQHT7qqMmIamAMFilS5QuskrsXzRv3UJacMEr89uaUkb8Ii/kRV5sD0nJ4CtsbGx4++b4lcRIJclYaCabW01wEyxAc4d7mmcPmqWZsMTJ5UXIjJFdZ5AJKuM6ouOZpkQ8z+z7Ve3/oZFz4m1gCyynjpcH3QTglI0dHTNt+qmh7vXzEMMYYBCPXQEXfz/qaY2ZfSIEH+dGIJTTcsxx5c/J8zbYgXrt2O8lZyoIy2eqXbCV/orFNvq2JShvTYYfgaomj5EQ//f181QYZWqVQPENLIfTzeVG6nJ8/UEDtFNtFWvhQU0LKL3aIfitMN5wKxwHA7k1d/EGpxt711X1gr+oEHsfy3RQ8vXXusjT1UjB3QexAd+VRQW3oasdVvJCmJwxYemALDI4bTMoRfC9H4j+bOSfI+m8sEdhY6Z7HDyG5DyE6TV1SgS/WwjnYSRqJ9omxejbyD4edKBoIYf+bJEs6jcVpLMoBRnrUyUuMJnwBD+3rmYLRgUXmeHqz8PIC7/J7W6Eir2e+7e60SCPN9vCNelZGo4uHCdzX6+QZKNVQgEspzqrR091g19UnG1OGcI/ZaiGfYfUtpT9jMrtgfcmxGPbD8yrfCnqDl7fcO3/YXnkGjgu+fFYl5/3MloknuymWZQ89Uin+WoeLFGGSn7OcvhjoLW23/B666BFU2QKOzSjJNu3FAIReJGlvEQ1NnW8Y3jvEOrx3yDlmdLtXZRZA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05816870-803f-4251-d960-08d9bfe0f348 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:32.6259 (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: bcNdOzuWDpQtog5932BH0IV/apa4J6xVGcFrOc8qWmyInTgHj0WCC8+kVh2ai08RZWNip5k9eGqNSVfWVnDzJehpVOj/Wy7Kp4nbSZIhvp8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=449 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: alxwI3VD4rK-hhdB_n5PcITFmw8JdsDC X-Proofpoint-GUID: alxwI3VD4rK-hhdB_n5PcITFmw8JdsDC Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Information on the implementation of the ACPI ERST support. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- docs/specs/acpi_erst.rst | 200 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 docs/specs/acpi_erst.rst diff --git a/docs/specs/acpi_erst.rst b/docs/specs/acpi_erst.rst new file mode 100644 index 0000000..a8a9d22 --- /dev/null +++ b/docs/specs/acpi_erst.rst @@ -0,0 +1,200 @@ +ACPI ERST DEVICE +================ + +The ACPI ERST device is utilized to support the ACPI Error Record +Serialization Table, ERST, functionality. This feature is designed for +storing error records in persistent storage for future reference +and/or debugging. + +The ACPI specification[1], in Chapter "ACPI Platform Error Interfaces +(APEI)", and specifically subsection "Error Serialization", outlines a +method for storing error records into persistent storage. + +The format of error records is described in the UEFI specification[2], +in Appendix N "Common Platform Error Record". + +While the ACPI specification allows for an NVRAM "mode" (see +GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES) where non-volatile RAM is +directly exposed for direct access by the OS/guest, this device +implements the non-NVRAM "mode". This non-NVRAM "mode" is what is +implemented by most BIOS (since flash memory requires programming +operations in order to update its contents). Furthermore, as of the +time of this writing, Linux only supports the non-NVRAM "mode". + + +Background/Motivation +--------------------- + +Linux uses the persistent storage filesystem, pstore, to record +information (eg. dmesg tail) upon panics and shutdowns. Pstore is +independent of, and runs before, kdump. In certain scenarios (ie. +hosts/guests with root filesystems on NFS/iSCSI where networking +software and/or hardware fails, and thus kdump fails), pstore may +contain information available for post-mortem debugging. + +Two common storage backends for the pstore filesystem are ACPI ERST +and UEFI. Most BIOS implement ACPI ERST. UEFI is not utilized in all +guests. With QEMU supporting ACPI ERST, it becomes a viable pstore +storage backend for virtual machines (as it is now for bare metal +machines). + +Enabling support for ACPI ERST facilitates a consistent method to +capture kernel panic information in a wide range of guests: from +resource-constrained microvms to very large guests, and in particular, +in direct-boot environments (which would lack UEFI run-time services). + +Note that Microsoft Windows also utilizes the ACPI ERST for certain +crash information, if available[3]. + + +Configuration|Usage +------------------- + +To use ACPI ERST, a memory-backend-file object and acpi-erst device +can be created, for example: + + qemu ... + -object memory-backend-file,id=erstnvram,mem-path=acpi-erst.backing,size=0x10000,share=on \ + -device acpi-erst,memdev=erstnvram + +For proper operation, the ACPI ERST device needs a memory-backend-file +object with the following parameters: + + - id: The id of the memory-backend-file object is used to associate + this memory with the acpi-erst device. + - size: The size of the ACPI ERST backing storage. This parameter is + required. + - mem-path: The location of the ACPI ERST backing storage file. This + parameter is also required. + - share: The share=on parameter is required so that updates to the + ERST backing store are written to the file. + +and ERST device: + + - memdev: Is the object id of the memory-backend-file. + - record_size: Specifies the size of the records (or slots) in the + backend storage. Must be a power of two value greater than or + equal to 4096 (PAGE_SIZE). + + +PCI Interface +------------- + +The ERST device is a PCI device with two BARs, one for accessing the +programming registers, and the other for accessing the record exchange +buffer. + +BAR0 contains the programming interface consisting of ACTION and VALUE +64-bit registers. All ERST actions/operations/side effects happen on +the write to the ACTION, by design. Any data needed by the action must +be placed into VALUE prior to writing ACTION. Reading the VALUE +simply returns the register contents, which can be updated by a +previous ACTION. + +BAR1 contains the 8KiB record exchange buffer, which is the +implemented maximum record size. + + +Backend Storage Format +---------------------- + +The backend storage is divided into fixed size "slots", 8KiB in +length, with each slot storing a single record. Not all slots need to +be occupied, and they need not be occupied in a contiguous fashion. +The ability to clear/erase specific records allows for the formation +of unoccupied slots. + +Slot 0 contains a backend storage header that identifies the contents +as ERST and also facilitates efficient access to the records. +Depending upon the size of the backend storage, additional slots will +be designated to be a part of the slot 0 header. For example, at 8KiB, +the slot 0 header can accomodate 1021 records. Thus a storage size +of 8MiB (8KiB * 1024) requires an additional slot for use by the +header. In this scenario, slot 0 and slot 1 form the backend storage +header, and records can be stored starting at slot 2. + +Below is an example layout of the backend storage format (for storage +size less than 8MiB). The size of the storage is a multiple of 8KiB, +and contains N number of slots to store records. The example below +shows two records (in CPER format) in the backend storage, while the +remaining slots are empty/available. + +:: + + Slot Record + <------------------ 8KiB --------------------> + +--------------------------------------------+ + 0 | storage header | + +--------------------------------------------+ + 1 | empty/available | + +--------------------------------------------+ + 2 | CPER | + +--------------------------------------------+ + 3 | CPER | + +--------------------------------------------+ + ... | | + +--------------------------------------------+ + N | empty/available | + +--------------------------------------------+ + +The storage header consists of some basic information and an array +of CPER record_id's to efficiently access records in the backend +storage. + +All fields in the header are stored in little endian format. + +:: + + +--------------------------------------------+ + | magic | 0x0000 + +--------------------------------------------+ + | record_offset | record_size | 0x0008 + +--------------------------------------------+ + | record_count | reserved | version | 0x0010 + +--------------------------------------------+ + | record_id[0] | 0x0018 + +--------------------------------------------+ + | record_id[1] | 0x0020 + +--------------------------------------------+ + | record_id[...] | + +--------------------------------------------+ + | record_id[N] | 0x1FF8 + +--------------------------------------------+ + +The 'magic' field contains the value 0x524F545354535245. + +The 'record_size' field contains the value 0x2000, 8KiB. + +The 'record_offset' field points to the first record_id in the array, +0x0018. + +The 'version' field contains 0x0100, the first version. + +The 'record_count' field contains the number of valid records in the +backend storage. + +The 'record_id' array fields are the 64-bit record identifiers of the +CPER record in the corresponding slot. Stated differently, the +location of a CPER record_id in the record_id[] array provides the +slot index for the corresponding record in the backend storage. + +Note that, for example, with a backend storage less than 8MiB, slot 0 +contains the header, so the record_id[0] will never contain a valid +CPER record_id. Instead slot 1 is the first available slot and thus +record_id_[1] may contain a CPER. + +A 'record_id' of all 0s or all 1s indicates an invalid record (ie. the +slot is available). + + +References +---------- + +[1] "Advanced Configuration and Power Interface Specification", + version 4.0, June 2009. + +[2] "Unified Extensible Firmware Interface Specification", + version 2.1, October 2008. + +[3] "Windows Hardware Error Architecture", specfically + "Error Record Persistence Mechanism". From patchwork Wed Dec 15 15:38:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C689C433F5 for ; Wed, 15 Dec 2021 16:11:26 +0000 (UTC) Received: from localhost ([::1]:36286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWsH-00026J-GK for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 11:11:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMp-0000j8-Jc for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:55 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:6618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMm-0000Ui-Qh for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:55 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEYwLl009078; Wed, 15 Dec 2021 15:38: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-2021-07-09; bh=BsKpnC7kaLxk41JtbrSpabPZ/1RGHWYpBxzYnzfhPiI=; b=id2hEJ/YgyQNjhm0oc7/vV2Wok9elSriBmI1947OBO0TlrY+AYMQMolgfziZWRjO7RMU 7R4NRWq/ak5eZyhkQPh/I5zOYEdwPW6lB/vz10/TW3xJUAToFO9Vf2hhFyFUroJD9ES1 v2PB4+Km2P8Cyn0bahmo2iR3NaxvKfIvilN+2ZegRWSxORMhJ3XrODmbgIOZIxzZt5jA dyclX9dngoLosZxd0p0CptSl1wjo4tDuDZOAYy/m5wd6TLOB0i8BwQKBosbREfv0+UpW syy0+s7gI/KWxgRgLVF3Zm0zgMCRFEREEtqeX7fy7x4q/1Be4RdOTMjkbdkhOxIJGdoy dg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx5akey71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:48 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwG094240; Wed, 15 Dec 2021 15:38:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgXdHi8QT6IZciTHOVB/uXKLeef/nnhDZ2UKQEYfu+xt5D14XZI7b++dKPabHrxwalhgCw7LP6qtcasXZ0M86VzSQuL8WXPjX1ClRt1JP1tuP/boNhdBPwuVRGJn28xoThOgA9rdEkyGO5Q5ofeykX1rnogxwITNIyo1fq7O+EW8Hi3KTbMRDVtOTkcTbadfnjVOLg3pmZ0T9dfdTx6nvIdDF46z+jVVhoCNXSv7GA0MnAR3PgqHDeF9LCwr2PV2ABoLGYf6OKm/A5vywXy0/wK9chWWjJrBVEvuz1k6PLGE5JjXepBZZgLkD1Pkjren3fnTv7Bc0idt2YKkxfaHAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BsKpnC7kaLxk41JtbrSpabPZ/1RGHWYpBxzYnzfhPiI=; b=NsZIjk4nlYuKD1uIeoULWlR765vEbJMfMLc0UeFriVLi0SA6m57oZDV/rFr9Ff+0nvxXRVdn/o+w+lb2CjqIWmByRkjRZ61ZGnxp96jWGPOtjgVJm57ApRVkeS2tfWO45iH17b2GkzZWSJxCW1POm38/rkM+J2daB8+pRvXfF9GYQGCOg8mx1/K77gRuPzORx7l/53suljOsIXL8elarHjc0IZpjJucL5L5pIwATS97ZrgNp7CR2EYIG1XE1E/skQDQ6Bk4gyoyshkQ4LeDf5Es6TphCpY3dRa+5tZ+MDK+JQ/xkntPdBb4PNyGbmEy6M4nj+TCY9ZOLtMnunq7SVA== 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=BsKpnC7kaLxk41JtbrSpabPZ/1RGHWYpBxzYnzfhPiI=; b=DZ/AWA432Sb0r8IX1pGHSPOEyYK0aykfyddM+4GyT5Dyzbrsqf0sVwGASpfae+j68oMeFC94RkzHE3dtHj1JXvf9BjHiH+qLdPJ5YjhHnT1CMUOousB28u4xaR5cSkok1SgRGvj6a9zMLwuJNMnOjmef/mJUGHjo6kEnvnxtLrc= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:34 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:34 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 03/10] ACPI ERST: PCI device_id for ERST Date: Wed, 15 Dec 2021 10:38:08 -0500 Message-Id: <1639582695-7328-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03d81187-4f22-406a-04eb-08d9bfe0f454 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gat6x62l77Y+BE+83TIX7s0a053fKZrQA7JqGZ8pmnsxNTGMmyXZFMafQG5d1G9+2IW7QzauQxZDmWRjdnFuS8GznUoSlHFzYbTpUSHNTby4q3DXxwi0ilWGQeAoX3zfFHnBNGDY/YJGhcdidyLBacq9CzCL1tdqg2vX1Ymuw4EU1l0X/yrV9nnAF8EeOLhFHb0fVPO5qCMQmfP/Huy/OyktExRkkxRmR8lnO6TZNIUJVLek0LFjaWur+y5wGJCSHzOflWIkE1NdamOEpdFrSmjMpkisFrpBtRGdsWZo2A4cZv0bFbZN1PYtv/lFgc+MQLv+/yTqEwPflOoHZ3614yq4EdLA45fqntL0zORkSHA7k5H1Ma9IQZXnCF7QImJMqVR//7SKgxyugH4dAqwV4rT2Uxqk1NeAgYMdLGETDv/ywqWCTukdF+ldOw0a9EVU+i86slCXISlEMMkoYwjiVGF64BMdtdmBXPDrEbWnldTHTj4zKJ6MD3TGacbmB4lzT+z2uRAtgU+CJXCcmtpInxsmgCilA54r8ATyMNTLl4KbdznjHQ5y+7wM2ENPKLG7/m7fnIcO4/kwcjhYJGSDXlXu/sC5nQZttxf8PVeWMe0+sb+987qSETJjj7+yaMVhINEMTJq/hWLEb2gygHLrX1qduhHLssmvYrOSDhWkDW9Xjgo9G9J2+/Kl24u16baEQ9pzs8kbQ0G/NOorggyL3w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(4744005)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H+SiAhUlGuJW9IPHKzzOcDneALAOO3kYz5nWHHnuVC7btdyOH4d0W6N/eq6NcRyoQlEIc0hU7PEPk6LjMop432v//4+pwtr5yhpjALD8y+1gnAbA/9bDzVptQsBtQa4DP8B22mcGMp9GLHJbef07r046sB7ydDTnvFd5K3VjhaPITGvHzDxO+XIJf0WCjNIBAoOtOne/PAiCQuf/k5eDdGuGHpqJjxRrIYrJfycrImm9mOVBy1NxdxzHi83I+Nz7sVQUuxt7l/wqmVw8OtYcSIXBFVOq8NiYylZHY/YFhPiD1XQ44kkbxW5FBRjEbPBib+xDb2DyhZ7NSpOu6OVNwkmE4c95Gr9LzyOmRVb+hfIy5uBIx+f3dsn7DSsdOT/mRiEX6xDYuUeVVIsYYlo9AK3HodASI6MHPA4vMgrSRq+2Dp5fTt7Aa/mXd25D2bFGXM94yX7wcYfBRus530A6Zty6/3wOTHW1PrMLUXMzPW9NFAQ4pHGo6DYS2Qke2OrH7CF2dlS5wMkK1sgg9C6u4xy5qjETVJjvTdeRk/zoNuutJlMDZaiQfrmuz/mnhuu+HkyWs2gkHwjjKfaXxs+D7raZKyWcSJoLfDaBZe2HlDfdbdBdMNyk+ryvb7rW7fM30fiMrX5Z3tqR0eHGYfilsqMeC1e2h/sbq5EoT3a8+rPMX9kXJlRWLPnUkeaMbn0gw4PLmTIIrBiUwbgJkqTsbVmlbQYxOZCZohPpaGOtrQLolh7qt77IF7b1NOtUUfqE05tqGcy0T5LthEVKvbTnBfL0gZgSbeS7fsC9JrpfdzykMzuJuxcszWkBMi+Z+mpxCO3v32DTIu8NRPIDi++RNPWa2N1IkqUKCz+QAJqqO/xBpokZj858gkDg5b3w7kDlicuS+QogzYMLcVFUQMqRHoc/0NS3mUPst6Hj+u+2KXtO0UOWykOeBTbExofoLKlUwRVbT237QoPfDFQ1aP7rShi9sM1IMBPsDcgeVtAq+gU1pCVOwO3IPBkkgapDP47n/Jz4vrMEOwpi0sdLWrGe8ep+JuJJi82lfa2pLT75VcusuyE6W2Q9xXi2Wn/AbQNXSMFyIQE8fSKs7iG3jio2AZOc8OmAkXezKN6lz6f7kfiwwP3ZIVFgUaX1RNqpJEO49fUqXk/qnDsuvsTFrswhQEgWAWCHMPsyQs3PFK8KMoOfxCU+17GrK4GMpOILGQKss9mSqhESTjC7jGP0B+l4RYv6Hb6iLo8pgfEeD03YY+BEXdYy+39BJkcZkN77RMWhLGmdgmcoatx+9kUkYuJVzdT1oMzpr68YsCSKiuYGrSgJ5aBdd4vq8I+FKFJPcf8g/42NCjtONZhABdlD0guPjVCbHdHtyLD7KxLJZggoz25t+daD+zeWxOgQhnhh0t6a6FFD4OqrzEgBoNvCcGU4tUN6vYQI7fvohWe8DENuxceNrpsVPSOrmHgmiitDoLRLq2mmvJdjfTu/ZJ8GFKZSVOCFzjvH/UGJkUPskpIYnVni7cy9a7G0L4O3to8Ly5Kj8AFjD5rdh0RYh+9jy9M/Ya+L7rkO/HL3mE5F13FY+3NrDHM6UmtEeoyxym89wk2hgkkb86DuYYBTEL+vANEq9k4zSnB9LuF3/stEBLVLGxaK5+75FVCtnfMzorbQH3L6/mFlCb3jj0TJCFI9sITJ6g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03d81187-4f22-406a-04eb-08d9bfe0f454 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:34.3924 (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: cluP1w8R+mUSfjsxX9Jc8aLca3kUlxGA5IMHjKpOSuVtxjtetJDmdVeicckJIzYeTcNTUPk7pdjsu99EmmdkR4xjO2LjPYvAOsHcWN6dIt0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=862 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-GUID: amPKzlWL66B6lKWEVz3aPDbwg1CtPKZA X-Proofpoint-ORIG-GUID: amPKzlWL66B6lKWEVz3aPDbwg1CtPKZA Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change reserves the PCI device_id for the new ACPI ERST device. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov Acked-by: Ani Sinha --- include/hw/pci/pci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index e7cdf2d..d3734b9 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -108,6 +108,7 @@ extern bool pci_available; #define PCI_DEVICE_ID_REDHAT_MDPY 0x000f #define PCI_DEVICE_ID_REDHAT_NVME 0x0010 #define PCI_DEVICE_ID_REDHAT_PVPANIC 0x0011 +#define PCI_DEVICE_ID_REDHAT_ACPI_ERST 0x0012 #define PCI_DEVICE_ID_REDHAT_QXL 0x0100 #define FMT_PCIBUS PRIx64 From patchwork Wed Dec 15 15:38:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4CCAC433F5 for ; Wed, 15 Dec 2021 16:14:01 +0000 (UTC) Received: from localhost ([::1]:52754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWbb-0008E4-U0 for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 10:54:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMr-0000oj-2p for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:57 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:8132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000Uo-P8 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:56 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEgO3D008084; Wed, 15 Dec 2021 15:38:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=O9Yah+9BgDL0QkA3d8SCCSGSCokotk/bgqZv2YM8qtuXgZTZAPLemh7WklgIxBM+xNEv rxfQh8/9OTp1wOmnlg+gTQ/dypvaY+M9NrED4CQ3Qy4deSKDIeLG/a4XH3+IwV9BXxc9 ioxZUKCkM3iCvZGBeRnKxk/sr5VPX9r3T2Ezzf1s1RscEtYV0J87Xq/zitl3W/93w9Rm b5lsdl9J5VSiG6WqlsqeBA6L4jpSQhl/miph0FRBBfFXDjboteatfS7ih3Qsb0XXD8pk fe3NkGq8TibcTsTw5aUumSlp83cFCLj+4KhGhgwnscv3LxVUUP9A+KVG9I+jE/J8MnGp aw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx2nff7b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:48 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwI094240; Wed, 15 Dec 2021 15:38:48 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lyq6fd9Kma4pGHYFP5DcYzSpG7c9ugDkbcJ/A3VeW3BG99um6Ijj2p7tudrj3cV1TA6PLb7YTsVXvs6GM50769gmCTm3x8ZEpwyItYhASCh8qWcy4+50BAWZevo3zAKE0G9QoEPs4Glkr/2dyTlbz9CXg9r/LrLrGAeSRbka4NZlubnWJsgWzSh0wxl51tfRN0gExJILTRT1HeNyxxUO8NT7AG1Qv32DBapjlvH6nFMEno4cM1hVLwrDk+jyTQP0JSVaKAFXulxDU5tp8UWnnd+R5mmaO8A3JAgss7R9w/yaRFSWh20ZSW7MttgQekk7OCVJxoJGYITahso5py9+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=HhdI6oeNWi+LaqpelLdTKtMH5aFkXHyWiHl2z6nAJz1rriO4CXJLMAnYXeLO4+GXIFuztrZOTMs9EHRm138amh0QIeUO/YZqn9gVwv9VlfAlS2rjLLTHFqa6DHuG8C4z5DXasIop6y9BZvs5RRBUJlHeG5gmeeuHrte/3+8AzvNtt7N7d5tE1Wq7+orMUram7ngAB8CpSs3FnrOXB15Maz77Y5Jzd6R7P56j2T+pnOW3CuuW1o7yWRuZmm+P/j1ELBSta7bZVvcKfbCGgTA5gh8E9r1BaZ2u8mxrrodc/gOIt5ueA5LGsO++wyawb0KLrDzWKTqQfey4XkuYIvCsqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4/tfqFrWnuMBDAgJe9rHCzAWYYO+Rgg9uqlAZfv56E0=; b=KlUFicyvlxsrm+RgwuuPc1dAav1aAlhZDcjN+9tPSd5gSpq6xl6VreJLhBPmAPk6UuKTeNwkrQ2PaEsvl5atsISIHKGsoPDsYtU9x11JZMSZ7+5IyUywTHBjGA8ju+mavgA7/VC4Y6h/RgpAt7fYMgu9v8moxKQ7/4GDxi9HYf0= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:36 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:36 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 04/10] ACPI ERST: header file for ERST Date: Wed, 15 Dec 2021 10:38:09 -0500 Message-Id: <1639582695-7328-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e0d52b5-b3d9-46b8-0f20-08d9bfe0f558 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t9QDn0V9/RAnJ9/Q9UABbWRdiP5XoaO0Og90Hrfb3sfJZ08CQOJixcpSjGjCLiNVm5N39Rh6m1MRyZmj3wNabgIug6OC0IjH/2Gj4ktNBQFrVvcJwxAswIMY9wh3/j7kyVcjSdHtLmY6Gsn/yrB/3fdXJGdl0fzcmEPjOjSV+QmhHtAilpSihDUYFLAi4BphtLLeAopxs7MOza9pMSHhaKp5uN4VVdDF5j/1ASnJEODmz89WJaRlM+9UIvyw9L660O2Lpb4jEgkr7pmt/EEoVl2yJhH1sVljHD4gkJBTkUWEWU8I8ijruVedvE7ErGLzcrWpOWZDn8h/xMYbxVTuj6/ChAXZKrJoNoRxb7jw7mz5KFoVsM8w2XncOE7Gw3Z0ZKZWjJ16+yWcNgFA1KPLS5z7txwpgn4ZSYfiC9G2wbbH4ordza9PZdV1ry5d9DlaU6V5R9Hhz9j3BlH1IRgs9sIEKni5BYwYUYxPHRJXmfaha16jpFiPDx3p5oZM+71PWW1EVIXJNsRQHi6ctgFiGisW4w/Pf8iwZeykix/VA2IpCwGw6bEiuogBmeOGG+BNzCCJb5NdlAfcgo0RAFt3X5ZWVD9XPYDLlqH4aMsmrCaeJLVL+IQchqAsJud1ZK3t5rcHRnvAh6oQ9wTevihy8kWYwTWjGGlk5oM8UXNq7282l21KVxyFIRpSzvGwUZXhs/+SlCXPya5t4EnZwGbh+w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(4744005)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cTzZXN2n8NOGfHQsvRnXO63H8gmbB4wKG4MB8rWP4aHWb4fX0W0G1LbKJt2ixn9kw0KM57D6eH5p28N3lMlAURw6tVM59F1YTU8/ew/4F8PfiXGtKFjkkT1rt9LUJOd0YRhw8X5nvl3aaBkw2G+6Xs92XwMFKxtxW+WwX5Hd4guR4JHoe8ttunApwJr8peQCwMmGq/81NSPAmRohHiH+iRlPHOiyFFvEW6JqqQpIktC1UVjUd+qPxHy5Cbl7KZ7fi0+EQyrLWgIc0nDAzkGr/5BZCP5CFhATh9wPGs6GolJtOVpsFJJ/Wd1AJ6+VJmrmQ+c3qW6OBG0lW9CD1LzxOA3rNtLhMIevDwbMrje3GkRJoRM53lIl5/km4mhby3lQJbx1CmmPwron6bidu30VkNq9zNY32kEmK7Uhk/d4175o32r1yRwKcxyp/TErciC7qL4uOtohkEQUBjPvoApedx6FDIQx+a/6YfiW2Qn9zZA6VLlwr0DZ0h/MreJJwDotMOEWzVL4f5xjrWc3WhAoR3ZH+KHei1+lVIb0s/HKAHU4G5Z7AUgOh3CDU25tbV85KyGaKiqwQusPITNOUmu6nYRUXfXxqDHu9JxsdNut0z9Jo52lWNlIiR37zrFB1YHXVb5fR42crHWEbv3eRcY7P3RZ+3ZzwLKid41qAsec8oKP1iPP6pTlcoFOZiLMQ5/pnUAJK7LhNS+KNTdVfmpwBKg6vgRDkLtSBrt/KQByVHCtDCxFnS3awsNVQYnjD6365HLt2SdKgmG/raj338QbNszZ6/kOfP89yw1U0Rilh2Mx+yg8l0VKBHjuG+46MxBKJuLG3BLsbIQjIO8j7Gkd9LZs+a1OriYGf/ixX5k0/je/BUM4oEo9THIQiisns262EXhIQdKGIl6yLdh4dEdQzSh66yrXiMIn3nwStyb3OWH6s2ektJJQyIOrZCUQCXtG78VoUu8TP5Gg3gElmFAjsD4Qz/3ENe6XAk9IDJVaYRj8wS+6FRxG2nlsPwcsq7oje02rojprxXCcD/ROblWYAYM35Hw1510eTlseCeF3+cloN4cgL2TI4wn/LFhyCky5WXC7KHG70xFGjq1fMdwiwOWILzJddfqUqxaDY4YR9ChlaKu+J7E813gErSUsYKPkWmFlfPpQ6NjCZ8vfjNzCJuofEZB8EgB0dsYD8rLfKK5AXI/DxGxOlx1w9f+xtvTAgj46NOA5u3Bza0qFw/mpK8rk4fxyKvEInsHfAj1qZOdaM6+7Oa/Bjl0BEFERknbp7RajTmwTShHJ2dLByMz/DW5UT247wH+neyDlbPUR5hEAoJydkAxe19FILA7KKdpkDwe78q27CoS8ttw5NrUPmyiuVIegM8QoS46lPMFsJJmuUgXAwe31Gvonwe/4DKHpTap0YiywHWyvTncyc/R35fOi25fevBYpRjRtEJbSiTfmdqMwKLxAhWFRSi+CoYYhs22+k+ld67Yr14peYYyxQUtarxWqTqY5YDcsB+GNF19hAnY5wJqMt6upUdVp18J7Z33lIWccb9my6R+FS6x7fd/Ji6sMwbC/kMcc1LjyNs4n/SJbwsiyFb5DmfSF7nfFu/e9vY05pCnlXu6NgOzFY7o5aW30XXcMzTz13VXw3I7V25MssRwRZXoVPOwGaPWZfZQqu/yp4THtr3g+8fiQFQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e0d52b5-b3d9-46b8-0f20-08d9bfe0f558 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:36.4872 (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: 35l/iBnHwq5MiJ6Zc3u4BRIiuJdTxwVyvu0AL8FSPK9R27ttBz0ayko5j0U+cicxvb1VrbqndCFbXWudNx+cxfR+cEGWD+BcInwbBuaQ0wc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: Gc8xry_zsKVV9YwYEoJTO502pk-jw-nr X-Proofpoint-GUID: Gc8xry_zsKVV9YwYEoJTO502pk-jw-nr Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change introduces the public defintions for ACPI ERST. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- include/hw/acpi/erst.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/hw/acpi/erst.h diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h new file mode 100644 index 0000000..9d63717 --- /dev/null +++ b/include/hw/acpi/erst.h @@ -0,0 +1,19 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef HW_ACPI_ERST_H +#define HW_ACPI_ERST_H + +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id); + +#define TYPE_ACPI_ERST "acpi-erst" + +#endif From patchwork Wed Dec 15 15:38:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38358C433EF for ; Wed, 15 Dec 2021 16:03:46 +0000 (UTC) Received: from localhost ([::1]:50858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWkr-0000zg-4O for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 11:03:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMt-0000xk-7L for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:59 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:10830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000Uu-OO for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:58 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEYwD9008125; Wed, 15 Dec 2021 15:38:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=ySovfDlOHAVMu9E6UxPOFTJ05t7BgvywO49V0HanonixE+ky+8nrCw+Qyo7mdHlf5nvN O6PYUdd4uTd8p/xKMoY0Xq7lZ0vVHqLEJ19FU4v+kf+2/ooXCENTwUmWdQ7KgMvcsdoi HNIXKiZk0XJYQ5DsKJXLqrVPzhFznkAhktiRdYV3CtfCsyWKr6xBFTjwFhanp8woA/nv BxyPM0DS0+GGAw+HOaXiEEkPAk5QCL9270tRPbNKCiEFHV60C2WzEDTyTOqMWkPkc6Fz mktp0olHhP8DuHO8xceSDaeWPxQEvfSAXv04G7hXY43sb+zfDhVA49jvpjWNUb3x7azg +A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx2nff7b3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:49 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwJ094240; Wed, 15 Dec 2021 15:38:48 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPyUy7hc0QUCfEKdDe42Q8QxsSzvNDOxW0RZebTBUo0Kv43O8PqGlR058olYPagIreOZJzLjvjK8JP9hzN1sw7H5e1HewL0/HGNzl9n1/1oslx/LVdeU+ky/Tn/xAodBZ7DnQyE64jZ5nFq/4UI9kKjLpuR20PLTJ3N0OMYsrOejGUHbC2OZGuL8TPr18nQc+eligIW/1+SwoC6CssLzlJ1a49yDGGUdA/UKPiH4g1iZb0UgfBX4go0bCwHoKu4wdjqbVrQPjEgi/8qPl/0uJ0ps8V4we2PeU8lF5ehdDP2Xo7NThXK1SlqY4t/0ZqXheadtiiYpP6INVffqm1LFjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=ki5q+wWqW0fqa0LGxRZyAzPqiWZEMajzCSFqW8qpjcpsD167inktA0ylHR8E8N0HonDFxhnbJwdEmcWcoosTvcVfD7oLpP2riGJWHsc0qxmOvXQf0WjUGhy3wdAm0CrXZFWBCMGJ+sIvs8GLfb9+coam9uQfmXLw82nU4GeGVx7BGBfYc6jfq7UqAzcq3hNjccqPdp/EejJoq5LGb/4c6jwVddXfviWBgTrmPSb2HDoqKIp/TDyIC2X/p8cYyPl3AmtytxpDgnQvbklsw52f3qBBk0O6IWY3YoBaGMQR4MKnDBYE4kLJgXeuEWxPhQ+IbEckeGBO3K/GtpZs990mVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6VO8Dn01eDJoZRejbWdW/XL+zrJHS3ikS1T8qYPAq28=; b=Dji9bcph/AjKbgOZW8DioWiOku/Ir03CNOXKAHhiY9WeIScCttAPhRjpfCxQo0RWdrTYr8PvV6uAz7uf5O4hMTrVL9agzCl/icjPLuFQGuKQd038kadM6TYPfA9qxFqaCoG7Aa6XE+3iWSD/ea0DcEnlgGleCo2bSgbCf+TRhNE= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:38 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:38 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 05/10] ACPI ERST: support for ACPI ERST feature Date: Wed, 15 Dec 2021 10:38:10 -0500 Message-Id: <1639582695-7328-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3d0eff5-715f-4194-9d88-08d9bfe0f6a3 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 67QUJ1oZr3QFKTnL12fiTImQhpYzAdAeeFHQXVPMVTEH/pdHluSS+g1CfOmpeJkcZfaelwIcYjepI32MjUD5YnUA9pxiF0efQUxcl8xl96iGZra/viF7ixm4UfYgdm5IYzfmM3hlsdCiX1kH0cSS2OpnD0iEzSwZnRtD7yj+QRC3yy4eV+RXoWTdnv3zziPnBqMxDj2OoCCthgVdcufIDLJULglN/QNncjfWS+ZwHrLMUU2VtmIuxZLqY0Wl9esiFi4pc7LoRMH+SnV+iNXK5bs4SL25E8wX/jVtqPs8aNn/sL1zaJhnzVgggPq1HAHWz+Lg+mkIsPDo+RkRQHS3HCsopBEPrVrZprb5bqPLZaElgUnSGK4T0hr+kiryQbgpkOoMBJxBwouQiQOuRHjCpQabbuam+dLBzKxwHX/sr0MmOdRJh6aKfoFp+EHQq0CPt27++LkQ3itaDtfBcK/0kd0OH5lJAcfPXyfcINtYDuXVjO+LqWXEDxPbRYG4SMi4iMYMjG7WLqPBnfx9N+eMBtUgZN1mteH/S1WwNweWIsCA1NHjdqF0prbiQz8CocA1xsD2guLDMer79muV1oJPqmmQH6ZHgh34hXObSgTyU+0KHog+4P/ftNaeFRQ6sTG2162s4QoBm5Cgrh+L5GokBA+h/5AwvE40904STxFB08APaaI1M1ZKrQwSZ9iU1zL0g43Ar+yfI3fqhcOhaTGzNw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(30864003)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WAVQ4mSgtYQrA8CGokgiqmfig7OJ+5ezZFx5ewZtII11KuLpUBP2mOY97d75oPeMPV+lDSHGshZIHRfgn++zAqR0/c4t2WuukJlwyQHhr8lCORYcm1fF+90R3B4O+2mfrGbAGrjOKJhx6waqCfXtz8twSSkTRAvy1PolIXvgoApAqhwQwDbtFNNY+G0AZYO2J3Y44WPi80a11UOO0MypDTKPEQlQ7ULtT9ZrOsoQj1KRNLBphTXYXOv/pc48j9Xito1UDwBa5r2du+YxeI0AMd/7jD8ijSWQGSwySeVVS7BCMRIHsw2cZdm4Zt9+tlTe9Dp0asbL7ajsNYFVeERFc4CR96ufHWETsbHCytT38vScHnEzRNQo82O8oEjRiOO29TQnVmmJOeiCABv3cVTfGiV5XCRdeSug/WKmYup5/WJQH9ALscs0g9cjQqdcFK9AG1zxg6fAy3VD3sHPq1ez8+CngoGJ4Zk+VY1/Gr/CyDu++7jlW59x5d3bfI/MoF6dHjJx720kKm4oWW8uv/yGABld1lA7UG2cpIE4wpcQwWdW4MkbFSZIIdf5NEfnQ+zLTbH6ZKnFtfXFSFqYlSPPgAzb95loMCLtCRo/sVq6Bh2yhPplgX1ksjQAxLrguZJXMbCRRHrF9YuSo6EUVMuiQ1u84495mdYa9YVIWnZDTO9ImhIxP6OW5/+L1vofMj813uaOxbY6o2n5iCTEEw3Y7ceGG+8P0tq6LDtyfrTuZ+l6rK0vtOie4NUR4p9CfTeMVW4YW0+S8BbCCpCnQeIv1LPhsIWAUI4rr1o16HwpYqwKRNxQOM1JvWYWuouLYiGNGG86CnAqKU3SZTU2CocFNlBbTDRueyOYOW834gibjtKV35s1a3mtabQ8UpzPl3cFRPS7REMZkWdGUVQ2LPPtZnOU0jbcSz4oX7LTQlzOA4fZUeJTdTXu+6eLA5MqI7qiSw8NuRMyjIqmBolDtvfI8iR8txM6o1nvp8uIvr90HqQke9BNU0YNGno0PYU1cfXGDfJgpGYiDM+/oTDH/+hxyHB+l2/3uHGJCAO6J99pTDH32C94b5MXuunyXDBt77vK8zBCGUkIHepPemiRkL0BOdwsPl7Cr4JKP5eNY9RaZXImuFc73YI8fqp4dApV6fRoOqZFh4kbmXkYTWPXNMNhGJr7IHu+GCrZbg3ZZxC0ZeH4srkRxzw3JDcWe42dRtyJ23ejh/90NBhF4z4Zt3MmCPUgQE4+8ibUhv/bh6zfJusb+dEZ/hDv3DqS/OM70AKs4xOWydGmhgH32ROfZw33ktBXwEi4AtDYcHNtU3jmo7UngAHbdC9qGExeOnbXyeE1En+e096c/wwl6PlCZTrbdwiNKqAIikzRx1SYMluJ44ajlSwZE83RDbocsjuab8/n64bcp8pACZ5DqEvfyBfuXjz2mwWxGuDOL0cy6tLqXWy0RtDDxJpYzr4tl44pj4eD2+IXktVlC5GXPXIPMaRLV1o7kh/5FBtVI8KlpCFd6vtcvf++ACEJxyisKQITxUZc3ebw4qezYE6vnz3k9Z8GLkrO+uikG1UiJ4s06ixGeezpb4DL/F1VZ8SooOsyM2GAq7l6WhDIuUhwDNt/nA1LuSnYdm0PaonkDiuamGlxa04vbJylrol2GF9nMhXMz/rBXG9E16jZi7mpYcDzTPf18w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3d0eff5-715f-4194-9d88-08d9bfe0f6a3 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:38.4727 (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: yhXaQHcA1qLnGAE6WTfmiZDWASS6FkNoElwEpz85Q7sdAHZTXTm3reTmiFznuH4mj4mSO3EOQYTa2ZzmT/mV/DvtqiefeFB7gOJNbsKnD2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: _Wg3Z3J6F9wUFAFRAXcPuqtTXKl80mFn X-Proofpoint-GUID: _Wg3Z3J6F9wUFAFRAXcPuqtTXKl80mFn Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This implements a PCI device for ACPI ERST. This implements the non-NVRAM "mode" of operation for ERST as it is supported by Linux and Windows. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/acpi/Kconfig | 6 + hw/acpi/erst.c | 845 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 + 4 files changed, 867 insertions(+) create mode 100644 hw/acpi/erst.c diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 622b0b5..19caebd 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -10,6 +10,7 @@ config ACPI_X86 select ACPI_HMAT select ACPI_PIIX4 select ACPI_PCIHP + select ACPI_ERST config ACPI_X86_ICH bool @@ -60,3 +61,8 @@ config ACPI_HW_REDUCED select ACPI select ACPI_MEMORY_HOTPLUG select ACPI_NVDIMM + +config ACPI_ERST + bool + default y + depends on ACPI && PCI diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c new file mode 100644 index 0000000..bb6cad4 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,845 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/qdev-core.h" +#include "exec/memory.h" +#include "qom/object.h" +#include "hw/pci/pci.h" +#include "qom/object_interfaces.h" +#include "qemu/error-report.h" +#include "migration/vmstate.h" +#include "hw/qdev-properties.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/acpi-defs.h" +#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "exec/address-spaces.h" +#include "sysemu/hostmem.h" +#include "hw/acpi/erst.h" +#include "trace.h" + +/* ACPI 4.0: Table 17-16 Serialization Actions */ +#define ACTION_BEGIN_WRITE_OPERATION 0x0 +#define ACTION_BEGIN_READ_OPERATION 0x1 +#define ACTION_BEGIN_CLEAR_OPERATION 0x2 +#define ACTION_END_OPERATION 0x3 +#define ACTION_SET_RECORD_OFFSET 0x4 +#define ACTION_EXECUTE_OPERATION 0x5 +#define ACTION_CHECK_BUSY_STATUS 0x6 +#define ACTION_GET_COMMAND_STATUS 0x7 +#define ACTION_GET_RECORD_IDENTIFIER 0x8 +#define ACTION_SET_RECORD_IDENTIFIER 0x9 +#define ACTION_GET_RECORD_COUNT 0xA +#define ACTION_BEGIN_DUMMY_WRITE_OPERATION 0xB +#define ACTION_RESERVED 0xC +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0xD +#define ACTION_GET_ERROR_LOG_ADDRESS_LENGTH 0xE +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0xF +#define ACTION_GET_EXECUTE_OPERATION_TIMINGS 0x10 /* ACPI 6.3 */ + +/* ACPI 4.0: Table 17-17 Command Status Definitions */ +#define STATUS_SUCCESS 0x00 +#define STATUS_NOT_ENOUGH_SPACE 0x01 +#define STATUS_HARDWARE_NOT_AVAILABLE 0x02 +#define STATUS_FAILED 0x03 +#define STATUS_RECORD_STORE_EMPTY 0x04 +#define STATUS_RECORD_NOT_FOUND 0x05 + +/* UEFI 2.1: Appendix N Common Platform Error Record */ +#define UEFI_CPER_RECORD_MIN_SIZE 128U +#define UEFI_CPER_RECORD_LENGTH_OFFSET 20U +#define UEFI_CPER_RECORD_ID_OFFSET 96U +#define IS_UEFI_CPER_RECORD(ptr) \ + (((ptr)[0] == 'C') && \ + ((ptr)[1] == 'P') && \ + ((ptr)[2] == 'E') && \ + ((ptr)[3] == 'R')) + +/* + * NOTE that when accessing CPER fields within a record, memcpy() + * is utilized to avoid a possible misaligned access on the host. + */ + +/* + * This implementation is an ACTION (cmd) and VALUE (data) + * interface consisting of just two 64-bit registers. + */ +#define ERST_REG_SIZE (16UL) +#define ERST_ACTION_OFFSET (0UL) /* action (cmd) */ +#define ERST_VALUE_OFFSET (8UL) /* argument/value (data) */ + +/* + * ERST_RECORD_SIZE is the buffer size for exchanging ERST + * record contents. Thus, it defines the maximum record size. + * As this is mapped through a PCI BAR, it must be a power of + * two and larger than UEFI_CPER_RECORD_MIN_SIZE. + * The backing storage is divided into fixed size "slots", + * each ERST_RECORD_SIZE in length, and each "slot" + * storing a single record. No attempt at optimizing storage + * through compression, compaction, etc is attempted. + * NOTE that slot 0 is reserved for the backing storage header. + * Depending upon the size of the backing storage, additional + * slots will be part of the slot 0 header in order to account + * for a record_id for each available remaining slot. + */ +/* 8KiB records, not too small, not too big */ +#define ERST_RECORD_SIZE (8192UL) + +#define ACPI_ERST_MEMDEV_PROP "memdev" +#define ACPI_ERST_RECORD_SIZE_PROP "record_size" + +/* + * From the ACPI ERST spec sections: + * A record id of all 0s is used to indicate 'unspecified' record id. + * A record id of all 1s is used to indicate empty or end. + */ +#define ERST_UNSPECIFIED_RECORD_ID (0UL) +#define ERST_EMPTY_END_RECORD_ID (~0UL) + +#define ERST_IS_VALID_RECORD_ID(rid) \ + ((rid != ERST_UNSPECIFIED_RECORD_ID) && \ + (rid != ERST_EMPTY_END_RECORD_ID)) + +/* + * Implementation-specific definitions and types. + * Values are arbitrary and chosen for this implementation. + * See erst.rst documentation for details. + */ +#define ERST_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_STORE_MAGIC 0x524F545354535245UL /* ERSTSTOR */ +typedef struct { + uint64_t magic; + uint32_t record_size; + uint32_t storage_offset; /* offset to record storage beyond header */ + uint16_t version; + uint16_t reserved; + uint32_t record_count; + uint64_t map[]; /* contains record_ids, and position indicates index */ +} __attribute__((packed)) ERSTStorageHeader; + +/* + * Object cast macro + */ +#define ACPIERST(obj) \ + OBJECT_CHECK(ERSTDeviceState, (obj), TYPE_ACPI_ERST) + +/* + * Main ERST device state structure + */ +typedef struct { + PCIDevice parent_obj; + + /* Backend storage */ + HostMemoryBackend *hostmem; + MemoryRegion *hostmem_mr; + uint32_t storage_size; + uint32_t default_record_size; + + /* Programming registers */ + MemoryRegion iomem_mr; + + /* Exchange buffer */ + MemoryRegion exchange_mr; + + /* Interface state */ + uint8_t operation; + uint8_t busy_status; + uint8_t command_status; + uint32_t record_offset; + uint64_t reg_action; + uint64_t reg_value; + uint64_t record_identifier; + ERSTStorageHeader *header; + unsigned first_record_index; + unsigned last_record_index; + unsigned next_record_index; + +} ERSTDeviceState; + +/*******************************************************************/ +/*******************************************************************/ +static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) +{ + uint8_t *rc = NULL; + off_t offset = (index * le32_to_cpu(s->header->record_size)); + + g_assert(offset < s->storage_size); + + rc = memory_region_get_ram_ptr(s->hostmem_mr); + rc += offset; + + return rc; +} + +static void make_erst_storage_header(ERSTDeviceState *s) +{ + ERSTStorageHeader *header = s->header; + unsigned mapsz, headersz; + + header->magic = cpu_to_le64(ERST_STORE_MAGIC); + header->record_size = cpu_to_le32(s->default_record_size); + header->version = cpu_to_le16(0x0100); + header->reserved = cpu_to_le16(0x0000); + + /* Compute mapsize */ + mapsz = s->storage_size / s->default_record_size; + mapsz *= sizeof(uint64_t); + /* Compute header+map size */ + headersz = sizeof(ERSTStorageHeader) + mapsz; + /* Round up to nearest integer multiple of ERST_RECORD_SIZE */ + headersz = QEMU_ALIGN_UP(headersz, s->default_record_size); + header->storage_offset = cpu_to_le32(headersz); + + /* + * The HostMemoryBackend initializes contents to zero, + * so all record_ids stashed in the map are zero'd. + * As well the record_count is zero. Properly initialized. + */ +} + +static void check_erst_backend_storage(ERSTDeviceState *s, Error **errp) +{ + ERSTStorageHeader *header; + uint32_t record_size; + + header = memory_region_get_ram_ptr(s->hostmem_mr); + s->header = header; + + /* Ensure pointer to header is 64-bit aligned */ + g_assert(QEMU_PTR_IS_ALIGNED(header, sizeof(uint64_t))); + + /* + * Check if header is uninitialized; HostMemoryBackend inits to 0 + */ + if (le64_to_cpu(header->magic) == 0UL) { + make_erst_storage_header(s); + } + + /* Validity check record_size */ + record_size = le32_to_cpu(header->record_size); + if (!( + (record_size) && /* non zero */ + (record_size >= UEFI_CPER_RECORD_MIN_SIZE) && + (((record_size - 1) & record_size) == 0) && /* is power of 2 */ + (record_size >= 4096) /* PAGE_SIZE */ + )) { + error_setg(errp, "ERST record_size %u is invalid", record_size); + } + + /* Validity check header */ + if (!( + (le64_to_cpu(header->magic) == ERST_STORE_MAGIC) && + ((le32_to_cpu(header->storage_offset) % record_size) == 0) && + (le16_to_cpu(header->version) == 0x0100) && + (le16_to_cpu(header->reserved) == 0) + )) { + error_setg(errp, "ERST backend storage header is invalid"); + } + + /* Check storage_size against record_size */ + if (((s->storage_size % record_size) != 0) || + (record_size > s->storage_size)) { + error_setg(errp, "ACPI ERST requires storage size be multiple of " + "record size (%uKiB)", record_size); + } + + /* Compute offset of first and last record storage slot */ + s->first_record_index = le32_to_cpu(header->storage_offset) + / record_size; + s->last_record_index = (s->storage_size / record_size); +} + +static void update_map_entry(ERSTDeviceState *s, unsigned index, + uint64_t record_id) +{ + if (index < s->last_record_index) { + s->header->map[index] = cpu_to_le64(record_id); + } +} + +static unsigned find_next_empty_record_index(ERSTDeviceState *s) +{ + unsigned rc = 0; /* 0 not a valid index */ + unsigned index = s->first_record_index; + + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) == ERST_UNSPECIFIED_RECORD_ID) { + rc = index; + break; + } + } + + return rc; +} + +static unsigned lookup_erst_record(ERSTDeviceState *s, + uint64_t record_identifier) +{ + unsigned rc = 0; /* 0 not a valid index */ + + /* Find the record_identifier in the map */ + if (record_identifier != ERST_UNSPECIFIED_RECORD_ID) { + /* + * Count number of valid records encountered, and + * short-circuit the loop if identifier not found + */ + uint32_t record_count = le32_to_cpu(s->header->record_count); + unsigned count = 0; + unsigned index; + for (index = s->first_record_index; index < s->last_record_index && + count < record_count; ++index) { + if (le64_to_cpu(s->header->map[index]) == record_identifier) { + rc = index; + break; + } + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + ++count; + } + } + } + + return rc; +} + +/* + * ACPI 4.0: 17.4.1.1 Serialization Actions, also see + * ACPI 4.0: 17.4.2.2 Operations - Reading 6.c and 2.c + */ +static unsigned get_next_record_identifier(ERSTDeviceState *s, + uint64_t *record_identifier, bool first) +{ + unsigned found = 0; + unsigned index; + + /* For operations needing to return 'first' record identifier */ + if (first) { + /* Reset initial index to beginning */ + s->next_record_index = s->first_record_index; + } + index = s->next_record_index; + + *record_identifier = ERST_EMPTY_END_RECORD_ID; + + if (le32_to_cpu(s->header->record_count)) { + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + /* where to start next time */ + s->next_record_index = index + 1; + *record_identifier = le64_to_cpu(s->header->map[index]); + found = 1; + break; + } + } + } + if (!found) { + /* at end (ie scan complete), reset */ + s->next_record_index = s->first_record_index; + } + + return STATUS_SUCCESS; +} + +/* ACPI 4.0: 17.4.2.3 Operations - Clearing */ +static unsigned clear_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned index; + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(s->record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + /* No need to wipe record, just invalidate its map entry */ + uint32_t record_count; + update_map_entry(s, index, ERST_UNSPECIFIED_RECORD_ID); + record_count = le32_to_cpu(s->header->record_count); + record_count -= 1; + s->header->record_count = cpu_to_le32(record_count); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.2 Operations - Reading */ +static unsigned read_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned exchange_length; + unsigned index; + + /* Check if backend storage is empty */ + if (le32_to_cpu(s->header->record_count) == 0) { + return STATUS_RECORD_STORE_EMPTY; + } + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Check for record identifier of all 0s */ + if (s->record_identifier == ERST_UNSPECIFIED_RECORD_ID) { + /* Set to 'first' record in storage */ + get_next_record_identifier(s, &s->record_identifier, true); + /* record_identifier is now a valid id, or all 1s */ + } + + /* Check for record identifier of all 1s */ + if (s->record_identifier == ERST_EMPTY_END_RECORD_ID) { + return STATUS_FAILED; + } + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + uint8_t *nvram; + uint8_t *exchange; + uint32_t record_length; + + /* Obtain pointer to the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + /* Obtain pointer to slot in storage */ + nvram = get_nvram_ptr_by_index(s, index); + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, + &nvram[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + rc = STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + rc = STATUS_FAILED; + } + /* If all is ok, copy the record to the exchange buffer */ + if (rc != STATUS_FAILED) { + memcpy(exchange, nvram, record_length); + rc = STATUS_SUCCESS; + } + } else { + /* + * See "Reading : 'The steps performed by the platform ...' 2.c" + * Set to 'first' record in storage + */ + get_next_record_identifier(s, &s->record_identifier, true); + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.1 Operations - Writing */ +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_FAILED; + unsigned exchange_length; + unsigned index; + uint64_t record_identifier; + uint32_t record_length; + uint8_t *exchange; + uint8_t *nvram = NULL; + bool record_found = false; + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + /* Obtain pointer to record in the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, &exchange[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + return STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + return STATUS_FAILED; + } + + /* Extract record identifier */ + memcpy((uint8_t *)&record_identifier, &exchange[UEFI_CPER_RECORD_ID_OFFSET], + sizeof(uint64_t)); + record_identifier = le64_to_cpu(record_identifier); + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, record_identifier); + if (index) { + /* Record found, overwrite existing record */ + nvram = get_nvram_ptr_by_index(s, index); + record_found = true; + } else { + /* Record not found, not an overwrite, allocate for write */ + index = find_next_empty_record_index(s); + if (index) { + nvram = get_nvram_ptr_by_index(s, index); + } else { + /* All slots are occupied */ + rc = STATUS_NOT_ENOUGH_SPACE; + } + } + if (nvram) { + /* Write the record into the slot */ + memcpy(nvram, exchange, record_length); + memset(nvram + record_length, exchange_length - record_length, 0xFF); + /* If a new record, increment the record_count */ + if (!record_found) { + uint32_t record_count; + record_count = le32_to_cpu(s->header->record_count); + record_count += 1; /* writing new record */ + s->header->record_count = cpu_to_le32(record_count); + } + update_map_entry(s, index, record_identifier); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/*******************************************************************/ + +static uint64_t erst_rd_reg64(hwaddr addr, + uint64_t reg, unsigned size) +{ + uint64_t rdval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + rdval = reg; + rdval >>= shift; + rdval &= mask; + + return rdval; +} + +static uint64_t erst_wr_reg64(hwaddr addr, + uint64_t reg, uint64_t val, unsigned size) +{ + uint64_t wrval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + val &= mask; + val <<= shift; + mask <<= shift; + wrval = reg; + wrval &= ~mask; + wrval |= val; + + return wrval; +} + +static void erst_reg_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + + /* + * NOTE: All actions/operations/side effects happen on the WRITE, + * by this implementation's design. The READs simply return the + * reg_value contents. + */ + trace_acpi_erst_reg_write(addr, val, size); + + switch (addr) { + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + s->reg_value = erst_wr_reg64(addr, s->reg_value, val, size); + break; + case ERST_ACTION_OFFSET + 0: + /* + * NOTE: all valid values written to this register are of the + * ACTION_* variety. Thus there is no need to make this a 64-bit + * register, 32-bits is appropriate. As such ERST_ACTION_OFFSET+4 + * is not needed. + */ + switch (val) { + case ACTION_BEGIN_WRITE_OPERATION: + case ACTION_BEGIN_READ_OPERATION: + case ACTION_BEGIN_CLEAR_OPERATION: + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACTION_END_OPERATION: + s->operation = val; + break; + case ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + case ACTION_END_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + default: + g_assert_not_reached(); + break; + } + s->busy_status = 0; + } + break; + case ACTION_CHECK_BUSY_STATUS: + s->reg_value = s->busy_status; + break; + case ACTION_GET_COMMAND_STATUS: + s->reg_value = s->command_status; + break; + case ACTION_GET_RECORD_IDENTIFIER: + s->command_status = get_next_record_identifier(s, + &s->reg_value, false); + break; + case ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACTION_GET_RECORD_COUNT: + s->reg_value = le32_to_cpu(s->header->record_count); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + s->reg_value = (hwaddr)pci_get_bar_addr(PCI_DEVICE(s), 1); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + s->reg_value = le32_to_cpu(s->header->record_size); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0x0; /* intentional, not NVRAM mode */ + break; + case ACTION_GET_EXECUTE_OPERATION_TIMINGS: + s->reg_value = + (100ULL << 32) | /* 100us max time */ + (10ULL << 0) ; /* 10us min time */ + break; + default: + /* Unknown action/command, NOP */ + break; + } + break; + default: + /* This should not happen, but if it does, NOP */ + break; + } +} + +static uint64_t erst_reg_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + switch (addr) { + case ERST_ACTION_OFFSET + 0: + case ERST_ACTION_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + g_assert_not_reached(); + break; + } + trace_acpi_erst_reg_read(addr, val, size); + return val; +} + +static const MemoryRegionOps erst_reg_ops = { + .read = erst_reg_read, + .write = erst_reg_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + ERSTDeviceState *s = opaque; + + /* Recompute pointer to header */ + s->header = (ERSTStorageHeader *)get_nvram_ptr_by_index(s, 0); + trace_acpi_erst_post_load(s->header, le32_to_cpu(s->header->record_size)); + + return 0; +} + +static const VMStateDescription erst_vmstate = { + .name = "acpi-erst", + .version_id = 1, + .minimum_version_id = 1, + .post_load = erst_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT8(operation, ERSTDeviceState), + VMSTATE_UINT8(busy_status, ERSTDeviceState), + VMSTATE_UINT8(command_status, ERSTDeviceState), + VMSTATE_UINT32(record_offset, ERSTDeviceState), + VMSTATE_UINT64(reg_action, ERSTDeviceState), + VMSTATE_UINT64(reg_value, ERSTDeviceState), + VMSTATE_UINT64(record_identifier, ERSTDeviceState), + VMSTATE_UINT32(next_record_index, ERSTDeviceState), + VMSTATE_END_OF_LIST() + } +}; + +static void erst_realizefn(PCIDevice *pci_dev, Error **errp) +{ + ERSTDeviceState *s = ACPIERST(pci_dev); + + trace_acpi_erst_realizefn_in(); + + if (!s->hostmem) { + error_setg(errp, "'" ACPI_ERST_MEMDEV_PROP "' property is not set"); + return; + } else if (host_memory_backend_is_mapped(s->hostmem)) { + error_setg(errp, "can't use already busy memdev: %s", + object_get_canonical_path_component(OBJECT(s->hostmem))); + return; + } + + s->hostmem_mr = host_memory_backend_get_memory(s->hostmem); + + /* HostMemoryBackend size will be multiple of PAGE_SIZE */ + s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp); + + /* Initialize backend storage and record_count */ + check_erst_backend_storage(s, errp); + + /* BAR 0: Programming registers */ + memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s, + TYPE_ACPI_ERST, ERST_REG_SIZE); + pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem_mr); + + /* BAR 1: Exchange buffer memory */ + memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev), + "erst.exchange", + le32_to_cpu(s->header->record_size), errp); + pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, + &s->exchange_mr); + + /* Include the backend storage in the migration stream */ + vmstate_register_ram_global(s->hostmem_mr); + + trace_acpi_erst_realizefn_out(s->storage_size); +} + +static void erst_reset(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + trace_acpi_erst_reset_in(le32_to_cpu(s->header->record_count)); + s->operation = 0; + s->busy_status = 0; + s->command_status = STATUS_SUCCESS; + s->record_identifier = ERST_UNSPECIFIED_RECORD_ID; + s->record_offset = 0; + s->next_record_index = s->first_record_index; + /* NOTE: first/last_record_index are computed only once */ + trace_acpi_erst_reset_out(le32_to_cpu(s->header->record_count)); +} + +static Property erst_properties[] = { + DEFINE_PROP_LINK(ACPI_ERST_MEMDEV_PROP, ERSTDeviceState, hostmem, + TYPE_MEMORY_BACKEND, HostMemoryBackend *), + DEFINE_PROP_UINT32(ACPI_ERST_RECORD_SIZE_PROP, ERSTDeviceState, + default_record_size, ERST_RECORD_SIZE), + DEFINE_PROP_END_OF_LIST(), +}; + +static void erst_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + trace_acpi_erst_class_init_in(); + k->realize = erst_realizefn; + k->vendor_id = PCI_VENDOR_ID_REDHAT; + k->device_id = PCI_DEVICE_ID_REDHAT_ACPI_ERST; + k->revision = 0x00; + k->class_id = PCI_CLASS_OTHERS; + dc->reset = erst_reset; + dc->vmsd = &erst_vmstate; + dc->user_creatable = true; + dc->hotpluggable = false; + device_class_set_props(dc, erst_properties); + dc->desc = "ACPI Error Record Serialization Table (ERST) device"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + trace_acpi_erst_class_init_out(); +} + +static const TypeInfo erst_type_info = { + .name = TYPE_ACPI_ERST, + .parent = TYPE_PCI_DEVICE, + .class_init = erst_class_init, + .instance_size = sizeof(ERSTDeviceState), + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + } +}; + +static void erst_register_types(void) +{ + type_register_static(&erst_type_info); +} + +type_init(erst_register_types) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index adf6347..f5b2298 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -22,6 +22,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 974d770..2250126 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -55,3 +55,18 @@ piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64 # tco.c tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)" tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d" + +# erst.c +acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%04" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_reg_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%04" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%06" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%06" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_pci_bar_0(uint64_t addr) "BAR0: 0x%016" PRIx64 +acpi_erst_pci_bar_1(uint64_t addr) "BAR1: 0x%016" PRIx64 +acpi_erst_realizefn_in(void) +acpi_erst_realizefn_out(unsigned size) "total nvram size %u bytes" +acpi_erst_reset_in(unsigned record_count) "record_count %u" +acpi_erst_reset_out(unsigned record_count) "record_count %u" +acpi_erst_post_load(void *header, unsigned slot_size) "header: 0x%p slot_size %u" +acpi_erst_class_init_in(void) +acpi_erst_class_init_out(void) From patchwork Wed Dec 15 15:38:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D6E7C433EF for ; Wed, 15 Dec 2021 15:59:33 +0000 (UTC) Received: from localhost ([::1]:60832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWe7-0005HR-BQ for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 10:56:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMr-0000q5-BR for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:57 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:11326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000Ux-O0 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:57 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEgO3E008084; Wed, 15 Dec 2021 15:38:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=mXEh2jGv4DoF0vIppaBruG/EAPEuT5VvAsiMhDw8k7o=; b=CerjxEq0lx6j6KDz7rjzVmzKZS8UiMyYhWjAWr/m5WnRPC53K8Ft0SoVb8smB72aXofW QH1uNBC23FiETiEV66TAyHXeM/kjJruFV2Ge14fc9pLK9jix4cWKWWX7RptfIQpAytNb rVDAuy5ov79lr1/GkAn3E5AEynv7tAywEGEsC6lQxRgn86jtnFnD2FZJ6iC+03/1hy1N fzqShB6TRNiuYjbNPnKUF5wpfoqIbtfB56D6QXGdckOx5SVDnw862KqevpzgFbOYv6dN TfkC/tl/Ca91E0jXJchbCS79h7zkbgDBBeiV79aesz3aIlDKwA1a0slCFBrX5iq0i03o IQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx2nff7b4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:50 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwK094240; Wed, 15 Dec 2021 15:38:49 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnCi/F+rzoEADjHk6sg0Gm92HHVLwP2cTrkuMKXdfq3BjKdfJAsdownsyEu+yLe1C7mlFmU1Z/yrQDgsEFHOUtO73AA9/lYVzipZNLJQ10/hktmU0y82hsv/3dciu0cRbMGUkOl4/W/NLiKkqoe0L0AboJ0w1OVotlQkXuyVpJXUKpTlWtzMOI613HGCCt9y0PcTc0JuDvhta+O5e2LIhKVUfL9FzHISV4971ckeMwvsLScUaguswTgvfbd7Yn7GCLV0lxGnzCLsA7dDVAwlaxwmQ4WEXR5WKOhF/GvVKqXJDYJhUo5wCtsyQbsZZHxCTbynC1uRB2Frc/c/yAvDrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mXEh2jGv4DoF0vIppaBruG/EAPEuT5VvAsiMhDw8k7o=; b=b0IknjUlDtehG3f/r/MzIpi3rmHKw6tYDKXYrc056QD9UCzt1k6j6kxO2+QMxMDZS8s0bPCCXkMEDqIJWDMx43plxlyGSNHlB0SAwlWblEZUhhfkd3/bRmXSMVBsRtKKl8dcdSbnY3T+gQhp8JIwkNjoA9QkrqLee6mf9ODk5yFpMdMSWCY/6ouzvj6OZn2Or3F18UhoSTSVJBFg32onz7IqATt3jVJIvliwOeUdLP5nnuHiYFc/aEUh3bLPtMZeWp8SFUcHraVbf5FRFyKLv4XeXhLw1hfeVBpd0tkmJxisL0BaHG7EmxDDU71f8FFvB5NRlRtFlvoOKUDoDTFfww== 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=mXEh2jGv4DoF0vIppaBruG/EAPEuT5VvAsiMhDw8k7o=; b=S4X7DxBi047VVY86ijxnLdLVQnr56PffP1kpZj7AKKTTU3LsBenC6vM1CHg0PZJemQz8EU0ImQgjPm8LesyIJ59uSAPbOg4Jfj/7T4RRFO45kDJggtEQ6SA0cxNitNRAnRdH36gnpDnK3zkrsWRcgkwb9A4He9oGioeJkbLpNXw= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:40 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:40 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 06/10] ACPI ERST: build the ACPI ERST table Date: Wed, 15 Dec 2021 10:38:11 -0500 Message-Id: <1639582695-7328-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: acdb565f-c317-4f29-1947-08d9bfe0f7bd X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ux38DRVPNit3PaNHrIiZRzy7FR+iQT86K86zGs+JTh1RresJUTO3HSg0UMDBmxNEFkFoztYnmWyYMgYQkJD8UhpLIjERXJ0dAgGfffteU1eeM8+qJ0573+BqT4b7MQ05TYWBXlFR8V8O6QCKlViR70ENOorr8wMcxhZfwa2Kl4aYLdxbjoAl/IllVMYqVj640cDFJf7JWBIsJnDnTfI0eVyqTy8SX5ZFdj9eEcqziYsalbyxSlzl9XuxxxbcSoh8e+eV8aen28Rz9etjVMxPzT03WH20OSbzQmQcpbgPvoX5nUiSLzk9MH9S9EB76w9f71sDge9l3zoalSdjP6q6Y9FzD9AEkdr3BUAvlpKg0wNMeijnwIsWzNbfRW4dIYT3krwSvTIgzs/+0yd+y65qJUCDcTDtbYoafsmMZbzY1XDNhAXC06bccOWb3Yptryw3Kwa3oFF0fIX5zIdjcixOpRZESfLJN/IKUQpHCyfzVxcTQgV2N6EYr5Lcrrl+rp15CAtqBpJOduLZjCQQrKJw5lqD4NupEuC0XQIPBE0j90PZZXuGJq6jHlJVgOOzT5QCWGfD39aDTxfHWhv7+0BrQSqy/avrjAKIN2/zdjVN6FJrs4lSqNfzhiOJSLHEnkdoMxgLJlQ7BdRri2h+TnIbpcP7Y6V/FlgKCc0Rw1Lhju3ADu5rrKxnaJ3OUOmv+jWR2mG4utMxqfa+HcbqNpsofQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N3SxfkcwOBl3rxY6SZzFZhiN5Owe0lY9OdR2b9b1Fu/FxGZ17TmFn0rhDn3tAds65PkqZktClOUFr5VxtR9AsW+quGHqueEGlT2mJIOKBy/j/WIR8qFa/LSRFQMsjvFV8iu4jut4tSCPMcOD03pzofm/DkyeanaNJmkJvBYIa16TD1PdFxVbXvg2zwgwpRzksuEBnxrTp2xCpMrMlxAtDDZ+W02i8SHcXEry2D1jy9Hdm5Sx/vMhrB5BfOn4JO/1hQjjtPVVT2y1aHUn4I8igzWUt7okfkf+mAqEFgKOhyz7Y9c8LjmyY8AtWNE/hxxiF0qpuuAGqMLEnmzFbv42D2D02MJLD1Hmwpohvc3AjFOB8hdRsYqGjoVzi6Gt9gNsrGLRCew/eTDmk8/5LifFKtrC/lrvtgkRBwkb6jrQPgKNHOQZEpKndkp5UqXmo8GDabKwEMBquz1ruduo5zAyB2HSPFoOyevCNzJwcXYp22w1pSEWOHRaNk40B8Sq8gZgCctn8tBeTeDlo/N2s4cyS+urawLO+4kXLGkdkKBEqzOpoK4b71HieFab73IL5tHySslIAdCQ7X29z0EvA1ekyuEv9PuKR+cixRkZaevQA99TRf+SsVHlWB4WGS7omFDd1GyTVpRFpBBMk5Lsc4c1jJJe168Z/XyTNmX2HpSAslPulxTjH4+nNJHXXttOrY/7tso14o/u2HOE9R4Bsk/wuTd1j4fNALvG1VUCiBH7cVrNyT1HyNrhucZlfUwK6egAErFr5T1MRKGtdstDKRTXJd/35fS0DTvAmjonDFhKD53tylxE7m6eRV5YK7sZA21b7+bMvn+fheOlOlRN9IlcceuER12oNZTZ4UUrbuUJ8L8ekbfG6PWe5qC/o/gmywUMBpi+t78tIBmX53L5I9LdHXb3lZCN3pl6YOBg6XoscgeldBQPCRbG0NFGk9Eljmo9KTndpbwRojOSnBIZuhVRjEXFjz2RMWW1APnF9pWBrsKsLfMpNO5ORTPo+LulwUYCYAJBatgw+F4Vp/iMg9TSTmwRtmuSySoITAIfQNDfUl9F41ddB8iGmHBoHDAZqxveu8nE5a/XSqxObflQ3JgWeBfsvHFmAt5DWTh6xMdIFzxN65z1qfjyin19BQEFDM5NZDs32FpnXpzltlSNQahczwF6Nmgzz7xmyheS4am5oAQVO2pvqxOCXTsD31BCmq4ViGWPb/EjQFRZZWwG2T+0nMAByMClSqrkOztrU86GCn443nOYHpys1oTqiNydGUaZ/XIbVqqdOXO9fG4h9dnhWFbcJ7ESbPAKscAGtayCRMgK+1JXy1lIuxuUcQ8KgtAU33PNB9ygXX8hk+Zo7SoRCAnM0HKCbMeQSVHd/kw2JOsjjI2roN9u3BRN8XCQemqnxVGlg8zOPieaU4Xc8uuFuuF3+QaHvCztFNvYy83qSpuCDFRZ8bLAt/qGXpNk4OwIeLjc3rp2qwmLFk4IrxvYWrqKaZtlurGf2YLgaGjwuCt7E8P5R4xqLrBukNCz+NqUq5+iEwidY3cQaSjU/oCSY+Gf8jjvnQhyu9GY1nm9r3etCXd2FaAmweGaQ3Ut87rRrawArmxYSmVt4azziQ6wnri6/B+ywq+Ws0os2c4Wr4MyPBX3IFSv6SGgTLtkMVtVzUcXRJEnw6QoQoqryKAIOw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: acdb565f-c317-4f29-1947-08d9bfe0f7bd X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:40.0986 (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: bkDAbIXjOsoAws0Urizq4RQD6bWqd+spbS5DT7DWwxruyxhZenaWq43Q4UENTnyVcANS9SP8b6K5Qigt5X9ucDbEkX74XpOWcFcpGR5vwDc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=923 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: p4SiaUv_RHCNfcZFFeOrvLKf_FQBR-aW X-Proofpoint-GUID: p4SiaUv_RHCNfcZFFeOrvLKf_FQBR-aW Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device. Signed-off-by: Eric DeVolder --- hw/acpi/erst.c | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index bb6cad4..05177b3 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -59,6 +59,27 @@ #define STATUS_RECORD_STORE_EMPTY 0x04 #define STATUS_RECORD_NOT_FOUND 0x05 +/* ACPI 4.0: Table 17-19 Serialization Instructions */ +#define INST_READ_REGISTER 0x00 +#define INST_READ_REGISTER_VALUE 0x01 +#define INST_WRITE_REGISTER 0x02 +#define INST_WRITE_REGISTER_VALUE 0x03 +#define INST_NOOP 0x04 +#define INST_LOAD_VAR1 0x05 +#define INST_LOAD_VAR2 0x06 +#define INST_STORE_VAR1 0x07 +#define INST_ADD 0x08 +#define INST_SUBTRACT 0x09 +#define INST_ADD_VALUE 0x0A +#define INST_SUBTRACT_VALUE 0x0B +#define INST_STALL 0x0C +#define INST_STALL_WHILE_TRUE 0x0D +#define INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E +#define INST_GOTO 0x0F +#define INST_SET_SRC_ADDRESS_BASE 0x10 +#define INST_SET_DST_ADDRESS_BASE 0x11 +#define INST_MOVE_DATA 0x12 + /* UEFI 2.1: Appendix N Common Platform Error Record */ #define UEFI_CPER_RECORD_MIN_SIZE 128U #define UEFI_CPER_RECORD_LENGTH_OFFSET 20U @@ -172,6 +193,173 @@ typedef struct { /*******************************************************************/ /*******************************************************************/ + +/* ACPI 4.0: 17.4.1.2 Serialization Instruction Entries */ +static void build_serialization_instruction_entry(GArray *table_data, + uint8_t serialization_action, + uint8_t instruction, + uint8_t flags, + uint8_t register_bit_width, + uint64_t register_address, + uint64_t value) +{ + /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */ + struct AcpiGenericAddress gas; + uint64_t mask; + + /* Serialization Action */ + build_append_int_noprefix(table_data, serialization_action, 1); + /* Instruction */ + build_append_int_noprefix(table_data, instruction , 1); + /* Flags */ + build_append_int_noprefix(table_data, flags , 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0 , 1); + /* Register Region */ + gas.space_id = AML_SYSTEM_MEMORY; + gas.bit_width = register_bit_width; + gas.bit_offset = 0; + gas.access_width = ctz32(register_bit_width) - 2; + gas.address = register_address; + build_append_gas_from_struct(table_data, &gas); + /* Value */ + build_append_int_noprefix(table_data, value , 8); + /* Mask */ + mask = (1ULL << (register_bit_width - 1) << 1) - 1; + build_append_int_noprefix(table_data, mask , 8); +} + +/* ACPI 4.0: 17.4.1 Serialization Action Table */ +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id) +{ + GArray *table_instruction_data; + unsigned action; + pcibus_t bar0 = pci_get_bar_addr(PCI_DEVICE(erst_dev), 0); + AcpiTable table = { .sig = "ERST", .rev = 1, .oem_id = oem_id, + .oem_table_id = oem_table_id }; + + trace_acpi_erst_pci_bar_0(bar0); + + /* + * Serialization Action Table + * The serialization action table must be generated first + * so that its size can be known in order to populate the + * Instruction Entry Count field. + */ + table_instruction_data = g_array_new(FALSE, FALSE, sizeof(char)); + + /* + * Macros for use with construction of the action instructions + */ +#define build_read_register(action, width_in_bits, reg) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_READ_REGISTER, 0, width_in_bits, \ + bar0 + reg, 0) + +#define build_read_register_value(action, width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_READ_REGISTER_VALUE, 0, width_in_bits, \ + bar0 + reg, value) + +#define build_write_register(action, width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_WRITE_REGISTER, 0, width_in_bits, \ + bar0 + reg, value) + +#define build_write_register_value(action, width_in_bits, reg, value) \ + build_serialization_instruction_entry(table_instruction_data, \ + action, INST_WRITE_REGISTER_VALUE, 0, width_in_bits, \ + bar0 + reg, value) + + /* Serialization Instruction Entries */ + action = ACTION_BEGIN_WRITE_OPERATION; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_BEGIN_READ_OPERATION; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_BEGIN_CLEAR_OPERATION; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_END_OPERATION; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_SET_RECORD_OFFSET; + build_write_register(action, 32, ERST_VALUE_OFFSET, 0); + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_EXECUTE_OPERATION; + build_write_register_value(action, 32, ERST_VALUE_OFFSET, + ERST_EXECUTE_OPERATION_MAGIC); + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_CHECK_BUSY_STATUS; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register_value(action, 32, ERST_VALUE_OFFSET, 0x01); + + action = ACTION_GET_COMMAND_STATUS; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 32, ERST_VALUE_OFFSET); + + action = ACTION_GET_RECORD_IDENTIFIER; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 64, ERST_VALUE_OFFSET); + + action = ACTION_SET_RECORD_IDENTIFIER; + build_write_register(action, 64, ERST_VALUE_OFFSET, 0); + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_GET_RECORD_COUNT; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 32, ERST_VALUE_OFFSET); + + action = ACTION_BEGIN_DUMMY_WRITE_OPERATION; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 64, ERST_VALUE_OFFSET); + + action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 64, ERST_VALUE_OFFSET); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 32, ERST_VALUE_OFFSET); + + action = ACTION_GET_EXECUTE_OPERATION_TIMINGS; + build_write_register_value(action, 32, ERST_ACTION_OFFSET, action); + build_read_register(action, 64, ERST_VALUE_OFFSET); + + /* Serialization Header */ + acpi_table_begin(&table, table_data); + + /* Serialization Header Size */ + build_append_int_noprefix(table_data, 48, 4); + + /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); + + /* + * Instruction Entry Count + * Each instruction entry is 32 bytes + */ + g_assert((table_instruction_data->len) % 32 == 0); + build_append_int_noprefix(table_data, + (table_instruction_data->len / 32), 4); + + /* Serialization Instruction Entries */ + g_array_append_vals(table_data, table_instruction_data->data, + table_instruction_data->len); + g_array_free(table_instruction_data, TRUE); + + acpi_table_end(linker, &table); +} + +/*******************************************************************/ +/*******************************************************************/ static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) { uint8_t *rc = NULL; From patchwork Wed Dec 15 15:38:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55631C433F5 for ; Wed, 15 Dec 2021 15:51:17 +0000 (UTC) Received: from localhost ([::1]:44214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWYb-0002Nt-NT for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 10:51:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMp-0000ix-IU for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:55 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:12628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000V7-NT for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:55 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFENbsS009133; Wed, 15 Dec 2021 15:38:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=U4X+kP3CwRScn0nWtv3EslOHKR547J4qOgJuzP/6cSo=; b=HBhLDYrqv1lt2G8h5BlgBcgwglBPHqTK1xDSSBUfKGYm2C/cHFRPjfWp6judY6X6byaE IXZ9aqBLfeskhg5cZIxLYiBcdvZ+eZPg9r067i4agkExlvMP7B3FAm6xiDHOXf6bIEmG KeIINCaXKCIvI49ALJAu/WRuAbZOsw5HZllf7RCnXM0eTmnwmpawYKqhmF8Yo5es6RU3 Fn63xTkZPMLk9/dafcRAunM/cqGjWr8HfmmwtYtU/o2y3pZj+SN6XKyBCzFD/cpWZ2hM fOHPWjrb96qemyi7qXRplGSFbTJ6hnrvX+SYoFUsavPV9gVz69Ejl0K8gU8FFpTHMGkq fA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx5akey78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:50 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwL094240; Wed, 15 Dec 2021 15:38:50 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A8m9+rJc5aqAAWhHVJYamP/hPJ/AlVbaeZJSS4Znt/+VXQhmLHQwfQs9md1JMPSor9U8rk3YCFxol7mRv7H1ThN3LFGWZGMwuyVG+ZKfNSd5KetkKk3YQe0bssAG3HTJ2wFNQ+r8NqRrctikLqAZ6NKiWqGx5XTTZB+rLiuC6wC0OwBNX4FRIEewBsyaAS8rSJRH6D0rM9tVEzSYQnT8Kee3ml3Lvd2EabWolDXcGAA2VIhNDpxkPleWU5PWEPIYA82jK9Uvfiw2AJ8r8sQzXIDOD0Tf5RQJgqOQ1EJ9mREL1APFh+I54z3Dl7PYJLq1bwUFn4V2hy8m3uk4V9mOUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U4X+kP3CwRScn0nWtv3EslOHKR547J4qOgJuzP/6cSo=; b=PAz9GbJLpq9T3S069vJlFOBUM2JHGK8U2lVDxEpA4a4rjFFDcjyjxRXxvMws5Wp0rDcONzqQvpkF57gvPe/HhpZrTB/LwcBzFmyGxg5iLj+tQeuEer2RsuG8kZygnw2Ng/3XXiDgM1EBFb0e9X3Hs7URWu1gTkp1lMkQVjsTC+HxapvxJCFAn8QdsZi3TLuj1EPw3AC7u+384Fb2Yp0r7kRmCPEiE/DP+LEgm5AFcq/pgBmz3HQbAhuldRI+ALRL2CMnyZY4lIwt8FHWPWjO98l+RR6b2YfQmOp8JNrzJGZ51bbyV/Aw27RndQuqcISTXyc226ujbPU63laNyQ9LeQ== 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=U4X+kP3CwRScn0nWtv3EslOHKR547J4qOgJuzP/6cSo=; b=SUV9MjAIt79hQtA7vbWdKGX3mcnSQDmWt5K/o1yftMsUrH5vuFHQOis4MGtVLmOXN0jKvWZVelsGZWf/pIMfwTE/sp+n9zd7jCtbdgKdV624WdYmulEX6oV5gyyBt8qcNsX1wfPP7t+uIM/PPkDJKuaavg/oMK+k11ME+FpKw4g= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:42 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:42 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Wed, 15 Dec 2021 10:38:12 -0500 Message-Id: <1639582695-7328-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d25189ed-9389-4838-a75a-08d9bfe0f8d1 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d+gRoyO+lklcjI2So3gZWSTcuoL+iirYvmwqU2mycdMNUIqAVMHJNNilQI8gu8H2iU4OAHz2p1E/pGOu5XdwS6x6IAxxvucbaFJxff22O7la5f5ImM9NMZGrpg2kCvcpooVUc/Nt4epM+PCbRJEoPGS5XnzXNwTV2Z9B/sgsyQMBH8hnjL1ra+SUTXw1C36J8zcLw6+G7GhUn/chzsNybQJf2eCqw/ypni8lCzrXxi9Kd+iANtprZVZ78rL9CTxGFW3zDQuC1LMa4MUTfI0KqYMujwfp4qB47I6WUKopK7gNZkndgq458DSfsARFhUF3110eELvIahkMUl61GaqpdAJNLn+dQXVX1OIGh0U1AYNOEfeuD66qRU7ngGfsQymrmd719Qi9CpkYkDjwWNLlQ6vj4j2T6fE4venYqbwCU8q7R2Ol7sGFGFo8HO5wUkcGupTlvSWNmBMXi7INewhYUP1bPm4fq4cxvlRf7Oty3mmv8+up5F5N4K435Y8u8wFLnEC2980HWYfnMpTmnoPqP8EuYwHjm9koVxtuXBbtvK620iGMOuCe2L6TiwvJjiLfpXbVHOSCq9mtJFi8OiRGSiNE2TXW2LuHlLPErrAKrPjksJ0TRToGXGFmKFQQ6WhSTc2OdUpyAXKLoJtpl0foCDqhNZh176Q1lcmaonzQh6IGCSRYzUDdnVzaZVrKtJh04NFbhm8KKLfXXDKJgW6x2w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BpZOfvyR+RmAJ68RFAHw85rmnCx09M9d9hx0mOwHauSP+c1GNCDQ2LH0h6mvunkoA6dv7JBQZiyVULV+DlepzmBf2mHDeeBOK2d0SfGQEgIYRSQWPhf26CvJV2N0Tz2RIuM9cPP6ThLDmLqbtDovBPn5MpZG0YpPUi3RYB0hqULizwYy7UdUn5onguYC/lH6IZ8xEzpPEV1RDexX7/KMleBI+ROCZbJoK2jXRvuPoU5xb5pG4mkmzI1Gk6r8KDfKAeMFwf4ilCQ9WJCsbm5+Lcszdg7Hd8lVngip2c8e+Sqfr0muhsROAt+/LnAta4j4wrCc75HFAUI1l70VqcJbs+WMpfsMxoFw5nrVdUrJqQecV16yQKbRsySXTnkSFntXtzRFc28FxFxcHDG1Xy5E6By2kvyES6IU3EA2ZoZpNPpKv8ONnIVYzSCW2jxyDlJAMWOlnBpaqqY6CkG5LpMpkpYCDyn1dh4VbmC1fdz6L0OIF/BbyNCVFH77aiy4ZRYBTygbYaqiblk1GIlghx3Il6ZAR7px7uBfzMhayr3xNXIoCW/sTVew/xBXWbs5fq94kFZ2WWoiA4ngQy0HXHyj+bc8UOccIMYNWYcoDOyMLfpow56UYDf4Y4c6kWC508K/JSylIXEeRnsfveau1FP4wEFsT+hrFF5w7xdVoaLP5pvCFgGWFFdNrlhgDMhV0vCKwMfAFmCh1wSXwqh+Bho56qRVls+9NkM4+JEfJBTtdDfzY8Sdri0cMDIHHTO6QfgRa1VcfbPat1O+mImMRSMM41cD2K4WMaG1zEjAWKn7Nkpw2FZT+umv1r/dduka9xFpXTVsSykeQnAqTojX0sMbQzO6nMYbuHi0m4QKNzxqvO6h6DLsRHl8s3T4fpIxaqwmtNuJKeXDOZzeIWkCnBgxsdpRA6UjGYzrjQIqz0+PRiGEZz2qG9DdNy5jqYigt+FhaT89PL6W7chDS5P4JE0zkhdOKcZMHUZIsdt4OAW2xrJrrBkJ3gWdCAtNEXkKiL+dv+Z4EoE/mEnRVFrtWVgjRFfvMHRKS9Au0PBHTj4phuRixJCYMj7M9FezUgL0uIwiELXLcSfFEkgTMuaWfGGkS80MnFFGQ7Pj9E+gmV1H55GnhGWa2mpQkqM9qazzMlkD8W8uDlvLTup5kNYp4sPqO6nGiUltfMtrUGiSXkY9wAXWEgWEppRVI8YGCcYOHHEEa3NOoFzaJPWnW/lwucOjQ09/OdCrFH4XEUXASLBWwKOQ2a4rw0tlZOb1aIdj79qlUdKNv1vHM6hkNNaUdf9DalsR0zToGDSohZlPASyw9YuMYsZz/0mo6nLO3mc38wzEaxS+uOJjc9MSjWFg1rw/tOJgjZm1Luo6MjFimBJWkC5myKLj7wOjtE2QPrXnM+sr8mBH8X9GgxxtiBB8B+aTp0I8Egwu8yU7OtMUOlQgmIENuoYcF1WBgZiDgPo89FXDwXdtNTl0o5jFjfji49tyA2pqRVCHCpFvHRYriVzL70g3J3tlSeEYEoEPhcEPqCtsJQt+AiM14YfyHGxHSpAYTuMYXoTvEI7+m7MwTT2q93dNs5OQWXxGbdJ2/uD/rzfHpKqnK+Ght2GSN9JtbqPFaqiVDMVy497pFJhNY7EVruBQQMrTeYtGLS6m9ujVAZydtilF5XpSDRANuwjUfy9CJA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d25189ed-9389-4838-a75a-08d9bfe0f8d1 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:41.9110 (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: QzDYgmQMvyqosUzlLN+dD0BD2gUXOx9/fVU2iP65nQ5EV/7RAvCE2+wK4kQ+7h713VrqkgyL13ZUNc5+cfwQFj8Tx1+lCZh5z7O2su4GDyI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-GUID: 95JoMZ4_gTXpAaVDcEhjGzA6C5JazEb7 X-Proofpoint-ORIG-GUID: 95JoMZ4_gTXpAaVDcEhjGzA6C5JazEb7 Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change exposes ACPI ERST support for x86 guests. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/i386/acpi-build.c | 15 +++++++++++++++ hw/i386/acpi-microvm.c | 15 +++++++++++++++ include/hw/acpi/erst.h | 5 +++++ 3 files changed, 35 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a99c6e4..55bca28 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -43,6 +43,7 @@ #include "sysemu/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" +#include "hw/acpi/erst.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" @@ -74,6 +75,8 @@ #include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" +#include CONFIG_DEVICES + /* These are used to size the ACPI tables for -M pc-i440fx-1.7 and * -M pc-i440fx-2.0. Even if the actual amount of AML generated grows * a little bit, there should be plenty of free space since the DSDT @@ -2566,6 +2569,18 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); +#ifdef CONFIG_ACPI_ERST + { + Object *erst_dev; + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + } +#endif + vmgenid_dev = find_vmgenid_dev(); if (vmgenid_dev) { acpi_add_table(table_offsets, tables_blob); diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index 196d318..68ca7e7 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -30,6 +30,7 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" +#include "hw/acpi/erst.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h" @@ -40,6 +41,8 @@ #include "acpi-common.h" #include "acpi-microvm.h" +#include CONFIG_DEVICES + static void acpi_dsdt_add_virtio(Aml *scope, MicrovmMachineState *mms) { @@ -207,6 +210,18 @@ static void acpi_build_microvm(AcpiBuildTables *tables, ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); +#ifdef CONFIG_ACPI_ERST + { + Object *erst_dev; + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + } +#endif + xsdt = tables_blob->len; build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id, x86ms->oem_table_id); diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h index 9d63717..b747fe7 100644 --- a/include/hw/acpi/erst.h +++ b/include/hw/acpi/erst.h @@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, #define TYPE_ACPI_ERST "acpi-erst" +/* returns NULL unless there is exactly one device */ +static inline Object *find_erst_dev(void) +{ + return object_resolve_path_type("", TYPE_ACPI_ERST, NULL); +} #endif From patchwork Wed Dec 15 15:38:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44706C433EF for ; Wed, 15 Dec 2021 15:59:55 +0000 (UTC) Received: from localhost ([::1]:41864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWh7-00033E-D0 for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 10:59:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMr-0000qo-J6 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:57 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:43574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000Ut-O9 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:57 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEMpfb023149; Wed, 15 Dec 2021 15:38: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-2021-07-09; bh=f2RnzeVRWCb+CCSMHzVlm1UuJbGX9qqDwVEw1Vvr8KA=; b=DzFAoNcTOiArfIyC3rbOirfZlQ80ienWmkqI5N7tyNC+bB50zUfrphNfHTGjTgSctVF8 YohDnF9D3QS5cMaiwY6MdnQiIZ6MG3zQCby6cPpL73XHtERQOfmDjOLTeRzfMYuOz8Ke kWtRhsrhkRdOCxyr7vo1SxW3desJ71tLXPQGJE7GkzUDtAW3vMBkrvudHvcKtnShG0BN Kx3aDOunqdfcITwXTW3pyqLV5IW2x2ApTw8zlys5S6QFoH4xL8cwjOBAbgNJjSMowC5O 5yexfwKnjQZv8hTaUFxneM33ZnCv0VzkFG7+kR5nWf4TgYIBDQX9tyjOBJoYWyimFAyG Yw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx3py77es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFVi2n127809; Wed, 15 Dec 2021 15:38:46 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by userp3020.oracle.com with ESMTP id 3cvnes2g32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KB9ecSTNd0QyT9srX/pOhO1ThwDBHeqG5Shkye5UD3GhBqRnznF6Z7hIF/LrLNa9vglVcjhI9ov8mj8nIFrwfKcOfG2edQlHtt+o+qZLrDo53mqKxzrhpoQIjMzoubHClCFT9NMfYnTmUa4f8Jv1h4tmcht9PRCX89Pkn9rTNzaWKW03Zhj0fxRYRlypaLlleQb/5omKrseNuqg9nU5n1pY9MAcfuTK4k+uQ7lckUgAagWBXDfSlmyaMD5ltnPTwyn30mNL8+9duo0vX5kCVczZztdX5mjPexC69SPudVzHY5y3bBvO0shUHGtGGKSjz8jbItV9gvnpTtsPDA5EDuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f2RnzeVRWCb+CCSMHzVlm1UuJbGX9qqDwVEw1Vvr8KA=; b=c3Oxds7T3uQuWx/E/30/wqM0VFPlH+DIIOHhn+w8T0zZ36PDuWdj537qGE8rClM5Eat32VW8p4PDl/wESJ4i97RPd3zoDqq7EVvVcLeeUInFf7+V16BEcPPZltN4GOljZFc4IIrBUiU9RRGT4DKOCjrGh0DPIoFzCRqhYEVf2iiwUo5YdxCjOMfk4GV7rcMcNSkgEAsLMqAOC7rv2eaTr7rq6UOIFw02WHb6zOhkVh8WrJtxosGjRe3JOjvafJSEuVCyAASXSomwj1jJas4PTY+L7UlgqjghcDeBS5oC+bHKF8dEO371SCf6sEM6jXnlIHdwIw/xmUnvU6XiraDuxA== 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=f2RnzeVRWCb+CCSMHzVlm1UuJbGX9qqDwVEw1Vvr8KA=; b=mNhihqYZvKc9X5XRoVrev8fK0tGs/UoS4BHdCPgBjptCzjOcxyCSGY0nZdSrjO4IczPPSPGymtJMsVQGpkoAvYxRWWC9hq/QUlH9xvv/AxiQaS1s9WLpvFx4HAzbKOpE/S87TDfo+rmgOyzlvS3W5dlZqAlY+pB+K+eco1GhIy4= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2349.namprd10.prod.outlook.com (2603:10b6:301:30::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:43 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:43 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 08/10] ACPI ERST: qtest for ERST Date: Wed, 15 Dec 2021 10:38:13 -0500 Message-Id: <1639582695-7328-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eecd8ec8-f94f-4e34-f220-08d9bfe0f9cb X-MS-TrafficTypeDiagnostic: MWHPR1001MB2349:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EHpZ/kJ1TNqBe5Tbfs+JXpTywqcScu5RkL3xhcQQ5AYMHf2FnwKrcxKBwstxlroSbHqkC5Un5R5MT98as9jrDFGm6fnUecPecvu3pU7DE7Rwbaltj/09TBIcReeh7nLF7w2sHsn3Xs6F/3VJMLAOopv7sfyWn4hm9zz8feiBanP+bGOKwoAmoqW5FDZFDQ5Wh1sTtNpnlcfm2KXRpz3QjxM+jgOO4su4/hyl0M6DlbaoCiwcb8rXRALlCIw4kZ5KaiB/FWzmC2XEp+IEFGHw7ENqwkSib4j22RyYeGCDSozmeG/R71UAD0eZ02CIcVxtMW62ejGvRgBcqQBr34t/c/KOggdwcSKy5be7a/bxfXoWk65cZVFc2edcz8gy1pXyhcnrDSTs3xHwl3qoQu9DFy5zx9EvHoQZU2xCRX+lOncAqgiG3ilzA2bJTgG4b0b9hAUbcPkOUz0pJxTDcY8hKJZmQDxsTylZ8s993UNvwjNutzIoRwBJBQnlA5GT4GHVVhCthA/qFmRWdmW8JcjZcVERKykmJoNFaMgsdz6b0HhrWIi6UZo7ReUkTPAy60NsRSaTFaHpMzlLp2FPLSyR/lmVngt7WG06XBXap2IfOJyhzx1vkdB1cAZipYPjlnNO9Wg91WGIwN6ryBMJvZhw2XkpxKLNvWjtjyoU05Z2SpWavKT2G46EfPqt3uOI7Do/XZ5GFPDdxv8D25FeeqzNAA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(6666004)(6506007)(6512007)(2616005)(6916009)(66476007)(66556008)(83380400001)(5660300002)(66946007)(2906002)(36756003)(8936002)(52116002)(107886003)(316002)(4326008)(38350700002)(38100700002)(8676002)(508600001)(26005)(6486002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WRYszf+0bWJ1DXIh1onsZ9TR7CwTQA8sfkTSQw4lNFsLHROb1olpXPDPLpKnywAuzMbBju2gkfk75KcqL3D5upibAeRkClu2ssYSCHz1BgkyeZ0SMLzmaoldwhX9cDfi36vi6OBkO8WBkRvOGqcbXpAFAU1GyxfcC4KFXNLFMMt+oIUGCTO37hctQEWFiJu5VLYjA7HGKQs1t9UD98jSJuVxcNeJyNpk2GtKlJlx9fRp9xUuuz6skfTd0QQFLcuugqEasewvcgs1jEfY7xCueTczxnMBuUxWkAw4da2ESvDXqMJ+TvYjd1rAQoXsucCxE7m8IpOr9zXaXDmdxGIvP80UWenSg4xWJIHjYB7xoIhpJfEDY9Cw2zto87oQsRRbTmjrAW3qLb2J+gnm+FfvKzoQtTa8yCyHJGbmhvf4wsW5KCEPkkuIMjel7MgOOY8vXj6epkOgsA7TnPlVXF7IKx41qZ11/BFh2HC9BufnjONzupVereZs0Dou8L6T1wzQAtr+PMzQX/fq2bHB78+z1EmWhrAnV0gkq/lfkmOoWTAVs2FP7JYlwevWNIMO14Fv+BNKXAno6O6qePnqckA466Ddxz3DrsuYh6RTFwQ/FinVaLWHrvKJlLbCwQkWqfjIiyrSr6Sh5M1BZxejQ22k8lZMEezKx+XAVlbEDuOsr5avZyRMuJRMz+SNxXeoQpC5HT4pQth62U7o8xsSb3X0EmR8QCRiAa9pzkMImwJsnCE1bMxBWoecRqqPYUo02KefT1U2eYfMNAbU7Uf2ssp/f744XFgCwqs+sDGqoqb0LgCLMN/uV71yVHlayweYKBiEgUcjmKN5Y5CHBQqp/YxqufT1EEJLCrqtn92ZxYQQ49//hKelSUpwvymq2YSfaHKu1B5wCgsfoztj5EbgQ3fwB9s6E2h1yM739wJZb2ULoZWcmK2s4gbaCD6QKgnui0FSK920Zzs9W665ZGoMV405/LF5b92vMTcA+aXVNJPUqcwaVMihlxtsix25pG7cyKADeh0s9NaDyOucYTp1IJml32LA8b1MC47c9j5rRDHmjO66+TX6+NaRoGOcZzNAYQXfY5zNMteI4RfvJo7nOm4hU8MfXE+MCWPiEsS9F4itUhMSAqcmTEWLB5x2BhxAB5fwpoUxyFoRESue6x5/PbgVNmd+Sw+x6ptfVRj/NE8WrwIFkcqZnSWDlVXMPTuKDnsIp+rSAxln+QxpHlACsX+2206+qWx2TLcPDblF3WxdpBSOcWqUPOgOOBrsqaPvv9Goep2SUVUG+b14xIzTEqL85ikTNveINfhQle5mATMzDaJsrOecpkv7scYkntUokhZd3BstRXiec/8dkmMIllNF1SNF4UYOy9g5r0oEpHxPG7o7wHLELVJipVsXIQoaPSBP0j1KbznhXf+KbHHPYIwBdJVrd9vb9M1CvJ8VRIGX5MyciSDUFYxX7JzWoL6VXl4HUxXGOX+V7xBx9ovo06wQq+N06adrJut0VCPUfy60gQgH+uc9FSJ7RQ2xwxNKre2gmTxJVMcVa+pOmiPK1Tjmc1zxL1ZcUkq0DMskAKVXKmfLGtnYHNcgb1m9G1AgcsA3GQZmRXjm1NS9zz0k6SSJ4GP5S2Fzltg96yx9XsRpE/cIRcU8FNw1Id4a2HvnEli65OHNyOy2MCnKnK9abAeK0A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eecd8ec8-f94f-4e34-f220-08d9bfe0f9cb X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:43.5513 (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: lbrxRfCVvPeuatuxvDDIVeoULs7U/i1uKD5aJcYQCMDHHUbMmb3Y8YbhSgGJNeu4svg0TyYYeY77JY1+qqXT1xYW34n0KUUKBcIV19hBDW8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2349 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: nQ1vdC0MkxkS56fyIqjzeTh4xvXoZRQF X-Proofpoint-GUID: nQ1vdC0MkxkS56fyIqjzeTh4xvXoZRQF Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/erst-test.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 169 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..370c119 --- /dev/null +++ b/tests/qtest/erst-test.c @@ -0,0 +1,167 @@ +/* + * QTest testcase for acpi-erst + * + * Copyright (c) 2021 Oracle + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include +#include "libqos/libqos-pc.h" +#include "libqos/libqtest.h" +#include "qemu-common.h" + +static void save_fn(QPCIDevice *dev, int devfn, void *data) +{ + QPCIDevice **pdev = (QPCIDevice **) data; + + *pdev = dev; +} + +static QPCIDevice *get_device(QPCIBus *pcibus) +{ + QPCIDevice *dev; + + dev = NULL; + qpci_device_foreach(pcibus, 0x1b36, 0x0012, save_fn, &dev); + g_assert(dev != NULL); + + return dev; +} + +typedef struct _ERSTState { + QOSState *qs; + QPCIBar reg_bar, mem_bar; + uint64_t reg_barsize, mem_barsize; + QPCIDevice *dev; +} ERSTState; + +#define ACTION 0 +#define VALUE 8 + +static const char *reg2str(unsigned reg) +{ + switch (reg) { + case 0: + return "ACTION"; + case 8: + return "VALUE"; + default: + return NULL; + } +} + +static inline uint32_t in_reg32(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint32_t res; + + res = qpci_io_readl(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %08x", name, res); + + return res; +} + +static inline uint64_t in_reg64(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint64_t res; + + res = qpci_io_readq(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %016llx", name, (unsigned long long)res); + + return res; +} + +static inline void out_reg32(ERSTState *s, unsigned reg, uint32_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%08x -> *%s", v, name); + qpci_io_writel(s->dev, s->reg_bar, reg, v); +} + +static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%016llx -> *%s", (unsigned long long)v, name); + qpci_io_writeq(s->dev, s->reg_bar, reg, v); +} + +static void cleanup_vm(ERSTState *s) +{ + g_free(s->dev); + qtest_shutdown(s->qs); +} + +static void setup_vm_cmd(ERSTState *s, const char *cmd) +{ + const char *arch = qtest_get_arch(); + + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + s->qs = qtest_pc_boot(cmd); + } else { + g_printerr("erst-test tests are only available on x86\n"); + exit(EXIT_FAILURE); + } + s->dev = get_device(s->qs->pcibus); + + s->reg_bar = qpci_iomap(s->dev, 0, &s->reg_barsize); + g_assert_cmpuint(s->reg_barsize, ==, 16); + + s->mem_bar = qpci_iomap(s->dev, 1, &s->mem_barsize); + g_assert_cmpuint(s->mem_barsize, ==, 0x2000); + + qpci_device_enable(s->dev); +} + +static void test_acpi_erst_basic(void) +{ + ERSTState state; + uint64_t log_address_range; + uint64_t log_address_length; + uint32_t log_address_attr; + + setup_vm_cmd(&state, + "-object memory-backend-file," + "mem-path=acpi-erst.XXXXXX," + "size=64K," + "share=on," + "id=nvram " + "-device acpi-erst," + "memdev=nvram"); + + out_reg32(&state, ACTION, 0xD); + log_address_range = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xE); + log_address_length = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xF); + log_address_attr = in_reg32(&state, VALUE); + + /* Check log_address_range is not 0, ~0 or base */ + g_assert_cmpuint(log_address_range, !=, 0ULL); + g_assert_cmpuint(log_address_range, !=, ~0ULL); + g_assert_cmpuint(log_address_range, !=, state.reg_bar.addr); + g_assert_cmpuint(log_address_range, ==, state.mem_bar.addr); + + /* Check log_address_length is bar1_size */ + g_assert_cmpuint(log_address_length, ==, state.mem_barsize); + + /* Check log_address_attr is 0 */ + g_assert_cmpuint(log_address_attr, ==, 0); + + cleanup_vm(&state); +} + +int main(int argc, char **argv) +{ + int ret; + + g_test_init(&argc, &argv, NULL); + qtest_add_func("/acpi-erst/basic", test_acpi_erst_basic); + ret = g_test_run(); + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c9d8458..4b01c22 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -68,6 +68,7 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ qtests_pci + \ ['fdc-test', @@ -246,6 +247,7 @@ qtests = { 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], 'cdrom-test': files('boot-sector.c'), 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, + 'erst-test': files('erst-test.c'), 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], 'migration-test': files('migration-helpers.c'), 'pxe-test': files('boot-sector.c'), From patchwork Wed Dec 15 15:38:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DB7FC433EF for ; Wed, 15 Dec 2021 16:11:21 +0000 (UTC) Received: from localhost ([::1]:36036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWsC-0001uA-Br for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 11:11:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMs-0000vG-IX for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:58 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:45004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000V2-PB for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:58 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEMpfc023149; Wed, 15 Dec 2021 15:38:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=SfvJCp/7ima11pfl07B0iZGcklh+t4Q1+Pxy6cp8HDE=; b=wqmULjWykxyru8/uNJbfIa6cBHgD5WqxUtvNr1eAh8H/If6FXDzwHqI4oXEyvRWYDBtF csPTZowhdmvHBLsS94Q7lfeDtC5obijkW3GLWMlA2U5Mc43/S0lSSc4MlZUe+U2kqgeD XzSwaqhNPhyBP8JsLuLZFnUF9JWNOBqI+fqiHqnWDK+n/XuccTS5QCEWnu63EwWZrGSx AX8uWinRlFbj2Xj6/iFo30Z199Lwp4pcuWXk98KvDVdMy16kFohRoCWR0rh3dRf/9gC/ gSM1X7nPd6UsKnRKJvySb3RxRmlnt2FU/sWBKtXPT3okM+64wRj9gibqYuGP4ZNb/tIn Ug== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx3py77eu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFVi2o127809; Wed, 15 Dec 2021 15:38:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by userp3020.oracle.com with ESMTP id 3cvnes2g32-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQhIdzTnO4DfelvN5a5FHmrbQlLYmuRop/5PZr64qDVW3D8TKUBJZQmtCNZ5nq7uJZbw6CU4jsfjKw5ygS+x+Ql+7zqtcosVvfnDvafRIb1mRryHMS4HSbg6OZ25twapE4peSmTUk6g5QdJPHBnJPtgf0Bi04mrM4cA3ciiCGUExVvX4PapoWdumjijZtVRJZ3obcs715oQ42V3i7wwMA2cWi4dQbLVMt5W5IU8OXObp9SkuBgYmuSDn0bgBCepmyMnZeYFkGGALUm1a50eKoYcLJIFgT3FNht8AWVBfvei+wWMbfeOwWvR58tdU8C047052lsTmk7LjV6muKQznkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SfvJCp/7ima11pfl07B0iZGcklh+t4Q1+Pxy6cp8HDE=; b=QqIvFdzwwowtTLutoxj0lOoHUrTHuKLiUB+xYp6wVRge32KM70oMpLYzj3UdFwtViFsvEXgdqEiepR56MsSFVj1Mt1q5OJ3mKgJ7X199X+KfQQ9375KuncS+wATu+Wmd5JzgRTXH1VO/BVbHomOKuDkk5aoN9MJcOEWEvaqjeO1NEl9736TUg6Z/DWqLpXSEAO6HGoeteaEophJHI7tBztUUlQKOJWYCKXl6THu32M93ivsBUI1zXR4uIVuktCMHhE7PSaOE+sBARRLDLtaXwhml2eGQnWEUEBdF50GYTFCJg2wpMh/SJENB7gf6bWFhsLG0xIOlwV1HjGJTqY1r3A== 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=SfvJCp/7ima11pfl07B0iZGcklh+t4Q1+Pxy6cp8HDE=; b=KLOrVGHRCIsG64cSEZaxCSWjacL1IjDVvEYUwDNtgipqBDAPiHpEI9UNGDlRVPOVP7t9EWFyg7vn3QYycz7eH3R5W832Yi+fLG4nvyZukbIQtXZUnwgsmV9JmkqiL8QvK1MH5lxU3G/7ABXagz1PnveYwYXkQIumi7w8X5LkIXc= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2349.namprd10.prod.outlook.com (2603:10b6:301:30::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:45 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:45 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 09/10] ACPI ERST: bios-tables-test testcase Date: Wed, 15 Dec 2021 10:38:14 -0500 Message-Id: <1639582695-7328-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 123fdd61-05a6-4f04-242d-08d9bfe0fad0 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2349:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:415; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IPbxH0xW3TeGBqkin9Q7ox46gLIAjSzp7XC1y9qDP9JIOIneFQMdxWuPmtG2ukSgxDK8rbly1L1wJ1X6A2Qyf9Ii4b+1MgEWq1UStxMY+ssVItTx8SWQyuFCPqE+vN3HN25PJfBfnkT34vBb+80ZPUE1PNdVnqvNvAPNKbnd78/sti1QIcwScdfl+kekOIKg9cUNtrBdllKzL6lpZS6bZOX7MlJI85Sj8hT7Ckcjkjj0ceDePmGsZLZbgEog5NVOA+rBhy01YsP7FJFOJL33aljQ2gsNcarVGm+pKzDgxBGPXhqwviCOSjMRb5PAQGEV8zHNTfOT6sPuQrWwnNvxRzflKeiifm3xs9eIY5vTTUKnHmULKFElGHSaBSLiFgwNHGLevIX3CwVKHwKaahEjMW0fugkyNLGX6E47jUdP7uTYzwQrzYJqsJ14mdxbc6RbuEnr/SKn+9epDGnqo+OaBpogzDfGWixWbAwV22igbT9QbsXQOe1sT1PZqVohHv64sXGplHEzgKTAVb09jHFxit6iy5mOyakiFOAAPLbUk0NSODmVLjE3DmaA5BHvBYLDhxd4f89cdPqCzBI7nwb6lRGW/vq2S26gARjL4z/544q4svEi9f6BgIRyyoLnDS5luSmqQkO0CT9ZL9/0uaW51uT2nh9vaeAJoiOTQF+Xbwq0S9n7i/ONFewEPBGMY0hM+QaxWEThHU6VrhEsdn5sPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(6666004)(6506007)(6512007)(2616005)(6916009)(66476007)(66556008)(5660300002)(66946007)(2906002)(36756003)(8936002)(52116002)(107886003)(316002)(4326008)(38350700002)(38100700002)(8676002)(508600001)(26005)(6486002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eOHuQpL/vm2wUo1qL2OvjJ1SJ9kQADnlki3Qo69u4OKyzFaWhGR7Wy/UMZ0OR08LhinD0AZ7rp2r8bP68NMf1pkVZT5jp17I551MCiYiipb2jJCXNk00ZkJLGAbowavT+rJKxOuPCxRhhsSeDLEG0yrGG3WJJLY6M6ofZ+bPH5u6a1Bqih/dPF7cof/4Ke5mlHmwzz97FBbKmKLgjJmwTSDWB2pOjujpMumXB3LoNvHCYImvXgbM96y3P1srkvru+7jglfIrtwEZUuOSreyRj3WJS+rARNcM5CEBG50F3nx5cPEn2458bJLXd5UIzjrTWO0OkDs/hphBRmdhRwSgpT8ZEuANIOEy1HsUQkprKhdq4LA4w5yNqlWhUYz8LbKTmjDMWWUIOdijy/PoYs5ovxr0wVYEar/FikfQjQbxGhwoOGF1I6OXtNy1rM5wZzTQEwZxVexw8Yx0DRYL+oqu2ISzk/iEEKdCnGVbIkNxk8pbv50gY6ot055J5T6BX+rEQig++ECbKH6UG+vDF7lBHe7TIOK0DTkFAXiN9rtqkBhaIls2uZgXccUFTfReK3W8szCCkiKlMh3PrR3+YsQSW/mtNRO40Im19qO6kTdQ4PuOKuN4vFQJhi+hBz456tSw1NEz/XulIf7jeh833XtNUr2oTeGhCm8a532WGKLB3KukB8bKCjTlWd+7wMmIQmOsl/l421/lIiPXA/D2ci3LVUo6ZNS4RLPMz5dpsj/2wOQNtU3N7R8uo/SUHYnsgG8wuEqFQ8GqBZq+wchorWaLeD4DhHLsRJpF26jB6jytu+isrS9yxGDzfRy8H+HWXGA9ltpgIL07MKx/lr2fPSCOAbtQQHISaIWUX5nWhx1bCbTCu2OvXiSH8HlrnzQJm+N1IiKg1ENN6kphkhoL/JfcIT1hjYzEQHHK4as2fzZNgHl7ZZ9p5LwY+ekvX2fk34ipRh2SW1h7kGwUF6iZ8aksM4iJJ2gmGlggvndMd3NguOOakGXsLYui1gGISfiQcm6MPWcyBW36UMK/E70llJu92nSwUXrazSkT6j+cg8K6c0RJebl9zajdgFUtiT2pkJLECGXDL6bP/ZvAH5xpGVAvHF16Z9ZiSU/OU8iHEsVv7dOTx0ovpJgvZt0HMgwhyP/LkWK+eZ+lqNL3B600IgVXdhX8alarwMb2nFZlnbK4m17J36ptg/6R8eaXLqDP62OObQDISzwByF4aShnnSerDHGVYIKPxU/n886V2OEPpOcn74xOAgVKf6ttVdaN9MaefY8G/blocewHpln2KuN5IY3amJugtOVzbtdTHcTflIal+HQ69ZLQ6JYhCiCvftycV38/j3fmhMmgYqHnVnCi+HZCBo8USe8AJTaxM+CqAZQoIxXoBsbZysOvvgJ/fXGBtACI/2DDDVZK+Ju6MbBNf0iVLb5t0pAoUG0hCRplVcD5YPHWdDDAq4Z5qCDb4b54FWE7pwSnxkcgtK91SvfBwsO99+85BidmIrYHgjy/LvSOOqPecGgc9xnLDhRnmH9gEJT0BxNw85O3raD63OBl8huow6+RgUli0YflFlm5L2lGVEUslXAe1La5qx7EUWhbYrjpmqeG3Fi2BF4vBtEfyplwoopgZ6p+45HeMrbG3PF8vLDL6Q/kGzJwmzVwnvaQ9M2fRyynGiMe3aBqqqtgrHAtasNsed5O49tZCGsJJmtc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 123fdd61-05a6-4f04-242d-08d9bfe0fad0 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:45.2722 (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: x/nw7mQnRMYXnyltQvwoqv8aFdhoMhYCnuU/lTK3HKcpeyBrO27uzR4inBSA5MC8jiPSVbEyOFlAuE4OkbpyegT2Biv1L6YFgZScSqveuc4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2349 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=871 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-ORIG-GUID: y3ArFTpM3qg9TtB7bBS1T3vp7N9C6M2P X-Proofpoint-GUID: y3ArFTpM3qg9TtB7bBS1T3vp7N9C6M2P Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change implements the test suite checks for the ERST table. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/bios-tables-test.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 2588741..2f073e6 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1446,6 +1446,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } +static void test_acpi_erst(const char *machine) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = machine; + data.variant = ".acpierst"; + params = g_strdup_printf( + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + free_test_data(&data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); +} + +static void test_acpi_piix4_acpi_erst(void) +{ + test_acpi_erst(MACHINE_PC); +} + +static void test_acpi_q35_acpi_erst(void) +{ + test_acpi_erst(MACHINE_Q35); +} + +static void test_acpi_microvm_acpi_erst(void) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + test_acpi_microvm_prepare(&data); + data.variant = ".pcie"; + data.tcg_only = true; /* need constant host-phys-bits */ + params = g_strdup_printf(" -machine microvm," + "acpi=on,ioapic2=off,rtc=off,pcie=on" + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); + free_test_data(&data); +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -1624,6 +1675,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat); qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); + qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); + qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); @@ -1639,6 +1692,9 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic); qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); } + if (strcmp(arch, "x86_64") == 0) { + qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_acpi_erst); + } } else if (strcmp(arch, "aarch64") == 0) { if (has_tcg) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); From patchwork Wed Dec 15 15:38:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12678579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED80AC433FE for ; Wed, 15 Dec 2021 15:57:48 +0000 (UTC) Received: from localhost ([::1]:33680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxWeK-00060S-2x for qemu-devel@archiver.kernel.org; Wed, 15 Dec 2021 10:57:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMt-0000xO-3n for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:59 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:15106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxWMn-0000VD-Q8 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 10:38:58 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFELE6S028543; Wed, 15 Dec 2021 15:38:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=WEhbo6JhI8teBzguE/uXGDbztcnVPYxZmVXAS/fx+bU=; b=IlmnIJbe6RNl+vNU6zzJ+V2S/oAOeUlC0kjg4LV9/+EG+gIM82zMZaNqzjBvlBONECKl hAOrNtJ4+87aI9gQcNMWRlY9UYzERA5JayO+zc5rN0xPQ66lWAso8wy80LbdtRNBBP+a zXQg09yi1JMym8Jg9+9iVCLC7kPlAiEoS+/Vg7Hqpa4pomaiW+3BwGVCjJlHpJwLYWM6 YIF6B6N523kQKHT233uqpL0Sb0HsWWeRBcQSu9pddS1YkwSJXvCelRzkl50fDlTSlSnC BPDrEsgX3Zab5LyIURo9kHPg7EDNS8uvDa0SBwnCmI/HFwP11gQ1LJt7DNenoXjPMkyf /g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx3ukf70j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:51 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFFUWwM094240; Wed, 15 Dec 2021 15:38:50 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3020.oracle.com with ESMTP id 3cxmrc0ww6-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 15:38:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LxkfoyRhdojeO0P3MsiM3Tt+ICOtE6cofayScXkb2QZ7Ai/O4b5OYVlYXIEUepfrw9XzmzS61sSETCcm+NnymCX8Le6QV9fLBLztI6as4i+lJSQLwQsE4LsBEFx6wA5q+pCSRC//HolOZCQpupotbADvXqUsgC4Z/3BY10jcrt1s930AGUkXppoLZDaSoDGCk5xYECdO6bFyjllElxLqr/v3I9IBkTLSMORidVIjKSjJ57ty/Z4r+nzmddnyONoi37MBhgZ2YPCGOgWqSpDHimqJNNVDU/GgBIg3Ju+/YcyCyMA/Zyi9p+imJ5g/XRueD8kPtL67phcqJ/ReR7ys0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WEhbo6JhI8teBzguE/uXGDbztcnVPYxZmVXAS/fx+bU=; b=iPJAoxhnk9V63oxOrOD6U6wH10xTPZm6R3koBKoT8NE+CJLAOwuvSDhQg9KvUBVTcRzkd5DiyoLnj7zC5QIs3X2mLb/K4W58IXKVdun2ouu4azg9NjRyNDxIrbaGXaSUKINXeIXYhTSpXve3Hdv8TyPOJCzP1n/0SZ/pnqRRH9U1SN0E7SFROibmDaQgU2tgiu2SpbMnxa88FEz1F2S/FpkeyZBUiFxghG+8zb/vIzbRNSlqDhZCKQs/3WubsQmz5toiEQ+xZpvHqwBI4Glcus+wmDalUZ5iiYp87+WLCVDm71Zio2ByVAmCpn3e6zk75FfrrnludooOUf7dh0HjFQ== 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=WEhbo6JhI8teBzguE/uXGDbztcnVPYxZmVXAS/fx+bU=; b=n4UeyaXIop+IguiwBE+1FTy7cW2QBk/VK29mAhf9uyOBdIWy6QTVeStXqk2hFlnuw3k6cthOqe8QCokF7nvJRhdoUf6aF6yLGyg3tzSCtfjzOsPufqK/ihyb1A081zAqCmfs5ahrs1uPvjAiy+UVDyHXCYvmxffGQs+8wGfZmzw= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5474.namprd10.prod.outlook.com (2603:10b6:5:35e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 15:38:47 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::143c:ea64:7017:19f%4]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 15:38:47 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v11 10/10] ACPI ERST: step 6 of bios-tables-test.c Date: Wed, 15 Dec 2021 10:38:15 -0500 Message-Id: <1639582695-7328-11-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> References: <1639582695-7328-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: SN1PR12CA0073.namprd12.prod.outlook.com (2603:10b6:802:20::44) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1d00fd6-f6a8-4308-978f-08d9bfe0fbd1 X-MS-TrafficTypeDiagnostic: CO6PR10MB5474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:177; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DYZNXjI0aSzEU9YL33UiOSU1vt3baQDY638JanzjEl1ieOQxKTy7VknHK6+3vF8aog6rSFU1K9yed13R1QUB/MVMeJsUKwcLGmMSl5DbirEHaa2acQ0EEXzZDC1dDhuChfcjgqSi13urX85u2Y637scEYyHs4snZhvnGZKxaxTmkQjGT2yAXpmvwhwut+Uu+yIYW2BxRO47TFT84mEJZ+i3opDeuXyizq2AfwHNY5eZ+3NVUP3E+41EDih5xJtBrrcY2myWpzm05SaqNSwijEukOZWlfT/7oNeKdB40oYY/1P/1o+17Xswv38wMM+X585FcKGT865Tzifr5BSi6efjZBLWyhkEbATuTg+lZJfdNbMMoJlO9UG+0AQm8Tcv6OJqAt5VjDr3HcBIg955blFnFL1R7XiTR3t04nP9Gcfw0dqLYuRpl1kzgpNJv7XvV5Dx3Eozak8LQdU9CGku5syl1Nb43g58iY3UUH8ykrmaeKOv8YZ4klOVjkc5dNyXnoKyBY4folZai+BDgqKs2p5DHZ9z7WM8q4H3QF8moLb0QAWgHPODmbLkXqANykOdpAnYpgNVS8d62oZi5U5EbjGQsFkuaYUZHZjvTDD3AHeuH5b7BViFWJbuYUn1ru0ZdtEjPx/j+L8EQg7ic1lbH8wkuKKqQXI1Fk/0+haJ8eptPlYhL/kqoX5RG1/rGPl7YvMUJ5/kVYTClLf/VITQQAbg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(508600001)(316002)(8936002)(38100700002)(8676002)(6506007)(38350700002)(2906002)(36756003)(107886003)(6486002)(26005)(6666004)(4326008)(30864003)(66946007)(66476007)(2616005)(186003)(6512007)(86362001)(66556008)(6916009)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VlDkgar2zy5xlVYonQczDHWkoXl5Q05ouS26dKZySGJuUYf4S2UCCGRQ8dL0YIsoaBrB1MLsEyFKBiqj/dxR3wtP7VRapa2z9HZgTA15wgpgdYEoeK5IS21NCm0KKu+imqXIfFnFFw6FiJ+xtIO2FGvRNpvZGM7Qa44Nt7VVpbUE7MC2pcQQsIROes/qWe6HC5hfPgjitScucsfvil+b08HtjlNAvkXr7vRZeHbcBXSIAZwpEB5ebEoit5Ml2S/rpZ4mtpIJUuEY2ODg/mEKUEAC7rr3E+wezPyJmJA6CbkzPbb4qQo7PTlPONhZB/Y0OHbcOMromje+2O0YfmfWfhA69p/CgklAwJNazBQK/gq1ah3P7AKxixl8PhRyTD+bdkn4JHKmEyUZrka56rPChCUWmChkOYE0rMzlNZZMVq7vUNIf3AnbW+Z8IqtIUiY1tovqaizZpPxrl9y9COzUfzNnrY6qJS0Axq0/m1NBo82nnj35v93yVk/almszJSDC0GYnF1MqasFQDtVffI1qSZspeUYbSX1AOSukF7Z3wwntJAASrQl1qc+VBgYzmM4Lob37uEyuZ6+NLiJeHBwkYXBhWPps+az2qoPTqQvZ3koV6cmBuappdUJr+Xv5iF1lP6uYy2ZBskwQJTeYa0tjrgyvuVcNO1NO7/NyDy+NAToMg29azKkUwOivF+yuO18NTFlNuz5HDa8O/Znyn53qoTpGtT8c9xfPU0OhNTjV0I649jvNR/OCv5ggcRo7g0stffBBKHv+Of8QjlBsNTnMyauO1XiOGCD68PMFrPUojs0y+4C9FZJv4ogHhm6YyPe1NXMRbBw4j8U38ePMfZ9S0o7oWoj1EVcxP34uzQaCTXlY5pJYPCCn/ObdqGNO8X8UX0GSrRb0GdFk80rgeq+ppejV7SFcJR/NBkE4wBiRfKAvhUt5mwLuEwhZ+UJ1q7rE11GrgyTclXXmHucMFgqClZE71iuevTtjpVubLAWKsG+A2eAegAJE+iAKjNYaMNazRcJNflu+kPL0j1uvyXKKnsls5C/oXhQLQHVaWa1POKY7lH/qAxhok7S73cAjYliOT77UfXQ4fDGHPWfxQw2ECSgtkG1nxD3+yyfJef0S5Rqb7QI8T0o+lhdKYiSw8Vuy8bCp2bZt2B/JN82TCLndgrZeBU3DrRlfTKDqbOaInhwWoChvgFJr7vvHVAbxIx70qSjdoLIAORrs5N/zmu3RfXczd1O2VU5X9ZkXvbT2jY4HW1d5H+Tqhuco2Po/FHqIcffKExQBqq5/ZG0PF6x80CrFso3eWwmt0l2ouAZ5RLVol0Xm3fLHODyYVkqc4iI/iU0YzpMJPihiHKEuj+Vj25JiDJ80hmZhTvKSl9S2iboNExDrzh3wFwZjP/qp9HJVwEwDXfgg6a/leOVxZf7XwpK44BBadDi8Xu8BwxGB/J9XtRws1hugt4grI0PjpBf4AUaFAUEGpM2QhOaQEnXpNfo0nusg+TXw6c2FL/fxwfKhZCo4QYIQnBFhOriIIWLKxFRQWWFFK7sumpk3Kkxfk+WPhw7wz9AisaOPUVLl9hBBISuYKn+qBWyFPw2zTnWkTELb07KfoRae2Yn78+OU1EoZ8naYY70A2vBFxHjcsotyYlkpNnlFMPgwdJ0JapBhiyu1bDLry1clAm+iG9H0lI9jCfBf8cmdPainoO/Obvw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1d00fd6-f6a8-4308-978f-08d9bfe0fbd1 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 15:38:47.0845 (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: iDHE+PpkSnHkbfsL0KM7M0Xs04uIqUSPuvbv9FBSJ+6tpRgginPCbq3WhDj/FLqgf9LgjUeD990ZzIB138LBX7g58r+hH37/jgfcTkTA4YU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5474 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=845 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150088 X-Proofpoint-GUID: IzrbJLTOKrcOXDDgiM1f-xRDOHMengSG X-Proofpoint-ORIG-GUID: IzrbJLTOKrcOXDDgiM1f-xRDOHMengSG Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6. Below is the disassembly of tests/data/acpi/pc/ERST.acpierst. /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180508 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * * Disassembly of tests/data/acpi/pc/ERST.acpierst, Thu Dec 2 13:32:07 2021 * * ACPI Data Table [ERST] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "ERST" [Error Record Serialization Table] [004h 0004 4] Table Length : 00000390 [008h 0008 1] Revision : 01 [009h 0009 1] Checksum : D6 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 4] Serialization Header Length : 00000030 [028h 0040 4] Reserved : 00000000 [02Ch 0044 4] Instruction Entry Count : 0000001B [030h 0048 1] Action : 00 [Begin Write Operation] [031h 0049 1] Instruction : 03 [Write Register Value] [032h 0050 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [033h 0051 1] Reserved : 00 [034h 0052 12] Register Region : [Generic Address Structure] [034h 0052 1] Space ID : 00 [SystemMemory] [035h 0053 1] Bit Width : 20 [036h 0054 1] Bit Offset : 00 [037h 0055 1] Encoded Access Width : 03 [DWord Access:32] [038h 0056 8] Address : 00000000FEBF3000 [040h 0064 8] Value : 0000000000000000 [048h 0072 8] Mask : 00000000000000FF [050h 0080 1] Action : 01 [Begin Read Operation] [051h 0081 1] Instruction : 03 [Write Register Value] [052h 0082 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [053h 0083 1] Reserved : 00 [054h 0084 12] Register Region : [Generic Address Structure] [054h 0084 1] Space ID : 00 [SystemMemory] [055h 0085 1] Bit Width : 20 [056h 0086 1] Bit Offset : 00 [057h 0087 1] Encoded Access Width : 03 [DWord Access:32] [058h 0088 8] Address : 00000000FEBF3000 [060h 0096 8] Value : 0000000000000001 [068h 0104 8] Mask : 00000000000000FF [070h 0112 1] Action : 02 [Begin Clear Operation] [071h 0113 1] Instruction : 03 [Write Register Value] [072h 0114 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [073h 0115 1] Reserved : 00 [074h 0116 12] Register Region : [Generic Address Structure] [074h 0116 1] Space ID : 00 [SystemMemory] [075h 0117 1] Bit Width : 20 [076h 0118 1] Bit Offset : 00 [077h 0119 1] Encoded Access Width : 03 [DWord Access:32] [078h 0120 8] Address : 00000000FEBF3000 [080h 0128 8] Value : 0000000000000002 [088h 0136 8] Mask : 00000000000000FF [090h 0144 1] Action : 03 [End Operation] [091h 0145 1] Instruction : 03 [Write Register Value] [092h 0146 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [093h 0147 1] Reserved : 00 [094h 0148 12] Register Region : [Generic Address Structure] [094h 0148 1] Space ID : 00 [SystemMemory] [095h 0149 1] Bit Width : 20 [096h 0150 1] Bit Offset : 00 [097h 0151 1] Encoded Access Width : 03 [DWord Access:32] [098h 0152 8] Address : 00000000FEBF3000 [0A0h 0160 8] Value : 0000000000000003 [0A8h 0168 8] Mask : 00000000000000FF [0B0h 0176 1] Action : 04 [Set Record Offset] [0B1h 0177 1] Instruction : 02 [Write Register] [0B2h 0178 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0B3h 0179 1] Reserved : 00 [0B4h 0180 12] Register Region : [Generic Address Structure] [0B4h 0180 1] Space ID : 00 [SystemMemory] [0B5h 0181 1] Bit Width : 20 [0B6h 0182 1] Bit Offset : 00 [0B7h 0183 1] Encoded Access Width : 03 [DWord Access:32] [0B8h 0184 8] Address : 00000000FEBF3008 [0C0h 0192 8] Value : 0000000000000000 [0C8h 0200 8] Mask : 00000000FFFFFFFF [0D0h 0208 1] Action : 04 [Set Record Offset] [0D1h 0209 1] Instruction : 03 [Write Register Value] [0D2h 0210 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0D3h 0211 1] Reserved : 00 [0D4h 0212 12] Register Region : [Generic Address Structure] [0D4h 0212 1] Space ID : 00 [SystemMemory] [0D5h 0213 1] Bit Width : 20 [0D6h 0214 1] Bit Offset : 00 [0D7h 0215 1] Encoded Access Width : 03 [DWord Access:32] [0D8h 0216 8] Address : 00000000FEBF3000 [0E0h 0224 8] Value : 0000000000000004 [0E8h 0232 8] Mask : 00000000000000FF [0F0h 0240 1] Action : 05 [Execute Operation] [0F1h 0241 1] Instruction : 03 [Write Register Value] [0F2h 0242 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0F3h 0243 1] Reserved : 00 [0F4h 0244 12] Register Region : [Generic Address Structure] [0F4h 0244 1] Space ID : 00 [SystemMemory] [0F5h 0245 1] Bit Width : 20 [0F6h 0246 1] Bit Offset : 00 [0F7h 0247 1] Encoded Access Width : 03 [DWord Access:32] [0F8h 0248 8] Address : 00000000FEBF3008 [100h 0256 8] Value : 000000000000009C [108h 0264 8] Mask : 00000000000000FF [110h 0272 1] Action : 05 [Execute Operation] [111h 0273 1] Instruction : 03 [Write Register Value] [112h 0274 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [113h 0275 1] Reserved : 00 [114h 0276 12] Register Region : [Generic Address Structure] [114h 0276 1] Space ID : 00 [SystemMemory] [115h 0277 1] Bit Width : 20 [116h 0278 1] Bit Offset : 00 [117h 0279 1] Encoded Access Width : 03 [DWord Access:32] [118h 0280 8] Address : 00000000FEBF3000 [120h 0288 8] Value : 0000000000000005 [128h 0296 8] Mask : 00000000000000FF [130h 0304 1] Action : 06 [Check Busy Status] [131h 0305 1] Instruction : 03 [Write Register Value] [132h 0306 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [133h 0307 1] Reserved : 00 [134h 0308 12] Register Region : [Generic Address Structure] [134h 0308 1] Space ID : 00 [SystemMemory] [135h 0309 1] Bit Width : 20 [136h 0310 1] Bit Offset : 00 [137h 0311 1] Encoded Access Width : 03 [DWord Access:32] [138h 0312 8] Address : 00000000FEBF3000 [140h 0320 8] Value : 0000000000000006 [148h 0328 8] Mask : 00000000000000FF [150h 0336 1] Action : 06 [Check Busy Status] [151h 0337 1] Instruction : 01 [Read Register Value] [152h 0338 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [153h 0339 1] Reserved : 00 [154h 0340 12] Register Region : [Generic Address Structure] [154h 0340 1] Space ID : 00 [SystemMemory] [155h 0341 1] Bit Width : 20 [156h 0342 1] Bit Offset : 00 [157h 0343 1] Encoded Access Width : 03 [DWord Access:32] [158h 0344 8] Address : 00000000FEBF3008 [160h 0352 8] Value : 0000000000000001 [168h 0360 8] Mask : 00000000000000FF [170h 0368 1] Action : 07 [Get Command Status] [171h 0369 1] Instruction : 03 [Write Register Value] [172h 0370 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [173h 0371 1] Reserved : 00 [174h 0372 12] Register Region : [Generic Address Structure] [174h 0372 1] Space ID : 00 [SystemMemory] [175h 0373 1] Bit Width : 20 [176h 0374 1] Bit Offset : 00 [177h 0375 1] Encoded Access Width : 03 [DWord Access:32] [178h 0376 8] Address : 00000000FEBF3000 [180h 0384 8] Value : 0000000000000007 [188h 0392 8] Mask : 00000000000000FF [190h 0400 1] Action : 07 [Get Command Status] [191h 0401 1] Instruction : 00 [Read Register] [192h 0402 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [193h 0403 1] Reserved : 00 [194h 0404 12] Register Region : [Generic Address Structure] [194h 0404 1] Space ID : 00 [SystemMemory] [195h 0405 1] Bit Width : 20 [196h 0406 1] Bit Offset : 00 [197h 0407 1] Encoded Access Width : 03 [DWord Access:32] [198h 0408 8] Address : 00000000FEBF3008 [1A0h 0416 8] Value : 0000000000000000 [1A8h 0424 8] Mask : 00000000000000FF [1B0h 0432 1] Action : 08 [Get Record Identifier] [1B1h 0433 1] Instruction : 03 [Write Register Value] [1B2h 0434 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1B3h 0435 1] Reserved : 00 [1B4h 0436 12] Register Region : [Generic Address Structure] [1B4h 0436 1] Space ID : 00 [SystemMemory] [1B5h 0437 1] Bit Width : 20 [1B6h 0438 1] Bit Offset : 00 [1B7h 0439 1] Encoded Access Width : 03 [DWord Access:32] [1B8h 0440 8] Address : 00000000FEBF3000 [1C0h 0448 8] Value : 0000000000000008 [1C8h 0456 8] Mask : 00000000000000FF [1D0h 0464 1] Action : 08 [Get Record Identifier] [1D1h 0465 1] Instruction : 00 [Read Register] [1D2h 0466 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1D3h 0467 1] Reserved : 00 [1D4h 0468 12] Register Region : [Generic Address Structure] [1D4h 0468 1] Space ID : 00 [SystemMemory] [1D5h 0469 1] Bit Width : 40 [1D6h 0470 1] Bit Offset : 00 [1D7h 0471 1] Encoded Access Width : 04 [QWord Access:64] [1D8h 0472 8] Address : 00000000FEBF3008 [1E0h 0480 8] Value : 0000000000000000 [1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF [1F0h 0496 1] Action : 09 [Set Record Identifier] [1F1h 0497 1] Instruction : 02 [Write Register] [1F2h 0498 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1F3h 0499 1] Reserved : 00 [1F4h 0500 12] Register Region : [Generic Address Structure] [1F4h 0500 1] Space ID : 00 [SystemMemory] [1F5h 0501 1] Bit Width : 40 [1F6h 0502 1] Bit Offset : 00 [1F7h 0503 1] Encoded Access Width : 04 [QWord Access:64] [1F8h 0504 8] Address : 00000000FEBF3008 [200h 0512 8] Value : 0000000000000000 [208h 0520 8] Mask : FFFFFFFFFFFFFFFF [210h 0528 1] Action : 09 [Set Record Identifier] [211h 0529 1] Instruction : 03 [Write Register Value] [212h 0530 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [213h 0531 1] Reserved : 00 [214h 0532 12] Register Region : [Generic Address Structure] [214h 0532 1] Space ID : 00 [SystemMemory] [215h 0533 1] Bit Width : 20 [216h 0534 1] Bit Offset : 00 [217h 0535 1] Encoded Access Width : 03 [DWord Access:32] [218h 0536 8] Address : 00000000FEBF3000 [220h 0544 8] Value : 0000000000000009 [228h 0552 8] Mask : 00000000000000FF [230h 0560 1] Action : 0A [Get Record Count] [231h 0561 1] Instruction : 03 [Write Register Value] [232h 0562 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [233h 0563 1] Reserved : 00 [234h 0564 12] Register Region : [Generic Address Structure] [234h 0564 1] Space ID : 00 [SystemMemory] [235h 0565 1] Bit Width : 20 [236h 0566 1] Bit Offset : 00 [237h 0567 1] Encoded Access Width : 03 [DWord Access:32] [238h 0568 8] Address : 00000000FEBF3000 [240h 0576 8] Value : 000000000000000A [248h 0584 8] Mask : 00000000000000FF [250h 0592 1] Action : 0A [Get Record Count] [251h 0593 1] Instruction : 00 [Read Register] [252h 0594 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [253h 0595 1] Reserved : 00 [254h 0596 12] Register Region : [Generic Address Structure] [254h 0596 1] Space ID : 00 [SystemMemory] [255h 0597 1] Bit Width : 20 [256h 0598 1] Bit Offset : 00 [257h 0599 1] Encoded Access Width : 03 [DWord Access:32] [258h 0600 8] Address : 00000000FEBF3008 [260h 0608 8] Value : 0000000000000000 [268h 0616 8] Mask : 00000000FFFFFFFF [270h 0624 1] Action : 0B [Begin Dummy Write] [271h 0625 1] Instruction : 03 [Write Register Value] [272h 0626 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [273h 0627 1] Reserved : 00 [274h 0628 12] Register Region : [Generic Address Structure] [274h 0628 1] Space ID : 00 [SystemMemory] [275h 0629 1] Bit Width : 20 [276h 0630 1] Bit Offset : 00 [277h 0631 1] Encoded Access Width : 03 [DWord Access:32] [278h 0632 8] Address : 00000000FEBF3000 [280h 0640 8] Value : 000000000000000B [288h 0648 8] Mask : 00000000000000FF [290h 0656 1] Action : 0D [Get Error Address Range] [291h 0657 1] Instruction : 03 [Write Register Value] [292h 0658 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [293h 0659 1] Reserved : 00 [294h 0660 12] Register Region : [Generic Address Structure] [294h 0660 1] Space ID : 00 [SystemMemory] [295h 0661 1] Bit Width : 20 [296h 0662 1] Bit Offset : 00 [297h 0663 1] Encoded Access Width : 03 [DWord Access:32] [298h 0664 8] Address : 00000000FEBF3000 [2A0h 0672 8] Value : 000000000000000D [2A8h 0680 8] Mask : 00000000000000FF [2B0h 0688 1] Action : 0D [Get Error Address Range] [2B1h 0689 1] Instruction : 00 [Read Register] [2B2h 0690 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2B3h 0691 1] Reserved : 00 [2B4h 0692 12] Register Region : [Generic Address Structure] [2B4h 0692 1] Space ID : 00 [SystemMemory] [2B5h 0693 1] Bit Width : 40 [2B6h 0694 1] Bit Offset : 00 [2B7h 0695 1] Encoded Access Width : 04 [QWord Access:64] [2B8h 0696 8] Address : 00000000FEBF3008 [2C0h 0704 8] Value : 0000000000000000 [2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF [2D0h 0720 1] Action : 0E [Get Error Address Length] [2D1h 0721 1] Instruction : 03 [Write Register Value] [2D2h 0722 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2D3h 0723 1] Reserved : 00 [2D4h 0724 12] Register Region : [Generic Address Structure] [2D4h 0724 1] Space ID : 00 [SystemMemory] [2D5h 0725 1] Bit Width : 20 [2D6h 0726 1] Bit Offset : 00 [2D7h 0727 1] Encoded Access Width : 03 [DWord Access:32] [2D8h 0728 8] Address : 00000000FEBF3000 [2E0h 0736 8] Value : 000000000000000E [2E8h 0744 8] Mask : 00000000000000FF [2F0h 0752 1] Action : 0E [Get Error Address Length] [2F1h 0753 1] Instruction : 00 [Read Register] [2F2h 0754 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2F3h 0755 1] Reserved : 00 [2F4h 0756 12] Register Region : [Generic Address Structure] [2F4h 0756 1] Space ID : 00 [SystemMemory] [2F5h 0757 1] Bit Width : 40 [2F6h 0758 1] Bit Offset : 00 [2F7h 0759 1] Encoded Access Width : 04 [QWord Access:64] [2F8h 0760 8] Address : 00000000FEBF3008 [300h 0768 8] Value : 0000000000000000 [308h 0776 8] Mask : 00000000FFFFFFFF [310h 0784 1] Action : 0F [Get Error Attributes] [311h 0785 1] Instruction : 03 [Write Register Value] [312h 0786 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [313h 0787 1] Reserved : 00 [314h 0788 12] Register Region : [Generic Address Structure] [314h 0788 1] Space ID : 00 [SystemMemory] [315h 0789 1] Bit Width : 20 [316h 0790 1] Bit Offset : 00 [317h 0791 1] Encoded Access Width : 03 [DWord Access:32] [318h 0792 8] Address : 00000000FEBF3000 [320h 0800 8] Value : 000000000000000F [328h 0808 8] Mask : 00000000000000FF [330h 0816 1] Action : 0F [Get Error Attributes] [331h 0817 1] Instruction : 00 [Read Register] [332h 0818 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [333h 0819 1] Reserved : 00 [334h 0820 12] Register Region : [Generic Address Structure] [334h 0820 1] Space ID : 00 [SystemMemory] [335h 0821 1] Bit Width : 20 [336h 0822 1] Bit Offset : 00 [337h 0823 1] Encoded Access Width : 03 [DWord Access:32] [338h 0824 8] Address : 00000000FEBF3008 [340h 0832 8] Value : 0000000000000000 [348h 0840 8] Mask : 00000000FFFFFFFF [350h 0848 1] Action : 10 [Execute Timings] [351h 0849 1] Instruction : 03 [Write Register Value] [352h 0850 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [353h 0851 1] Reserved : 00 [354h 0852 12] Register Region : [Generic Address Structure] [354h 0852 1] Space ID : 00 [SystemMemory] [355h 0853 1] Bit Width : 20 [356h 0854 1] Bit Offset : 00 [357h 0855 1] Encoded Access Width : 03 [DWord Access:32] [358h 0856 8] Address : 00000000FEBF3000 [360h 0864 8] Value : 0000000000000010 [368h 0872 8] Mask : 00000000000000FF [370h 0880 1] Action : 10 [Execute Timings] [371h 0881 1] Instruction : 00 [Read Register] [372h 0882 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [373h 0883 1] Reserved : 00 [374h 0884 12] Register Region : [Generic Address Structure] [374h 0884 1] Space ID : 00 [SystemMemory] [375h 0885 1] Bit Width : 40 [376h 0886 1] Bit Offset : 00 [377h 0887 1] Encoded Access Width : 04 [QWord Access:64] [378h 0888 8] Address : 00000000FEBF3008 [380h 0896 8] Value : 0000000000000000 [388h 0904 8] Mask : FFFFFFFFFFFFFFFF Raw Table Data: Length 912 (0x390) Note that the contents of tests/data/q35/ERST.acpierst and tests/data/microvm/ERST.pcie are the same except for differences due to assigned base address. Files tests/data/pc/DSDT.acpierst and tests/data/acpi/q35/DSDT.acpierst are new files (and are included as a result of 'make check' process). Rather than provide the entire content, I am providing the differences between pc/DSDT and pc/DSDT.acpierst, and the difference between q35/DSDT and q35/DSDT.acpierst, with an explanation to follow. diff pc/DSDT pc/DSDT.acpierst: @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/pc/DSDT, Thu Dec 2 10:10:13 2021 + * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Dec 2 12:59:36 2021 * * Original Table Header: * Signature "DSDT" - * Length 0x00001772 (6002) + * Length 0x00001751 (5969) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x9E + * Checksum 0x95 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Device (S18) { - Name (_SUN, 0x03) // _SUN: Slot User Number Name (_ADR, 0x00030000) // _ADR: Address - Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device - { - PCEJ (BSEL, _SUN) - } - + Name (ASUN, 0x03) Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method { - Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN)) + Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN)) } } @@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Method (DVNT, 2, NotSerialized) { - If ((Arg0 & 0x08)) - { - Notify (S18, Arg1) - } - If ((Arg0 & 0x10)) { Notify (S20, Arg1) diff q35/DSDT and q35/DSDT.acpierst: @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/q35/DSDT, Thu Dec 2 10:10:13 2021 + * Disassembly of tests/data/acpi/q35/DSDT.acpierst, Thu Dec 2 12:59:36 2021 * * Original Table Header: * Signature "DSDT" - * Length 0x00002061 (8289) + * Length 0x00002072 (8306) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0xFA + * Checksum 0x9A * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -3278,6 +3278,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " } } + Device (S10) + { + Name (_ADR, 0x00020000) // _ADR: Address + } + Method (PCNT, 0, NotSerialized) { } For both pc and q35, there is but a small difference between this DSDT.acpierst and the corresponding DSDT. In both cases, the changes occur under the hiearchy: Scope (\_SB) { Scope (PCI0) { which leads me to believe that the change to the DSDT was needed due to the introduction of the ERST PCI device. And is explained in detail by Ani Sinha: I have convinced myself of the changes we see in the DSDT tables. On i440fx side, we are adding a non-hotpluggable pci device on slot 3. So the changes we see are basically replacing an empty hotpluggable slot on the pci root port with a non-hotplugggable device. On q35, bsel on pcie root bus is not set (its not hotpluggable bus), so the change basically adds the address enumeration for the device. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- tests/data/acpi/microvm/ERST.pcie | Bin 0 -> 912 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 0 -> 5969 bytes tests/data/acpi/pc/ERST.acpierst | Bin 0 -> 912 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 0 -> 8306 bytes tests/data/acpi/q35/ERST.acpierst | Bin 0 -> 912 bytes tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- 6 files changed, 5 deletions(-) diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2 100644 GIT binary patch literal 912 zcmaKpO%8%E5QPUQ|KVrvh9h_c12J)@5f?5!k_Ygv*jGA8UW7?#`}+D#XXyDpKHiZ? z@anI_W$gOrZRl(SB7!yMqx}#E4EC&a5=}m^g_!0^0`kEl)DOuIXM6D@@*xq*8vyqH z)b0KTlmlgmH~xt7vGp5lnFb*Ui&1&BGpsO$pT3_)pk?J?$-jLiezjJ$6`=r)uYry0Rn7KuJIp&j)|! zckaizM=~sYzU*-I~PkUtAn>Dr`~u=;o(_O$t$PK8~R}U#&P6`{0u*{ zz`m8fl|Wu#ucTKJu-TjNQ`rN~%rBccG0yWwF_}_zQl+X71|-_g)Pr`x1*Xgb!&xdP4yUPQ>QealcAR5Lj8F@vR~&d_hFrfVBOumUtb3< zL8GI#8|W0leXv|!GGL=~vE5*uM7z%Af!czNXYqlQL#IT$!9xR0zORu68XY#=M-SGy z3b+$tZv(*Hu4BBt4F>MUo>Padde^ZZU%V_4TiQ&t&6ruaomTLcp<9-2bBZ=qyp40+ ziEQ&$6L)c>%cI)0;%&VWL5E5@F~Or>jX}g)!VlmH>3A6L#ZGj;i8(jvxl3w$XL%gc z#4Y0Q*ces>sy7Obm6bTnr@oqih!n=P&+!w*&jZjVy;9R95=2i+)QqA9kLa1VJk2ES zOh6C4;>puBt75SyO`ippr%I9Z{pk6j=(st4aP-WP=ov412KgP0p3z1}&)7R9%3U9d z&O-shXOD!>df~G};j<@%&-TL`!{M=J{^0EAj)b4{!p{wbpF1J^oV~LmWA@f?c-apx zmJl5aIOP$4%5j~Id6TV0{V^u0sG`|bSAOB2V2gb1@Ki7>g+T~D<}I$cZmy;lKl#kP zxAm*k{f|HWWb1z8<4?h6y1Bg6FLiOw7Z@DC0gGYf$3^AUwgVosAOD1e9Hex!P-c3u zY%#r3y2G$SrRg@$K+^S+fmJX`o|0}AmQ(0%hN|GcJ*{Ry{RpZVR_9(>4G!#sMm9K*-Kb2oqvI?7dL24<1WVww+F6k zrAwi@3blP`ov2|RQA!4yn|HMt+&l|rp;ky|p}*s4Bhi{tS7b7IwWYtO z($_%y0DUt+12O0t{g&d0!qm$i(>FX+UGsM;osE9mca!r!@5Ld6Jt2$-nabyyC?4*zT@l2 z4LgzF3U^-%E&8T*RhMxH{B|{Nmd$hyhrlm@q(4&m{QfcO=jBztZw|gWU^0Q+lFdc4 z;t%ATAUG5ws_1bncmXfi8SEC{UBmF!TrD{!GvtiVS87Q`#ts;JTa>Png~+QvKOAg( z=l%H)^?9Gb?Lui47fY7Bv8_MKSPiRTs@3YkU)Q{@YvnKAT;;J8U>fgQ>9qeF0+gJ! zS_V9pumOy9sSU)%^lS1X17&Pw`o1`MA>W^ePI^H@E*S%`|HOx^c$lLHVkhwcpCba771jDZ#SdZmhM`3K=q{% zNdudV5*`|Tn?lmSM!~R<_iYsI+Q3HPu(0YhlR~GImZVAKI~h z+O@D02|KpVC?DEYlCeYxd&-j!?Kerrtt;#;Pd>DJ8RM1`cI=OKE&Yg{vc{!8uv6Z~ u5j$m$OK@OMk$l8{6J=Z)1AB{Pv}@<7F~|QN>AydkHSF$IS^vS{(*FTuhT2R3 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/pc/ERST.acpierst b/tests/data/acpi/pc/ERST.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f24fadd345c798ee5c17cdb66e0e1703bd1b2f26 100644 GIT binary patch literal 912 zcmaKpOAdlC6h#XZC=fn#CoF*_7>J28jW}>wF2KFG3zs9lTPTnl;U#=7r>E_sr(1u2 z21W+{ zr+@MJrMD_~fBw&3-hS0e0dO9FP5iwO(II>Q|7$G zoVF=c*370~>q(Ucw2`X*UeoWjna$X}Z?i1bzv)oC^kS{!mHe(ZC>5U_1icE2s3nZ3 zY5U#Ka>9}Q$uMNYFgqR}u+hRN!)^AvZJYi3f9V5uU@eNi<*kJe=czCEzGW%K(3|f) zNxh-*?(d&$1(g9GVw69NuK2C)X2J?B+gV$DDk*`4>hC|jR`mcD_b7?pqgS%bacj9@ zge+u+(J-#EtN42^folEz$J!fPhpfdVjb&Qtb2LKz{qyU7Z&l__iTiD6SjWmWjJK0- zCr$I*9?yK<-Dn?j(m-Q0XK?N(?n{28O7Ue=tUS zz8mz6>|NV3acd}WF?L%e9K2G0FQ{F_Ecm-^;l^btaI59oMO>(M+Fc`iPtYiEtDUWO z$!~ctmHI|?-CbkF$9=bUG0}gNqVYJ|B}DX&ag9-q{`aZ*fEAypfHMn4xgt7*F*YoE z8Q%-q3#0XTYTSG7AO8uSdAI$^%Gd1^e{CtL5V)tERpa9(Exo7$}ef`$x|2%4;rOQ9c_Ndgx~!~$?ZT;n`I zWk^iq=hy^i0vkufl+Xm@Oh7pkAu-V#j!kl=>_L(dQ$mx12`FbGB&Mu_c_pwsPl_`o zG$oj_^9WU)X-#LEGbJ=Fn6mQ-Rh=14XNEH+G^6W8sOp^4bk1oy=X9M2Rh_1$)6{gD zx=w_uPP~DXk)GFd&g(i6syZ!Ar={t%be#xQomow1R@0f)bs|)C;$5iRPg~Pz>pBst zI&+%NoTf9U>qMyPT+nnbXgU{kod{K(i<-_wP3NMn6QQcp(R4bRPDj^?P}P~&bmldk zd0i($RcArdSiBQ#f zOw)Nx(|JtSiBQ#vF9|$-@;$Vo>0HruB2;xA*K{7&bRO4rB2;yr;LJ+=COpBJ)%az1 zLNMJ2Au+ueds1Vb)R-rACPI~YN@JeVn5T3mLX~-1W1iNSr*$SmmHCLqd_-eDqB9Yy z%rl%RUFHmD%6I%3!IUp2Z%2?G^a&V+#~P%=;f zu&LjgxD0RX>1(q{mpbC@>R6seC3>2Z%2?G^a&V+#~P%=;f=3{*fllMEE0)CmI> zSk8ojDo`>|0p(0GP=rz^3{+q_69%e4$v_2^Gs!>^N}VuJf#pmXr~)Me6;RG314Srx z!axOM_lrzad z5lWpfP=V!47^ngz0~JutBm+e#b;3XemNQ|X3X}{~Ksl2P6rt1!0~J`#gn=qhGEf2K zOfpb}QYQ>lU^x>8szAv=1(Y+%KoLrvFi=E_fg(~36rpOM2o(cWm@rUrJ|DqSSTCWL;la|0sTXICqsWK z{hL31DoOvP(y9incNl(mvjWH6tkS`ygJ&|Vy=>O#yiSJ(9hzowskMpKfYJPW*4{1_ zS>_L{Z1L&VrrVtdpj*x_SlN#=Y@V+Ky~A!(o0Z0~6}`7>EiyVoC%RaAS)aocbd=l=)@cw3a6JzzFxX9Om4yX(0O{JJ0c&&iFPv_PiZ&{@E zC&pkx>rc%Di%Qq*=H;*XaMEMlG$|lP@qP%>0;IjhLU98{gZN&_q^7upZI!-q^ zjjg<%4&NG6=|tPibW`)Ppr^wJ$W%JfHZ$GSJi`(&%`+(sUnNuNMBB`CQ}d>%r^Bbp zR65Z%Gu_lYSk}|w`(-MfXq%aC>bX9qr^83hR65Z%Gu_m4x}vAUm(El=(Wa+!PCZ!9 z-d_ybRcy6jTg6Ud&EMI0LF`U6t;-Kq{QYh%kWZXv#f^kmHm}%*jUwvC(+XRSGHyMZ~lOS3M;vOtz)>YPGGp* z_KOAptfED+^h6TSZi)|T4uzk5l{Vv%UlmSBs!U^xPGf# zUM*8M#Kuv&n0I^imlGpvxXV6t%jNR5Vl#u)`^tR((aTSz}YjKG}?75er8r zhm#jbLS!vs*?sED`r1KQY^O=q!xb_nQz665{Kfh)H*h=V5i(4-Q@d11j3c%a8CSpX z3d5^L#I8n07_sdy*6rU8L*ug@G=6ym-#}Cs3&$W3#Pd8>jyVA>NEt6rjfxbhF3)nR6Wl0R%y>`8L3X`Yd*9Nunc^1!j znn?6aIU6au#3z0{r^?T=;!l8GWi$|nJAz`zN@?)j4)3XkaN5gart(c8zE^rNYyIU` zjwP@}fZv!7*fG3s-?t4D?FQaS_wL6`E~j%9*^m>n0^VSZNHk> z#`=@E!v3gTxr=?-Z^f0nFWi0tTefjF(MF?1dtewi?ME?fQo1P&j@YHn(=;}&UM$mYa7S0P5HyiC?8xH z6f!9TeaHFJgMyi|5*8Nm5IsXzNQv{a2e+ZW|787=D||1vS!-|MF*;9ZZ04#xcG6Co z-r~+i`ZC|zYozHe_V=?vxh(dKF(f|<%Fl}ccg$cg<6zZe*tEpSd3kbyPWmvO)tCru Lf)z9L%&`9h*%QBN literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/ERST.acpierst b/tests/data/acpi/q35/ERST.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f24fadd345c798ee5c17cdb66e0e1703bd1b2f26 100644 GIT binary patch literal 912 zcmaKpOAdlC6h#XZC=fn#CoF*_7>J28jW}>wF2KFG3zs9lTPTnl;U#=7r>E_sr(1u2 z21