From patchwork Mon Feb 8 20:57:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076795 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 617E0C433E0 for ; Mon, 8 Feb 2021 23:40:38 +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 E1C7C64D9D for ; Mon, 8 Feb 2021 23:40:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1C7C64D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9G8y-00064F-T3 for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 18:40:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc0-0000lg-84 for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:25 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dbx-0002hy-MW for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:23 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KuP4O009589; Mon, 8 Feb 2021 20:58: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-2020-01-29; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=dK8zPR+8mtKgSULL2Eb2yIeHABy+POJKAOI7S0jf0VblbkAioz9gexosCyqUTQpJf7zG KKIjtO9VPFemuvLa3V5Yty/vIqkc2WR9fs20CPe3Dvrma1cM16zOuc7wJW3eWO8FaGQK Vw9J85mYinG5oeGXP1m+jnv5K7tRCFhnbNN6IwBQ8Q1Kkh+Kmb3/iQtQ6h53EunPqBsB ktlDHMbKWTvwTDTF3wxYIto2eHzpLRf5SOrdOzbNx4XWn0AZfYtK30WWmdsoQMxC4x/5 ZIx57vHzRCPWGnKbEDsMwBrY8cBM6pUs2syNKE0r+TV/M3m0V6qZE+bXegW6FKCyrvYe kw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36hk2kdc5u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:16 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118K5q7L157095; Mon, 8 Feb 2021 20:58:16 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by aserp3030.oracle.com with ESMTP id 36j4pmtyjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kby2g+o0ptLNX7hnBNCF2TpVsk2JRecd9zF0r/eoG6Zc7Gnx1KBdp+9pdtArD2aw4b0+jwBfiVy/j5pw/8LXn0qEeCR1ILz5/DZK22llM+8JRp1F/87TUlNY6IQOre1TiUKSr74isVD5R9uNbCVURnlpJt2mfF6DjON4XrNE1i6xDL6y3G1sX32Oia/5MrMnvbfvOH6jYPImzUQZHq8313FJ0hg7koL9AQQ+0bvXWCYa+wMOHP5iOluDzMS1URMuGjPD60omOQhjctWSMSxZZ6E4heb8QpM8hfHuiJsWfIP1mJ4CIAgd72JlJ6hVS8AOutY0RNQghyg+v3Cg9hwtSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=Ygiwt4uX7qDZzOtvZA1DbQuoR77lSt47Q9A4ybxUvBj51mZdUPPIID4Po7Ev6Kjd5hPUBQyeA6X1cMNiBp5MjgrW5DlIlTvdK0mtNyDwcxn1DUR4aVnRXyet70nTRv4rfKiyxrm0OimOzmQcdUKQKDbYNDROnJnv3xopY5axTBdmWqHxAetKG/xVOR/snvHCXrWUAnqg9D5bCJ2ZmK2Uiuxyo3hIjZd+/wbl5VQrcKld5ELmPwHSemogVfufQ6kZ/+Y36kCO4RMeyXzPtcIhSkVvS0F61MyocGSAMO5/8o0VGWfRm55HRQyR/o5XoCAgLzDge8JxTiAfDDrd3U+DXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wZfAvjwjzb4XNzJEnJp2r64ok9W1vDs4HG855mJ8SyE=; b=xXjtM8sfQiAapyeuOA6OCjvuKAyVQYk07az8isrb2R05SqlPt1tNLXNUeAJv73MNkO/0dLor+js9768CZSyqaah9YlTMK8L4qCVJ5Ig+r22VTaVZPqN//3pOMU65j0cVsT6vrbEeJ6nd8Oz19ZthPAsQawlCk5EBH8xZGTCzyCE= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:14 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:14 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 1/7] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Mon, 8 Feb 2021 15:57:53 -0500 Message-Id: <1612817879-21511-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 596a93ce-df9e-4e34-5a06-08d8cc744039 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OFdexJ8mQnsRkouzXSmmhzYc2jfOrOZVOK9m1agnOV9lbXiE4mAfyLPE0upJfpYqpHBIl5Sm5NfDtAWRmFzmDCYJCM+xIQKPv2EjXOzv+PEkVCurbrS/uVltn4yWnjviYc9aWNWg+EupaYxzyXlqt5WQs8n1lyj5V/SszaahmSUMNUnIGmRFRk2FBxjP0br78guPOUYV3/2ZqNsp5BvIPQP0pugzTzXUVaLqueZbQqNY2W2Nt29rUSCfHiI8fZJ0OdFfFhNwGq4e8gfYFPNMIL4rGVBeNQTClIaKEh/JMIuhsTnt3FfmOdcDLimUteoStZIvDe/+UZl1bS2a3C4AmUYUK61jsZhd4gw5hJOCAx2oHnmkVG2a8YoJb84pFa0X1agKTOxUoUBtIb3aTgbRWIfjehddAeBYB8X89iWlHwQcv9zrPHrHnaJ0vKSHA0YzfZqbXxUecDLQH6r8bP7ZToFV/IYeg0B9Gmoi85OqCU+kYYpdhzIS/4BWAPQgl+e7geAlCri7RXUy9YfXIbWUkQ== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(5660300002)(478600001)(66476007)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: nxoJq+ksMTzPaMB9krXRr0eDN1yTpg3fB4QXzs5sVRtoAJZdD1nMOV2Fmx8yCh+cM8Sz508omMFvFrBbHJXt1xsnMyGZVX+ob+tybLf0FkhfCQp1R+BtzCIdWKtOHCRZ/Z8dSCkKv6u7fyYYTpxFP8/Z/RkW5WHN/0Bt6l1JMY82Ij6+lUUkPVn4Ff+UYBzkHWUCHpGJGc6BtMiY5yGXF/woRneA+oxQ/mReG3k9uu7aWKRGFvI9aRJT4N+7XytVtfCyWsXae5XZ73+Uyes4mriSvhnOngacwIXCzZhvnMNmLYww/QxjWDiG7fKgZnDMn45Fal+LSHObiEOIbgHEBkKfTahutNS5KSNfrEhh3IC1ZSB5fdG+OMxkJNrLcwEUAMN0efW/8W+9vOt7OeU/W5MWK/ty+uQp3p9fjtG2Yc0N4kkn5JZu/sVJi6uYdgaGIJ//8iykgUPGJcoZBM4tqZC05a7WrukJAytpfqYp47eH+57oh3gAUcdpxJeioSKCaZsMiI1w2pWedEHssXLlfbKgPqBqMWzEDHYvfjxsIYc7eqUTOOE+JxBZfR+rmOl0uhxD0WhcrDePeAniIx9a/lvK42JwWUYY+gSIUBF4wImCROKdrCwOGMY7NIP1W/MlvjhE6SZ757pWvKSedTXy4BKtL0KKbxZJMNDl4C053K3mS4Kn67xf7oRcY6BevlXo0b1rmiXy1Ln22pIWhNRZOnyId+WnlGIg6tbXcoO3usjifgFZt8oi63G0p9q321am6ofvxVjiiy+UyIqinDXlQClU/IMnnWqtFHVfc2KzssvW00W0rtMNV6obB+GE0BmApFFfO+/FGQpo8RhdmQHLRNvmaP/HDO0Iv6uVnDEw99PrOEU7f9QZefCkTItBGblvqPeqxGY/rYO08gTqHBayzSDECTvXGoq3poKA7ml4IzCDRP/99qgk4oWPyxPMBMQ3brh20NN7EsXPyfwg2Yz5ni6k6WbbIIi162p8yFWwjJiSLTzXVKgpVSQaFQMxLCT8ChYgXD//ONd3xSVUugwjn2bizxb1F16xB/LiRUc8LVxhvHWYTqDsvbHx/cnb7pfgpEUmm5Edqqh+SGup+tspEau4ewI1BDzyStWGMNQrMU9Xdym/vVkf6CTz11/9jQZItB6u17EhLE29GCeghKoTjfAjchwN6l7clDJovD3sATsg6jw41UHYk+mOpWMkhWclKmZjL+UPgOT0I2RYQpNvL9kZid0ZM9ydQZviMQPaNlkWhyZ2MJXsrlNdONBp0PZLnofjTmMjAkfLk+wCkZviXNLmNVW8qO5CgiQ2derZLikuMZS3d6nBvJHIAtcRY1Yi X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 596a93ce-df9e-4e34-5a06-08d8cc744039 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:14.0659 (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: MRwycwVWYhst5fpCpF+ImZ2DFQh8mo0lOi+4gwImA71yoJszGC+KMbT+IABthCNvSuGZASw3J4EW7iFwywTHSARvVd/urBM08+cTV8oaREQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=141.146.126.78; envelope-from=eric.devolder@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com 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 --- tests/data/acpi/microvm/ERST | 0 tests/data/acpi/pc/ERST | 0 tests/data/acpi/q35/ERST | 0 tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 4 files changed, 4 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST create mode 100644 tests/data/acpi/pc/ERST create mode 100644 tests/data/acpi/q35/ERST diff --git a/tests/data/acpi/microvm/ERST b/tests/data/acpi/microvm/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST b/tests/data/acpi/q35/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523..e004c71 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,5 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/ERST", +"tests/data/acpi/q35/ERST", +"tests/data/acpi/microvm/ERST", + From patchwork Mon Feb 8 20:57:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076909 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UPPERCASE_50_75,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41FF4C433DB for ; Tue, 9 Feb 2021 00:30:53 +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 70BC964E6E for ; Tue, 9 Feb 2021 00:30:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70BC964E6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Gvb-0002wi-Cf for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 19:30:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc3-0000ny-GJ for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:28 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dbx-0002iB-LS for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:27 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118Kv5HL009842; Mon, 8 Feb 2021 20:58: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-2020-01-29; bh=j6BRnNCZQPhjjgJ8pvPJxU5tO9nSvEfSiPyzTiveAcE=; b=lluu5vA8+v8urEgVBs2NY8wB68sbIP6jLviQVBG+BoeZKfnEJ//b39gNPv/8M0KkGqIP JGf07GilgETQdPNNXAlnSEfQmk1FQFuWsaTaE/bhTKAbtmGERvymsEytJu+XZITlInr0 nDIpF+oSGHUGOHbVFv8CsT3/D1qcV6yRwlI0z57ZuN3waQFt60+YfPXXtAHglY27ehit GnymHfD88R/tqQwQD0IWHUjymv+A9YKl3pimXBDU8QfpBDbHr1X78UmxcrwMcN7u6i0A bx/n2W+fwcXxhvCj+RbfPHLDDjh3PMq40fe/Y/KI4qd8dm3RQ/xGSZ60OR2wgt+4e89s Dw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36hk2kdc5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:17 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118K5q7M157095; Mon, 8 Feb 2021 20:58:17 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by aserp3030.oracle.com with ESMTP id 36j4pmtyjb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aWu4dYRtAWxmuxIRWaCVvrXFSvj5zpSK6TVr/aNZf8H3muwzpTEF1AGt7JuzcN2eoxK1qUiKlL4csHeqwZ3vjlyOY4SeoOLDAXROoUwh4XXaEIZ7rgf+M1u7BVYgYKvWTTr8y0wbSAlAVodhwp8+t0Q2OKDGbz3IBB2lSbP3wa7zMrCPRx2DTRJScqBMYoKWzzYYL+1XefZZoLzSDXlE1CoWyc/NerY613hcBM7O+6Yb1gBgZ8pIaqPieKLRfeJKzlbNwtnBbCAK2PuLhboYwn8chBTwNLMXv6lHTMRVgfQpUg7kusL4Uao17VF6HiG5kXQLRxs2azGw0BtBOvkqfw== 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=j6BRnNCZQPhjjgJ8pvPJxU5tO9nSvEfSiPyzTiveAcE=; b=Eh8FDhCv96+Ey7V7UswYPjXxx3kgUcbi5VicBleaJXMGM9NZU6occ06W7H3ve09xL0enkFS0U/G2FX70Lq+g+qithHzhp+BHkYN/2sW5TMM0eoNaiy62b5FIr0c4V1l7vs5W9YPyE4llHue56iA2HDImHufuaY8xO+tVBJwrcy+BKjfVuhWNjzfs1MGn0W+40u2Uq4aVAtTiY0rYeeh3hew/uRMbvyEtTpnQdbLn6GwgvWOmyhpdZAm6YkK6/ue0NmM7X+QkLaHA0TPl/+WA8snvxnY0fcJfXT2F1KUl7Xt5oNk+Wp5E1a/XCH+tAm/Mkw71jfUyOTxNxEpqLpPktQ== 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=j6BRnNCZQPhjjgJ8pvPJxU5tO9nSvEfSiPyzTiveAcE=; b=Y/WuPKsyeMSActbGnfc4QSANM9LHPfHVpd6bfNVNJvnrDy7yFPJwzJNWgPM+GDiJQFfXYe8qv8XAKwex60UDs1OEBG8gnvBtlRrW6ndcqcO+m5T3vI4GnYKbevnKLqxA+WkaNDfZrmTBSsI6Y7xYHS6HcVaOInwA+zXri+4bdDk= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:15 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:15 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 2/7] ACPI ERST: header file for erst Date: Mon, 8 Feb 2021 15:57:54 -0500 Message-Id: <1612817879-21511-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cca0781-887b-4fc2-13d7-08d8cc744111 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yEC9pdn2k1MpEtsFhZVM2dSYzDBS0oO6m2iPgyPM2eMOYcfeNNABRlG6bm/SPwJ3mkkgZUJR1+9iFjp54uBmLWLPLDG4huE7pqMJAU1AtBG4JU7i8L+A25mgNzM+h1SI/7Vfd3sBMQuuQaXuPmY0ryWYVFTFIehI8KBPj+BNtk0jf0hWZsMjLnGzbMmq/6jaOy8yUdwCU6KKmNPVfwVNcqLAAQWe7WLVPm3ETTJ0UoxseRxgc9GZ6G9QrkkdZ1Dsm5phIvNkuzuJ/9wBRHiw5appX8TNRysyb2lAGBmXrNdhQLZifqTdAejuP5QlvLOnDNGVGiFuMgpbG8c+1F1OUS4VBprl1UiNjBZA2sOEO0Zl+q7RqYusaAR5l1MwiSvLZ6DZf+MvlyoIBjs3ycmqQpj2d47tBXhWTedohrE/kRypGe5o1NNHE7fLWocShRAMt11H4std8FLQcJ8jRPIO/IHAS/BwkZF31u72xp5a8XxwfQUrA3TapXTSiuIuykzMrLwMUJ+EehL0y69IWxpva7FMO8fQfr1ckVGa/e7tEpz7EU7d4VnH9b+h6ovYS6GKXsUCFZrL2mi3RvxqtdXKIftq4eR15gshHwNRyRSpik/8W96NjpwqDasG3XzoyuLhbS+1zl5mXd5tPxYIv70g5Q== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(5660300002)(478600001)(66476007)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HESCG7RDqLYueEulU6dWnwNIp1VbxNmbsdTrd7Jrwx85CaweSAl9AACRApVBaunoM3haVweY7s6UoWjYlJTtDnSdyCtby1YQ0d8m58fxhfkO1/Qqvhqd9n6k0P+zvYVzjMchxL8IEigCip0itfC/HYWn05CoP/X6DSyYCCZyRVq9LVz2OBRhj8hwKkqwaWpZuME0u2vq/UWgzl27ejh341eNBefLOqSI3HVmw+3aIYmtxxh3x8H6h2xOY12DXAurF52NzrxNPT0XDKEC07jejRfOBuJ2oCkkF85GZhrMDjYzbm3Bibk/Ce5sm3jN4AoczeCCfRykFB4flXrpVBXZvLBG1sjevy/dqy8oIgJ680LFVeDD5hqHXckEtEJr4cD+T3PXf4l97EaXfZULMrDZB50mXffLi1zJFgNDnCdDKPsCR6hsf0Tn2rB0dkvZZMnQrw2E9OkW1V9Jfiitb1VZSpAFImmG+VaHU2qacDKudm1CYkvjantbEfX7re/Pv2pG1qmxrPLjUkR5ImuJg2r4OZhqaT6wY5rRRQHw2TBSI6xnnDAZrTbv5/WIoVjcg2QT7gUQALk+XMA3UlzDKhNCH/8DAkwwWiTMtgESFhrsRMTPK1TMiC3ozUcQC9VRdghmS043zFbjRyvaFGBMDiV1KjjbhmW1G4l/40IQ++5in7VQ10wo//TniNc+5RfgFv2/Xt3mAK9533M0y2EDKBQsXVaR9dqmG/zgywk3UnVUjgF4M9zT9qPDU0CFh8f1J6c1X4TezgATzW8dEok0Kmcs2aTU1kik7c+aGJgBDR5QrGUa99+ySebWQzdOoyzjAAxqxzcDzhuV2bxcohWZExibDNXteFHxlqDD+SigscSmtBjbpLHg/wSzTTgGlKkx9hPR8nAL+MuIjMAkofg1mKQB3HVHjO/Whi3TXztXfmnCRnblj/ylEmcS3M+TzwM5nKgw4IoaSrm1Cx6SKOoVdgkvRqW/enGwc/Y8ljhJXQQJJFw5329eLOFnzQ886V/Yg29RHi1JGvWomkO69iCYonQLK2QseTV7Bos1U4NnJuMqA+3h4RBSo3xTuljLT5KC46DOrsKsgZjNbaJbWWGLP22AAbcN2nmiNNG2jWPRHt8cBceQ+ki+mnHHOUO16lSqhIDUWv7Hy63Jp3FAZTXFAgDsFbjYz/Q62qpwJ3eebhsI1choUa5ajE668lkxs+SPjkCEK59AJ+T9u2MGhNVkchaWridML0Bv3zKSSbuWHnHrWN0y98pcIVq4NQMvefhi7mbKmBhmyALM+ivNL3MWFX8uZEgw4GPOx5SfiHXWnOabyL2ZXn+9uuLxOSKsOP77mP3Y X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cca0781-887b-4fc2-13d7-08d8cc744111 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:15.4578 (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: 9wuZxZKf58X8+FF4SrUyBUY87tF2sad0Ps1E3QraRpyuoCcY7/BXNfFF1zWhluVKmFGNOhajH5KHdl4/eys08aP6ui/ROuu4E4mlp+mC6gI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=141.146.126.78; envelope-from=eric.devolder@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, kwilk@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change introduces the defintions for ACPI ERST support. Signed-off-by: Eric DeVolder --- include/hw/acpi/erst.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 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..be9b3fa --- /dev/null +++ b/include/hw/acpi/erst.h @@ -0,0 +1,77 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * Copyright (c) 2020 Oracle and/or its affiliates. + * + * See ACPI specification, "ACPI Platform Error Interfaces" + * "Error Serialization" + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ +#ifndef HW_ACPI_ERST_H +#define HW_ACPI_ERST_H + +void build_erst(GArray *table_data, BIOSLinker *linker, hwaddr base); + +#define TYPE_ACPI_ERST "acpi-erst" + +#define ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION 0x0 +#define ACPI_ERST_ACTION_BEGIN_READ_OPERATION 0x1 +#define ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION 0x2 +#define ACPI_ERST_ACTION_END_OPERATION 0x3 +#define ACPI_ERST_ACTION_SET_RECORD_OFFSET 0x4 +#define ACPI_ERST_ACTION_EXECUTE_OPERATION 0x5 +#define ACPI_ERST_ACTION_CHECK_BUSY_STATUS 0x6 +#define ACPI_ERST_ACTION_GET_COMMAND_STATUS 0x7 +#define ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER 0x8 +#define ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER 0x9 +#define ACPI_ERST_ACTION_GET_RECORD_COUNT 0xA +#define ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION 0xB +#define ACPI_ERST_ACTION_RESERVED 0xC +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0xD +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH 0xE +#define ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0xF +#define ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS 0x10 +#define ACPI_ERST_MAX_ACTIONS \ + (ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS + 1) + +#define ACPI_ERST_STATUS_SUCCESS 0x00 +#define ACPI_ERST_STATUS_NOT_ENOUGH_SPACE 0x01 +#define ACPI_ERST_STATUS_HARDWARE_NOT_AVAILABLE 0x02 +#define ACPI_ERST_STATUS_FAILED 0x03 +#define ACPI_ERST_STATUS_RECORD_STORE_EMPTY 0x04 +#define ACPI_ERST_STATUS_RECORD_NOT_FOUND 0x05 + +#define ACPI_ERST_INST_READ_REGISTER 0x00 +#define ACPI_ERST_INST_READ_REGISTER_VALUE 0x01 +#define ACPI_ERST_INST_WRITE_REGISTER 0x02 +#define ACPI_ERST_INST_WRITE_REGISTER_VALUE 0x03 +#define ACPI_ERST_INST_NOOP 0x04 +#define ACPI_ERST_INST_LOAD_VAR1 0x05 +#define ACPI_ERST_INST_LOAD_VAR2 0x06 +#define ACPI_ERST_INST_STORE_VAR1 0x07 +#define ACPI_ERST_INST_ADD 0x08 +#define ACPI_ERST_INST_SUBTRACT 0x09 +#define ACPI_ERST_INST_ADD_VALUE 0x0A +#define ACPI_ERST_INST_SUBTRACT_VALUE 0x0B +#define ACPI_ERST_INST_STALL 0x0C +#define ACPI_ERST_INST_STALL_WHILE_TRUE 0x0D +#define ACPI_ERST_INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E +#define ACPI_ERST_INST_GOTO 0x0F +#define ACPI_ERST_INST_SET_SRC_ADDRESS_BASE 0x10 +#define ACPI_ERST_INST_SET_DST_ADDRESS_BASE 0x11 +#define ACPI_ERST_INST_MOVE_DATA 0x12 + +#endif + From patchwork Mon Feb 8 20:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076913 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 36848C433E0 for ; Tue, 9 Feb 2021 00:34:03 +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 6484364EA1 for ; Tue, 9 Feb 2021 00:34:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6484364EA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Gyf-0006ZJ-8K for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 19:34:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc6-0000p4-PS for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:30 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:44682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dbz-0002k3-Ca for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:29 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KvJZv137457; Mon, 8 Feb 2021 20:58:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=T0GyGeaqVtGEmoALF8F7WGnLy1pGaoAr8R0iSGVV0Bg=; b=eObwb2l8UcyR5Bv8/WcxvS0CWvPDIAw80khi9PTEUQ11i4muEOKyGoCXhTKVe0upDQIL yYy8zD8BRSZ9kBitabKWeptZC9ykzYUcIKXT80/BO7wJiG0RXNJRqsM8W57mmK3HeOUy NGyHkSvFz6MYQMHW42pCktPJreM2hcfMBnCJkb+r9PO51304g1tmgipXjJNXbbTlPfV/ RhJraxdQonXNxp+W/aIPPQihh4tHyS5RKGObknPd8tvOeTXxFjM51SUbxk5kKNl1VmvP VS6SoK4K7PbH7EtRByKb93GJv8vZvv+ZVas1ZCooAgR8ozwd4nEs5DTgA9RWjRmlIR03 ig== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 36hkrmware-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58: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 118K5LP7020761; Mon, 8 Feb 2021 20:58:19 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by aserp3020.oracle.com with ESMTP id 36j510b3c5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mFdwR2c6nTHfCCwbKmavzsPPcwiotbUW3ei3TgyLR76TKa6MbisMTXyRQLec8mDPWDf/JwDIoVs/hILncNwm735RzG1+cFcCnOE3P4YseMA5GqPk7x+osk3z1Ue60qrYuIS3MNqoRdU3t9XWZu80FiRM9O2vB+w0LHAlYW97cVftTGIE6qWiAkcURtMZ7aQacY/sWY9PNOJ1uN0YeWF1kgmc1smROWp++Q4ck3ifsqrLp6BmRUSDEOt2lbrqoJsfY2zihvJ5WPAHevRgq/ilyKvcKeDtj1ip9Ld5afdYMrvFJYfxKFDUEe01ttryl2gji3azdE2k/uLYpifvd8oYdw== 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=T0GyGeaqVtGEmoALF8F7WGnLy1pGaoAr8R0iSGVV0Bg=; b=hViQrVC0Q3TkFLSqYzCAQ6puZJtWlS6iJGZUSd+kdxNsL15GtLu/JnNp/y0JBDgH2L2viiuAjR40Qgls4wIefdxJ6va1YnYa12Hhe6w1CYiU0by8HMyjkUq3/MmxdNF9l/uoJHjofy8J2ckR47YQJO5MXh12dt+wCdgUN2HtvSQjp0mQwyBkZJGyhOpoHxA5jej4d+nenU6Jn6eIgQukdTXz+8M973DIq8O95+qEF1A2BP5FHerNFNT6fvedvjU5rnE8wdxQWcgs2sBiPPwUCWUXsT58iouEmU39nhnb+wv0jNjLBhPrS1m2DTU7823OYxu+5CVmC/zTkLeUG4LYaw== 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=T0GyGeaqVtGEmoALF8F7WGnLy1pGaoAr8R0iSGVV0Bg=; b=OXJUm9Pc6ocSMpQx5Jlob37BjnZ2grsEkOooH0FOrqzoqYkx2I7xnPOimIi1s7qCp8FpRhRvaDe+Nx7e+MEu0SVfZQtMo4fLh8zc7St1sSCuB7rN2y4REsjVQcj3flBU2jLCVTDmpSPbC3ZcK5ocP7EPrfKXz4cqIrw672//zBA= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:17 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:17 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 3/7] ACPI ERST: support for ACPI ERST feature Date: Mon, 8 Feb 2021 15:57:55 -0500 Message-Id: <1612817879-21511-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a199c2cc-7b0d-4a6d-700c-08d8cc7441f3 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 17CGgo1hWf6hjsl5kvU7pgRr+WhsgG6L4/OC34u808tzAq7gz+lYeM83Qiq+kN7bUTPLncN8cGyV5zlhoJZPLiXx9QLV5xpwrONqk35iXEQZCGhenVk6mDdA39vwKRNVNF4wSemZTKGhyIM6OeyvJVFY4XK5lGb1YfhMMHqDiPlqePasc0KkplepdFmIIvo81+doqVwFSDafQD/jl9IUEKPmKe4arkxMRFjMIE/vHuTZQrgDk2mOSJUAAsDeoyDf12kGtMp+cT/iMhQpyDVYO92EMLfdU/piipKdJeXUfkzVCIPBdqSea3w8dJ7Mo/5Wc9UB9eUlMbGGL1Hym3AWkXncitmA/keZqWAd2wl0Xet+COwQzsxnMFPFiVkmAF0mxSD8JksZoz7fP7Tm6DzU5pHysB0NwxCnXN1mL0hl9j0GemXK4fymqseubtk1VQCIiEEy3yrxgp05JQHaF6EK1Q8pvZs6L+JgMtWz+39v5ch4YRFc/LVl/3EJC9FyEu3YWS1FCjKqXsQta4MHxHbVXZlo/32Sz7CG/iI17IaGSr2SCACbnldP/PEQ1i0rZEoTJxrUFbwlud0J1MSajw4j88FhXCz0kKbovw1g2lbJw00OJ4UvVY6wUgsCVsAWToFFaRve+sc/YJJn1QjzsLATsw== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(30864003)(36756003)(16526019)(956004)(966005)(5660300002)(478600001)(66476007)(83380400001)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: rhUt4XesUhB1KVLNmYFUhh2mSu5BfqkwUGrTAEKYmUDAKGXBWBtmlxEBUydEpU0mqkYrKq5Orj0nHd85K/CWOne+cev9xQTb35A4+RecO1hGX3PuLfUen9iLmARPEC+Y6++Nz+H4TBXyBJTuJGp7EI4iKJU+xBfIWW+dTuWcIleknP9wxGpUDNfrsnZiWjFaQmvy20+r++fBK34uK1ioaIwWiHim8VN486ot3JtYItQfTdF0FMVNk9PUQUAehm7flqsdZBkj2pxWUVfCPGVr3/Zh69kAuj0aEG430wVU1AgLGD0KXVMyiL91KsFdafg67IGmodnLRViylCtZUPZxzftQhwnWUg0xZwUlo4GpTa+qSciNakD/dc2b5lbhCPndotfQ6R+QZxviDu7vWfL/6zlaq+oqF371Uf/EVlWIRtxT/mK/0EgWDvDq8flDQD/0PIf13dJgC+qvH5Qg5azdaqrL2i69VKpOAtZtlZTIflho2duXAJ6SKzs+7rVJlMAmpFXzyiHdLuuxWzLEG37P0kKRyDye2sogqVkrD9QlDAvIErlbfSMdQPa6kpZHQJ2MuO5XZzIqhWVDki+Uc4W8iNV4lD1mCDRtMUqvfeqGkJDjfP398IrEdLHcU2oExJ28Qkg9K5dvfWlgYh/OEy143rxq/H/kIORrFxa+i4kjOw+869VioRBM8FqlxG9KVCyivoQKvKJXntSZR7i4rwVLnzOEiAWkOfr6TuFaevGcFYx2wkwGzoWrvfcebdvI0guoV4h7G9iO7UjVIOaJhmlHpH6FBKiK5Z1PGV/EQhHjoLrcgGMP+m+qkakcC2F7GT6aKTxlm2+dUK5YTvAYPlUfuQvGF4jhBA7CHU3qSJ/9qnItMFsqzPS3s1elIq9DD6NPNr0YHg7Zx8q7N8lJO2yaRUoELKsOe3l+0PIW15QDhc5H1uWSwEtdyQgfPm/a28Ec3jHNsIYO0geTuTDB53aM5Ur4yLcg9oITJDU18RUKFv6l1LE1/lLlo0XjV4KScFF4b7alOeznT1RmrYyvw/sUjut8Ru+wYMYqmc07wgISnc4hQBxB93FE8qFpnvHatNa8dA72qtDYU+hrt1Z5qLezflXq8C45jm1GTcjYq4fVlbv6ogQi3RjkDT14NRuai8d/oPPes2Hxi1XIPLZPALZfXnMGvyEeQFXkc2xHAfUbV6wbRhnic7o9M4VLKvCqSeOlIcC5a7uy3nzPAf4HUEy9OXpqmOXilYnov6DXcpOrFAGtuYVXxYx70+B6kmoKmfoXivhruwmRlCu2pSNtAUq3MCLKdwRjoA1Ic0Lm6dfMqlicLxFL9AO6Z0FXqBahJ08h X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a199c2cc-7b0d-4a6d-700c-08d8cc7441f3 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:16.9104 (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: WcYJ5pZf5tXdk9ckMOTusoU2DFJ7XhFQSLhznNosLbgXox04KaJRHXSbZnErhw2zSA28fQFy70OMC304a1iaSvuleMOvGzZ0pBUinocnCFg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=156.151.31.85; envelope-from=eric.devolder@oracle.com; helo=userp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change implements the support for the ACPI ERST feature[1,2]. The size of the ACPI ERST storage is declared via the QEMU global parameter acpi-erst.size. The size can range from 64KiB to to 64MiB. The default is 64KiB. The location of the ACPI ERST storage backing file is delared via the QEMU global parameter acpi-erst.filename. The default is acpi-erst.backing. [1] "Advanced Configuration and Power Interface Specification", version 6.2, May 2017. https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf [2] "Unified Extensible Firmware Interface Specification", version 2.8, March 2019. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf Signed-off-by: Eric DeVolder --- hw/acpi/erst.c | 952 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 952 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..3a342f9 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,952 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * Copyright (c) 2020 Oracle and/or its affiliates. + * + * See ACPI specification, + * "ACPI Platform Error Interfaces" : "Error Serialization" + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#include +#include +#include + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/sysbus.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 "hw/acpi/erst.h" + +#ifdef _ERST_DEBUG +#define erst_debug(fmt, ...) \ + do { fprintf(stderr, fmt, ## __VA_ARGS__); fflush(stderr); } while (0) +#else +#define erst_debug(fmt, ...) do { } while (0) +#endif + +/* See UEFI spec, Appendix N Common Platform Error Record */ +/* UEFI CPER allows for an OSPM book keeping area in the record */ +#define UEFI_CPER_RECORD_MIN_SIZE 128U +#define UEFI_CPER_SIZE_OFFSET 20U +#define UEFI_CPER_RECORD_ID_OFFSET 96U +#define IS_UEFI_CPER_RECORD(ptr) \ + (((ptr)[0] == 'C') && \ + ((ptr)[1] == 'P') && \ + ((ptr)[2] == 'E') && \ + ((ptr)[3] == 'R')) +#define THE_UEFI_CPER_RECORD_ID(ptr) \ + (*(uint64_t *)(&(ptr)[UEFI_CPER_RECORD_ID_OFFSET])) + +#define ERST_INVALID_RECORD_ID (~0UL) +#define ERST_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_CSR_ACTION (0UL << 3) /* action (cmd) */ +#define ERST_CSR_VALUE (1UL << 3) /* argument/value (data) */ + +/* + * As ERST_IOMEM_SIZE is used to map the ERST into the guest, + * it should/must be an integer multiple of PAGE_SIZE. + * NOTE that any change to this value will make any pre- + * existing backing files, not of the same ERST_IOMEM_SIZE, + * unusable to the guest. + */ +#define ERST_IOMEM_SIZE (2UL * 4096) + +/* + * This implementation is an ACTION (cmd) and VALUE (data) + * interface consisting of just two 64-bit registers. + */ +#define ERST_REG_LEN (2UL * sizeof(uint64_t)) + +/* + * The space not utilized by the register interface is the + * buffer for exchanging ERST record contents. + */ +#define ERST_RECORD_SIZE (ERST_IOMEM_SIZE - ERST_REG_LEN) + +/* + * Mode to be used for backing file + */ +#define ERST_BACKING_FILE_MODE 0644 /* S_IRWXU|S_IRWXG */ + +#define ACPIERST(obj) \ + OBJECT_CHECK(ERSTDeviceState, (obj), TYPE_ACPI_ERST) +#define ACPIERST_CLASS(oc) \ + OBJECT_CLASS_CHECK(ERSTDeviceStateClass, (oc), TYPE_ACPI_ERST) +#define ACPIERST_GET_CLASS(obj) \ + OBJECT_GET_CLASS(ERSTDeviceStateClass, (obj), TYPE_ACPI_ERST) + +static hwaddr erst_base; + +typedef struct { + SysBusDevice parent_obj; + + MemoryRegion iomem; + uint32_t prop_size; + char *prop_filename; + hwaddr base; + + uint8_t operation; + uint8_t busy_status; + uint8_t command_status; + uint32_t record_offset; + uint32_t record_count; + uint64_t reg_action; + uint64_t reg_value; + uint64_t record_identifier; + + unsigned next_record_index; + uint8_t record[ERST_RECORD_SIZE]; /* read/written directly by guest */ + uint8_t tmp_record[ERST_RECORD_SIZE]; /* intermediate manipulation buffer */ + uint8_t *nvram; /* persistent storage, of length prop_size */ + +} ERSTDeviceState; + +static void update_erst_backing_file(ERSTDeviceState *s, + off_t offset, const uint8_t *data, size_t length) +{ + int fd; + + /* Bounds check */ + if ((offset + length) > s->prop_size) { + error_report("update: off 0x%lx len 0x%lx > size 0x%lx out of range", + (long)offset, (long)length, (long)s->prop_size); + return; + } + + fd = open(s->prop_filename, O_WRONLY | O_CREAT, ERST_BACKING_FILE_MODE); + if (fd > 0) { + off_t src; + size_t wrc = 0; + src = lseek(fd, offset, SEEK_SET); + if (offset == src) { + wrc = write(fd, data, length); + } + if ((offset != src) || (length != wrc)) { + error_report("ERST write failed: %d %d", (int)wrc, (int)length); + } + close(fd); + } else { + error_report("open failed: %s : %d", s->prop_filename, fd); + } +} + +static unsigned copy_from_nvram_by_index(ERSTDeviceState *s, unsigned index) +{ + /* Read a nvram[] entry into tmp_record */ + unsigned rc = ACPI_ERST_STATUS_FAILED; + off_t offset = (index * ERST_RECORD_SIZE); + + if ((offset + ERST_RECORD_SIZE) <= s->prop_size) { + memcpy(s->tmp_record, &s->nvram[offset], ERST_RECORD_SIZE); + rc = ACPI_ERST_STATUS_SUCCESS; + } + return rc; +} + +static unsigned copy_to_nvram_by_index(ERSTDeviceState *s, unsigned index) +{ + /* Write entry in tmp_record into nvram[], and backing file */ + unsigned rc = ACPI_ERST_STATUS_FAILED; + off_t offset = (index * ERST_RECORD_SIZE); + + if ((offset + ERST_RECORD_SIZE) <= s->prop_size) { + memcpy(&s->nvram[offset], s->tmp_record, ERST_RECORD_SIZE); + update_erst_backing_file(s, offset, s->tmp_record, ERST_RECORD_SIZE); + rc = ACPI_ERST_STATUS_SUCCESS; + } + return rc; +} + +static int lookup_erst_record_by_identifier(ERSTDeviceState *s, + uint64_t record_identifier, bool *record_found, bool alloc_for_write) +{ + int rc = -1; + int empty_index = -1; + int index = 0; + unsigned rrc; + + *record_found = 0; + + do { + rrc = copy_from_nvram_by_index(s, (unsigned)index); + if (rrc == ACPI_ERST_STATUS_SUCCESS) { + uint64_t this_identifier; + this_identifier = THE_UEFI_CPER_RECORD_ID(s->tmp_record); + if (IS_UEFI_CPER_RECORD(s->tmp_record) && + (this_identifier == record_identifier)) { + rc = index; + *record_found = 1; + break; + } + if ((this_identifier == ERST_INVALID_RECORD_ID) && + (empty_index < 0)) { + empty_index = index; /* first available for write */ + } + } + ++index; + } while (rrc == ACPI_ERST_STATUS_SUCCESS); + + /* Record not found, allocate for writing */ + if ((rc < 0) && alloc_for_write) { + rc = empty_index; + } + + return rc; +} + +static unsigned clear_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + bool record_found; + int index; + + index = lookup_erst_record_by_identifier(s, + s->record_identifier, &record_found, 0); + if (record_found) { + memset(s->tmp_record, 0xFF, ERST_RECORD_SIZE); + rc = copy_to_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + s->record_count -= 1; + } + } + + return rc; +} + +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_FAILED; + + if (s->record_offset < (ERST_RECORD_SIZE - UEFI_CPER_RECORD_MIN_SIZE)) { + uint64_t record_identifier; + uint8_t *record = &s->record[s->record_offset]; + bool record_found; + int index; + + record_identifier = (s->record_identifier == ERST_INVALID_RECORD_ID) + ? THE_UEFI_CPER_RECORD_ID(record) : s->record_identifier; + + index = lookup_erst_record_by_identifier(s, + record_identifier, &record_found, 1); + if (index < 0) { + rc = ACPI_ERST_STATUS_NOT_ENOUGH_SPACE; + } else { + if (0 != s->record_offset) { + memset(&s->tmp_record[ERST_RECORD_SIZE - s->record_offset], + 0xFF, s->record_offset); + } + memcpy(s->tmp_record, record, ERST_RECORD_SIZE - s->record_offset); + rc = copy_to_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + if (!record_found) { /* not overwriting existing record */ + s->record_count += 1; /* writing new record */ + } + } + } + } + + return rc; +} + +static unsigned next_erst_record(ERSTDeviceState *s, + uint64_t *record_identifier) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + unsigned index; + unsigned rrc; + + *record_identifier = ERST_INVALID_RECORD_ID; + + index = s->next_record_index; + do { + rrc = copy_from_nvram_by_index(s, (unsigned)index); + if (rrc == ACPI_ERST_STATUS_SUCCESS) { + if (IS_UEFI_CPER_RECORD(s->tmp_record)) { + s->next_record_index = index + 1; /* where to start next time */ + *record_identifier = THE_UEFI_CPER_RECORD_ID(s->tmp_record); + rc = ACPI_ERST_STATUS_SUCCESS; + break; + } + ++index; + } else { + if (s->next_record_index == 0) { + rc = ACPI_ERST_STATUS_RECORD_STORE_EMPTY; + } + s->next_record_index = 0; /* at end, reset */ + } + } while (rrc == ACPI_ERST_STATUS_SUCCESS); + + return rc; +} + +static unsigned read_erst_record(ERSTDeviceState *s) +{ + unsigned rc = ACPI_ERST_STATUS_RECORD_NOT_FOUND; + bool record_found; + int index; + + index = lookup_erst_record_by_identifier(s, + s->record_identifier, &record_found, 0); + if (record_found) { + rc = copy_from_nvram_by_index(s, (unsigned)index); + if (rc == ACPI_ERST_STATUS_SUCCESS) { + if (s->record_offset < ERST_RECORD_SIZE) { + memcpy(&s->record[s->record_offset], s->tmp_record, + ERST_RECORD_SIZE - s->record_offset); + } + } + } + + return rc; +} + +static unsigned get_erst_record_count(ERSTDeviceState *s) +{ + /* Compute record_count */ + off_t offset; + + s->record_count = 0; + offset = 0; + do { + uint8_t *ptr = &s->nvram[offset]; + uint64_t record_identifier = THE_UEFI_CPER_RECORD_ID(ptr); + if (IS_UEFI_CPER_RECORD(ptr) && + (ERST_INVALID_RECORD_ID != record_identifier)) { + s->record_count += 1; + } + offset += ERST_RECORD_SIZE; + } while (offset < (off_t)s->prop_size); + + return s->record_count; +} + +static void load_erst_backing_file(ERSTDeviceState *s) +{ + int fd; + struct stat statbuf; + + erst_debug("+load_erst_backing_file()\n"); + + /* Allocate and initialize nvram[] */ + s->nvram = g_malloc(s->prop_size); + memset(s->nvram, 0xFF, s->prop_size); + + /* Ensure backing file at least same as prop_size */ + if (stat(s->prop_filename, &statbuf) == 0) { + /* ensure prop_size at least matches file size */ + if (statbuf.st_size < s->prop_size) { + /* Ensure records are ERST_INVALID_RECORD_ID */ + memset(s->nvram, 0xFF, s->prop_size - statbuf.st_size); + update_erst_backing_file(s, + statbuf.st_size, s->nvram, s->prop_size - statbuf.st_size); + } + } + + /* Pre-load nvram[] from backing file, if present */ + fd = open(s->prop_filename, O_RDONLY, ERST_BACKING_FILE_MODE); + if (fd > 0) { + size_t rrc = read(fd, s->nvram, s->prop_size); + (void)rrc; + close(fd); + /* + * If existing file is smaller than prop_size, it will be resized + * accordingly upon subsequent record writes. If the file + * is larger than prop_size, only prop_size bytes are utilized, + * the extra bytes are untouched (though will be lost after + * a migration when the backing file is re-written as length + * of prop_size bytes). + */ + } else { + /* Create empty backing file */ + update_erst_backing_file(s, 0, s->nvram, s->prop_size); + } + + /* Initialize record_count */ + get_erst_record_count(s); + + erst_debug("-load_erst_backing_file() %d\n", s->record_count); +} + +static uint64_t erst_rd_reg64(hwaddr addr, + uint64_t reg, unsigned size) +{ + uint64_t rdval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + rdval = reg; + rdval >>= shift; + rdval &= mask; + + return rdval; +} + +static uint64_t erst_wr_reg64(hwaddr addr, + uint64_t reg, uint64_t val, unsigned size) +{ + uint64_t wrval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + val &= mask; + val <<= shift; + mask <<= shift; + wrval = reg; + wrval &= ~mask; + wrval |= val; + + return wrval; +} + +static void erst_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + + if (addr < ERST_REG_LEN) { + /* + * NOTE: All actions/operations/side effects happen on the WRITE, + * by design. The READs simply return the reg_value contents. + */ + erst_debug("ERST write %016lx %10s val %016lx sz %u", + addr, erst_reg(addr), val, size); + /* The REGISTER region */ + switch (addr) { + case ERST_CSR_VALUE + 0: + case ERST_CSR_VALUE + 4: + s->reg_value = erst_wr_reg64(addr, s->reg_value, val, size); + break; + case ERST_CSR_ACTION + 0: +/* case ERST_CSR_ACTION+4: as coded, not really a 64b register */ + switch (val) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACPI_ERST_ACTION_END_OPERATION: + s->operation = val; + break; + case ACPI_ERST_ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACPI_ERST_ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = ACPI_ERST_STATUS_SUCCESS; + break; + case ACPI_ERST_ACTION_END_OPERATION: + s->command_status = ACPI_ERST_STATUS_SUCCESS; + break; + default: + s->command_status = ACPI_ERST_STATUS_FAILED; + break; + } + s->record_identifier = ERST_INVALID_RECORD_ID; + s->busy_status = 0; + } + break; + case ACPI_ERST_ACTION_CHECK_BUSY_STATUS: + s->reg_value = s->busy_status; + break; + case ACPI_ERST_ACTION_GET_COMMAND_STATUS: + s->reg_value = s->command_status; + break; + case ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER: + s->command_status = next_erst_record(s, &s->reg_value); + break; + case ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACPI_ERST_ACTION_GET_RECORD_COUNT: + s->reg_value = s->record_count; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + s->reg_value = s->base + ERST_REG_LEN; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + s->reg_value = ERST_RECORD_SIZE; + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0; /* correct/intended value */ + break; + case ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS: + /* + * 100UL is max, 10UL is nominal + */ + s->reg_value = ((100UL << 32) | (10UL << 0)); + break; + case ACPI_ERST_ACTION_RESERVED: + default: + /* + * NOP + */ + break; + } + break; + default: + /* + * All other register writes are NO-OPs + */ + break; + } + } else { + /* The RECORD region */ + unsigned offset = addr - ERST_REG_LEN; + uint8_t *ptr = &s->record[offset]; + switch (size) { + default: + case sizeof(uint8_t): + *(uint8_t *)ptr = (uint8_t)val; + break; + case sizeof(uint16_t): + *(uint16_t *)ptr = (uint16_t)val; + break; + case sizeof(uint32_t): + *(uint32_t *)ptr = (uint32_t)val; + break; + case sizeof(uint64_t): + *(uint64_t *)ptr = (uint64_t)val; + break; + } + } +} + +static uint64_t erst_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + if (addr < ERST_REG_LEN) { + switch (addr) { + case ERST_CSR_ACTION + 0: + case ERST_CSR_ACTION + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_CSR_VALUE + 0: + case ERST_CSR_VALUE + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + break; + } + erst_debug("ERST read %016lx %10s val %016lx sz %u\n", + addr, erst_reg(addr), val, size); + } else { + /* + * The RECORD region + */ + uint8_t *ptr = &s->record[addr - ERST_REG_LEN]; + switch (size) { + default: + case sizeof(uint8_t): + val = *(uint8_t *)ptr; + break; + case sizeof(uint16_t): + val = *(uint16_t *)ptr; + break; + case sizeof(uint32_t): + val = *(uint32_t *)ptr; + break; + case sizeof(uint64_t): + val = *(uint64_t *)ptr; + break; + } + } + erst_debug("ERST read %016lx %10s val %016lx sz %u\n", + addr, erst_reg(addr), val, size); + return val; +} + +static size_t build_erst_action(GArray *table_data, + uint8_t serialization_action, + uint8_t instruction, + uint8_t flags, + uint8_t width, + uint64_t address, + uint64_t value, + uint64_t mask) +{ + /* See ACPI spec, Error Serialization */ + uint8_t access_width = 0; + build_append_int_noprefix(table_data, serialization_action, 1); + build_append_int_noprefix(table_data, instruction , 1); + build_append_int_noprefix(table_data, flags , 1); + build_append_int_noprefix(table_data, 0 , 1); + /* GAS space_id */ + build_append_int_noprefix(table_data, AML_SYSTEM_MEMORY , 1); + /* GAS bit_width */ + build_append_int_noprefix(table_data, width , 1); + /* GAS bit_offset */ + build_append_int_noprefix(table_data, 0 , 1); + /* GAS access_width */ + switch (width) { + case 8: + access_width = 1; + break; + case 16: + access_width = 2; + break; + case 32: + access_width = 3; + break; + case 64: + access_width = 4; + break; + default: + access_width = 0; + break; + } + build_append_int_noprefix(table_data, access_width , 1); + /* GAS address */ + build_append_int_noprefix(table_data, address, 8); + /* value */ + build_append_int_noprefix(table_data, value , 8); + /* mask */ + build_append_int_noprefix(table_data, mask , 8); + + return 1; +} + +static const MemoryRegionOps erst_rw_ops = { + .read = erst_read, + .write = erst_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +void build_erst(GArray *table_data, BIOSLinker *linker, hwaddr base) +{ + unsigned action, insns = 0; + unsigned erst_start = table_data->len; + unsigned iec_offset = 0; + + /* See ACPI spec, Error Serialization */ + acpi_data_push(table_data, sizeof(AcpiTableHeader)); + /* serialization_header_length */ + build_append_int_noprefix(table_data, 48, 4); + /* reserved */ + build_append_int_noprefix(table_data, 0, 4); + iec_offset = table_data->len; + /* instruction_entry_count (placeholder) */ + build_append_int_noprefix(table_data, 0, 4); + +#define BEA(I, F, W, ADDR, VAL, MASK) \ + build_erst_action(table_data, action, \ + ACPI_ERST_INST_##I, F, W, base + ADDR, VAL, MASK) +#define MASK8 0x00000000000000FFUL +#define MASK16 0x000000000000FFFFUL +#define MASK32 0x00000000FFFFFFFFUL +#define MASK64 0xFFFFFFFFFFFFFFFFUL + + for (action = 0; action < ACPI_ERST_MAX_ACTIONS; ++action) { + switch (action) { + case ACPI_ERST_ACTION_BEGIN_WRITE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_BEGIN_READ_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_BEGIN_CLEAR_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_END_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_SET_RECORD_OFFSET: + insns += BEA(WRITE_REGISTER , 0, 32, + ERST_CSR_VALUE , 0, MASK32); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_EXECUTE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_VALUE , ERST_EXECUTE_OPERATION_MAGIC, MASK8); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_CHECK_BUSY_STATUS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER_VALUE , 0, 32, + ERST_CSR_VALUE, 0x01, MASK8); + break; + case ACPI_ERST_ACTION_GET_COMMAND_STATUS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK8); + break; + case ACPI_ERST_ACTION_GET_RECORD_IDENTIFIER: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + break; + case ACPI_ERST_ACTION_SET_RECORD_IDENTIFIER: + insns += BEA(WRITE_REGISTER , 0, 64, + ERST_CSR_VALUE , 0, MASK64); + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_GET_RECORD_COUNT: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_BEGIN_DUMMY_WRITE_OPERATION: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_RESERVED: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 32, + ERST_CSR_VALUE, 0, MASK32); + break; + case ACPI_ERST_ACTION_GET_EXECUTE_OPERATION_TIMINGS: + insns += BEA(WRITE_REGISTER_VALUE, 0, 32, + ERST_CSR_ACTION, action, MASK8); + insns += BEA(READ_REGISTER , 0, 64, + ERST_CSR_VALUE, 0, MASK64); + default: + insns += BEA(NOOP, 0, 0, 0, action, 0); + break; + } + } + + /* acpi_data_push() within BEA() can result in new GArray pointer */ + *(uint32_t *)(table_data->data + iec_offset) = cpu_to_le32(insns); + + build_header(linker, table_data, + (void *)(table_data->data + erst_start), + "ERST", table_data->len - erst_start, + 1, NULL, NULL); + + if (erst_base == 0) { + /* + * This ACPI routine is invoked twice, but this code + * snippet needs to happen just once. + * And this code in erst_class_init() is too early. + */ + DeviceState *dev; + SysBusDevice *s; + + dev = qdev_new(TYPE_ACPI_ERST); + erst_debug("qdev_create dev %p\n", dev); + s = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(s, &error_fatal); + + ACPIERST(dev)->base = base; + sysbus_mmio_map(s, 0, base); + erst_base = base; + erst_debug("erst_base %lx\n", base); + } +} + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + ERSTDeviceState *s = opaque; + erst_debug("+erst_post_load(%d)\n", version_id); + /* Ensure nvram[] persists into backing file */ + update_erst_backing_file(s, 0, s->nvram, s->prop_size); + erst_debug("-erst_post_load()\n"); + return 0; +} + +static const VMStateDescription erst_vmstate = { + .name = "acpi-erst", + .version_id = 1, + .minimum_version_id = 1, + .post_load = erst_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT8(operation, ERSTDeviceState), + VMSTATE_UINT8(busy_status, ERSTDeviceState), + VMSTATE_UINT8(command_status, ERSTDeviceState), + VMSTATE_UINT32(record_offset, ERSTDeviceState), + VMSTATE_UINT32(record_count, ERSTDeviceState), + VMSTATE_UINT64(reg_action, ERSTDeviceState), + VMSTATE_UINT64(reg_value, ERSTDeviceState), + VMSTATE_UINT64(record_identifier, ERSTDeviceState), + VMSTATE_UINT8_ARRAY(record, ERSTDeviceState, ERST_RECORD_SIZE), + VMSTATE_UINT8_ARRAY(tmp_record, ERSTDeviceState, ERST_RECORD_SIZE), + VMSTATE_VARRAY_UINT32(nvram, ERSTDeviceState, prop_size, 0, + vmstate_info_uint8, uint8_t), + VMSTATE_END_OF_LIST() + } +}; + +static void erst_realizefn(DeviceState *dev, Error **errp) +{ + SysBusDevice *d = SYS_BUS_DEVICE(dev); + ERSTDeviceState *s = ACPIERST(dev); + + erst_debug("+erst_realizefn()\n"); + if (!s->prop_filename) { + s->prop_filename = (char *)(TYPE_ACPI_ERST ".backing"); + } + + if (!s->prop_filename) { + error_setg(errp, "'filename' property is not set"); + return; + } + + if (!(s->prop_size > ERST_RECORD_SIZE) && + (s->prop_size <= 0x04000000)) { + error_setg(errp, "'size' property %d is not set properly", + s->prop_size); + return; + } + + /* Convert prop_size to integer multiple of ERST_RECORD_SIZE */ + s->prop_size -= (s->prop_size % ERST_RECORD_SIZE); + + load_erst_backing_file(s); + + erst_debug("filename %s\n", s->prop_filename); + erst_debug("size %x\n", s->prop_size); + + memory_region_init_io(&s->iomem, OBJECT(s), &erst_rw_ops, s, + TYPE_ACPI_ERST, ERST_IOMEM_SIZE); + sysbus_init_mmio(d, &s->iomem); + erst_debug("-erst_realizefn()\n"); +} + +static void erst_unrealizefn(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + erst_debug("+erst_unrealizefn()\n"); + if (s->nvram) { + /* Ensure nvram[] persists into backing file */ + update_erst_backing_file(s, 0, s->nvram, s->prop_size); + g_free(s->nvram); + s->nvram = NULL; + } + erst_debug("-erst_unrealizefn()\n"); +} + +static void erst_reset(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + erst_debug("+erst_reset(%p) %d\n", s, s->record_count); + s->operation = 0; + s->busy_status = 0; + s->command_status = ACPI_ERST_STATUS_SUCCESS; + /* indicate empty/no-more until further notice */ + s->record_identifier = ERST_INVALID_RECORD_ID; + s->record_offset = 0; + s->next_record_index = 0; + /* NOTE: record_count and nvram[] are initialized elsewhere */ + erst_debug("-erst_reset()\n"); +} + +static Property erst_properties[] = { + DEFINE_PROP_UINT32("size", ERSTDeviceState, prop_size, 0x00010000), + DEFINE_PROP_STRING("filename", ERSTDeviceState, prop_filename), + DEFINE_PROP_END_OF_LIST(), +}; + +static void erst_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + erst_debug("+erst_class_init()\n"); + dc->realize = erst_realizefn; + dc->unrealize = erst_unrealizefn; + dc->reset = erst_reset; + dc->vmsd = &erst_vmstate; + device_class_set_props(dc, erst_properties); + dc->desc = "ACPI Error Record Serialization Table (ERST) device"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + erst_debug("-erst_class_init()\n"); +} + +static const TypeInfo erst_type_info = { + .name = TYPE_ACPI_ERST, + .parent = TYPE_SYS_BUS_DEVICE, + .class_init = erst_class_init, + .instance_size = sizeof(ERSTDeviceState), +}; + +static void erst_register_types(void) +{ + type_register_static(&erst_type_info); +} + +type_init(erst_register_types) From patchwork Mon Feb 8 20:57:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076729 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 ED42AC433DB for ; Mon, 8 Feb 2021 23:09: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 5EC6864E42 for ; Mon, 8 Feb 2021 23:09:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EC6864E42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9FfJ-0000Vj-CN for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 18:09:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc3-0000np-Co for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:28 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dbz-0002k7-J7 for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:26 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KuPBg009595; Mon, 8 Feb 2021 20:58:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=PUkdIudox1n3NAqeXy3J/sh1lZ+ikVPvNiW5dwu3ih0=; b=gQ2X4SpF6peF0AuL70KAopKvIKAWnOVYpmC+ZU0cgSsc2N6/9ICXMrc7mCfjLogLeAU0 t+/Kk3LDshUdssOC+tKOs4ZM5ylHi8bhgIDRfw/v/9bG9rxShIsind1A5a94xePnNRh/ 8NYaUhZMFbP2l99BNeB6eHCI/sJZzFfyX5H5+I/jyayzeRTmWvi4AlADy+jCeXA9cst5 Ff7u3/RDbJA9E52R1cEqZTdqHIaNm5bI762w7moSVIQs9Dn4AcMN2DYvoS2bRlGpmxKd 6V/3bhKlyx/JS5F2TXW21sV7O+GjVMrsLFvFY+KW4DG7kEDjcvGSxNE+APZtTIBOvT9F XQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36hk2kdc64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:21 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118K5rqi157115; Mon, 8 Feb 2021 20:58:21 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by aserp3030.oracle.com with ESMTP id 36j4pmtykn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQbu6iiE+eVcSGZiYOzDj/5gCZr48NBtxhB/3bF+C1/Kj3jCTpPRNgKcrVuB/UV+Rk9BZnrhsyFQCYA/HbY27WyBQJPPFor7P2nJGXLWzXzhEZZVL/kvrwVsywb40ZbTL1eaaR/9lgHqGGvJERtVz6/rSl/5uja7zVR7a2Z/+z+PsLCMy1x6bhetRf5rOpEHxa8GmghP6ru0tGEQmgL+EMyv8oEv+XDcXAS4nE3KPSEFeoTFYAZIA5G1TFFIYusvma1j1hHiaybvJefGIsBhl1DTlDVl2Xu8+ynVPUaZWCw2yn4ui//yoMgW0nk8tnqTz1SEvqRo5LAgFoo28tSehQ== 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=PUkdIudox1n3NAqeXy3J/sh1lZ+ikVPvNiW5dwu3ih0=; b=WNb3/YPVwo+CIYjI/FJFnVYDtHw+6TEvMJ34b0NH1WjGbFr8aw8tPhSe76J36yMSJ3Z02VsCDJ2o2/rQaia9p/+gCwS0Lr8xPWL2H+77fjCycCtewLQyMMmCnEDpQPLri4w8tg9t78iwmc0NaIf5RKrIO2KrS0XpZjdwtw1fm5eyns9pjtbXOyh7w/nNzpExb3yxlkzVZg15g1k7L282/dt8n1VnZ9gU/tzMIuVYBrKK2swpRPycTUcvHMbkpkXnSvDRGSp7vPqdCbebQQDaB9RBay9sfXhzebO9v8pt2R+BrIDbPkA31C32dlI2HPC5SM6SkCdl7xOUkhj9mOmJDw== 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=PUkdIudox1n3NAqeXy3J/sh1lZ+ikVPvNiW5dwu3ih0=; b=rIsT1E47YCVtpMCEJYkiU6/3rSEEW6mRCnQq4C54pzVsfNxLwEpNywkwSWE3dcbUwfAA3SBb+GpbQMkyx4HHjtmuSAq/mjqi0rWnk+3y/7sSF6tnKDuwQ8oJKVc/1nWf0XCWKs9u8L8203gYbqB9+hiemcwAmFtUgnm/9lHskcY= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:18 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:18 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 4/7] ACPI ERST: build step for ACPI ERST Date: Mon, 8 Feb 2021 15:57:56 -0500 Message-Id: <1612817879-21511-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1845e0f-1d95-459b-4385-08d8cc7442c3 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X6D38zuaBQqtDvSjdpHgHUtPE9jTBLCm7qYPl84ULngmIq453N1/XRCPExPqykTG/nDK9HjvMPnEv8r89as4KBGK2P2kpSadM8WgaaMmAUvflHjasGZNEKuwtQ7bGfxPohpYtjjoEX8mIhEJaxA+sV3WFiomi7G2kOu6p4KITqGOWwJ4YFfVXL0o3swZJPCIey/SuFnalvMjkyJaMWW49ISTgVopEW9/AvXeJROO+Qh0BK4jRwiBidpYLQj3CU8q8w23PIFPzykGXQEq9nhPWjo3XB1fni/mL8iXinGmR9OwtGozQDGZ6kfR2KdAkzdNBXlOvmwBw5OgKtaOsOcAZ66CC8K9KTjBTBAlGt5qEZgO+8QccLsrMze413RgIrwY8qFHSLVb9MCgOqmDp4nc5m0tdEFR5yrs60RjGUgbp7ZfbEpeKsaI93mrmIDiN0vGXciLfyIaDVCZlYTrTulqor0igSlLRrZcoUtGN1EHRhCBd5qxbzmf72nc1dxeNlfwtKcS/6g1ggdvjKvrMMZAYw== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(4744005)(5660300002)(478600001)(66476007)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IlcwWkS/rKYsG8e4ZyiVgJ03our21Dypw/Jw0Bxhv84NiG5qpUw93TChMEZKu9Q0Ul+7Y47Iawger+JIf0+F3uUFMVq5lsfV3Vg9oB2zvGym6Z0aqTuBKixzxitmQ0W3sGdMKRyHI0T6xSvNfmxnmfnqT6n5+75LbwGcFWCIUNBTFzj88kzevQR6/z2gZGYEfqa4b35cZAERBEi50zphi+BMIKX1bkwMNteOF5GQSAbozet9FfWP86yfveYnwQcX5JnUL7jrbz6WjR0XFWYJuEFBi6LUZPUkfTmzpCRuXNoxu2fgpRwLIkFGC5i1LWPUDfhwzu7Dm5tQ46sT5Giz4TzYh1BMS71b8orBKwPrisNSFFpPHOf69t8sSijn5Tuag4rc/StbbCWOzWTlegMES23UoLHGxTc+BA3d3GgvHg8S7TxGdKw3diggb71Kb+qdJpyaXKNikZCDZVVe3KvsCI7EQIXU/xzWvsWVTKTQiXIys5RGnHQy5/30QBragktPbV4EZxkFT1UwgB4oMWNAE1hWSjLPO9acgsLN1GS99RqbhtrhfxmZ2vwfnCrl1NvVFVRwvYb1YUx9VdU2cYMx3mBhdk/Sip/0pBV6WH5fntf3ZoJoC2oscuIyA0FLYRpmiu10XD7TKk/QH61u1oGehqwP+GPe5xPLp5/mJ5HPzkIWIAGIT5lgu/ZERHhSArtOVEDm3jzjEkYOLfuYvOa882mMfOlSofazuhZp2LEZ3B8zFWr2XfKrPIFntjfpsZs0ZC8WopSYz7PSSIO6J0mxpIURlVA7B69MQ/yMpCwps/yPTJVc4DuTy4cl/kl233M84ip9gMUPWn/3y9W0BACOW5HZ1f3mJpSKhVKEJvGYA/t5WGpiYg7WLIggSPNNTpnv2vySwW5arjMdGYYbH7Ayd5WaELqTaXEh+TYqMBJxcbnon8Q0B7ZkpYNqXt6NzDNMykFXPivkoAAQQ/cIi7vJ1vEAIlCk8Yx/Md7SumTLuYp/aMt+aZIv7mZImXl9IA6W76iwJVvV4arvRIwC42cKHNQzzuaeSXv9hKKkfH9q1aMdcz+wzXlOKc1F1i+HUH+Z/i/8w169SSaTigyIyWd9JziF5x+JxjYsuRsD+IUefg+SctTyTLt1LNbE0/+ihYflL+zchcx/dNb+41x2S0Zhuvi1AaRfqy1LGcHKf/phP0wFUQ+T4YucqFaHP+Umh8DfkiXfCvVUOsCkkd9q8U/bLZ7FzLNPuDnVEX51ItqqKj4G78f2qg62df0G3YlBDdfZ3bJZRAtAWOXjSZb5xN5T5kdDB1ruiYFVkWDnjA8tZ9aSXi8AC6PiQyvO+8dvY0qz X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1845e0f-1d95-459b-4385-08d8cc7442c3 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:18.3252 (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: jLVHwPIpHzDrahCFSNUKmnFOAsA7TbRFv4E/xX3A9ZbGn+fQZTYLVXO6Yyc8rXipvxtlCSSbQTJt1xJg98/0YSfXTZxYuZJ6Z/l/21wu1BQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=141.146.126.78; envelope-from=eric.devolder@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change includes ERST in the build of ACPI support. Signed-off-by: Eric DeVolder --- hw/acpi/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index dd69577..262a8ee 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -4,6 +4,7 @@ acpi_ss.add(files( 'aml-build.c', 'bios-linker-loader.c', 'utils.c', + 'erst.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c')) From patchwork Mon Feb 8 20:57:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076733 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 EC6BFC433E0 for ; Mon, 8 Feb 2021 23:12:23 +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 8816164E6E for ; Mon, 8 Feb 2021 23:12:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8816164E6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Fhe-0003qR-Jt for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 18:12:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc9-0000rB-Gn for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:33 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:34084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc1-0002l3-Dw for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:32 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KuQrP001246; Mon, 8 Feb 2021 20:58:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=q1IJVxa3AzhQVcC6f1jaVW1MTy9h5ziV/tasrzD8OwA=; b=bcUmajmz/qOSi5rBy16ZdKIWMzNeL5PPLtR7m71HI5KXnWQp5HppDmU8Vnp0OGqZbaxg /pLgpEMLQLA0hPTB5usAjZfO3K7yHGZaoxW7jy0IO3E19vGNv+kGIUja/XLj9w25wpAm 9JzMVMLib+4y/U4gbOMzn2x05NankhE/eP7UYcTu+loHW8+B9vIcRKqNbBxEU6EvgBXu w/f+wDB3sGoKCBQZFctadMWP2Jy+owV3fHPQNAIztogsPxmVmGtTdl6em8fW/K+Y5/KB 43+w4as+xF6h+5mC51I3NpF70NH+uPw3ilJsML6GPNY+TIRAyR0aPE3H7GVvpH85C48r yQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 36hjhqncxs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:22 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118K5rqj157115; Mon, 8 Feb 2021 20:58:21 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by aserp3030.oracle.com with ESMTP id 36j4pmtykn-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NeqetFJ3dcmp3wTmf5dCSPvNXQVcb3fin1mo2NiQ/TDbZrY2SYXgz1F14m1NLZ/d6qfcIVANYfMgGcu0u4EfOUeu9zmwvro2WHY/6+J/oJtIawi7Ma3rVRBTvqc+qbTHnXOIKQrtWzbYHdiDb7kUWdGBk53tiQUpqBWB39DcxagE/k/nZ7fMq1Z1Uve51uyPx37pQHvNcnUDuobqoY7PSmJ6sa21dGvp+bWhtdQLURafisZXJhDNSv5NYP9LbFTPc9v0nYHX19UQgf2JA5uuk75tnpfGy5MZ8T9bLqz8z6whVpBmd5quJ2BPNM12/wTs9ZuqV5X0IPitaMInAT8deA== 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=q1IJVxa3AzhQVcC6f1jaVW1MTy9h5ziV/tasrzD8OwA=; b=ewT51oOvsfmJBar/4vBhBSrvFo4nsLW7JFCE9ovneKOLGQiCZ02meJlk+kVWYu21JqNTRoXVzuKn9y4cLqTiMjTtbyiEgWHo7taxDB7HM5h/gcrtkPqomAbm+O0gF4i6DcgLhbpfwiZDb1SHQujckpx1Tnay8pVriXTOMcBu+7z602IkC+zrEdUoy0vpVeEJgVLYdH2QuRTW72MgRWjQGX0Vj5tqW6Qmrxqb5kP8OphB/ajOXfnDkGjNiO+ARa/mc5vcjYpQXnHs54qhrvx4EIQkeq0ZJXLKSaS6OYw7qm91w7M1xXXO36XkNGZ4FYhVH/mhCr5S9wxo5AutuuzPhw== 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=q1IJVxa3AzhQVcC6f1jaVW1MTy9h5ziV/tasrzD8OwA=; b=EwD8p2QcQzgtMSsHB6hJzhkqO72kP+GdJWdzgKBCS+uRzsKTC8dDHnDQuUG22Zf60pth1N12QGzVTL/otDoBZDtqe9i+Kax67Vb4EYIrGzmRmSDRptZmxyei/cB575cJbqTDDT//8vdZ/ldqHZqGT+WOngOIX51hDCNmmrF6uz8= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:20 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:19 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 5/7] ACPI ERST: support ERST for x86 guest Date: Mon, 8 Feb 2021 15:57:57 -0500 Message-Id: <1612817879-21511-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ef60008-76bf-448b-41aa-08d8cc7443a4 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FoYDsi7oJzpvaqycjKLtGBPfFNoQ+PAXI4Lx2SGq8NOviKb5Z+ExQXX3DozZG66mXs3tnQW6NjPdav8uoADqHdKQEwg2zyyZECbWNlnJKYY/PWSe58rJ4i69SYd8rP5Ky6NtXAPfLZ2d2UCiohOyPpB5ZhyAV/Qz3R6xuxAVVGN0w4zrLc8nEmSgO6NRFNLFWNf8jx5JvsbCIXf+5xo4HQcIooKCoB9l3E7L5dWczZ0wIo20V22IrGdwR0facOIRLc5Laxwaj+frBL00JNvfkDiKUa5OIakmpHt6YN/+zSv7Yp/GL2twZbYbQVEHkIL/nrcEPvAmtY9Umot5srZzEgc0DFjUnqgg6+JR+P8CCRPKImeCVkgIszXQXo2gs3EZYkvW7qgq6Sx/7yCDbreCIyo1d0srGSDsbke71mK/wYnM3OFAwaputZReDzUglwPpwBRTxMwXR8OTsrrB64y6JbS893QNNUXI2O9OTTSkTLY2hZ39H6wMiKz9E4SbcpqByw+Jn0AiR2LdW0eRlpeIZQ== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(4744005)(5660300002)(478600001)(66476007)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: W8bUBXKyptVe5tUWgfXQMNMZHJDKYOdWpq9dAbCT64MgNMsmHb8yTuUuphn3WSVf0EivP9MxTDegK+Y2Vm0J1AqGuSB9piiDRHZxON1jESMB9a0K2eVSyy9V8QhJhHLUC3EN+f3XzG74kNCB9qlp1ehRKGlQCmsY24gRG65tpHEcGY3Ve8JKtu/L10fahiNvczkp6b7OCsGn6aY6tO2mwvqiwb5YZuvIsi32dv88FRnt3zBFDO7eKcLuX1ZLN1xIN24WzMcYd5SmkVJJuJHvuC9hzlNiGi04ko7tLAy7IxpovhMpgPRZpluh/PW9MI7w7XdGzuIMJBJo08EPKKenMA3VfOcHnRFBKBJaC8ZVr2NyFdFmuerVJ2JVdT9L2AHBI5OIVp4aaL7CmwVg1MMyKOS8JEjeXvUUIeHiJq5Z/iqUNsn/nb8uuSSLR4bxyIsefNEZrOGvbhkBichyQjabbKZk9GKnp6flMI2AnukuA320hZydaUgq242uTX6CabKlIULb2wJ1XxKIW6exJ15wNQopJ6XfhfeHdlwfoGjli/LaFEFMHXsyhqp/PV0w1SabwOypeL6493ofQu/CfQViPsUP0lwgIC+yHH6KnkohrjpHRDfHiak2eEyEmErzzVAAmB7ms5Nc6slYPGhtgdPZK7sZo6ZuSp9AVtpExEHoTqWzA7L/OEu8zItc0Bvf+aBSBL9cmVmxrQE+1tTFt9xz8dyv3vWSef7Bue5tkDBsS3+fkGlfr1CEt5vQTP4PEwQypOMnPzJTOR1/GTDTU6nyrQUZUwHfZ3NSSvCsqVqdeccMtj+IMG7WAo9VP2p85T1WNJtwzpSFCP19drH7KM7ApkDpslzsWoiW5y/tVS4ZQt5d2F25KPnr0ZLbh3zwC2eIgSlK9wd9sqNd4zYjINtrW8Ax59gqUA9yFqeAqaT6o0EbCv7wy6+th5e7+uIV625P1wVkWlZxD6xAUMCHZqAhZJJaXMIqu7krLvfLNhT6bATf+rIk4wDn1yvOHtQrnZrfLauhE/PEizjEq1uSzMiBhw6Rqp9dmR77I8rt81RlOREO0fU24MXeoAiJU6zo7cq38tjfS/kDLiaNImh/tlYcMIMFDPLmRHrYXWGRtHBQAUn7Gwi+ZOi5yVjvStQg1SvG5bnDpTCxIW+/kiU5uVRdxhNRG3nzV3/nqFz7Ahuft01MMo4yLvCqs2r9bF93uTNBIU6NiRLEwKSpEV25XZ7BTdb+n3TJgW8dg65ROmfeXknKx1V6hEMID0Imj7BQ+lZoQ3Vrysaxy4DbHB0wC0Wt5GgeBhnhv72c9Hxt886h8dwUidYgfp20+S6niV60VxGh X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ef60008-76bf-448b-41aa-08d8cc7443a4 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:19.8087 (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: DhbEnknkYqJc/11MGn9zLI8hT3Wo92r2ulFrNMqAulf33YAFDUEaG6+ZzQ4eAVz/s0N8aJS3T6m0+w8PQ+mjxqj16W3UiN9RW74O9IA6OAk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 impostorscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=156.151.31.86; envelope-from=eric.devolder@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change includes ERST support for x86 guests. Signed-off-by: Eric DeVolder --- hw/i386/acpi-build.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f18b71d..2c0b27d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -43,6 +43,7 @@ #include "sysemu/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" +#include "hw/acpi/erst.h" #include "hw/boards.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" @@ -2196,6 +2197,9 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) acpi_build_madt(tables_blob, tables->linker, x86ms, ACPI_DEVICE_IF(x86ms->acpi_dev)); + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, HPET_BASE + 0x10000UL); + vmgenid_dev = find_vmgenid_dev(); if (vmgenid_dev) { acpi_add_table(table_offsets, tables_blob); From patchwork Mon Feb 8 20:57:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076867 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 B759AC433E0 for ; Mon, 8 Feb 2021 23:44:14 +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 0E55464E8F for ; Mon, 8 Feb 2021 23:44:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E55464E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9GCT-000271-03 for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 18:44:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9DcA-0000rv-SM for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:35 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc1-0002lA-UX for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:34 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KvGds010184; Mon, 8 Feb 2021 20:58:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=mFK5egzB7/6ymCVgCMffkiWdnMVmbsIMWE3IMHkZltI=; b=xZUYPqWm2py6Qhqtrh8+o8r8ilto4y4EGiOsqS4reCeXWN91zReRGqipstotA22albHj xnXBEIdgbXP8MlPwjqbo4ey8/p2WPJtZ0nNvWeEzDFmf1h8rCoyX9UqY0m3imrNZLdHs 7qBSCNcjQB7qAMVLmqr6jMI+ttUp1c8QFP2Z4SU32ZJZ19YHGcLUAfCVljicYXzuEMMT upYEMzBq13LLsedy1GfSi90815zNr5LMbn69d89keb+704a9BWvm5nagTP11wyZIM6YK LrLMC8mmZ0V1cS5HVxFCvj0oYNdZv6I+J4t3NgrmkjpYaCwXmELJIPCZu8Opbsa8Olvf +Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 36hk2kdc66-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:23 +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 118K5MmH020945; Mon, 8 Feb 2021 20:58:23 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by aserp3020.oracle.com with ESMTP id 36j510b3dh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BcxJUFP7PstnRdC7AskYhpfXl6qoMAFsIK56eXUjDDnLyIMPj/PQIdWYdC5+oWZsac3BQkidzKpLEnoaNBnmyMtpm5xNmG1X826HNzZEcuXJMUbXesMvkRbf0G7VL4ko1ed0MS4Ww0QUFpNPqnZ2677JbpLMawxYAhFK/Ff98NfwPP2MElM017YQVEbuzpdKv8YrLwJugHPIJWPVkVqR6YO1uutJ7QCp5YVVWSP6c9klDFfi0ghGaw0vgbnR51nkWRf+is+3PmP9YLX4g272AhL4YD1Mq9CaNyyZ1PsbQsrxZ4OK8Ncqokm9DEuosMVVo/iYWnVMLZxsI0/D6O7X+Q== 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=mFK5egzB7/6ymCVgCMffkiWdnMVmbsIMWE3IMHkZltI=; b=UFmWIRe5X0Aqjsjxe+P6cMSkLgYQa5/K4YFL0U8fSvCHiE+qQDmG3bLBNqQttpU9SQkIkVZdK9MoaUejVtpTgiiv1hHoP1W3kqrlWW/kZDvmslP5Oq1Q1SBUcM79r3CwKoVCf1ZtaSfPOcWcQXvCHGHzF1MwUS9BAA8ylP0UO3seJsnk2iJuQ8V/vG+gR4nPWz3lmIW1l1FbLGuQdoBHkFoj8AT7IcuHCHMm8dCksAJrtG0/6yCZvOsna72bhOUi60YOqBVibcOb8XLEDOdUGcS+mSlvaNR9gecnlUUeW0jCKTI0Xkj/NPwkKV7Lb9b9JjPrtVwbeNfv5ysmiy8O/g== 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=mFK5egzB7/6ymCVgCMffkiWdnMVmbsIMWE3IMHkZltI=; b=YyiAHXUzuDyMN1TdmmEdTzp6Iw5crs1tkOG898j2n3MxPxFwt52VRUU9Xv/KLr4FjTtqynZo/g6OqmWdTP2Mry6MoLokkAUZnPbNYDOQ9N4y4L5220wHXj2655uYoSvUDD+oEI1hjbYTFOQSjyRhjN0cmnIieaJgSJ5WetRvMhI= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:21 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:21 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 6/7] ACPI ERST: qtest for ERST Date: Mon, 8 Feb 2021 15:57:58 -0500 Message-Id: <1612817879-21511-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 546c2b2c-ddef-45ee-7708-08d8cc744486 X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BxRidDQtYdBHsQPqpDsQ3ECtBSAx9WRwS/GxJWVUl2blaRuM+jqPFL3ZSBPOwd+mv/QCR9cwn4qCGw2np9yfryfABOAMKU0wcvmxQwtUTUuWG15+NoDyIq9d/lvWLCqozaQnB/pUUGXA6Uh0T41ZXXDSFoRNAnlFG/bfSyvqWrKJdocq0tELaMz7q9zaBYdpiyHpAuHUVYlAMZ7lUKhCWVXbIDHZMCILN8SGEkiM6YvJq3Joh87prJG2zVIuewgxW2gPHfOGTl5/adYoAhe0smEQaNNEipG2UdL3Cb56ZY0oGSCw3/InpEnuc3/uNHmQWk0Sz0oo3w5SC5E1IfRDyoUsHpHupLC/EWNgITqnyC+9+RaJREZQlS7RpgyumKyL338jKtj3suHnvXhQmrGfkJT0BLnRZ/tdZ54woHbe+BjksUctTruNBH00w+RnwyrAjEJ8vIG3xg1cKxFVY/nNvyVxI20+Tkhhm56lrhcO7AjZJIYQsS8vtCyvDeEbPgcT7GSJKE1T3CR/CxyJ17k+VA== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(5660300002)(478600001)(66476007)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6kSE8Gmzu4oSvs05QTcb7iMpB9Z0Oyg99cd+LWSijUbtODIIzz7q12uIgwYUgbnUyPLONklWLJJfkcIzGkBEjj4vtVYNpSzFqXbdWlTMiSvbS5XQT0JQqjNn0oFeGGyNkpehQHNyYDRczCTsZyS5zXWweQbilpyfkUCXHys/Yyl6dyMXRPIuDy540a5Hjc86eRpVbC0JzEwuWUsezLtK2b+mBt3H2RzlD7/6eLqqiebMu0jLe0Te7+j0LWu/VDR10GBydBQf+hJuRToX7iZZv97l7MTuHbqxmRy6OrClHRJFQhAKZV4JrXDMViG9/OKJMZ79jHdAlfOJc0R3Ql0/CUq+x6KYOvBQmMzI7vESpcCoBUxENPkZRdyOxYDMlBh/KRo0cZ5Hx4hThe1cgbob7n0RJfNwEVpbuXMPeHOkqu8rw5a3C5kw4xTOZDIFyeijsoeTRa+UfsKu0UP1UBL+osr7ovP+fVWfM9YvNDoj6CwwL7SspbqzhYK50TALSVrwCYze8gzoR3hePGe++sD1kIcf+V2uYc4CQDZvCVhy6srszws36Ri9N0ESiR+QSrUTnIZXCsvFAoijynTsqY/MbJKczp+BVqNXPk0RoQlaJguMAh25N2CZwQLl4M1GalVq56tM9Aisn4+3RUMEzYOQi/5b8FlPxgfpIomYxIgz1wgurp4Dz6+u5qO1q+RQvWbdqIAkev9cDK0GoDFpHA7qLpy4HSpjWRy54iLVqijuJ4yHHhf9MFbIc2imhO7+LaJqrXXjmXXWdrQwtatReo49jqWLUQ/sCQDZ1r4A1Qdj51Hcz+SAnEaFDmBlqUt9/Ye4o2qQjJ1XeLcSRbzmNb2GcEjwwx2yue7JJS9tqrmBataN/rtEtdEz8j6n5re6qmvijsHlg9r7wSj1qCiQ5DwvheGaZzhAUfZ8VUlkzvMDz3VwCN7PJzajqQK0Mjt9CHG4m28Jcr0TDq7L5PRnYK2AvswYVwmRslGZNbrGHy9z6Yg+uh3G0WUOkBegGLODnrmLBSeUqLZ+ycdmaVlUkNtFuA8Ec2xa64ZUh4fBMCQyNaD/5lox+TFXERc406dwyzpAMzSaMoGyEm1oMZOqa2N1guzCmT0FvKQbbw4WQWkJq8ZMDIIwudTYH0N6C9PIFejD65TnY0xIfKN5XVyKyPJlC/7p4OeYFUXi5D3Wu4c6EPuV9Qha/7uFIiMhIZP/8xsJMVGSvVM8I7aga+KnLcwZ2qqGbhCXRDhO9sR0wS76yHTRw9W0kfHB8DOLxdDbiSnz969Ea02+CDT0mBwNQu9ZoKqDqyTVKIq7FhASEBnSZdjT/1E2qEYuhHM7l3AJ1VNp X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 546c2b2c-ddef-45ee-7708-08d8cc744486 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:21.2633 (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: keJEdMPGwvrTOiVt5JEwgK/CONgVDXRllSRVQuxZeFxXwVfUwP02nb9L28ORWzjUz3DHfxYUOn8sOUGFmkydgXdiBjNQVVCtS3BFRbqmAlI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=141.146.126.78; envelope-from=eric.devolder@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com 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 | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 108 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..1030e83 --- /dev/null +++ b/tests/qtest/erst-test.c @@ -0,0 +1,106 @@ +/* + * QTest testcase for ACPI ERST + * + * Copyright (c) 2021 Oracle + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/bitmap.h" +#include "qemu/uuid.h" +#include "hw/acpi/acpi-defs.h" +#include "boot-sector.h" +#include "acpi-utils.h" +#include "libqos/libqtest.h" +#include "qapi/qmp/qdict.h" + +#define RSDP_ADDR_INVALID 0x100000 /* RSDP must be below this address */ + +static uint64_t acpi_find_erst(QTestState *qts) +{ + uint32_t rsdp_offset; + uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */]; + uint32_t rsdt_len, table_length; + uint8_t *rsdt, *ent; + uint64_t base = 0; + + /* Wait for guest firmware to finish and start the payload. */ + boot_sector_test(qts); + + /* Tables should be initialized now. */ + rsdp_offset = acpi_find_rsdp_address(qts); + + g_assert_cmphex(rsdp_offset, <, RSDP_ADDR_INVALID); + + acpi_fetch_rsdp_table(qts, rsdp_offset, rsdp_table); + acpi_fetch_table(qts, &rsdt, &rsdt_len, &rsdp_table[16 /* RsdtAddress */], + 4, "RSDT", true); + + ACPI_FOREACH_RSDT_ENTRY(rsdt, rsdt_len, ent, 4 /* Entry size */) { + uint8_t *table_aml; + acpi_fetch_table(qts, &table_aml, &table_length, ent, 4, NULL, true); + if (!memcmp(table_aml + 16 /* OEM Table ID */, "BXPCERST", 8)) { + /* + * Picking up ERST base address from the Register Region + * specified as part of the first Serialization Instruction + * Action (which is a Begin Write Operation). + */ + memcpy(&base, &table_aml[56], 8); + g_free(table_aml); + break; + } + g_free(table_aml); + } + g_free(rsdt); + return base; +} + +static char disk[] = "tests/erst-test-disk-XXXXXX"; + +#define ERST_CMD() \ + "-accel kvm -accel tcg " \ + "-drive id=hd0,if=none,file=%s,format=raw " \ + "-device ide-hd,drive=hd0 ", disk + +static void erst_get_error_log_address_range(void) +{ + QTestState *qts; + uint64_t log_address_range = 0; + + qts = qtest_initf(ERST_CMD()); + + uint64_t base = acpi_find_erst(qts); + g_assert(base != 0); + + /* Issue GET_ERROR_LOG_ADDRESS_RANGE command */ + qtest_writel(qts, base + 0, 0xD); + /* Read GET_ERROR_LOG_ADDRESS_RANGE result */ + log_address_range = qtest_readq(qts, base + 8);\ + + /* Check addr_range is offset of base */ + g_assert((base + 16) == log_address_range); + + qtest_quit(qts); +} + +int main(int argc, char **argv) +{ + int ret; + + ret = boot_sector_init(disk); + if (ret) { + return ret; + } + + g_test_init(&argc, &argv, NULL); + + qtest_add_func("/erst/get-error-log-address-range", + erst_get_error_log_address_range); + + ret = g_test_run(); + boot_sector_cleanup(disk); + + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 6a67c53..8409892 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -46,6 +46,7 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \ (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \ (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ACPI') ? ['erst-test'] : []) + \ qtests_pci + \ ['fdc-test', 'ide-test', @@ -208,6 +209,7 @@ qtests = { 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], 'cdrom-test': files('boot-sector.c'), 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, + 'erst-test': files('erst-test.c', 'boot-sector.c', 'acpi-utils.c'), 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], 'migration-test': files('migration-helpers.c'), 'pxe-test': files('boot-sector.c'), From patchwork Mon Feb 8 20:57:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12076737 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 2601BC433E0 for ; Mon, 8 Feb 2021 23:16:14 +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 71CD964E6E for ; Mon, 8 Feb 2021 23:16:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71CD964E6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9FlM-0007BQ-4r for qemu-devel@archiver.kernel.org; Mon, 08 Feb 2021 18:16:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9DcD-0000tn-4X for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:38 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:56650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dc5-0002mQ-03 for qemu-devel@nongnu.org; Mon, 08 Feb 2021 15:58:36 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118KvE5e047006; Mon, 8 Feb 2021 20:58:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=fpbRO5Pj227pJ+mfHgzCx03xnvItbs0J4YmY3PU2Xt0=; b=DI3FZOwwhFfOqKGRz15TTeB7UaI4YVtj6cpVesSvE/IDWsB/xp31urr2i1S0yiv+pb0z 0CGZ98E6cLY/79NvjHV5ae1Hj0lxFj3SruMbXPXc5g9unanW57PGib2xPhfWsTcJcxGo 0mQYutF3rKSp8LQoYFku2UKjZ/K9ltm4b0Awd7xGalx+/crXn1Rgcyqonkg6OnpMfz82 HlZtIg70TFcczJE3AxpiIIMhqdCO/O35H9P2GOI4Q3PZX18b/wXgfr56M41Fj1S9Jm8G D0iPmWpKqF8cD093RUv4T8yIxDc/rn35uyOgmyPSfAaC8WcfgdNMFxuSEdsCnS9wykKN Dg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 36hgmadg8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:25 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 118K4uC5009231; Mon, 8 Feb 2021 20:58:25 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by userp3030.oracle.com with ESMTP id 36j51v5s12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Feb 2021 20:58:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J4bF3WhmS8unFZwGeIJizG1KQzUdWNCxabq3y3rsecLFOOW0GARcEfzWHimf3RpblHdNYb7BbahlKWdW9/vU5FvFhePyu4SlxXrFGFXllrIE4rRCghU82yjn/k9+m45F7t69ozwhTEWZzQHI2A3nWiAy3Y2JHvfeautQQho4SIA1T+XDaBcgn1QDumPmlFRQ+Vaa5+ZKNnA2jFkRBkdZDJ10mItTCMgkmx9zIg9luEPReSN5SOE5cIM5pAyqsm1x6hEeLBM/VnPBx2YxsRFZha1I9DbOCJO8IXXWN2vHlRBo/p8I2U93L0SGzFj0HXwdrcpFUiwQ7if2nJq/XLHqdA== 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=fpbRO5Pj227pJ+mfHgzCx03xnvItbs0J4YmY3PU2Xt0=; b=YkrmfH3tSRJuic6VAVY7RdbdGxPt7chZ7vEHAdbHy/TlYrJfIS8dLW7FlK2Vmvz2pc2mIPxgX9if1cde7xuEljBqVJ4awcKKcl86t9LYg+MGMs5g5JDR7EhwLjc1XBXvzdx588nQRLUOzkKSGuXCXmjSJMfyQig7E3V/cKZ0OIClqvzvVcewN1hhyNH324ycXzA9Puq0gCpEl83ZJyO2MzVpB6c+e3DBW24kdeedP0APWfN52t4gQS+7aN5RlblJzrLGArnSc8RW/HW0juxB5nl9SYd4p3qhRgp2LYwo1UBl/uSnDsrnYiG5IzFvtVzOI8FMf7S7I+eKVwjbFLlD6g== 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=fpbRO5Pj227pJ+mfHgzCx03xnvItbs0J4YmY3PU2Xt0=; b=YbgTnvvn1eQWZP8eS3dV8adtcaK+2d53D8Ycb82QQfeU5YOR2qr1qABFGuqQH8yS6ef+CwwDhd3BlORUgGAF29lPrctoxLfGraQeHHc5TT726sKzMGmIJu9O/jSwZdc0TXUCv8AyAa9Q7CS+QToopXFHqq5H43Z/kV8Ajn7LRC4= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MWHPR10MB1599.namprd10.prod.outlook.com (2603:10b6:300:28::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 20:58:22 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::1193:5eb7:7993:85a2%7]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 20:58:22 +0000 From: Eric DeVolder To: mst@redhat.com, imammedo@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 7/7] ACPI ERST: bios-tables-test.c step 5 Date: Mon, 8 Feb 2021 15:57:59 -0500 Message-Id: <1612817879-21511-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> References: <1612817879-21511-1-git-send-email-eric.devolder@oracle.com> X-Originating-IP: [138.3.200.23] X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) 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.200.23) by BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Mon, 8 Feb 2021 20:58:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 961f7cda-26cc-4921-4111-08d8cc74455f X-MS-TrafficTypeDiagnostic: MWHPR10MB1599: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJ007RpxZOTQ+GQxCMgTVCIyLnVSRAM7l2ZB4aNUOXR/rN9guaFIeFpQLzM8YGdFGIHQ7OnhkA2F6NGs8FxfrrM05YsfJOzlfALDHMfat9KiRNidbHmM3E4UPoLitESe4Ag8vWc3cDkeiIDjUvW7P7FicLcOUnHOXP0atyD6jGY3vm0IAW5X3Mc9zzKl+mUwRIf1RB1Zwa74S+9O6/fQGpxs0J2bs3d/WSfM6uEq5j70C4RcKNdAys5CiR+EutZ5tenAAQKuFXG5AkNSkh3FdnMc63oEj+UrvEjjRtghIkFb9SZT2OTUHTJ8ZePjARq+42eq9dxCvYYCT+IUQDOe7P/t4V9RjMS3aIEkIkHbenetKGuySH4HWDQZ/5HePts53RoD2gl7wHcqgQVsEpFb0WNFTwD0Xe9op2+6065Z5jz1+NNW5eQzUDsI9kYrb041Se9+XcRbmLyHaYj2aqI+mq7KCZjxlg4bmOfuhfYEThVF3Jvj4p5w1bScbm1d7nL1qUEiHlJ3r47KeYZ6ECr7tw== 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:(136003)(366004)(376002)(396003)(346002)(39860400002)(6666004)(4326008)(316002)(2616005)(52116002)(186003)(86362001)(36756003)(16526019)(956004)(5660300002)(478600001)(66476007)(83380400001)(107886003)(8936002)(26005)(66556008)(8676002)(66946007)(6486002)(2906002)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: v5negZB11iU30RL2gjqM3CviZaxQrgI1ctEqlci1RVhe+nzTXo7zPUxURXJc+UcDR2c//H+4eLW1gVdugCjh61bK+HkhUafKDd51nD9v7PKf7f6GaidtPP4ex0MFRpkBwwDm0q5uKwU7EUO0jLaBg28IRn53b84MTIbd34BN55h6ACdbDBRN++UiMJqlmSdDDsDUXLjalnm+LO6/7udTfaL5CNtGz5gWDyezOXZ3uGGHSTUBgZHHy9Aj/ELOQBcIWnEGtXttub4byXTrZTGyfiGTKWe8vSMhNTC20vN6yutmGLHieowfLAzU8gZOm+QboU1+iLfv2uleCvUtJSgLSRwn3QE+coWu2Uh1M5noBmBIgbVV6vS5lbgWWo5tKm4p59kCjemYFZhd6aVyZff0HfNEDm4JdnJkzVdHL1tI7iQQoqCJC4UjXztxbxKc1NuhjAD45TuJmK5xW/iYIH1R0JmQ4FyedtDkLsTzqVYee0v2inap7JFyS4cR7psi/Lg7brmpPJEP5wDK2hziT5DSXBRntYXgpgMNu1mhjNntC8x/XEUIHizXVe7H7NlvfTEd/DYudwi+Chj0nO4E3kyrWdB5DlIq4228tUzvp2QJMHDb5YP4W+f7KmQZE16+pqoU0suBBRzh/g4OXHzwdu97olw6iX/wvwQm84vTrQyBhCkJgnO5jBYAr2PO3D0UOHwAYd1JZ3Cdtam1zCQJVntVO35Gke3dNHofdi6yvMvP0uy8EzHWxyw5lsWvcETMtttgpnPpLLwikGD3JXMkCzr6idGlTmL1HR5jM0uRPIH01wGpnRyT2R7hVZsPzi48gO8og4tCPgl3wmxobkE1dBqHVOSnDDj4PS212oea6MttWAbZ7pgFpKi+igM4hheQ90wr2x1rlYa3tg/gxFmkAdyAFS9lvDijT88VtnizA2ebLZmoVNH/p6zxYlk4baKQpZAJRd8+eNePes8YG925sDUoySsGyFa3L7NqZ2bAgGW/pdIhthzuKp1DqXGO4+stdnSAJvgU5Pw/L8WkIPi1L8r+8DkHPLTUOHntfYPC2lQYKxWP9UcEVNniCBs0Kz+A1nZK9oIWB3aTU78gcQPdet3stFRY/IsGNhsqJkuu/kx8eKJZAYAi2rGRRHZ0IjsUaGL6TlisLqAhh4IZbu+0LYpeH2rX/Mye7Zom6w7Gldy7+pwsK57imDPIsgL3MO8bi9LxM6yOkmaLrflYXQvxiunDNh9bXUbcOi4LLupt3YSt/W6ehQGuLtr4Je1d1hatzC9bj+ZR6PQkce8bYCBwv8Hv2AzLhy90Bf9JawNOwhEfaKcxWPxZDISbDde3VP+rtia+ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 961f7cda-26cc-4921-4111-08d8cc74455f X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 20:58:22.7099 (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: nfoYPNRVBMYT5k5FRwFIBGJR0z2ZDMggwAQhi1CcX7EZT8SUGEJKzoTa3MAqNaF9HDukcXTo1g00RPzlYCQGbg1A6S+gELRKlLTiCkKPkqo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1599 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9889 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080119 Received-SPF: pass client-ip=141.146.126.79; envelope-from=eric.devolder@oracle.com; helo=aserp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: boris.ostrovsky@oracle.com, kwilk@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change is step 5 of bios-tables-test.c. This change is the result of the output of rebuild-expected-aml.sh. Signed-off-by: Eric DeVolder --- tests/data/acpi/pc/ERST | Bin 0 -> 976 bytes tests/data/acpi/q35/ERST | Bin 0 -> 976 bytes tests/qtest/bios-tables-test-allowed-diff.h | 4 ---- 3 files changed, 4 deletions(-) diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fcfec715478919a40b23aa20fe90b5dc74114f58 100644 GIT binary patch literal 976 zcmaKqSq_3Q6h+HC4;wIH2`<4vNc_`?A1=;C>4wDK(pSli@Dhg0>1lbC@iyIGfl{8= zUxxG4^^fZ?>Svx(3ir4k^?^Fzq{pfb=l2IuYPL5Xarh|VK5>7+jt9gMQR0UX^!h2U zKhI`JNPcMSpC4H+{&Ry%e-ZJR=8u`9;nn+b{|WgC`6jP?i(UUI`6>A(pHwLQIbVMt zREF=j$7%kI=Ff@e%#r`Szg`=tAiuyvU9!I=@p8eASHvsk$UFVj4wDK(pSli@Dhg0>1lbC@iyIGfl{8= zUxxG4^^fZ?>Svx(3ir4k^?^Fzq{pfb=l2IuYPL5Xarh|VK5>7+jt9gMQR0UX^!h2U zKhI`JNPcMSpC4H+{&Ry%e-ZJR=8u`9;nn+b{|WgC`6jP?i(UUI`6>A(pHwLQIbVMt zREF=j$7%kI=Ff@e%#r`Szg`=tAiuyvU9!I=@p8eASHvsk$UFVj