From patchwork Thu Aug 5 22:30:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC4D8C432BE for ; Thu, 5 Aug 2021 22:35:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5508E61131 for ; Thu, 5 Aug 2021 22:35:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5508E61131 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:46420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBlxa-00057E-4P for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:35:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltc-00020Y-2j for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:24 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:11082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltZ-0006hS-Ol for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:23 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MUwld021793; Thu, 5 Aug 2021 22:31:17 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=ZHXJaNKj4fCaogHdBrI5ZQIy+iW/ldFMEXjCMwtrbJo=; b=1FeFJLhJZg4Z3S7TieAVGHYPkWb7BqpS3G3Zfe6xYseSHHXa9CciKvvqS/p6pZzRgnXg n5YlSAGiOGoUWQWVWHiCGek4oC2dsH+GiBIZtODO0fWaArky1P7tzDpajjhqTmx92rsN ZON6YOeaq+9SxCkHLKqTCucX7iPTjk10QDfk4Ryacw4E3St4S5wNkbSHkxYP+RUikggm wgKa10GhkKcwbQHfNrHLUTDpFYKjHSfZpn1QYULoj8l30zaoi1sT1Gp2bEHfU5lCUivf EBNryHYS/yX9lO3kwn7rDMsxkOYBrtnZUDZQNDHDKiQ/65ciHj5jT+ExRNVW1k0ss97q YA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=ZHXJaNKj4fCaogHdBrI5ZQIy+iW/ldFMEXjCMwtrbJo=; b=uxbkj5poSt7HGAZraO1IJ64JJJNPvo7Yi5wbQQjv/gB9owflzQFXyUnqVbDjAk61d7fc esG9PTRlGYrYnV+d6GmoxjP5oUtAszVTltGiXMc8V0Nr4Yqp9R4p9CqL4z/KeJG3Ih45 afBNTlmLzVlkhsRka8xwra4oj8vc/APNjCng9aD1iywYLNq3hEt3gzww7EnotjunmayR XFwUr1nnRq8Cg7GnpkDztW2Z4XDCW31l30see00xm4fhLNI3fV7hk4a95aZd0SSxc4qw IyVuXPsuRcd8v5+QPtEQbYeGQG2dL+tTfkCdNJaQsmHzjgY3jjcRM7SczJEkIM0wQzmn Lg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7hxpna3k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:17 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175M9mfl150466; Thu, 5 Aug 2021 22:31:16 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by userp3020.oracle.com with ESMTP id 3a5ga1217e-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GWA62pPP3DyjBW8Vuv6/g7uC9xjF5xllsiqXrnnuYXzxUcXIJoC11KdU6n0oTmGTff0CA+YXe2MrlJZSknbftPDSx6NjLwvn9Uh4TuG+s2CwCNIME2xwX2JTrcuPrjsso0alydvbdikC0v6oYDiWGWpa7m9Vgo1DDCMbr5jpkqUnj9D673CpvF51EJbMFtXUU+aL9TRA30FYsi5kv0dgwvepkL50NFTCYIitBBumIES3wwn8EpIpt5zHX0+B1itul/gXoZonGC/sWFgWtN1swv3a4uUMTCV+xy/fBUH4Yv7yAG+pGsLl2C73PkPjtogXW4ishKKJpa28oK+dLR6E6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZHXJaNKj4fCaogHdBrI5ZQIy+iW/ldFMEXjCMwtrbJo=; b=mniBTE57/jpQQqBA3dHaKVZZW1WXvihrzEz0XyHGpfC5Yl3t5S8eHFs1JGCkEPx+TrF1FAwvezUZyYLUqTPFZf0XhzAhWdLeyH8mFRJf8zhcar0aRTzLd1MKP5UxjkgRgi4jAKTyM9CEj1vTYOvqLzRgnWvVkPx2L1/+YkJPDjlAeDw1IkUJlB6FKemnOP0swTrVTXsk9L6MA1lTY4kDfXRVyu5DcdYH/BqA+cbdPq5s85TvUUCB/yfpFOqtYJHbPWPyNsNIG2KoAkuuoYcZpA/GgwQsifkfHH22S834fhnN/cLbGrPpCMlV1Vj6Aceo6G5cFN747PE16gr2CoSw4A== 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=ZHXJaNKj4fCaogHdBrI5ZQIy+iW/ldFMEXjCMwtrbJo=; b=Wg7TCOa3QbZHbc6K2aQiBW2i5StOM6s3858icqM3UKP2mSu5neusR/sqI3qmN28EPYbaTgW1ePeC1Zd502nGYpd6ZXZZT/yr0JUvdMeKxAcuXcW6FyU3+7YL5t1H/PCwbca5xXJLn40wflSjTMoNFR2wBJPjTNSygkaaOpIfqSk= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:15 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:15 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Thu, 5 Aug 2021 18:30:30 -0400 Message-Id: <1628202639-16361-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cb64716-8ca5-40bd-1cd1-08d95860bc39 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True 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: Q3v9Nqi072ByHHsi4MgvcJPzPG9vV9pqXLQs8PmFA104OBrgnHO7y2407WzRGhRG/ZlNueEQXKoxxarkvrBGAHBmFtbNRqgRcExCKoH8POnCrdyzoqhrBLpoMWCShkzz9D32c1iWPVHgt3PxH1wzn/wkj/gZRxh7BA/2FXD4W/gebu7TDM4d+FWj++p8bkwC3I4kqH2eHCB3U6CXRlVHWAg3Qxdl2V1lzNiNzKbn+p6pwCGsoxqLCdQeSE7XdF1Gew/i1lAWsDABqCnQbpWhDKyAp4Y/1o+avucMcgCMb3PJzznjS8oDTej3fiDLJ3KNbHXP0sdqHk2wShbR1GGF/hl5///3cWQ0OU+fih6K++2A7NtjbB5u1+UxFP5/e2HPRhiDp2M+QsiwlxCel0XSNFaL+qKoxl4jmLsqruO8VYgiWTLrIz66tMgZ1j3ngzDOn3kuQ2/wwSe0bZSVtFACv7Qor4irQsARFW6Bb+eHCCB/gUjbw4T6HOfuiSvkvPpXSVg95QXS/uv8R5HCGKnhQaggRTN8KvJptPSRhB45V+49UGKohYSW68Lhvk6LM1yHtI+v0afPiPPejEjSsr9Yzd6eRoUTLl35VMPARtXWVu6z3yLgt2VJ76iXejkN5gGXjV2fHM8LzClCyyzIiS++a8n8F6N5Nyw2C4QBSwsI1OEO6C+Gg6N2qWdrAtVyBolfbzqYYSlw1tpqnzsGy/pUXg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(4326008)(2906002)(26005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1Cf7GX+n/WWKZYrRmCYB/tXxLWPGnOiBHqNps37tPvVvOq086iIgHsEUFs+TpVcFzovXRpkHS0uMlDRoHdu9TBAERNYRA26uDuIZcA3b0nwEHDfLV0GMtaPwaavOxDzSeRW10j1S6Sfnat4ZI8+lz0hbgTdZOZZDUNgyb32ttxjvTW1HkXfktZXlqEWFy8vBBf0GvQC2sBKvAae8LFOFf8S9d2kjwYUEUsf1Uj0a2VN0eabqFoVIHmdAjpTOLKDzdKbbCtR6nYwJsveQQspzrJQagPYtRejpShmjBKaMJeBxpp9lxTTcGsl6mhUeH8grIivavyRh51N148C2fglRRvSTEkOY5Rmrl20mKKacRLjuXPRO86+gKYRankkgh038FG/S/0NU0BCu6dV5izm3SjQ0nHjAvfE5EVdVhVRGWFFi2qk1JZRQvINyq7sx2qEHeLpVMgOtex58iVbs6lMmE7tQpwmdazlz1j6zISOzbWXTF50Xs6IiLbjJaz2Ye7HRsm/XZ+VDqhMoDZlSUsnHilVq8CGuVdwGLXrVEgecpHTqL9HOc/jg6pRbAoWmvbiGeZBFPktUq3hE3wzyjGdpf8LjGKycPjjevFpYTyto58v3SgnxHas4xycMXugQXaA5UzUSnKTG43nbd4+RmJuvB5W3Hg3DHpBRULe2bynXGrx8kbiQu2JTgf2ZnJ5CGgN+ThRvN/wjWiO607cCSRUYtzj8G3rNFfxWhRHRKXO0+7gYNNe4fbMY7riVRnMWK+cfHJ7ju8DmcpSeEige4H6+7goSHun551TmHDbrOHqZgrDs5hbTxzCE0a8aMUhIrvurESdd6e57eqUYeNpSTjjG5oBaSGIl7HIgEPQ/lEMqtJB6raFKQpfUle3YbJh2sFiUzDo2B1Zs1I8HClfi9rlLvfDVw4YtRyAqG4AXDUqygrDaeyk4QJSBz8vNTta1oKTDdrAaNggS4GwsfCJUcJiG6XerjZqPOfayg63oHC/BPDMgx6kF7KKp7jQe8QthT2xZmag0phq00xGWNAycH7MaXIWoDz/H0tHRHGkw9ZeANqnF3kietJIbLcv96j2Wd46dh7RVfIo6/VNrR09/IMpBC5doPxVGOrmGlIBkQYpMoHxVIHtzcbSdahpmgMh62kpKkOabt345k0RCHRVniixG/YV8Qz+b2B2VMbtg2dGYDZlTefSMU4I2IpCeIQbetcJXL+h19fVvP1bNZciDbLqJQmobKkP/OP+g4ykYtBB1ecevYNOPbGbDYI8F6evvS3BFMhcniGi1z9c5ZQuaw6RvU4vpYdr6OjXAwE776tjFALYpVfQcDVhhL8mFLbxe33Wd X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cb64716-8ca5-40bd-1cd1-08d95860bc39 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:14.9322 (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: aPpyJGlj9LbRrCj1aeO153pA/5U8v0+8H8Vfe+ymDX5rv1Wsa3sR8O77i2CjdnjBtyXeNWLOxYdywOMFakOS8n0JkmDW+0RbyFp2vyqEOV8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050130 X-Proofpoint-GUID: jUeVEI7xjLVCziJbcZXSWlrKzYPdKaJO X-Proofpoint-ORIG-GUID: jUeVEI7xjLVCziJbcZXSWlrKzYPdKaJO Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov --- tests/data/acpi/microvm/ERST | 0 tests/data/acpi/pc/ERST | 0 tests/data/acpi/q35/ERST | 0 tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++ 4 files changed, 6 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST create mode 100644 tests/data/acpi/pc/ERST create mode 100644 tests/data/acpi/q35/ERST diff --git a/tests/data/acpi/microvm/ERST b/tests/data/acpi/microvm/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST b/tests/data/acpi/q35/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523..b3aaf76 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,7 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/ERST", +"tests/data/acpi/q35/ERST", +"tests/data/acpi/microvm/ERST", +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/microvm/DSDT", From patchwork Thu Aug 5 22:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7F4C4338F for ; Thu, 5 Aug 2021 22:39:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE48B61156 for ; Thu, 5 Aug 2021 22:39:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DE48B61156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:36054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm1f-0008W0-R2 for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltd-00023o-9q for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:25 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:57394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltZ-0006io-Ov for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:25 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MCQcA016841; Thu, 5 Aug 2021 22:31:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=xzGlLAHQxiPUqHp1mwUYIMAbxK8qmeJjkjkUCTCKpxc=; b=RmKngQ9f2fdaZRV/Otrsrxy7yKvnDMyLglyYDfyafpyFQghDQEeKFz6Qiy7RAoqN+YQj cqEO8ScM4Q4ag5h3Cm3aWMjwhnkJAznGDCJOOjlArs1oWkkTh3FNM1zf06ZUZLdTH3e6 0zO8X25tV/QL4klzBlfqEJDz/PcM2NhouSjD8ALRcfIB0ydmQXBmgflUz38hDa7+GdSO y3LSxqRTTiABXwOFjZbgL6qWcc5SYFcEsMJaxh289sfE0mcaom6BRQS3V3lQ5sX57MB3 UU/1JrCGmBwUjx40/Fn+IhqvPNna6b6QBE/qiQ7Dm6r13PNMQjK57G2QH3YX/NfU2LRh JA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=xzGlLAHQxiPUqHp1mwUYIMAbxK8qmeJjkjkUCTCKpxc=; b=ljr18kY/8IXTQ5Tgcb0qKh/T0WjTkCh1EXn44hKpFyYt93ch7hOZOAbor+/Nj9SkxPwg TW2EpsEl4fgX2C37DFJDHj3VEhgKJCTX3RmzqGs6d7kMK7w16bBG4bfUDoTGMSOZV8BZ wNiXF6laM4Q5AESvdvMF3WclLPuKNUTgxZkizVEZ0Mhz1R8gOAm1YRfw7m2I+FG17kHF oEVpRw8D0chDtd6FJsgrKLVeOsNHKZIPIBqvjiD2COaCxK17+RcolJYCL1qAvjgWKeO6 Yht1VQCJuOIo4hRGwKDCsACQaS4V5s4kdlBlvWvnLtI7nw5dEfYhMBV6NdkcY9CwVR3D Pw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3a843pamju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:19 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MUFIg166810; Thu, 5 Aug 2021 22:31:18 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by aserp3020.oracle.com with ESMTP id 3a7r4ah26u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hUjBjZShU2vYwcGYqMGNb7tOG3p15JW1OR5EWfuwu68WZoGS/WoHAwLEYUTgP5HxHFjgmqfHTtDtNCXpyWjV+0L5Xr6RZT2V0BqjkDH5KfrHnIriHSd3LgYfFo25IepaBHwEH4d6D7Yg+1Al04WJNBHdY0APn4c4nDZ+1N1XX3nUkbhwpyRe/ECga5L7aSdHhT82FmLFfhOtUZUyl5iIYmdTMYEchYqwegh2u/1ERWCgp4QW/+XjaeZPE3Bc61+CrAOkKneOYxfG1G+2V2ma2WF+wgHOmaCInif4r0X3dv8/BzQ2f+PXT6H5xRy3hwvvrKmHaHqd8cbApK2SXif2Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xzGlLAHQxiPUqHp1mwUYIMAbxK8qmeJjkjkUCTCKpxc=; b=cvfp7lH/UHC74fnGUM9LxywTSP74xFi3jfEmD92LZtVxDOKDrgW5upUcaLDi371Zjx41VXvbTaOJabtvIlPxa8O3M2SwWWtoGryCY3EXmYVksGbvkJgislrJb54qmVYNjXj8eMaqx8pVD5KquR3kgJqQE0O7t7By86PwSiBDUXfLT/fF0MIM3x+Vc4XfSkShHXnBDl+7QSsPMFA1jpwnDLM+De92AmTp5OJGacbm3Pvq2lVUA9z5Lu9NEomJ5WKpe2bS3DAE0BXXpEWT+E05PlN+Hvn0AtjKrluvj6seFAET2vBsmYOKSDiekf++/BavI1iexlDnqwRUNCPL0FPSag== 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=xzGlLAHQxiPUqHp1mwUYIMAbxK8qmeJjkjkUCTCKpxc=; b=hH6fZEplEvppJ6rgwmmGXowAFbDtv5qyxaKro170v5cSNLthWFBrLBYpwvvik0fARCAJep5pWhEtBXBi4lg9Vo2bLSY8rjGtG4E0wZIQnHdeD7JSDhcXfu5UuhXQ2BMezdXEfefSuUfyL5cPXe/I1jWZSnq87rqd6kyaI5h7x6E= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:16 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:16 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 02/10] ACPI ERST: specification for ERST support Date: Thu, 5 Aug 2021 18:30:31 -0400 Message-Id: <1628202639-16361-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4665eee-e643-4720-939c-08d95860bd2b X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True 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: s4GI5xnGrA8t69/yIpVWFPxhduX0Kc1ElueBuCoHTo0UZcjyf/sLqTPabkSjtTfHruLlTmHu+Hkg1UMNnEYFsev5YKn+ziEs+Rg4XAUtBtoITeUN2PfAuuWJPqK1eBHimp7uksdZU5KFmMq5BLhyySaXoW0dIFF2fPaArnsh/hoycq7EjzEJEo+27RZDmzTe536/aiuVJ8lxRPM2StiNoTpfJ2Z6OMk5MF/QxT7cS58cMEtDGFPtNgZhqXFGakyvS+gE2SmFsrriqgTWtgji2zfnh3fXsIgv57SFiIll2qyX4EqEFMKIoLyemCyMe2AGdmJApES/TC9Ag4V9UCtrQVhP6x9kUiJe6Ix6z1jrKUXaozuW6yaSew983Tp7UCuOuZthEFQwkLL+4IzA3XCml5BFdmOFfLMtlBclYo+CVPh2keEboR07Qa1X1nlhZQyvhVqLJ1vorwpDCOFsbvnJJ6qZmbDFiYCchLfU7laFuqC/Pp7zCGy+CS2UsgPmSZS1iTEe1jhaHvql0iU4x169EO9aWx4DgVcM9EH9hXnRJki2BcJ1BNZk57jEpKlGqiH7kwbv2ogWq0RxXD//vMudfBt1MCi42DCdgAk8pT6+/16BmgnHPsYRAiLdi6inweSKfwsNr2Pvwla5vS2CazmQJL7QpEAqPSlyC4dXTxmGNqtCeEStVNJHeT6L7+WE61YZhcmBoSttcU53VJu0X3+iuA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(83380400001)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(45080400002)(4326008)(2906002)(26005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d2W+1/fMWA60CeGtPRbx704j/Ou/nN6YRQLXm37tIE1b9LLL4WV81d7bRuMFCfbr/oEWYC+5r03gVPQFAiGTfo05kVaMIHEagKyDG7cf7At/qItbI93o6a0rId6+WgxpcSEDPP7ulDR7S3HTOvHdAsVHoNRduubIBZ8KB/DLYbXspMOKOtWGvN+EpfM+2Mw5khqlKbKUnW6Ux3YZBZYhSPrwMdc0iSCUEgcIRPoGBGrhyKM4kdPytjMa/RbeHPdbxZ63RS1C9tUVy4Iw8YdbOn9mkqiUy86hsJbAwMlVWBkRgqp4DPbE3TRkfq7aKfTWJtbXv0h/MeUOWRA7yhh2qfjGuKV9jvfKKVTkH2nZfqKZKmfkCMsBKnrRARyKQbzhHEjm37DRaJCBKIxUsY7zqlQgQzV1SiyGfwJLgFHl0jQ6FpkUddXeXLrqbVcEJr/1o6Q+c+wuVS4oRTwrFQYvlRF1mW2BbJQx92ZalFzZ2pkWXKnB2ZPEbCVSikxoNBtUswz68sLFR9HcTVCoO98ag4LEhaslk47454npcoNq+7RNma13v373MtVQvVOMn5rKxAAYErl9ftpYEC1SwA4gVuWVTiV1g+367n5Za9lLu/NGQxmbWh4cFSLMXQkV+0UQ5ypeIW5HCinjuL2SYQ3Y3ywAgrG1HhsjyCmt9+orqo2dLwEvABPUePW26oP67FqJOZPzj0/FbjKnzYtNNj69JdKG2vs1QjNFTBoxVpehqqdrmgzLwvWTsu9bUN0eCyVz01wG+jx2w7M9gVcTcHAZNHwwCj8o3z2RglbmDEtEGe8aZ82gtH4ugC0Y29TVthCCVo0bJk9007m6XSNDP7zLtXF8j1H1bXK83kJKX2Flv0VaQwqEk3KCsO8guS1F9AmM/Ysz02XHfZ46oVF7MTyi3vYAD7wwDTQyr82k7E5bUhzT48fUu8tTs+ndL0ZFGk3TAEvyOQxmQS3XLQHAr+4nSEz6hCrT/Sl8wjwHSzxjPwHB96Yo4js3OD84vWj3/ZGmHlnOc/HH1Qv+z5QVIRRqejhUsSW4TuQfK1H3z9xzU9O84e7xsGOoI0o97UTNfO7P+lYw4956KC8drEx3f+dJkmVC/rwhLXPjBwWmXXi0SvqPFVsG2m23rbvsSqRmIaVFusZuvtuXtEPnlpJu02e/TQeCzPq0YXk8v/vU+1a2acOb5G2cyfsFuWsLynUWOyp26LF0mPuK8vH3dwX/nccZfHotHDcdYlbZGMjcHHLYQWSWiflklsHjDQtiEFt2gEvKy/5lzdf+Mc+qklvraoaDfEcZ3ibz/ShzYF30ACb3HcNq5UkAxQ8ynlNw5bv8LNiC X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4665eee-e643-4720-939c-08d95860bd2b X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:16.5073 (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: uPtu2lDH+Nt5s0UpdXgTNrGDPqkEmW7Hbcupe3GIKHCmBByNDpVcsXwD84oob2t0uQaNGoocsa+nrVV5U84UR9+wYAof9rCLKfRwVzP3erU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxlogscore=638 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-ORIG-GUID: sx0h9_2BiNIbLpEw77bj9KQcS3YAjFVT X-Proofpoint-GUID: sx0h9_2BiNIbLpEw77bj9KQcS3YAjFVT Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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.txt | 147 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 docs/specs/acpi_erst.txt diff --git a/docs/specs/acpi_erst.txt b/docs/specs/acpi_erst.txt new file mode 100644 index 0000000..7f7544f --- /dev/null +++ b/docs/specs/acpi_erst.txt @@ -0,0 +1,147 @@ +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), 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. + + +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 is reserved for 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 reserved to be a part of the slot 0 header. For example, at 8KiB, +the slot 0 header can accomodate 1024 records. Thus a storage size +above 8MiB (8KiB * 1024) requires an additional slot. 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 + +--------------------------------------------+ + 0 | reserved: storage header | + +--------------------------------------------+ + 1 | empty/available | + +--------------------------------------------+ + 2 | CPER | + +--------------------------------------------+ + 3 | CPER | + +--------------------------------------------+ + ... | | + +--------------------------------------------+ + N | empty/available | + +--------------------------------------------+ + <------------------ 8KiB --------------------> + + + +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 Thu Aug 5 22:30:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FED6C432BE for ; Thu, 5 Aug 2021 22:37:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6260561156 for ; Thu, 5 Aug 2021 22:37:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6260561156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBlzn-00048p-E6 for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:37:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltc-0001zf-2q for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:24 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:57952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltZ-0006iq-P6 for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:23 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MUwuH009440; Thu, 5 Aug 2021 22:31:20 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=45OhlR7SlCVp/xRrtHyab9dZ+SPh6iBGrJB0D4Vd82s=; b=UeETe8ql2tuoOpQg6s9370BXcxzfdmxDPhDpPVoB4ElfXAvZh5/ZgWPFFmlvTQiQd8Wd q5gegfZH0mVQ8LreE6KccGcxhJ9ThyNb4Fy5oE2KqhQ+5awi+QX7FMiR7CNuDGiMrE/K 7Qy8nXx8KKF7VdQ1L9ve1X/Bx8zKd5Lv8tOr+hUrJhVjXSZKXHFmZhynUdXwCVGSrMar XYTFlvxs6QmDsHWbyYpZWPtJhGA4iftXN6hjOXFFOeQUyubwErNwA/t5n706xTD+mLOT LG6yBtqq96fOqKSPrr1uq3R06Xn7asLdyOFp2klUcb+w3cTZGoPdEUScI9a9b+VUdSws qA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=45OhlR7SlCVp/xRrtHyab9dZ+SPh6iBGrJB0D4Vd82s=; b=wj4qK2Gdcm/2sbRkydEfoUJCLfGf3ksCifh1RwNBlqkap3GR2EOj/Dt7jzRJpRqKt2Vf D69zyXdxPISg4DZxzxVndy5onLSEdqY8+RqaGdU8DEtyEXuI1QLHA/HodgDWhyQVy4LK U2pyU8ahktEAnYmjM2hQA+y8PicrnZBcvv86v3d4m5xWxtxWuqdiQwtWTuXtDZb7Gc7U AAepL225tB1q6i6vg3b8KMhAiUNIT3lNfOROZyw5gGPiBpRR5Rz/Jj153nrica7ozoAS H6KNRmZSlTYvDWoVsMToRHTNb5XQJGq7A5eT72o2cFj63bLQDifn37Vhk0Z9lGrv79S2 4Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7wqubj6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:20 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MUFIh166810; Thu, 5 Aug 2021 22:31:19 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by aserp3020.oracle.com with ESMTP id 3a7r4ah26u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RZZNDwN49J5SzNut1sCIMUakXyUyHQB3JE3mWopf50LGys25Su8lxpGS6K08r2Xo1tv9qlEYSVdKsB1odCIwqmQ1mivKYJAT8ZXzWIJSLLr/28lSrkd3i+xGY8Nv0oYas4MWo+8dfDrhAOwacn+8Ox7Y114ajRSl+eSfRRCFYEYi2d2hC6x3TdE8eytZbje2lgfSk3cCWdBnWqGQGG/JxjepcNzH+h0FK268BwxIWhfOnam/kzu1AdlNpR85AZkHVsZu6Q0L+bSD98g+0Wp8Nz82DlQ2UtrZ19Dhz3wQVLEehSH5tip6Uf+fTN9kqN7pSySjQ6ZUFbckJ6RuTeyVxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=45OhlR7SlCVp/xRrtHyab9dZ+SPh6iBGrJB0D4Vd82s=; b=dZos3H9fquC6u1zguVsHm7i+gkYEWxttUbOSXk3BNBfpI2xhJUi7GQkZ6mVqXHpjhpmYzM7TSByRN2otCjLVMVq4mwtJ30sbTbVvDle7r33fM/tVwGwcj5kErc90TNMRtSwgDu3fQJKnOE29D2Cx14odmQMdy1vjY4dMqgAVEyTiQl1t0slMzIdIA8EH1NSy9bEJk43cfBI/KLMf6S1jaE3gG0AZJDpIsONKyBUHY8mNXFfjB6mkiY0b//FtHpAcPxFXL14awNHXLAYmaX75JQbJ8nS5+rF1dV48f5bazS3b9oZ+nsHzZEweRfZD+Zya1kGrwnxD8EHd5r/22ToCBQ== 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=45OhlR7SlCVp/xRrtHyab9dZ+SPh6iBGrJB0D4Vd82s=; b=utMjincD5gqStKoIgPe0tiY+grOO2lGlMwpvGnpu5RpHIteDkGupluCAubPYPGU+KR4uOlt17NvM944YPI35+2eV7xckwB1kkWUWBGO+V3Zy/OuZoZD0jtvrqjoprXv+zJQc6U7YW+zhj7zTjWtRv+ZQQ22phMnL/C64EFwR46A= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:18 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:18 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 03/10] ACPI ERST: PCI device_id for ERST Date: Thu, 5 Aug 2021 18:30:32 -0400 Message-Id: <1628202639-16361-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b61fb3a-d8ce-4240-d049-08d95860be23 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True 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: MkFQ6BeI+zHahBo2bjQzcbJHLmbIBhve5+V/2oIu5OeLp0ttCwGyojOdu0Wx/obGqSE3P9tRmzSwbj3ZA/ABMlXjyfiQr71TPrUQiKGuYsISz6To+00pA2y0lo00IPZ4KfDU60JT+BoLvT/d1tB2s8NeMYA3D1zw7mGY0VfVNqxjXiC1bDcXsYgzh0e+o2R+TQnAuZkEgCpFyFaUrGQHWuBTx8zKUehLqfIb4cxHfnGnH/ptSGWTtoMQjb40QbyU0fQPQM+KqztFo5beqkKp1D12JQrkqVqX3Hl+NvUkhsTf2RYivixY4cdbWKIDREIYOVNinhjv2nLZcBEs/u3kQN+h0QY635nW09rRf7c5anacWiYWU33T6Pil+Af6VdFBC1Vl51aXTQRBJ6jV5sw2H8e79sSVnhEhk1QH/++MBnNF5OmGXTPqCwEQUA4TWtPZMBsO0kpKkeAE/ROpN4wzlTbLNsBXK4GQsxCoGQ+HglkQzrhrBkVCOVPPC4ZdsVw61Es5csb43jStLY+dIxw/5xZe2iLVxPSDDkBkSVW2NoT+BcP/YkiqLaqMZjXAiSknmODbO4UW/noV/w8i7n6xIlR1/FohmqPlaRjgumMLWjI+mPAcBDiRf+4+FYrqMP6y+utYbsU/zusUET2uPE3BdfnXQ5GiJbo1TLKBexvKb/k2EvfHxbGbCtiSZNPdsof0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(4326008)(2906002)(26005)(4744005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VNnucCkXmdXVvvKKqS0ofnCQT4MjjaibwbZ3t9qm/8VWlQaUuLdnutAD1PYW3qqGEjYvHxXA7HDSDhs/NJ68qU5wEg1p8uj645hKiwdh9vSKXz6YcPf/jskIYq9+DqGoB3cvTjg2l35371QnrO4qm12MjCR9/ZYiuKjz0YcUNmltSQPpM1dydekCFWAj7YHgC/6E30wfkthY9OlqkkKUJyyuTgy8nZ8eATt/zXYH8ARmtlvEq7OEUaIeNtSrUhxnTjYBgvNvnASyq2KEJx7ihbs/K/rvhKIyqHbvEykb8YWfIRWpfNKKJ+4lfPKMLwod5nAbGMKQJaOv+NBN4cD4JBBtAwY5GTQINOjASMSpJEjcnAPuuaV7mJfvnCS6zdHjFab03G8yuGx9RStcChL5UdHKuCOB5dqo2xb6VW1I0gnHcFOKjQ42mYnD6qJ8JmHO6uK+K5zgF3soxB8VFaeTkf2xSEXPO51cseWkpb85ZxdrTSBx9V0Nq/RzJsBk3lAjpVvlmx6bHcM0gYGiJqXOtg2uXk+0VluGBR4MMVdWvE6EqpD7dw0f8bRBZlgbUNw6sNi93bbfAYppG4wqKWz0jeEsoNIS3+HoSBFERP8Lg+4epkcQ66PIbRwpOnoCQPorwgS8fbxrDG57jMRRfWlt30SVUJSeYsgZma1GOUsl3AQUbaj9PzhTKKkezJMk5CdhnIkJ0tEcUMVdG2IPf3R42OI01pr3xIpjmbZWmBJ5x4x1Vq8ZBRtqLzgI2yTO8FM6KSaP3YuiAYMtWs2y1IVI8bVsd5IALgnkYlUvtVMOaspB9zDlL0Ozj0XEpkCDNpUg1AEFy/izstGcW8lkqDrJCYKzJmwq4qnldXhZlrXm5WJYyI3M64yhx8CdzHWhSZI60ygpDZvHy+h1Y9W7MwCEGk8uq5cyqS/uecHo45atRQLoOq54+Islrj6rjwHwZQSwqNCfVxfn2NLJ4cWQV4gT9bmPUzvhSUiaxFNkBS3HDkCN36d3TwMHYPSpzpKkGWms9v99ANCyVXbUiXFOIcl3RuxC9oJpNickSiGXgBV0k+Qb0vJSHy0LYsaHj71pDyEvc2u3iF48rAhegdVQ3W8UrV44ZsneEb4dm4/ncqp1FH63rVEfmJiVWiqU97KXz9NpfQOMufeHH8Yci+clF3Iu/yUN2kQx8Ws1qxPp5qxkbBesa3Nzqh+Kj80DNTXVtLVbJby7RzFLIXjrUZoN8by5Ac2j0rOy3h1QpFtnbusU0hOT3MyHSFQTNdTVeHY52Relp7Z0ZkT0rSnqfnuDTNC3s2m0zaZQfA+A2LRoO7n1dbrCfS7lt8Jx2+cmWDTneqg/ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b61fb3a-d8ce-4240-d049-08d95860be23 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:18.1660 (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: GTR3dnLsYVIwc/1nnOSmMZKbco/BnI+8xsB/80BwhYm1SCQPquItHQroFqK+NslD30E4h2KQeXo2tyc9CRY27LDtA+ZTAHCwVOsIjvECifM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-GUID: FwqyxDoc7Hj0TdIbDjQxKHEUzwv1XAMZ X-Proofpoint-ORIG-GUID: FwqyxDoc7Hj0TdIbDjQxKHEUzwv1XAMZ Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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 --- 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 d0f4266..58101d8 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 Thu Aug 5 22:30:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83FAFC4338F for ; Thu, 5 Aug 2021 22:37:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C78FE60EBB for ; Thu, 5 Aug 2021 22:37:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C78FE60EBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBlzl-00045e-Nm for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltx-00036b-8y for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:45 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:22288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltt-0006xH-Gr for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:44 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MCRis016853; Thu, 5 Aug 2021 22:31:40 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=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=dzrua3pExd2fNOEDxQPxfH8LaWxcJBFIhk1VbQ18mgV/NmuyZrS3UwjbeM+7A98xqyki /XHLfOTJz/ioaTaV2zmbtIMq9Er1d6G0YQsE8azcHxuRJrGgQzkPERdmfSuQt8Ld3+1z yjotWjIcrB9F44lPhaufED5lqzcZPvULULO+I7yLEj9A9Pe1emQtqa0BSA/HnlnbKboH famAbWmXGp3gCZUAn3V3wAYK0XGDlpO+pS0+Bu6Ym+JVooqzW63jZHX0b9HHczmatYor yYKFe4ukGGJ7hHDTT3DCfI+CxtKTBJs2WjCRk2mRwd1AZlh/K5Vw6TwuOGzAFmwEDdGQ kw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=mBHz+caln3DGIa+UwEDp/DHFKYa9v+ATT3UxmuBD5jdEk8qob+xJRYLmMXGWzc1FcCe6 C2apr25A5z0AQPp9wGbW0ovd4zfv2rvix77N4gURWkAVB2HHTW9f3YDTg/wI2JiV4vm9 WrUKMfUwjvMpzZabFy2VTPtiQ93eyNeD3XZb+M8uRPrcuPl68vp1FHz7oRqHYj336n/E bVaIw9q0ga/uGFxgm8I9vrwEMMFIrA7kac7yCRzJp2cYIltIHyLSMZ5tTRHfpQw3eR4s a7L+rCKFQ02PqrX4yTBEZiyyDJYMpZ8gQNbdFq09bEVVdM0RIq4W0S4ejQXWMLNoRDoC bg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a843pamk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:40 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVZs4008821; Thu, 5 Aug 2021 22:31:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by userp3020.oracle.com with ESMTP id 3a5ga121at-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MiKVMnucCJyzGcrb7jWoP8hDsL1ENqjJ7NRvafhVLDpjqjSvQe7NW07btDW8fCUn63w73OjJbUZEzr4JjhHmJAdmHOFHqGqZ1OqTpedJlt6j204aUBq6RJL7lg1FKoL/cTlufuLCDH7l833LGxznNn1AyH58QmowEvuKiSpj6/GLiQwqU4cOu4VnlIHZCs+gdh+75NObW15NRbF2y1c0W5xXn7IUUwJct4yOkidW4BczNMcPzvHt8I3viIdvpF8Bpi1LsUjktwWwVSd0qjJ82J0lAXTpiZPE8l4K1oaL276zsdFkWwVMsknCsnmhVdOwH/WxkllS3ksP6Ka1v5BnwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=G17Q/7qKrWDGZ1/DLCHyYjCrLM+F1SDhUCo8C5e/7nRT85qhvve5iDnzDeKuNOrOLv86ItWi57GPuW8Yiyjm999n4uVbNxBk9ZSBttx36Z8gYW4bmDzz/BtHAhZXsXF9906fkFDmAES/kYtOxXiZ/9XdDv0WMPkgQk5ZIbJ1tZGE/qy8/xkbGtjKtTbtWeihslSvA2pOmlkttg5k7p5icekYcYANz+d6+alZLqZzLxqWSPLvkztc7Hp+QfplRv2Lpa6Y294G9wxZrUioV9BbtApLYsb05yp5Z6So40JOV189iiN6W15HwVfZoT+9oThUooN3Uxpa1w3V8OFOMk351Q== 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=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=g0QRbER8HK2Yjx1QztWwN8BH+yxvB6HT7dJQFfOLSh6UIja7qvUvLS08/J8DlQfBCLMC4cNMsdOYiGIfnt9vTSNqX6f4RJjEFnHfNTEhVyFndvkYgqEYffcDNKnwaqHTkGTswwJf5LFH7yWOK5Oe9119E4G8g+/6l0uEh93ztjw= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:19 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:19 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 04/10] ACPI ERST: header file for ERST Date: Thu, 5 Aug 2021 18:30:33 -0400 Message-Id: <1628202639-16361-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5df743b-727b-477e-aef2-08d95860bf1a X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True 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: B7/HuB9mhandQuQ80PNHrN4CPT5/+B3y61k0X4uqip/YMBwK2Bl7njM3JeKGLGsiRFIfoMV1iL7SZDWdtqgBIrRgNLwxK1umM244KUnq9FtwQ4oSbTxwQ8XlcFo9umJXTbIy61Vykb2XvaseCD+En4eQ6KzkfsJSNH592b4RJ3V0c2ju2y/BtuXf6LaqBVLayKo3BfFxU8zmtQU/COPx9Yht6KQH+ZepIv6OdLlbeMs3+JnkvHmAF8Q+kRDwWhMw4cdbAQ7b6RWS+4q96otLjrwb3DdLXtU2RbwI8VLL8f8wLyAyedNylaeIV/BxtCNMrbHp6TKBc/7ZmwfJeZcqTtL24G1/MwVIF2/mDCqrNvpJs3cKEWS4zwAzdrNP5nYArER8ivtD1OxfQGfICytoorfhjxBnj4LlXk/vr9LzOp9+kCeuo2beq1IRNZzbAqLgmafP3fOixwrM7yw40UfgmPJRsQfT0qNcF31sFnSBSlQ0Cfi1PLbbOL+NWZ6FmA3r62idrplVAeiOLyzBlNGN7zmjx6iAyXiaCMrlcX2B72NzW7WBjFIj5EfZK92xmgCqxkxn/kQeonDBQgQbiAUStzomx2VDVKC6L7rTuM63xycbJLVDHPfxHyfCKqtHdDhtgERN0HZrRcYbuLzfwd86YL5pR13vyNWCzyD42zrmTiVvTWoot9RWwAmE9UArge4Bm2QX222phiOetp3asGuvvQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(4326008)(2906002)(26005)(4744005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bv4BrWqIQ24gYmADhTUeYwrvf3Z7DpHA94T0ijgGwzF59QpcgxUH48UpSk3lZINYlsy9/VCh9Ws+tTMyPrKNCI/FKI2ko96LcbeZW7B7oc5G/AoSX27rikI3rQE6BfZPUsx0RkacVkOpv6YtB5jogpXkbJdvMyb0rPu8TO8DW3tZxfsN8wALEUUeh/n6jXdc7khtvh2KQZpqC2waP8rP6I7i2JNFfEFm8lMhI/YR5k8/W5OSjPzPgKIHhy21cBCca1dSwTpKaxp3jvtewLbCJmCIyiCumYJ9ncsvOq5byVtWpxpnIdUsLZ7e8VLUSkfMuquIUZqf+JeMGpJKyqvs8z8ZdD4Rs0ezhav2aincrrxd69bTHlwJA4vOf1jQ/N9C252FlGjkvMMxjoHFlkyN6jP7zwboKlO1EOv2TqmL95+kSxtdK3OpmfxDFY5ZqLuZAM4OsPlHIzot+t20tRH18oFcE+VnoHl0AqRkK/guGa82N1Dm+q/ArF9FYN5p3ilo5pLR+sEmtEM/8q4QYBuXITvO5oFTDlChWAb87k/mMgLpy89Oh/0CehdTud/te3WO5k/JNUP2grODYNWhUt8391HsGzXzhdXrcpJ9J53qNuokzgAEGtRnlqPS1Ma0vZrgz+EcreLWU4KaUYOXiXaH0vCY0YzIOlQm8O+TnQj/xtSPkwkPRabNVZagvAySX4ysYWYfa9b4mYxwivjXIVv9a8Axl+NHmxtKw5FGv7kCQ0WNb/Gzfymy7I+yx0ZUafGDrJzm2Ulnii/guc9H3KJoh+5qAgiTSh0LY8fIORZTE0pJU44d/MhiI17hmmsXkXSICzsOqs3EJ/p8PWKArHPyv2kj52iApatF3qxWOOAd5mpWfs3LwshBG1v05Uy4PLxDR+smUi3660AK3P5+Eg3RwrYaeyYkhT0cT50zrNHMHBv2OYUJ30dALfLwfPgxcklajOZ8jqiLqwsDt+/VMomnWvY2wEJ/t7tq+1keg/JgDbe9chHzZKqnhAV2QFs9nZ6o1cBIOnnKec4KfZCGFn3u3QApv+OowX1dLRMpLenaazkXbmcSiVLBDcJz0mD4K4hqvE5zu6lEI+BprV1fyDNajDW3+olG5erh2iECb7YeT2F5qHyHfAaO87vzMIovdSnqUV+Eh+GAgSg2BvZ7CsPXoIPKW5voOkZlpILFa9Q+XVWo7UIxuhEo8XLbT7CSS5cRqof2FclRZN/lVXcVPysjgToXDrOWk0FR7H9XKVoKdPUIM5ix5SDOGohrn2D1jSjld87J4qR+0IZAzSCCr5+l5M3G5RUqQo6ZJMUeFHp5SyWcO+Vz3Nw6+z7Qt/JqlsuW X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5df743b-727b-477e-aef2-08d95860bf1a X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:19.7530 (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: HHRKjUcs4y92+Q+W2aMds88IlxiCDRDOmxF0irv3N/z4kSlVEUDYWm93Uv4wuUB87LnPDro16/u2iN2I04p4Tg4jcz97MZC5bA5m4SC7nM8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-ORIG-GUID: C4qMiAvqMsAu6ueNzmjobhVkMXrMw81k X-Proofpoint-GUID: C4qMiAvqMsAu6ueNzmjobhVkMXrMw81k Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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 --- 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 Thu Aug 5 22:30:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0197C4338F for ; Thu, 5 Aug 2021 22:43:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E3A2D61156 for ; Thu, 5 Aug 2021 22:43:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E3A2D61156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:46920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm5F-0007YB-QJ for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:43:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltz-0003GH-RY for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:47 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:26192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltw-00071Y-9C for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:47 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MUxjk009450; Thu, 5 Aug 2021 22:31:43 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=QC1vgJfCjccxJfjMhrNkbpZqQprPRI0WcKg7O/MMIjQ=; b=ZvnDT5ZEdyLPMM3BB20Y1br0mccXgZcOU7qqTIdgvP2mw4OmzGf7ankrtzR8l+72ewko +P5M9KTcyqVgpYQZBtc+bMBYrLRILSvySsRETpcec/4kcV2esSrF/kxwRW6bxeOcDY80 gisUAHQVMyY2ZyHnZ3ge9GrIFPEjJwd4LcAqbigjHNNtU+cbkyifxxjJH6VfQ6PUYCRv GgQyIdQaiAX6hdH14Su617v9tKE84jDr7aTcq8RQxRTjAIbAJ3F8z5iTsOLoC7kchAnq xkCfN/bIyojetC74aJl0qEcjyFPnBcXz8Pf3YwxMP7f16qUudIovlfo8CPJY7a1dlm7h fQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=QC1vgJfCjccxJfjMhrNkbpZqQprPRI0WcKg7O/MMIjQ=; b=qZarDfQqefrIYU+Hf7VI3IqeEgJf/VL4cn6nb7eUxk6ZiiBgHhlLGxGZrB7lgRgPqvQ4 LcUmnPNBYOXgXlArurywGOlmLp+z+bNkJX/78n7qwT/opHxPCpDYlFJ76K5TtO1qOMDr PSCl9bBocxZN2ZNf0b0CFU8O6mN+MmaOoUGqE5yLL1OPhFTKdcL6W5VymEDQib4BJiLT 0XbXrMXtmvKYTdOWenHb/DvwYlF1/R4VosH46A3bE0U0z2CrB8YhTknBYaS3mCnBcFPV fAAhPlvv3TOojtjvwZftTg7kDsDp3IRPhW0TJipj5XCV6YCl8ylyALerB2szJIUttG60 3A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7wqubj6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:42 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVYmx008792; Thu, 5 Aug 2021 22:31:41 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by userp3020.oracle.com with ESMTP id 3a5ga121ma-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gdnd4JBpPJrQOqEzQTO+1hqSps+xo8PO0Z8c73a+KppNgo0i/dG/ZeKMJPSwiHoM9dR3EjIRx4icag5VvjoQGjfYiLYhmtPpebSvXkD6pikF/LONdH4VW1hcalbe8boomAlS9mHynFE5ZbvSW35nB/7VbG4hpv8adqJg5Vlb9ajiMpz00GaqkQB9kCeHyPDITZT4qeea0xFms1WSM6jYxi6Dy7Zwi4vQ7m5BBFyB0yU8SmFgZ4Oeg8U1DNPaYdj6Wu0fczqgvQlEPP1okt6TIYtl5MCi1GNcjjlFBvKKi4cndzgu4/XiemDc+Ycv85nSgMucZiTdOF71JPsCZp/Ieg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QC1vgJfCjccxJfjMhrNkbpZqQprPRI0WcKg7O/MMIjQ=; b=nUAD6xroiANRURjjoELPFVpsSRbydQy3HB+SbEQb062rZZo86PnpGGk17R7981PbsyPX90XjXPEFr+NCCI2KMt8h2a+/mVdxslwD9OenkAAqp/wIhPFL1zW2mUq8BYb0RTrU3/93gH87LJ8vRAGSIGmJA8xxRaIV/cUuxGTafI2fF6mnpAhsSm8sG5hrRezvaj8wtXkMm6UTHqfLbxLo82vSi2EreVYmo2rHrbKDDiKTvW341ZtnMLi2PMSzJYlzQqQXQs1p3ANfGx3/pIGdtpfUX++4AymLAUIiNxqSTqdJPypkxiSMuC1zCfKAgfnlZEWWb4Y8kzxHDnuvhFqgvA== 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=QC1vgJfCjccxJfjMhrNkbpZqQprPRI0WcKg7O/MMIjQ=; b=Vy9lKtRsCQu3CMR8nt4hKwra4dtivrqj1LjTcQeSvu8QPxBzH7A4S455nCrVl3bplI5Q5bDJ2eIMOMbuFcRVzjIFxnbo/IiUY1DOWEO1ycua7ODGpcYxfwUbCg81HUdfRPDRR5Rp8xV/Zar/FWElW2mrSZdGSUuyx09B9g7Dx70= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:21 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:21 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 05/10] ACPI ERST: support for ACPI ERST feature Date: Thu, 5 Aug 2021 18:30:34 -0400 Message-Id: <1628202639-16361-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f441afd-fdf5-4f0c-d86a-08d95860c018 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /QxiYEecEA59u9DPQpZ4bc9/TcquO+S/kTAuos57TWKmUzvXk9t7uguRdxTorJRQxkYigm4RICirGsyW8O4J/qANrd5X4eR3scGdwr8xBVbN1gty0G+RPQnATzAwmsbuuihPLtZQEHJ3JrdJtvnZob79N9RTQsHSJh6Dze43DNbHnsOW5uk7RQEgSruKSpj9/lUtr1OobZLI/SyUdpxYBaqHVaDhhoWp8xYG08/MsZe/AfTDdxduFr/Q7S3g9d67vnm5DLFPPV7Lp+Zsb9PUdSnJ4m1PNB1yMEOFi3pZ+iG8UQWwSbJjqKJMYoGfT9Pc+9CvZt9t3srT9HMj1bzgXR3FEmq2kzdZQsCpdLadNTt3LnZdruRZzsa2W+UmpFjSwynlgm0MOF7k0Ar1lpOq92p8SSTWxX49SveglrkQV7GMFo/mVGJeWculeMrqIrMxc9f84CLGOI8Ku6UFhfo5/Mm0ViyjW6ojvHf0sLAOpOVzkgZKxReaS2ikMYtURVzkz7mpdOVhvp+3iOs2vUb7ORIr1hsamNschqzDPPXpe8dgc5KueZm8KYNTEgRr8vzpdmLJJWXhGFYySH7ZVtYn5tPNSSicjhK8EJmRL4ySrQf6CFzLafgBvw3AyzOM+rxSZurDSil93fyfXP0QJjLM20wQFcBQAMgjuujYHICoMgtvdF6dNhjFAx7hNfcE0N6j X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(83380400001)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(4326008)(2906002)(26005)(30864003)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5uGGDV1qU1DzG2xDJiMZyoIyhYvL3rtAKNvqNH6zWAwuwDCkcD5n87xPP/spEcM+uUy85pCidt5PumjoMQJadGXAtdbC+GaxUJ8tNmtHtl/00i1Y9lcwrYfU5J+7W+vxizQKCT/0uCCHon+NdsFpQyhQ/GEJ7dsJmDKB0SKKbZkpu9P/3e/eJfFJ1oO9U9CMlfRkPt3lMfh9zJgksjuufZ5GfQlRT4R07t8e2tfMnwlA4jymNIu4t2FHSrm976Pa/UwcOqAvu4TiIsehrW8jIu1WYYoc43N48e+PmQs4rhwCh6zo9lm+o0GtDmtnMvnmgXjnj3LHllR0m7lLx1765IkX1eVIv40nUzMIMEqpFmPTYMEDdo7oaObeFI1qCx80PLHsShabr8KTMRiix3dm00U/FN5/NVmr8BEbqaRXprIhm0R/0sqNm5p/IFDRpdzL114pPD8lUvZ2SgfMGK7UzZcnZuWlfyB41+pooC76afC56Qmnnjlc9P7TL1WzG9+Qvnv5SPwoDqwjocQ/MaFGHo/o9mrupGilmXRtipPHJGg2suYtm81qDtPD1VCwxYRDsRQi86VpCMUJBkvdCB+bZ0lmn1wk/H2mOZ39ZBlP0gs6prL4JgZCfEGIgNE2s+ztOXuEPkxQcwS6U/rf3Jp9BsiWWRYsHhMllITar7QHhwSM10IQ6Ahvlg4sM+DN9ToXp9ei8WnAwplHesEfQfgBdpbJM76Z4LvuPUV0rMpU+H5LEQe7Edd0o5dS+q1k0qu7IigooFMilkEvZaTAD4tzZXOrUGZOouN1i+PFZTLRy70XHake4lY+JAHgE9ma49DZsxxknmiYfQieJUL8TkNk+5lB/bLuaLd3hMT52wrNUsuha69xPqCmbtv9yORn1rAi4t2ijVnsim/EbZ2wKt0w++uvROldmvbCfhQ+iv/i86x42tNCFgpFdVpR4rWrNP6NhNNPxOl04d8mo6LL6Thf6OMJyHSqtjTufg1iziEI6jObW0NatYEcrmEdl2mEKnJ1D/1kGf7ff2npK+hs77gwmwKKQugTzlUcTdi+ID8utSqWWcj+8cLfGwshcEG+MBCn0kX6ZiYZBhZxy8Q6QpoiZEmoKk1pOh51kf8JXsf+xefqhwHG03f6K3bgpKRUyXZx8Rajzym/sF6lviazJ/+IPt9U82oIYVaMQGJL7oEP+yHr7S1zu/kmW521OhDlM84JUF8769C9y0DkCO2YJf7EMBkxC2ljtT0gDc3mhWZ31RDPwaXoFAERSbm13n5U+a6I59wQSA8zFEjT1E+FSbZvJu1ZoXgceV3eSPnSyNZ+ddFDPWVycuOdzHqW82AsA+FT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f441afd-fdf5-4f0c-d86a-08d95860c018 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:21.3490 (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: bu0tjnL8cc7xXY7bfIGp1XLhoQSsgPjwSSD29RosQ7I/uak8w1BAN9/kgw7WJWw3jztDG71CcctoRPZmpUFCcw9qYdz1DeRFjgvaCfMBmMs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-GUID: zNUMujPLSBLxB4Mb8QO1jOvmbNG3qC0K X-Proofpoint-ORIG-GUID: zNUMujPLSBLxB4Mb8QO1jOvmbNG3qC0K Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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 --- hw/acpi/erst.c | 750 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 ++ 3 files changed, 766 insertions(+) create mode 100644 hw/acpi/erst.c diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c new file mode 100644 index 0000000..eb4ab34 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,750 @@ +/* + * 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 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')) +#define THE_UEFI_CPER_RECORD_ID(ptr) \ + (*(uint64_t *)(&(ptr)[UEFI_CPER_RECORD_ID_OFFSET])) + +/* + * 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" + +/* + * 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_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_IS_VALID_RECORD_ID(rid) \ + ((rid != ERST_UNSPECIFIED_RECORD_ID) && \ + (rid != ERST_EMPTY_END_RECORD_ID)) + +typedef struct erst_storage_header_s { +#define ERST_STORE_MAGIC 0x524F545354535245UL + uint64_t magic; + uint32_t record_size; + uint32_t record_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 */ +} erst_storage_header_t; + +/* + * 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; + + /* Programming registers */ + MemoryRegion iomem; + + /* Exchange buffer */ + Object *exchange_obj; + HostMemoryBackend *exchange; + MemoryRegion *exchange_mr; + uint32_t storage_size; + + /* 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; + erst_storage_header_t *header; + unsigned next_record_index; + unsigned first_record_index; + unsigned last_record_index; + +} ERSTDeviceState; + +/*******************************************************************/ +/*******************************************************************/ + +static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) +{ + uint8_t *rc = NULL; + off_t offset = (index * ERST_RECORD_SIZE); + if ((offset + ERST_RECORD_SIZE) <= s->storage_size) { + if (s->hostmem_mr) { + uint8_t *p = (uint8_t *)memory_region_get_ram_ptr(s->hostmem_mr); + rc = p + offset; + } + } + return rc; +} + +static void make_erst_storage_header(ERSTDeviceState *s) +{ + erst_storage_header_t *header = s->header; + unsigned mapsz, headersz; + + header->magic = ERST_STORE_MAGIC; + header->record_size = ERST_RECORD_SIZE; + header->version = 0x0101; + header->reserved = 0x0000; + + /* Compute mapsize */ + mapsz = s->storage_size / ERST_RECORD_SIZE; + mapsz *= sizeof(uint64_t); + /* Compute header+map size */ + headersz = sizeof(erst_storage_header_t) + mapsz; + /* Round up to nearest integer multiple of ERST_RECORD_SIZE */ + headersz += (ERST_RECORD_SIZE - 1); + headersz /= ERST_RECORD_SIZE; + headersz *= ERST_RECORD_SIZE; + header->record_offset = 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) +{ + erst_storage_header_t *header; + + header = (erst_storage_header_t *)get_nvram_ptr_by_index(s, 0); + s->header = header; + + /* Check if header is uninitialized */ + if (header->magic == 0UL) { /* HostMemoryBackend inits to 0 */ + make_erst_storage_header(s); + } + + if (!( + (header->magic == ERST_STORE_MAGIC) && + (header->record_size == ERST_RECORD_SIZE) && + ((header->record_offset % ERST_RECORD_SIZE) == 0) && + (header->version == 0x0101) && + (header->reserved == 0x0000) + )) { + error_setg(errp, "ERST backend storage header is invalid"); + } + + /* Compute offset of first and last record storage slot */ + s->first_record_index = header->record_offset / ERST_RECORD_SIZE; + s->last_record_index = (s->storage_size / ERST_RECORD_SIZE); +} + +static void set_erst_map_by_index(ERSTDeviceState *s, unsigned index, + uint64_t record_id) +{ + if (index < s->last_record_index) { + s->header->map[index] = record_id; + } +} + +static unsigned lookup_erst_record(ERSTDeviceState *s, + uint64_t record_identifier) +{ + unsigned rc = 0; /* 0 not a valid index */ + unsigned index = s->first_record_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 + */ + unsigned count = 0; + for (; index < s->last_record_index && + count < s->header->record_count; ++index) { + uint64_t map_record_identifier = s->header->map[index]; + if (map_record_identifier != ERST_UNSPECIFIED_RECORD_ID) { + ++count; + } + if (map_record_identifier == record_identifier) { + rc = index; + break; + } + } + } else { + /* Find first available unoccupied slot */ + for (; index < s->last_record_index; ++index) { + if (s->header->map[index] == ERST_UNSPECIFIED_RECORD_ID) { + rc = index; + break; + } + } + } + + return rc; +} + +/* 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 */ + set_erst_map_by_index(s, index, ERST_UNSPECIFIED_RECORD_ID); + s->header->record_count -= 1; + 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 index; + + /* Check record boundary wihin exchange buffer */ + if (s->record_offset >= (ERST_RECORD_SIZE - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + /* 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) { + uint8_t *ptr; + uint8_t *record = ((uint8_t *) + memory_region_get_ram_ptr(s->exchange_mr) + + s->record_offset); + ptr = get_nvram_ptr_by_index(s, index); + memcpy(record, ptr, ERST_RECORD_SIZE - s->record_offset); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.1 Operations - Writing */ +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_FAILED; + unsigned index; + uint64_t record_identifier; + uint8_t *record; + uint8_t *ptr = NULL; + bool record_found = false; + + /* Check record boundary wihin exchange buffer */ + if (s->record_offset >= (ERST_RECORD_SIZE - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + /* Extract record identifier */ + record = ((uint8_t *)memory_region_get_ram_ptr(s->exchange_mr) + + s->record_offset); + record_identifier = THE_UEFI_CPER_RECORD_ID(record); + + /* 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 */ + ptr = get_nvram_ptr_by_index(s, index); + record_found = true; + } else { + /* Record not found, not an overwrite, allocate for write */ + index = lookup_erst_record(s, ERST_UNSPECIFIED_RECORD_ID); + if (index) { + ptr = get_nvram_ptr_by_index(s, index); + } else { + rc = STATUS_NOT_ENOUGH_SPACE; + } + } + if (ptr) { + memcpy(ptr, record, ERST_RECORD_SIZE - s->record_offset); + if (0 != s->record_offset) { + memset(&ptr[ERST_RECORD_SIZE - s->record_offset], + 0xFF, s->record_offset); + } + if (!record_found) { + s->header->record_count += 1; /* writing new record */ + } + set_erst_map_by_index(s, index, record_identifier); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.2 Operations - Reading "During boot..." */ +static unsigned next_erst_record(ERSTDeviceState *s, + uint64_t *record_identifier) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned index = s->next_record_index; + + *record_identifier = ERST_EMPTY_END_RECORD_ID; + + if (s->header->record_count) { + for (; index < s->last_record_index; ++index) { + uint64_t map_record_identifier; + map_record_identifier = s->header->map[index]; + if (map_record_identifier != ERST_UNSPECIFIED_RECORD_ID) { + /* where to start next time */ + s->next_record_index = index + 1; + *record_identifier = map_record_identifier; + rc = STATUS_SUCCESS; + break; + } + } + } + if (rc != STATUS_SUCCESS) { + if (s->next_record_index == s->first_record_index) { + /* + * next_record_identifier is unchanged, no records found + * and *record_identifier contains EMPTY_END id + */ + rc = STATUS_RECORD_STORE_EMPTY; + } + /* at end/scan complete, reset */ + s->next_record_index = s->first_record_index; + } + + 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 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: +/* case ERST_ACTION_OFFSET+4: as coded, not really a 64b register */ + switch (val) { + case ACTION_BEGIN_WRITE_OPERATION: + case ACTION_BEGIN_READ_OPERATION: + case ACTION_BEGIN_CLEAR_OPERATION: + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACTION_END_OPERATION: + s->operation = val; + break; + case ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + case ACTION_END_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + default: + s->command_status = STATUS_FAILED; + break; + } + s->record_identifier = ERST_UNSPECIFIED_RECORD_ID; + 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 = next_erst_record(s, &s->reg_value); + break; + case ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACTION_GET_RECORD_COUNT: + s->reg_value = 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 = ERST_RECORD_SIZE; + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0x0; /* intentional, not NVRAM mode */ + break; + case ACTION_GET_EXECUTE_OPERATION_TIMINGS: + s->reg_value = + (100ULL << 32) | /* 100us max time */ + (10ULL << 0) ; /* 10us min time */ + break; + default: + /* Unknown action/command, NOP */ + break; + } + break; + default: + /* This should not happen, but if it does, NOP */ + break; + } +} + +static uint64_t erst_reg_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + switch (addr) { + case ERST_ACTION_OFFSET + 0: + case ERST_ACTION_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + break; + } + trace_acpi_erst_reg_read(addr, val, size); + return val; +} + +static const MemoryRegionOps erst_reg_ops = { + .read = erst_reg_read, + .write = erst_reg_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + ERSTDeviceState *s = opaque; + + /* Recompute pointer to header */ + s->header = (erst_storage_header_t *)get_nvram_ptr_by_index(s, 0); + trace_acpi_erst_post_load(s->header); + + 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_UINT32(storage_size, ERSTDeviceState), + 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_UINT32(first_record_index, ERSTDeviceState), + VMSTATE_UINT32(last_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); + + /* Check storage_size against ERST_RECORD_SIZE */ + if (((s->storage_size % ERST_RECORD_SIZE) != 0) || + (ERST_RECORD_SIZE > s->storage_size)) { + error_setg(errp, "ACPI ERST requires size be multiple of " + "record size (%luKiB)", ERST_RECORD_SIZE); + } + + /* Initialize backend storage and record_count */ + check_erst_backend_storage(s, errp); + + /* BAR 0: Programming registers */ + memory_region_init_io(&s->iomem, 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); + + /* BAR 1: Exchange buffer memory */ + /* Create a hostmem object to use as the exchange buffer */ + s->exchange_obj = object_new(TYPE_MEMORY_BACKEND_RAM); + object_property_set_int(s->exchange_obj, "size", ERST_RECORD_SIZE, errp); + user_creatable_complete(USER_CREATABLE(s->exchange_obj), errp); + s->exchange = MEMORY_BACKEND(s->exchange_obj); + host_memory_backend_set_mapped(s->exchange, true); + s->exchange_mr = host_memory_backend_get_memory(s->exchange); + memory_region_init_resizeable_ram(s->exchange_mr, OBJECT(pci_dev), + TYPE_ACPI_ERST, ERST_RECORD_SIZE, ERST_RECORD_SIZE, NULL, errp); + pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, s->exchange_mr); + /* Include the exchange buffer in the migration stream */ + vmstate_register_ram_global(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(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(s->header->record_count); +} + +static Property erst_properties[] = { + DEFINE_PROP_LINK(ACPI_ERST_MEMDEV_PROP, ERSTDeviceState, hostmem, + TYPE_MEMORY_BACKEND, HostMemoryBackend *), + DEFINE_PROP_END_OF_LIST(), +}; + +static void erst_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + 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; + 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 29f804d..401d0e5 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -5,6 +5,7 @@ acpi_ss.add(files( 'bios-linker-loader.c', 'core.c', 'utils.c', + 'erst.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c')) diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 974d770..3579768 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) "header: 0x%p" +acpi_erst_class_init_in(void) +acpi_erst_class_init_out(void) From patchwork Thu Aug 5 22:30:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3396DC4338F for ; Thu, 5 Aug 2021 22:41:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 739D161158 for ; Thu, 5 Aug 2021 22:41:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 739D161158 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm3k-0004Ui-Cp for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltv-0002z8-B1 for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:43 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:20882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBlts-0006we-LY for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:43 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MUwuL009440; Thu, 5 Aug 2021 22:31:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=VLrcvTGSeYnuaBBLKjqRwVgUXuJNQ2C6zzV4UzhyKyU=; b=WvStCqUmp7E3pcoajz8YxgaSX5ODng2jZj+QnJr5maWktq058Y3cNcp49dL847+O/Ave nopG++GPPWl0rsps3mkWMR2Wg+bJA3S7NfN/8DBd9U2mxFySCs/Ck0pD+aJ3iTQWp2QY ZfCteMkTbztrT06HlcdfTcK7qmuq5vetGjk/51RIUs5Gh983fUEoKEPJRVtlcnSpSPyi vOXdpe9OrQh3l2oWra/Zg/4B+wZ5TkgCw17rN+q7zanjqwFAx5Yjt6UFVbJN+uELa2vb 63KFknYsUo9DCEBNiHI5NUfMzrxKJy2Ok0QmvtDEMtTU+OODFbWsbqdeyNxSAgfVmfKm eA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=VLrcvTGSeYnuaBBLKjqRwVgUXuJNQ2C6zzV4UzhyKyU=; b=sPbU/8UEiZvbHJe/5BlTSGEQbP8+YxyPo9LOD6J2kUApG1ncNGl4+IE+5XJT2sEh+nwN 1zSP8ChaaTC4/vOUIPiGt16N7cXJHZ3vBbYDE1ai0mqSj02FWitbtrqNP+fM1XKKBrqP geXz8S3T9nwT+6R9aydtsVa6lZa+eZBnDpcH2mFC9CB49fj/BVc/0jzSLDospVlzA/8y mTRnYBMxgdQ2wGQWwUmIA/HJSkKjY3doZj9XSnU305PMmsW9gnV87sYAsqpLjo0fBZHJ rHjEBSL28fEEu9BJ/6f9Od2oElDUya41hqBH4R1t5AhLtS1w6xCvWQlg4v2YwxBOWtZ6 7A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7wqubj6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVa0p008919; Thu, 5 Aug 2021 22:31:38 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2177.outbound.protection.outlook.com [104.47.73.177]) by userp3020.oracle.com with ESMTP id 3a5ga121dh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpfnJGCDHk7bqlmBrUC61r3IrhFrRTDrb478IpdHwZ/Jt8+/LmD+ECluBeRt9h1izjCkMoyoJRxk26UpvFOU/wwOKS6LF8GZumZuVrSbjGyAaj5vYJCGiCPu2X/KnV9K31HIMzXNdTqYlvtZ4W0dTOa4CokeuTwyPUkYNhjFNbCZtGOYZ+5v//UHPF3VVbnkQirEQOzQqLbrB/ti1mdnD/GKaJU+weOwD/qMD45x5y/7sn/pCVWLQp19bwmw2NrgbHktPEZth0z2lmUP/fvwCEAOwO28MXho6ty27DJt+9E+fLkAjPOgQ6Qr8lL52QfDLJ+wHukB03nL5w+xzXGQAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VLrcvTGSeYnuaBBLKjqRwVgUXuJNQ2C6zzV4UzhyKyU=; b=QpXZ6+MtM2gKhebY55mhu/8poV/vNKohbJFXAPESFfozGODYlpea/zn81qVUe0S+0diVapO7HZ/i1NAuPHg4ZTs4sYURZC1xBCXfxJS1b4+2/TcgaLYN2DkwjfO5Olw/QZQFh8cJjPjSJxM+URedxl6Mq7LFlda8WZ1Dxr9g5mdFLJKq3o0lS3/nSBkB7GZXjf5RCXHEyKKcDFh6YzJDNftzxrmamLlo1OUlcQQX+cMWjIX5Qehs5YvHly7hUmoxASPJhYmH/aewOKoZNjxCFm3V0xcNrk0nqmU/uAGzlNLWXa0HNug9+/4d5YJlTafw/n/dqq1aT1binkUT6JyDcA== 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=VLrcvTGSeYnuaBBLKjqRwVgUXuJNQ2C6zzV4UzhyKyU=; b=UxX9Q6+Ei86NYdgZ2xEdNYDBQhXnzmPXFs7FrpVVVsztP+ZOEyfBVVToudI4WMYO9C7cMzAyDsfpMmymOPknSNB7kz7rQWKbk3lzyohTwbP/XCtaqH21QvCeQOnIj6Ip+Y8+4qQ3LGTiiYfcIzxyHhAMXQJsOoe1mhqlOWfN8Fk= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1518.namprd10.prod.outlook.com (2603:10b6:300:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:23 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:22 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 06/10] ACPI ERST: build the ACPI ERST table Date: Thu, 5 Aug 2021 18:30:35 -0400 Message-Id: <1628202639-16361-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b567b82-14f2-4119-fa90-08d95860c100 X-MS-TrafficTypeDiagnostic: MWHPR10MB1518: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aekU1QdLkY+Tm3ayhqxB0Rju2h10e/GESzXKjq/EAg8LdtdygBPr/eNMsZIDV5Ng/LBhbTKh3YfDbgtfA6lYdq5MuifGMh9IEk5OvcgE6qcx9sYJ4wK7pbM9ZYd3gYixo30hqKd+UZgZjNJsYR76yHdCKqUas8z4zltjODoQzkjiutRNcCQsxWNNQLCHFtT4GCi64adTMoGDR+Hr2uHr6Ml0LLGBDF0U1j34AyrSaRFFmOlcHzmDERm3rguEIWOWEiuMwiJqtnsnjMp4t0e3ZBIsB6pCeOQXPHNCeYsRFaiF2qYW7j0w2qZ9K+zcpez21HLf9wK0KX8KnFq5xQiEpYi5hOvZQpQFDvOD7fq120qkGJvZ0romDknxvy+l1H0a5hRT42UGUYpZMt6ODXPBgv13m+nWNs1mLHjPcY+MWz5N9fG+2UUAjeStiY4MvqvAFcz2rB6A9wqWdH7em1MJQIienhYwGcaUN/jE1u33z0nz8WnvveUdx7AlyEnrnvNotY8jEmxVrjSQHIlqFUT1qvoz5EI0XFb/PfdHa/sKY6G/N7MbKmJYxU0EKF0i5NVd/BxcyVeWPPI4fKpxNU7H1Xx105R61wJH2awD7ySOOEDKgFzdESCRnVhjqL15mq3DrRjsU0vGaJ+FC2NAgVuzzE0WG1BOCCeMkoOXmiqltXNI7GQSANkzlwAIxobGvTxi/6329dmd9OAdP0XffIhjIw== 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:(39860400002)(376002)(346002)(396003)(366004)(136003)(66476007)(83380400001)(86362001)(4326008)(66946007)(5660300002)(478600001)(316002)(38100700002)(38350700002)(6666004)(36756003)(66556008)(8936002)(107886003)(6486002)(8676002)(26005)(7696005)(52116002)(2616005)(956004)(2906002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qWSBBveqVRHgi/lmZQuRPQcY7YXLCV9K8EBfjJJAqWbXswuN//nLFQdNsUgKsfPe6guCsJA/ufNb085yHLq1WXAYcKy2mVq13xbWU5aUUgxH74HSM954AWY8Ju7but9Ccm8Xitej5zIO5hVAPRkjc+CXFcGNbZluO1e5GmuGOZWd8ETPfCrDTdXp3xAtQArWkmwdEF5An/2E4QQk1ybDCiGDK6Z83NTHSlNHBgcmXm6rb4QhB0qaqUTJNZeDgQyxUS9f4XaZmHJ2Y99uRfUa0rm4jnw0qHW9D1k6/ZDdnPYnxVlRE0d2USJly2C5TjuQdoWiTX+w93pQ7WU0lYtueWJieLvtKjYs4lcC4OnHmids+ZqgEdhj1+EaB+BKZCEHtFMKZbVhYaDm08gX27v4Dv/fEN22xoYCeHMA6/KkcfifKMcGg1FBBJrCO4L9GBtqzIoS0Y6QGTIcZakFefSOHYGDS1HCLXDiAJWigJQu1Wr3r52jEPvfVeFj40BOpUp7++OEXzxNpBOVuwfVtaM+VmgckoAMZrOmF0EG9GVNHh4r4zn9DjL4Yez/KPK2dpyhI1oRlsRNWe89WUJeGoTHv+gUdSWr3SPRaloSFNeirAt1vUUoNxGwtne/tjzN6tOvExmu7PQQSwNC9vigq3ECycElx+YcIz6AwenHQSF2Sv+GWyA9W9oQRJnMbnDQADGreQcoZKoPvKq2+YXRYR5XeNa8AbAzNs+ik2FLJX+XrjwQaLoQ5zHU1c1TCU7yvsjgOssi8YXWJFKw5zUQ6x0DYtkO3inQ7CtE/VHVWN6KuWh+Axc3CCvgAqraBRvWMPF9knn2jId4L0Dt7ucw1H0sTandcrBo1JFnSM/cJG+TaUfElcct3wGyTDgMnQWZIZzGTijNVAKfvshRSZmzkyqaxyWhL/p9LSvag2uEWAs3KYJEAguCp6Lx7LYyJvAufaeoolS20bXxczPbB29apNRwAwN/gwLdg3DNUrv18lOhVvHUc4nhAT+s8tw9B6B//WTL9FPyVfPjacFUMlQk3S7yoj8f1zuH7LYbeio2/lyDhem37AayaaJYkUJNKeOO6QD2Soyv52TmVYfh44x/HcG9qamuztr9m/4jYXuCdzmCjyCuK0K4PtV1LzgL2Ft2jopX5bjtsJ5GihMumTMNYTulPIAIx5GPPOJcDUCUNYZIGl1kt0mIv2yQkjzBbMXg/p0C5kVjVlk+icTbsBMthbgx9k1iHHpPDm5uVkk340g+Oz7Dr7HJXsZrCYwr66EnCXQUuiIFu1I834OTkLimrWktFFHNTK/yOo6R/U1x+g1BJipuWVWU6ey9Js7qhavjt6Md X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b567b82-14f2-4119-fa90-08d95860c100 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:22.8623 (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: 3svUSaN2LneugypRmdOSCAhQpMe4r9McYfA7PKh5OzhZ5P6Xk0tXIqZrLG2WyTRvBVLAU2Z127OMexqHO8VMTYE0lNEjJts4BVYKkNlH0QI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1518 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-GUID: q6Gp-ja49dGg51FUWBjSEXFX3_c5q38D X-Proofpoint-ORIG-GUID: q6Gp-ja49dGg51FUWBjSEXFX3_c5q38D Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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 | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index eb4ab34..ecf1533 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -601,6 +601,245 @@ static const MemoryRegionOps erst_reg_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; + +/*******************************************************************/ +/*******************************************************************/ + +/* 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 + +/* 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, + uint64_t mask) +{ + /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */ + struct AcpiGenericAddress gas; + + /* 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; + switch (register_bit_width) { + case 8: + gas.access_width = 1; + break; + case 16: + gas.access_width = 2; + break; + case 32: + gas.access_width = 3; + break; + case 64: + gas.access_width = 4; + break; + default: + gas.access_width = 0; + break; + } + gas.address = register_address; + build_append_gas_from_struct(table_data, &gas); + /* Value */ + build_append_int_noprefix(table_data, value , 8); + /* Mask */ + 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; + unsigned erst_start = table_data->len; + hwaddr bar0, bar1; + + bar0 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 0); + trace_acpi_erst_pci_bar_0(bar0); + bar1 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 1); + trace_acpi_erst_pci_bar_1(bar1); + +#define MASK8 0x00000000000000FFUL +#define MASK16 0x000000000000FFFFUL +#define MASK32 0x00000000FFFFFFFFUL +#define MASK64 0xFFFFFFFFFFFFFFFFUL + + /* + * 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)); + + /* Serialization Instruction Entries */ + action = ACTION_BEGIN_WRITE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_BEGIN_READ_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_BEGIN_CLEAR_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_END_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_SET_RECORD_OFFSET; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET , 0, MASK32); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_EXECUTE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_VALUE_OFFSET , ERST_EXECUTE_OPERATION_MAGIC, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_CHECK_BUSY_STATUS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER_VALUE , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0x01, MASK8); + + action = ACTION_GET_COMMAND_STATUS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK8); + + action = ACTION_GET_RECORD_IDENTIFIER; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + action = ACTION_SET_RECORD_IDENTIFIER; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET , 0, MASK64); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_GET_RECORD_COUNT; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_BEGIN_DUMMY_WRITE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_GET_EXECUTE_OPERATION_TIMINGS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + /* Serialization Header */ + acpi_data_push(table_data, sizeof(AcpiTableHeader)); + /* 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 + */ + 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); + + build_header(linker, table_data, + (void *)(table_data->data + erst_start), + "ERST", table_data->len - erst_start, + 1, oem_id, oem_table_id); +} + /*******************************************************************/ /*******************************************************************/ static int erst_post_load(void *opaque, int version_id) From patchwork Thu Aug 5 22:30:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A7E2C4338F for ; Thu, 5 Aug 2021 22:37:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E406360EBB for ; Thu, 5 Aug 2021 22:37:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E406360EBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBlzD-0002rK-So for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:37:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBluD-0003lF-4l for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:32:02 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:63876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBlu7-0007AW-Gu for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:32:00 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MVpa7016768; Thu, 5 Aug 2021 22:31:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=59x1T9zv+o4pJbI37iM8vQupKYDFEzPsrOXGN0yNsBE=; b=untneudEV4rpZEVTNgJ8Bme4i5FGByiMehGcGj9inlM8BbO0M1lJm7AGd1RY+zfn+Z6H +6HYrJHfK/NWUk8Ck73aSWmuu3dkxS0befMClyc8QBd9o4lqQaRG9DKlV9iHYDH+Sqvp 5nRXHHKFH0nn6HG8hwdkQGTcx8sDp9O8AYfCb7WWNgunfIopH/HNSalAwUx0RxVljsbJ GY6NTVasvSY3RXlZh6EGojBt95NDKvHylOrfiStE12vXvQPK7Xa7F9KDgB/p1fvdTFjL VX7L2KbcfcwMxRqhcjIga5aIS1bZYsovxNguTEz/K1dFepxM3qsK43iLs1S15Gnx+c6f lg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=59x1T9zv+o4pJbI37iM8vQupKYDFEzPsrOXGN0yNsBE=; b=IAs9Yc5NR1u9fnHe//ycjVlhISD1FeZfJWOT+1E47JGEilpkz1OlB/EF7GASo6/RRON5 whizdqG1NeIlMaTO0/GvSNk4zdYAel47hRZNfOKPBiJYYOi5q8zR3DYdOxgNO88MZmuu ntcf8wYHPezOh12gnuPanKjUY6/AR7cru8F+Ywf/QxE9H8b1Ywf5y+N1MOUGUXLusxHi HBT9LrcYNuKoXF7yymqTHOjmEv1pQxgXFZbvNWJeoRHLZUHHeQagY/lE4muZiJ+zPizC r9wIYIdscPWmfsKm4N7SFFSWD8UVVVy8ZJQQ43oMk69PC08OrLBRiXDbIOOghqONvYXY TQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7aq0dwks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:53 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVYmw008792; Thu, 5 Aug 2021 22:31:41 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by userp3020.oracle.com with ESMTP id 3a5ga121ma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=axBWcMt+cYNmwqRE0I5iz+MF1PoA9Iq69OD/LdFqzT5YViZUaMmaLk413w67/XGFCss8dOatgozIvwBRvgFQBpEsn5Pgccr+axlm2mDzMQCVT/5zaDLfus+0uICfyQ5XPTvS6plUvBzGuCYDkdW9O0F1tsVsYkILv+wIqe/iKFtzhlXFIvMLEAopcx557fUkQH1E2dPqTXiWy7DdjPid5Z57AgT3DjxA7YUM4KrjVlXSQJnFIjM5y4a3ntyqdb49A9SroQ9eWgjkFXtN4sHIpZuK1mPTCqX04/uyRLPWztYjzTgabtzksmEsAj7/UWzqvjtn4mxB5XBayelyWr7Y+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=59x1T9zv+o4pJbI37iM8vQupKYDFEzPsrOXGN0yNsBE=; b=NEsDuSkcs3+bPi1+bDlCmHao0HGtcmsPmp3DbFUQV5j48SPQplq8QgHEo0HvgxK5EyhnntGvkLWOtRh358zSv+xhqKrs3lD0zwPTiQPL2xgcnTmbiBa5X7QkN5nuFPWkFKZIL/h+UGHOyWYoAtqbFjtF2sPLekpRXSwqkLRsGHs2tQQc8qT3HrBi/piSgCJ742kdLafCiZ+/cF1Nuy81YVblpdor37cL637MiWRy3Zy+693DoL61Bq/OkARUY1ZYJsJihYy3T6/Z4JMEwKilN2EY5CP4zrM5dC9QvzQQewYj1D+P2BP68pmd/m0qFiYT2MCe2ZbIypDoA1tZ+RKrtQ== 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=59x1T9zv+o4pJbI37iM8vQupKYDFEzPsrOXGN0yNsBE=; b=zZQjE9BVos5OJxs28GFyZ7LWtKVeZFF71gwNkhOE51r/bsjJZLG/t9A5YQnoIMDp7pOq5Zxu0GF3Q/xo/NFR0b9RsdMYkvXZR5IFdFvOFTjrWWo5uLehNozF7VFfLFHMgCHN6llLnw9nf6gnM+QiT6vkGMMNa7bM7rQWeUCkPuk= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR1001MB2221.namprd10.prod.outlook.com (2603:10b6:301:2c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:24 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:24 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Thu, 5 Aug 2021 18:30:36 -0400 Message-Id: <1628202639-16361-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ad8f27e-85b2-4f14-9e39-08d95860c1e5 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2221: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UXCj8t5hoo9rntQrgXZaI/K0on7DI/Ig75ewfANihgzvnRpeAum1eQejRaM5qsRahDgQiZnuVjr3177wE7aox0pnHItalBlC+PTl/ZZyP5qB7Fpy7+MPBO84eUb3p8MFm098CJ/z6Bv/uz53G0aywI3TUYpIUZoxCCv4IND8xNHhrj3nt3r24QMEf7Lfv/nxyeLpETxyr1dNWVO8dYbICy4lA7A6fyFOMN1FNmPReFelfpTTgkYoxFbH8dYGxttY0sUQJafXWCPzbyeZwpSEoJ6SMTKwkzEVvuanzRvAVlIcAbsVVSJAad/sPh05t5+T339H51ARSJN4e0595RQEqOee7ED8NjKNOwaRpFhB2WBtmjzny+nEu13PS41N+jyd1F+2lpHbmzjyN9oqqYs1c/3mlbFQqJoALjHYAvXVXUFId3VAdyVK9Y3m3pPYziVGHtddzh4gh9AYGKe9xlx086PE/KsKsXyn3wmOpaXTFySn3EsWZVrL20w+rroWG2D0+f9kTD2JwT8jgnIjb/gzueJUsH4ZtqY+q3mhNoCIykC59ml5vN7Kmtj/y18ipds38jNELhx940rYMeajsQDx10UlPHcCMjbDsLfRxUoykOtKbLLRAjr0OLWMzbHpUWhShZlLu50/lrMDmZpFE3FaNZNdyaL3KqPJX5aXgmHPxsISAcO6ttN+drIBpnthYlEQ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(366004)(346002)(136003)(39860400002)(8676002)(6486002)(38100700002)(38350700002)(107886003)(66946007)(8936002)(66476007)(66556008)(316002)(2616005)(36756003)(956004)(186003)(5660300002)(52116002)(478600001)(7696005)(86362001)(4326008)(2906002)(26005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8RHlwNg8KkJ9IzQNRaIMpkHur0ZiheIqWXdXX8jSDV7wRdeWdR4X6gLns7l6fUrpT4U5ZFGCn+KQ9jxIxBqSzDg3JytzxrVpevD6uOQsyI9U5m5WhMxipQipF1lgnMOcAqaZnIngMUZsqQXa9gcvYqayTiu8b7PkChRrOluso6I+rTqmSnHWctzBB2y5zndHqSqTOScK+b4WU8JlP6Oz/BChl3tIvCMtPFB81UdUefACkifpotW2YJ13H8Vw9hsdsEdohb+RufviVjOkWBS+GLBINQh/x/dnle3QqDPe5gYfTvVHMuWXba7WypnDw25eO09D9UBj7t9dLm5O0KtEOZs4FlRC8gU5IloJGIUYfHXFbaUPUrMtqZNn2VIbiJTWmTurPxVZwHAFzSXCBVDWpTga/L66pNz3D+aVkryjBye15ei/bklBwf2d1hVK+KnFEkGlu8nGGfThRt3x1lGlzn65vtG0XhID2wNS+hKlkubIOPaW4KLOk67IZDGMXv8TQ7mvAzXXmQCmRCs7uVBRgBugMk/PQlDzEirUlGoXQsifH7TTrs9xu4RE+iUmVkYeibFNcWhBH/m8apTl3OKpi5CUsXjQwW/JB0/ev6XE9MWe5mDYeP98XIBTKTeqsQNUh0uerVmutQVGdYj5rh70nLXw+1ebKSuCuGl6XiwNHiWUtlEr+b04IQ+HHkOYiBs1QWYtsmaNyx1XIyYz3gbGyRvzNpJhoXHvn5YZ4GLVAWmLOiUVu+pL8xZBuUzvxSJF6zInPzUDfmD5ZNqoLuXpJ/fR5cdlmU1DT2Z/C1AOMV6o6GDXhGpcxS4RvdBoUsvMNBglK8z2ZXRkX+g9Rf003sXknznUtbEshIWYfCaXzQhEB1OQQRat2a9WXUSFXWHCVWjIoNSG8To4FWbS5leALQuvmuK16FTLeKfP0KOHUCtFjTNKLNsPCvxDqMRTQiAPH2btohzZOsNBttNu1wrrjm+HXwZl4LrEwc+dbv4d9XqGMfn5aaD4OJ3x1rKR0fn0kjRiTSgpptUnHqO/deNl42cGufu0iUJouutHHHEg95uYuucX6ibev92PcSsHSGDvTs0SXYXjL4BY3fJ+i0CUnbHonrYJqkWbEYZxJ/GcC5aZz0fACR+vHU9pzfwzrA16Cpsr3cIf7q341TZHZDYak/UqgwZNzWRZr900q/P+cAkfscRfxYSBNQjziYmEVA9P96qzBKsruqr7SNR+Ud08fZ6KFMPsrVeSx0DwC3SIptJps+VLavWmU2CbNqKcFRH1KiYPoHHJX4F8pYFTew4xcKVDxpqDmYIeEuYzw9cK3IExM8xNSEq+FD8j+fjLu0f5 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ad8f27e-85b2-4f14-9e39-08d95860c1e5 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:24.4573 (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: X5JrEuYJo9m41qvujgkPgIs/n048eXKEWHCZkKYOQiK+zIok/Qy7ruNNIWROpYK7XNwMNb9pBp86PhoP6viNlN7IDVcG9ExZnc/PxLvKjac= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2221 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-ORIG-GUID: 06gi2j6scbEJGBGSgqQ2UucVSUPf0DSl X-Proofpoint-GUID: 06gi2j6scbEJGBGSgqQ2UucVSUPf0DSl Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change exposes ACPI ERST support for x86 guests. Signed-off-by: Eric DeVolder --- hw/i386/acpi-build.c | 9 +++++++++ hw/i386/acpi-microvm.c | 9 +++++++++ include/hw/acpi/erst.h | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a33ac8b..b55a548 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" @@ -2443,6 +2444,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) GArray *tables_blob = tables->table_data; AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL }; Object *vmgenid_dev; + Object *erst_dev; char *oem_id; char *oem_table_id; @@ -2504,6 +2506,13 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); + 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); + } + 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 1a0f77b..6578254 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" @@ -159,6 +160,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables, X86MachineState *x86ms = X86_MACHINE(mms); GArray *table_offsets; GArray *tables_blob = tables->table_data; + Object *erst_dev; unsigned dsdt, xsdt; AcpiFadtData pmfadt = { /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */ @@ -208,6 +210,13 @@ static void acpi_build_microvm(AcpiBuildTables *tables, ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); + 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); + } + 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 Thu Aug 5 22:30:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48B44C4320A for ; Thu, 5 Aug 2021 22:41:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D4D061158 for ; Thu, 5 Aug 2021 22:41:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6D4D061158 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm3p-0004jM-4q for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBluB-0003jq-8j for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:59 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:62780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBlu6-00079s-Oe for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:59 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MVpGx016771; Thu, 5 Aug 2021 22:31:52 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=0zOOI6D4Wyou1/iKSG00EWJHIuqW+jLmSOttLCDLEmM=; b=vTsiSGjiiizhyMR708O3izCSoZxQZNar7LtatSS42pjjBMElyBMtO84mHHx0/FU3vure u3aqMq/mL9jqtCs2tbcYq5YAPv41TsDpvWXcNuoveTuqQ5VNuV8mi3OoWOAZi+NcV+U8 J05PoMF6LfVxnIq3U0EThWWvAy7LZBIr7NtQXbVOvCeJ8NC+znA6d3s/jOOrtWNZ9G4k h0qK317gJocqizhZYwg5ViauYuRil1DhL6XqXP4L4Ee4MuZtT+dNnSpe96ktCyTkLrMx +MDX4+63o1a1l6ygzTRmOIeY0bjp8w0sUL8s88XrIu8qB2fha8GJngxYfwRJqnpq2bBa 6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=0zOOI6D4Wyou1/iKSG00EWJHIuqW+jLmSOttLCDLEmM=; b=Ypm6v/29f3TImA2PC6OL6wajU4YwpBSHlJZCQsdGScdUJrB6QmVdsm1D3A5827RW5759 ZC6DKljbDc/2YrYEK1IqJCZzR2tQQk8pV/qWcMvAlHJxkW+qqkRtIeG98dUVF29Y/K3v 0Hj+fssY1dSgTCDNlbPqaOppStBHvrgjqP1q480e0UoceJlOmBwqgrAax4iUC4T1a0Ga ThUmbbHamg5yQcfUSZ/QpHyN1MTkbBKq4tI+yV4PeTTcKC2VkDowGLPG2ZjZeEplSe+1 KXMPalmjV6ZNgz92OOzRh09hVYeGc+BnKs/fLUBX6o/+QHr5GYiJknVRI6P4dxe9nn/U Dg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7aq0dwkp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:52 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVa0q008919; Thu, 5 Aug 2021 22:31:39 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2177.outbound.protection.outlook.com [104.47.73.177]) by userp3020.oracle.com with ESMTP id 3a5ga121dh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hp2lhZ8oLvBxuJzQfziixN04Rfzrz3gWtL80N7nHOMbKVDgj13XxZ3PMlh+Fm78gVaUVeGc2UsWiTwVVrYrQPgmI8aGJyGvJ/3a6qje4aR0unqJldKKMPZrruRAP5LP5mz5Z2+yRqTNysUHuHaWJMA2SV76lLwFIr5iAkG7RhBnjRMBo/CQLEoEb/c4M6CEwa/E4zn5iQKxDJCgwxFZI6qQDKaA9hojUSLtvmwycPA+oAyjILbsRI1AOO+gBBaRtrzFNmSFENHfw2pull/kx5rQlAMTv6M/8cFZBiykQUZklmikXQf2xPKuxp+DYS3AorZAYUjtPerhzk7NwWiPcYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0zOOI6D4Wyou1/iKSG00EWJHIuqW+jLmSOttLCDLEmM=; b=kvfqIpeyvxXFjNB0sefyAffM5Jly8rN4jJ5FcGEksoSqOlef3VFw9aiGH6K8D5N3tgKOUz8lI4TRumdZDWIByQ4zvP8G07DDgejvb963aPBTlAOvPvw6ufqIrnOO97rF+FrAK+KVAi7D0nJ3UqU37h9OxBI7gePLZJ91y7iuoEEWvCBhvLbf4JAiox4widDqJnx6FCjnxv1A0ABH6aFqpCyqNRNi3rSqsYLWrorEdtKxmgT8TlgSqniFhunb4Ro2erXaQhcJnAZW6CsseQWhNAmBLHO22VgDLFZUdu9lTt0PtJmDu1RycFx4rCfQfpbkKShF1rf7TyI0UnL87g+Kug== 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=0zOOI6D4Wyou1/iKSG00EWJHIuqW+jLmSOttLCDLEmM=; b=UaaKb1O3E2UYBwTfOZMxHSOjPM+GfLd0sF1/Ncu6BED200i8gSYSYs4QBE7ZGAQCgnNvFAxZqwPfnN23tP4+c+8WwWO0NJNbWVDmcCmEV94ah/kmfMLcjU25LsTuMpuLHKY6yeEMf+SpdTApViRaUx0L3MmtGAAuRBFp793MsNc= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1518.namprd10.prod.outlook.com (2603:10b6:300:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:26 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:26 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 08/10] ACPI ERST: qtest for ERST Date: Thu, 5 Aug 2021 18:30:37 -0400 Message-Id: <1628202639-16361-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23a39531-98e2-4f1d-6643-08d95860c2dd X-MS-TrafficTypeDiagnostic: MWHPR10MB1518: X-MS-Exchange-Transport-Forked: True 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: Z6/XCdbrrbKDzq04iIJpUcdE0J6qfznlKsmO6/fIQzM8H+YIAghmqihcap1Yqd7fFOE2R9bZAt/GkzlMaPx1IRtRdNk15NTX6WEv5HIyD0gBikwafwYNKfK6h4HYAmwm+vh5DM/R3uMFxWx/WsVCk0YSnjho5sUn4TsBkoFDLmRVDl2U55iHZ9IGGyeYjKrR3iAVF7Zw4TTH3guTaV0qDTNA/dkwYQIRit7PO3qGUV+P/UPh2JZ8Oqcxcg5tqx3XfumiksZIu5MSnMpO8IAOYq/dGZ86ZJcy+x/iK+EPBIi21KX2ArNeq/HEyTUDemp269UG+5+BYDGC9ofVoYTqDsOWqxZQ8J6LRjHzc5t1lgBj4ra1t3xAiABEygH+DWyTLlhH068kxJt4cAn/KXhqFPvNq4t3e/jsHhbKmhqMtKkGsi3fxumJzuk7NDSpya5TJkOYZ87a59kvvFhzexJuDR0Q75yTXBTdlUJu1rHw1lARR4bFBC9bWv8sjtDpAZUdmp8x9q7mft5pXFLQ4lWJnM6C9DZCtF4dsFvKjRLMfeCH8Bq2G6MHd3p5L77anAyGw8+1trokMV4/vdnpe3D7R0qDHeJA34BMN5DIyQvrXYgW0l0BsyUcx1mdimKu4spdxAtHdN9seRdF6Mx2RWcO5A6bj1dMCIoo3t6zfNuT9lOU8mAcvFtnvLaStiy5pQqkvBvHSJBMfw/a5tu/mqBubg== 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:(39860400002)(376002)(346002)(396003)(366004)(136003)(66476007)(83380400001)(86362001)(4326008)(66946007)(5660300002)(478600001)(316002)(38100700002)(38350700002)(6666004)(36756003)(66556008)(8936002)(107886003)(6486002)(8676002)(26005)(7696005)(52116002)(2616005)(956004)(2906002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0sFDcaPzcU/R07sLvpptBHR/De1sUR4oXKFtzMOzlgfTESdMXGq0LSkgVxOXKmoqmYSLBZzTMosJT4cmEonzkSlVBcwrduOX7ZbFChJ/BUvJt2AS52/9bJVr1EFyLjKYyfzHis1HeNVzz6ZDW09a/Y4s3ouQc+nHsaDdwZdXGyF9fvZcYszIrVDaGJdVgvQ1y+vWSFO29FleaPBbpmtvUjpz88KDOvmflq1j+cO3Rup0sWEMg3hOSWBLt8r0QzkFt4T59TCLK1eSXIKgpVAvt3tRPKOTPy8mm/Z9+P8G8jIgux3OHDc5EYEQytSmqjLNDnbekikorXIhe1d1iqazMiAfyioqWyASKf+zMbYrW1lNgCOg77LtulEx0h2HJVT1n/PAr+GaY0TLpxzHZYK0728D1yeAYGcjzV67xy0gNogV3HwuEsSehkf8SM9/i59bfQpnCVACgz+MlKoGHtzoOOhRNrscBdNKw2OaimzYOU5KFFcc2+a7cu2saub5vrtboI1lEuOwLLm5dgXFqpElqk+XDwmiET8OWMXPLdgX9MIo8a0DKZw128Wn/Y2L7fwTQbp0A06c9uFVNJTzros4H2Z43tAn6hIFYlJPFAt8mpAsBREqJ+zTh8KjbjXoYGrpTMqf2UZt0UHPKjDzi8ubGWAxne3pGjnugwa/J+/gc2MwWpnhtLQxd7KlZ9m14LB5USf3RhTsfx8uwfObkO5Yfvlpij2OaVNTSWR9zz8eGVba5nnDIvi881LchsUEsZvY9SXVJGLQM0tUz6yUxuwDtbdCWZKF164Hfjol7WJobpIRYucY1TTsBy7wNgemQsfxrTv3RP05sOpj6LjuzfkYa904XuX7+prJnL0O28RQ8dF03ZMzZ7iu9QWaq19s0JwFQ3ts91/r9r70QrwXhLfLyYBJpV/DRPrO5r/u0/2SX2LFWSGIWzPMDpK4mIO5bEUMUGko7ufOgIj3D45Ahvo6/tF/gU7+xMs2cLGdXK/xoqa01bS4ULpsXj2wOE/36zr+Vyorzp/3WnTY7MnGDE7zsICaAZIdO4QbOBQYBguvKoWLp2zbXFmiKZowbR378nkSYhXntlEyUmduvjnLaowiDbO1+eSS+TKypOfiT3ZS1Wrk1kLok87OLjlLyo8mZhU5QswLyQx5xXz84595bhUXZm7ALdZrNgX7mKrwurUuJmmnpJeFRXEKT9f4/VBs9Y6Gbs38th+PClZg/BgYxQH55QDRiFQbxpg2oTbiWhP0V+VwfOfk6n0EhnpK9YcO3jPLOTz5Z7qqQci516M3LAzuzfaScncpCxuog/Mjaqdpy5+a9NsReHtgCskpIv8PdawR X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23a39531-98e2-4f1d-6643-08d95860c2dd X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:25.9906 (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: SCKa02GDHkonTMiiAzYd4F2X2wGfJ4X9hX+jIOsM6c5JsZs8hwGc8D7DewadzWuv6mSUAvYCGA2XOiC/t8Ci4vabdeIGOojxyXi0DsIbEOE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1518 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-ORIG-GUID: Gx9LL5lO81bTH4HfeuzUj0ylzZGlUZpt X-Proofpoint-GUID: Gx9LL5lO81bTH4HfeuzUj0ylzZGlUZpt Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest. Signed-off-by: Eric DeVolder --- tests/qtest/erst-test.c | 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 e22a079..b69834d 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-test'] : []) + \ qtests_pci + \ ['fdc-test', 'ide-test', @@ -245,6 +246,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 Thu Aug 5 22:30:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1E5DC4338F for ; Thu, 5 Aug 2021 22:41:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C10961156 for ; Thu, 5 Aug 2021 22:41:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C10961156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm3o-0004j6-Sx for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:41:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltx-00038B-Md for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:45 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:46680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltv-0006zf-GH for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:45 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MVc0Z005499; Thu, 5 Aug 2021 22:31:41 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=gQvHGEngwOEn1A2b3mlIeDMzvdMLGv5xXvpMb68B63E=; b=m7ZY0bLFVg0cvz7K9slqwFm425cmx5HjGYP42yNm/oZcvF5vade8qIATe4c+7zMaqDuF xd1oHQiY2Tq6MeEmmIIVod2nPHQGly9/JzoyU9BJpVzPNMtO6J6myk2+xIC9vyQXJd+9 JaEruUNfmllK9mSu+YNt9hRaQUM6gqRs42rPbwELt6ayg4tAUeyOsUKvBantI9B2ZqWe Gq4Dz3FeH9VE+skbbspfRTNF+jYzKNfgsVSQLcDdssvCP5zj5w56D7L5B6+11xpbvG8O 4ecRum4VtI6Y0cY6Y5ooEEStMoL8/rLbulzNzqhg8kiO4rHg1exEst30LUSqNFg781i3 ZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=gQvHGEngwOEn1A2b3mlIeDMzvdMLGv5xXvpMb68B63E=; b=hvA3ZyGfNLMLBMTNTQ+Ir5Eca75oFpMlg+UYClaF4PE9vvmgbtA8b8R1C+YtC7Pw8QJj +ydkPMOyE73GZcN9s4qP9LJtxtFyfQTxAEyTG7jdtx9q103hw/mt1GV7U4mfG0e9Imhk hXDS56+YYvuj2l/Oe6NdRVU+jeuUTXV5q0BuyFasLf+SXeNCVFQ3sDLW7mmLx/WzyGqM ScFlt20R7P14qLfrEACapLmW6MvN7FVidGAat1ldfl4XjgKWsBMx0qhYs3uGfr+miEo8 5ppCBzTdQHMTpkkyjAXDNdBCLIHHlLhgdV749Fu9bjH1+shujP6YG5jOMBt8axjiW+In IA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a8p6rg9q9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:40 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVa0r008919; Thu, 5 Aug 2021 22:31:39 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2177.outbound.protection.outlook.com [104.47.73.177]) by userp3020.oracle.com with ESMTP id 3a5ga121dh-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HSpcwS+K41sUULbUlnrQOW4Kj3065hKsQhE9zxkMq1gUylaZA41I9DhyK9GCC+zhLo2T9nrOSRFTKqtorbH/shRyIqoswwZPPCe20Hq4oGqmaaOgIoUsqqYoEBGKvAJmzF6jdjuVBd8PXDmEO0Ymlal+wVMPoJG2w2oxcsqZn4C9DgzBEPozqDIaOUagNTML8TEiBwEs+gFM71ECFqmhERiGJTKbaadaTOG91TK6fgqGJaeeosHX4AMYUt/X5LBHAnjCOcMUQbUVaAoXnNHcp3VKN4NEQQdr2lR5Pmh49BpDp9J9LKrb8ciP9+aueDepOmfWVg8s3Lky1ejlPKBung== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gQvHGEngwOEn1A2b3mlIeDMzvdMLGv5xXvpMb68B63E=; b=nUlsNodg/eAf1h+lBX9Gtdl19nIvYfLIC/HTKjrvoapoXHG5UuYaUBiwIyJ2wcaFY18dQIVCMsLLiozFHt/KljMRaDN7ci3ia0/G+AheOoDldQ6i0zLpuURKmNcZ0sSjAHJUzTAkpfB19oSl1pxcU7BlNpwGrqnZtaVlu3fpQQCg/zeuEwLbchjbShIa0OeBujDmqcBHyEomMdoUP4LSSsUpCe0RgfDIDwJdHSHlGMdrX0x1FCrtZdtb4zhsnK4ZWfNIJEXxJsQsHlkT6IkVVKNjcC+cxXJGVRN/Wamzlh4JaZaSCnlSvLI76rR1bvrW3wy97uOrMc6zNfUeTLe3SQ== 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=gQvHGEngwOEn1A2b3mlIeDMzvdMLGv5xXvpMb68B63E=; b=iSYH8wE/9OyC2/NOeis9Ps4bWoQp3PXvXhnMxZwdTfAeD3kfYXpc912Win1UYUIxRNVxFsXYDvh/xSklfe+Qc/TNxkQDDWmfB8tRm/qYqxBUQPcgVE+O0Xp3D6fUnlkJSot/0g87Vt+eb7Ku/E9hvmMjNWeCGriNHyuKE8X7xAQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1518.namprd10.prod.outlook.com (2603:10b6:300:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:28 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:27 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 09/10] ACPI ERST: bios-tables-test testcase Date: Thu, 5 Aug 2021 18:30:38 -0400 Message-Id: <1628202639-16361-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6003360d-036e-44ca-c28b-08d95860c3bf X-MS-TrafficTypeDiagnostic: MWHPR10MB1518: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mG99gYZqcJebS36Yz3JF1ihBnr+BU2lCELxb1FF8zyIItjg37u+FI2Gx9zGgF0B0gqVAtoDCq91FmrGz5Df2vevPvR/MjFS5toUsC+BFA9N44KQ1IJbs0rlvtl+OD7sgs2nqcfgiJQanryjkS7x3jIibzc6QBAIoyGDlJySHfn+SBj1f4u43azLz6q9nunsbbICCUPpPADIwAS75FurRDfNed9iJi0XhKWQbkx9SJjsQdo5DjHfktTxjaYO16cAuBfKzgmlOeJ9+FdS4yFs63eE0jNNI9Xl7MLhh4wiThVtah5nqFBCI56EFbjE8ZDmFR4tlz+i295wRYMW+Ss34Wr86nevOYsK6pcteg6JNBEyvg9h2UawbbTI01E+EzCkyHM1OmwVYLQRxpzkZOLbkujQEe1paVi+ipAmEN4WQhA2Xw8AfoTzSD8CUmBjkknsXWLOPFMivIsm/6S4MtL4jd64ei3ETHTGGE31Cplbv8A0fT6z4wgCitIk6HTSnVGWPK2ba+VjNJDC2RxhR465t+wYULmNopnpM53Iv8ol424ndZpye1OXMD38wG/1Li3+LVqQfdQUnaXggxcsKkUb7unMHP04gicWeJbyEnrWVdq9+JKUCItMWN1x+hrpFDQWc6oTXR64/J7F14ybMKMiM0sc0xJhyIcz/GcP7eC7wLbxtiEMIO8bxsl+r1AD9n969y2i3PbpQaJTIclAuZ93p5g== 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:(39860400002)(376002)(346002)(396003)(366004)(136003)(66476007)(86362001)(4326008)(66946007)(5660300002)(478600001)(316002)(38100700002)(38350700002)(6666004)(36756003)(66556008)(8936002)(107886003)(6486002)(8676002)(26005)(7696005)(52116002)(2616005)(956004)(2906002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kVQPgoRlbXbrcRxHBI4L8dWLqs3hgwgKe1t7MwjHkAwk7Dl6JQ06Kvmx+6vuec+UFLJWYor6rtBvOnSdkaQ+iaMQvSE9VjTcHuG11bAnu4bbkPbXmM+CGIVzLSwSgb1DePHrN/JsAwRZQSSQu+6OZWrCVb/D8NsoTUOJWXlEEt31pZm9KBWVi5pEd1sP6Z6vRD1pHmsTY6bfRILzDiwYWsx/kdIvspbF4dUsf8dLZeiLbT2+KS8xqMI5/z8CDPYtXSF+n6NbJ+GrfvPt5wtuSztyGFM+3wGe10d8OmBEiWD8aF1zgnBEM3nRA/a9xaw1FO4yJcP2cO5JZ4eFvXo14Wusji90nWd7Ynv6IsaFGyrBsNehIS5wuFq44pUsdwjr5FJO44vCClBt33Ojj5UBWzGwFWCESPTmM+6wY2he0QmCY6EoUmzq/u6UES7G/0ryOfEhX/DjcPV1ThaAJc/SvSdTrlPAhREed4os4VdAcPOqCaH5s3SOmrsEVPOqrk7lr9X0nm5flUGwop+oD6ZBQyJP1QKMbPLQ6BfPjDYkBjv+dfgi0S9vkme+O7xQ4j1N0AXsKx9uVTHbHojbs7wAhUVDbUeWExaG4L07qs77hdixpBQF4vTPBPywimtwnyQ3cPfqJyp4SPZyLyqDtDVdMPzrfHjd7sfxV/lb/P65VcKGT6z/vS1FBeiIbFRF2LVNWzddy9BVCGsFi15NIuNwQZUODTiXp/RA0ecjOFPb/YvGtEWcOzIt46XgZd2FI51RFMEB6Y5UtZjAh9kgj31FF2I+fx2GmBUJg4CUmgDMdrDUmI3gtiihV6wsWNBE5bFQQ93FKdCBwR6+nLZ020kViTFbGv/FXeDorh1TFNeFxaJazrMhi5XIxwBVJ+tjrP5KZwUKXkt2EUBXYyZF1M4dSkSTk0amntx1Z9R2d1HWFAb6TYkpt8Gz6OaSqeAKhqZttiaEw3ZjaHViWYu/9UUz9qSmQgBSEPb8Ws6tf2blJlmlqFyyzjJNBKacai07X6TyYb1bqei/tcuVeYHHXXNTKO5ryfOAwK2boWQZ0AjUJRXL8EnRvjkU+kWWa2q8Kv9D9PxF5eYI9SNCJdgkMBoQxfF+g/nl5nJPj+zS9sWdIODfRYtRXJ24yLBnzhuiOoKYpL06Pxp5U9p0k/i0O4guZuDBYf5NzWSbcMoXayuPRRSGuPCQlmoTj0QX3J/5geYyXWUKPK3L3jQFlnowOru/3PkLGR+Oq7oANBUONh4+jU55kP/egwZMxWAfu4oAGAPKLY83i7msIQ/PtL0mpMwGrFpJEnQsV7fSy93ktAkT7TZA0BeGAajOl0i4p++8ary7 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6003360d-036e-44ca-c28b-08d95860c3bf X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:27.8375 (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: 1zQ+JBfMuDmk9596XmpL3ingUd/NprfUhWVESIIHRTeVyhDxLf2czfDKzN1D04QvPDuqfiTB/1wZBREDTy0kC07DR2Wz815CLkxFISOY9k4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1518 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-ORIG-GUID: peFT45v69nKfCD5vxkk_zPnMkYNYDKK2 X-Proofpoint-GUID: peFT45v69nKfCD5vxkk_zPnMkYNYDKK2 Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@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 --- tests/qtest/bios-tables-test.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 51d3a4e..6ee78ec 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1378,6 +1378,45 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } +static void test_acpi_erst(const char *machine) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = machine; + /*data.variant = ".acpierst";*/ + test_acpi_one(" -object memory-backend-file,id=erstnvram," + "mem-path=tests/acpi-erst.XXXXXX,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", + &data); + free_test_data(&data); +} + +static void test_acpi_piix4_erst(void) +{ + test_acpi_erst(MACHINE_PC); +} + +static void test_acpi_q35_erst(void) +{ + test_acpi_erst(MACHINE_Q35); +} + +static void test_acpi_microvm_erst(void) +{ + test_data data; + + test_acpi_microvm_prepare(&data); + data.variant = ".pcie"; + data.tcg_only = true; /* need constant host-phys-bits */ + test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off,pcie=on " + "-object memory-backend-file,id=erstnvram," + "mem-path=tests/acpi-erst.XXXXXX,size=0x10000,share=on " + "-device acpi-erst,memdev=erstnvram", + &data); + free_test_data(&data); +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -1560,7 +1599,11 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm); if (strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_erst); } + qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_erst); + qtest_add_func("acpi/q35/acpierst", test_acpi_q35_erst); + } else if (strcmp(arch, "aarch64") == 0) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); From patchwork Thu Aug 5 22:30:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12422275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D33FC4338F for ; Thu, 5 Aug 2021 22:39:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 932A361156 for ; Thu, 5 Aug 2021 22:39:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 932A361156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:36488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBm1l-0000Oe-Ka for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 18:39:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBlty-0003Cg-TZ for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:46 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:48590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBltw-00071h-Mn for qemu-devel@nongnu.org; Thu, 05 Aug 2021 18:31:46 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 175MUwlh021793; Thu, 5 Aug 2021 22:31:42 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=oml4UNaaMWFddZsB5VA/3Wnlmefd4v6A0AAAeBi+9LM=; b=Nj8h5PcAAm4K81WclbUzGOEgarUCKc3BSn+jjarq8Bb7sNxUaTqlVcwPi95RhsvWk+A+ UEMTcqeD3ixU9PbgJnfbuzmzMCJN1jfVfRbM3U5yocKAtKRcBr98Hej6Ty2d6RJR1XJ1 OT9wINd1dRb/TP7L7WBFIMjIfXX1IgeegbuVe/lPsKKiONZqi0UDUO/G1hRooxkwTYW/ ulrbLYS7ONsZSg3bxo+91l2sqgVRJGpxEnarAqRNo9CIY9FrypiCAVaIHhNliyBlY1gu Gyqb3BZz1e2iWus8eTXqp4bcdLVwX9lRJRWuwYlXaXzQz2znNp6fqsDMRRj6TIhefm6n WQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=oml4UNaaMWFddZsB5VA/3Wnlmefd4v6A0AAAeBi+9LM=; b=oCmunyrr+ha8gt5I4TuXsisOseLRmViPA+hMENNznD3sMwUUDaB+zKFgS53Q2RVmoOMs w4FgwN+cjmEpHmNndMFNSZvqSHSoBV2TjWdJts1rZ8mC/eNNJEfwLu8lYQMs3ryNxkYm dlt09qJhr2ExnQ677GR3oDbx0rxOVOi/Vo9YSboG3fJOdou/pLz3yqPtTCgYe4lf64+t c/G9iUFUwabexNJoJac5scwCjnYxhYMC4xEsILqHRS1Ci24JNZnaztr5xysLKUufBlSs ix3Hp0JND3Uwx+uiqz5yOnRyXoqYeper7yZ2kyLHiKXlbEfnD78ZsqCcPDs4768T2VkG pw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3a7hxpna3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:41 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 175MVa0t008919; Thu, 5 Aug 2021 22:31:40 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2177.outbound.protection.outlook.com [104.47.73.177]) by userp3020.oracle.com with ESMTP id 3a5ga121dh-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Aug 2021 22:31:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H6Q7xmFYU7Q3pRWKdGEr+Jb0VzfuHut5VwaYsUCi5t5DD+VTj0UhDHWtqtBkH6JCROulvNPjtxtHDa+owkHGGHJwDbCH9iF0jHNv61VQCnZhoeSgeFMsOhd6C95huO48eyjdSPIjcEL0Cx7KFL2sEm5HuXtbOLTi8QncyAZ4UeNOD7456OkhwfLDCeWY9W54JWHM4cLqFZ/dW9Rtw72J1gVo1M7cQuIPFV9qmkaqY1N5XyxVWShMooZDuxvyt40+0POxBaukjLr9JDfyzW9xqHJPGyvcnae3MVKIol6Tyc02j0mYJYUanZTmiBAwlaojXxsVqUpVRQd3/DMBLmJbVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oml4UNaaMWFddZsB5VA/3Wnlmefd4v6A0AAAeBi+9LM=; b=SQSHs8aGhcZO01yAdgWlo4O02qwYIG/V6ufzT7Wryv/kwmw//WxabRdamu7+Tk5q47rc6p7dmaUw9xzaJX0WL6YoOLPqsvTFwrIFy11hT0gEIkpG6PJPluNUHMlaheCVqHwkIKowECLYOFq4aPliRjQOTF9hjUMDmAP4jKc6ZM5UmZmoBzT9+EhEic1rovsaTwHL2T79Jc1xcoTNrmaN/AN1hPK3tL+gAdVHBvcyNnn1uMn/3jBWC4mAE3wYgINtO/R/nCxwhchpYsrk2j4yaIP6hQnujNWpvK9WOo1FF+6fo2AUnEZFS0U+ZbpZPo08K8gJpPpdO8b1yOaONAsFgA== 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=oml4UNaaMWFddZsB5VA/3Wnlmefd4v6A0AAAeBi+9LM=; b=H64hJVqiRqwtM0T/nV8M0CWZ23EWHkP9yNS4UbynAX4DE2JpkY9/L+BMUJLGoWx7ZYoGggkpJmRe78xuXgbWxF9nEZ3x0vRhknbrgcCkOws2s6gvPMt4wSDagEngF9Q8eeBjgUppw7R8Li2PAa+b8jRSPShFlgiP22MtMgxI+cg= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1518.namprd10.prod.outlook.com (2603:10b6:300:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Thu, 5 Aug 2021 22:31:29 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::d23:ea44:5df6:2bbb%2]) with mapi id 15.20.4394.017; Thu, 5 Aug 2021 22:31:29 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org, imammedo@redhat.com Subject: [PATCH v6 10/10] ACPI ERST: step 6 of bios-tables-test Date: Thu, 5 Aug 2021 18:30:39 -0400 Message-Id: <1628202639-16361-11-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> References: <1628202639-16361-1-git-send-email-eric.devolder@oracle.com> X-ClientProxiedBy: BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by BY3PR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:217::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Thu, 5 Aug 2021 22:31:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d47bf53-0498-4669-d33e-08d95860c4dd X-MS-TrafficTypeDiagnostic: MWHPR10MB1518: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hnKS8arADwprBdIRfdG1b6QKfAv+t6S+y/vZykd1AYETyW2lACvjISomeUWjWqkHOws5JA6atiZ4ZbDfpFM/uSYpLMy27dg5iPx2trZNvAhyisLkrEAQPJyjHtR/odBvbXxhwClV2i1wJwAp1WRJS/GdP3GjO9r0WZyAENg2KNOO0vYNRPKmm02+S7tE6sCS6LT/a5pESb/x5oh8Jf1bC2ei62O0p6WCDxmpeHNCDwBzdm2Du83B1Um3xfx8pVluV3GEBi7GAHnK+UWxLuhsPKr29BjCVPMBhqKbYDiDhHT5jDo156EL8nsYiDEjOinqtNhNZNBladJ/wi9NLE9OugcbYW+xb7++DYJCQ69Y+xlsU37n5UAKeRxUJiDRtvNGFt9pWHxt6JAqvXDq+IbU9GWLvByuAzkholdWPA4rwEANyKTIawxbDeoGKR8Zx1677WlpDHIIxJXj2EtMPfvsi4TuAKmtFQBQCziWGRg4ozwmNm44fE22nUJ6WhN1p6sa0fU8SezUo52C3HzRp8QnyiI93Ljrn21wOpeiuHH9R6ieYeTXv/ef6RdnvZCH50om1HZwX4GNipFjrScpTuDaDITsij3dJQwe2K71A24NhkRRips8IcqTss848VLEkPh6h2SGgCTk0HmjyKS3Q5f9muaQ1phhanIYNi7bNrEEaHk621IzzKD5TNhB7jEgmmJ81Y+dmlsyJ+xJu0u7sXBPXg== 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:(39860400002)(376002)(346002)(396003)(366004)(136003)(66476007)(83380400001)(86362001)(4326008)(66946007)(5660300002)(478600001)(316002)(38100700002)(38350700002)(6666004)(36756003)(66556008)(8936002)(107886003)(6486002)(8676002)(26005)(7696005)(52116002)(2616005)(956004)(2906002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TvJMbF+uj9mtcPkliKsChyeRPW+fIvy2A0JEs4TKBwssEGgcK9YG8OM8AqfzcRFjn+EW8uMfVlbsxf5YcSN1+2nhsFT+d8nVtLLgLrSJ3Z11MQVtBINL/tSH9oR3tdHJQbqG07LWaqxxgb5rwLm0x9sFOtt/4GgA+1MSr6QsVzuqEC+pKq0EdbJKfHRiazqYmvbOSaRxD0rZ8+wFIfiQXVOfgNd3jD18kTHreM2yQVC6dsOHgblcdMqOf5grB9clB19QlzCSMw46QsJpyh6iMqovkHyORTXxSesBRHkSASkM1GypQy/Eq3j0bOWzoeS8MfptRj/PsQb+tm4+2QlgIryP1jtME7hiDDrlTQVL5pxUvAKjuhErJAvA7zp3Kd4VwI7gI804ReQ38Xa5U+X34LveQCHQCQvnPYwt4IW9FGaX8WWmym2LWFV9UctBuKMf/qRl7WyuCdrv05u3/jnaAX0+C70eE8fqZ4FQwIjfagk3QaFgPlqoQOKgL9rvz0aZ1sb4aENr8MrY3PGQysPURTpL1mnREz+ODGz9QBT3ZXkgwmYRDzWRC80xr0LZyWWdhzZbNVyX5ROtN6wxLX2y6Q3r6Gf8366m2OO9CSKEPBMoN8bV/ouHShKBE3pF/LYymmMrC33Qy/tUXVzzGKH2+TXjEYHPyFkJY+lzZr+/UiOiPvpLTXhI3yE+PtyQkShbu9LNAtmE4KEYXJvUopnSkiVLHy7HzVJrLWCRpP0I46kpu8szQiOo9PoinEbMPZ80UEA3l5M4rVINW9yLLMtwAGrGChAvU5jqVZrXitj1ClcFe/qTH8EYjaqQb8smniUbU69lRErnzpHGnkdFv1Tnrjo8u+fqiQcHC51y3ycpHnvBXKIx83qRlrhwmGvhAdOfXrKLG550cJ6k7NUcggREJFCL10PPqRVQkGwLG/VE1BOmdb0kpXHLYUG8IRjptUaSE2TkAiv6MxVFXdWo46Ep06JaJ5UObc2REeiYLqD/uLC5KDgAWYkBWPvAF6mqCljDWWGf5atyUTsuA2oGl3Q07PIEbAes7OoLaJag07xuoDLdMIRh0rT9CZBR5my1RqrOnXdLkXyty4AO5olmSALMxm287lhMkrtmqkFEC9uzxlD7/WJOBJgi5dtQ/8PgYHWNlW28y95RowQN48vhTvJjUDAtRW8MYc1NoF9YkgicArj7GnFQbUF2lDSXmu78s3SeKShOyKkpUAtNrF0eSd82+HbubRHkPa46Bvt18vW/gviMzH4e8VG05j5cZaKth0d5lqiDFne1UJDVGPop59M5btjzKShvAIFyzOQlmxw5Qbo3WiLbKCMLUYgOOQ611m9V X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d47bf53-0498-4669-d33e-08d95860c4dd X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2021 22:31:29.4504 (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: Li6zV/1lj4K3tU51a2l5l5Mv+gmnMa5mCVEjkFY/LwNb3kURj056VdeMajb1tN5gokysdPu/mJvqglZ2eENohE7uFJ1Wkx3Ux+J8m7jx1qQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1518 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10067 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108050131 X-Proofpoint-GUID: kS-sJdly45HCFQ0Xuh1pxv8mKpjmleyi X-Proofpoint-ORIG-GUID: kS-sJdly45HCFQ0Xuh1pxv8mKpjmleyi Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, konrad.wilk@oracle.com, mst@redhat.com, pbonzini@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6, the re-generated ACPI tables binary blobs. Signed-off-by: Eric DeVolder --- tests/data/acpi/microvm/ERST.pcie | Bin 0 -> 912 bytes tests/data/acpi/pc/DSDT | Bin 6002 -> 6009 bytes tests/data/acpi/pc/ERST | Bin 0 -> 912 bytes tests/data/acpi/q35/DSDT | Bin 8289 -> 8306 bytes tests/data/acpi/q35/ERST | Bin 0 -> 912 bytes tests/qtest/bios-tables-test-allowed-diff.h | 6 ------ 6 files changed, 6 deletions(-) create mode 100644 tests/data/acpi/microvm/ERST.pcie diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie new file mode 100644 index 0000000000000000000000000000000000000000..d9a2b3211ab5893a50751ad52be3782579e367f2 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~xt7vG=QZp?+M@&@5ljF8 diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f24fadd345c798ee5c17cdb66e0e1703bd1b2f26 100644 GIT binary patch literal 912 zcmaKpOAdlC6h#XZC=fn#CoF*_7>J28jW}>wF2KFG3zs9lTPTnl;U#=7r>E_sr(1u2 z21ttC4TZ!l<{$N9cc#e2SmmnSn O1||j(wg6|p5C#C(xDBxY delta 42 xcmez5@X&$FCDJ28jW}>wF2KFG3zs9lTPTnl;U#=7r>E_sr(1u2 z21