From patchwork Fri Oct 15 19:02:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12562651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35EADC433EF for ; Fri, 15 Oct 2021 19:06:56 +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 7499D6105A for ; Fri, 15 Oct 2021 19:06:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7499D6105A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSXe-0006dr-DV for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUS-0003tK-Nc for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:36 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:53516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUQ-0007ee-AO for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:36 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIEiiI007407; Fri, 15 Oct 2021 19:03:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=corp-2021-07-09; bh=GjX+lo14eFdxClVrSX+jYCt3YfSu55185uQ1kLNYJnc=; b=ItowGkCR6+PUcq3HPGf8IWKTvmnCrRGt7QbZ7C+flYAr7c7dZb6jm6z1ZnPF8enqkCkM kbLmAoL/Y6AU+dRB4Pil6JoATUjrPE15R51uGUT9p+lQ0Yho43qGzzkRFW4YP4j0wn7g XLQcy+Sz0jr/l49OAplBvbk12HL3XUIw2ffpW93W/lt54EoerOAhnDWHUD1b0NwkagVd LGB/7XP9DUaZn1er8nOwOPPFP341QW8LGmQ+oHJLX2zoJlgCA3fokW8pLj7uoAlxca/8 YR6IOqLzxvkfKAHoVybQ+TjF0+dKDSpeSQqgWeJH7cC/FiJV7sLav7XEb05wZmAdJb3g Jw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3bpfsytrjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:29 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ0tsm180973; Fri, 15 Oct 2021 19:03:27 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2041.outbound.protection.outlook.com [104.47.74.41]) by aserp3020.oracle.com with ESMTP id 3bmae4nd20-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZjxnL6m0eUb6R94sR25XHl+VEuJSxjmGX3oNLTKZ2/As1Da6a1hvx9uLKMcYJyewAN8L8ax2Bg8R+cEdLfiGNWO9wgtq/cUEkl4OFKCUlnGURXaZDWRsdZU2EBtLQ/TqEsoGFD2JVZkuMdf3lcmU5d8dftHs6NS3ZxCmvL8vcXmw1aiiAZop/sPBDgiNKEWAcyA+YGPnTiXtCobJDlbcUZ8Iapq1IBxnXWxH8yrawi+xj8uLvPk5gHdb3SkB/ukCraAveI5s6I4fR/yii/0n24a7QZVajNBmDI1XyZDIa69R9kg8VA/C2vnCFq/RB3YQiFXxH9Id/kU2iah6B4xlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GjX+lo14eFdxClVrSX+jYCt3YfSu55185uQ1kLNYJnc=; b=TsDhqYuWphyPOQCsmB7XdIT0g1CKW3TZ7ihyuSi3oAuyjRQpgf2XWxesaVcfENRZ4p4Pk+L/fH71GFo3FeW/I2ywhigOPgmHGEhE453fvO2123s9tbQ5gj3v08nVFjTlADpKs5qvZ1nq0Wt90hdHjDc9WNYqGMI0p4YA8lkbqFH6EBmQKytca5foiHgjjZQywGDcHnCFQU6ca3Pt1VGpW0sNr2ETX4NKJMP2eXsPFZQdMYAEyev2UJUsBSZgFm/s2KZR1VN9RmjUHTckpa+um38PnjFILUAsQhjePxCPKhpvCooLcwoCgbZ4IkzuZbXmtRST1ovoIFhzlj+PjaotCQ== 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=GjX+lo14eFdxClVrSX+jYCt3YfSu55185uQ1kLNYJnc=; b=Gh79cjubolRFBZQ7+xa5SkLsfNWlW7Zp7cVN+ouJdT/JXJqKMlDZjh7PSxuepDFXxa5uJFvzaKzxsSQoUo6aQR1CbVCm33RAxtpxZdNCc5Oi4X5k+EqtdlwyGz9gU3JanB3eU18WHOmzWPghsVD9I3JFB28/rhip9VIQf/b+Qn0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5441.namprd10.prod.outlook.com (2603:10b6:5:35a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Fri, 15 Oct 2021 19:03:25 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::90ef:e061:a4c2:acd6]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::90ef:e061:a4c2:acd6%9]) with mapi id 15.20.4608.017; Fri, 15 Oct 2021 19:03:25 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 00/10] acpi: Error Record Serialization Table, ERST, support for QEMU Date: Fri, 15 Oct 2021 15:02:50 -0400 Message-Id: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: SA9PR13CA0129.namprd13.prod.outlook.com (2603:10b6:806:27::14) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 Received: from ban25x6uut23.us.oracle.com (138.3.201.23) by SA9PR13CA0129.namprd13.prod.outlook.com (2603:10b6:806:27::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.9 via Frontend Transport; Fri, 15 Oct 2021 19:03:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72a28129-27bb-49c2-2368-08d9900e76c2 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aUCW2dOhugMfNjctewvbVMgZxirK/9P5qhBU2OVXdPw2fQMQZvJ2edcbklpDz6IsRboFiFAsWSP98jUJM/k1UHFpy1+tQstQ1Vuts25QOCBPIZhIA5FIINc/pRL82c2bjgKHgyKl/wOwkE7plQ+v9w4w4cS/NiGBmm+3SdiQS/20Dl9NIZi1MzgeD2hxDmYTiBHjWOx5LydfpQisu5V1WvvWRHCjWQcOW7dHC8ULUwiexr++krGEmjGDOasC7GTYfZXxVJEIQuYKoOEfsmUePz1cdk/O7lSTeSukD4wI62sRoNIqyXtakBCE1/5xu0wie6n8MZ7XqNoOOaA9aLJ1prc0VBvFyVk3eh1a2kpTyxSfSRx0PqFwQEuNWwDrZzx9zFV4XiECc8JcJpoz8hyGI2pQRE8HcumyyfMuV40iP0xXmRH/uRNQ1PEzkxNwH9nvZvJ49y/fhpwvOOdg+wtIdMiPGP+JVdIeU57ErUZ2LzQbEc2Ec0cJzREymogret8UUN3tJI11dUPAztB2c7weo8/ebiK7Nm5NuhFEohLQZkpmp/msJTPmL6GqrbJv78OQJ+C/RPI/b9DNGwm8uH7OdED0W+SbtDO3rvGRzJ5QridOUI5aQV2Q2E2O4vTxu100d+DssGi6AOB8cWffhIklp+CZVvcFZwrFlblbdfnPjxRnAWd0pAw22kCpI8g4lOZ5s1D2EfMaD1JcQwQnEveD/w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(36756003)(186003)(66476007)(66556008)(66946007)(8936002)(83380400001)(2616005)(86362001)(6666004)(2906002)(956004)(508600001)(5660300002)(7696005)(6916009)(4326008)(52116002)(8676002)(38100700002)(316002)(6486002)(107886003)(38350700002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DTZqO81Rf4yP+EBvgjFE6IVUom6kPUjVFUqFkCAM0K/SbG3AELzHiR4pfa00dLwYmDkCyqDJ4Ad9U3LxofcEFSxpLzkAyKbG5q8OIFzjP+PwK6fmc3BlNcMI7pl5uPul6hExQxkf97hzZhFcRh+5I5Zp/0onTfENXPr5SxgNCffsHXbXR8oFUmWaG/kycQfrWyh+rVPl0vHy0nsf1tYIH5j1aJ7QP7kkU8rmTmUjjwmQuwXzHiG+uNqqsd9BHY+sNMjbEimlQmtqNKdXJOSSaXj3gwKl4rrTXXYenaqdNtHJynNbNseW+qOlL8ttFoUXZb3ViPYpRkD+ycKMZbMSjPes0kLtjzjaIVbVoj6Cc2bo/7n0eMOEJfBGozHni/oAuRn6rQG8YGc3sNyK/9U7KYaSG4kpsll8VpWJvK9lKoZmn9rn4uqFuE3nvuSctYQqVR43UtV3ky3ThB7T2CCYhaQJGhnFc2DHgZ4oShEyoNS5152hf2vNvbhfkudlMmg1wUh1ugulvpztoFfEWQawcsuADAuy2XuHjvdUTOpLc09J+LuKX8VrQjpphMK9lq07Nz5ktC6yDUDr9xdMgncFE4QkefJdRc26g/43PO+w/DpHjGqDd1CGpQhVdjRxk7e2dIamnUkDcT4g8YInw4ude3Gjs12f0PMIHhUoTU/S+p/QrgwUi7Zlj1CfUgWXGuxSJnO97BMjFThr6IP3w4/rDnf1U9XKkDxCL516RtYXbaSZlY1VBWxsEuI88YHfC1YFAGyzq9KUOLT1Nh43Eay8/YDwlG02cPF5bAY/xNkh8cOkQI4BIRNesBDMNzGngDvpUQRoOA7zvb1OnW7c1A+AIR9zsZAppCK4R3TYGAsyvEnELZxMILlT/jnc/ho/d1L05ZQF5BraaUuPhMXd/0ETveZjMJwqh2Zxqv2Bl+eDB8ZM5J5byYRicN+TTs8PTKv6JbQ6xf/hp8fldwZlgJy/oCcNJdKou2/6U89lYxbcQJsTIX5Sg+BuYVuuGoI0N/ZRIvT6YKXBWpea98nkVC0YOvVFnwPz1ewgtZMcVR4iEFxN9vC4mKiyNi/s5t1+cWqBkRrLeMtIorgT5A9YGNbqJIpp/QXeUrjYD5XO23BpxaqdnwuEX45313L57bDvpfWKNPQGBEbr3kQnX0+Vf8b0HA9NP0ZcgogDC7Xf9iM88lPOyoChHFTVXXPCS0RhdtpeIRJ7miZ4QVicDA+wV6HGrslWwI2QEgZUH2ezbee4Buy36jmlEB8e4kkpgZJlbWI6TK0v1uXm9py2wZlDgAwz3nKANEhM/4WZ8Z4zScfgKSnX5KscE2Bjad3NZYEUShoX X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72a28129-27bb-49c2-2368-08d9900e76c2 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2021 19:03:24.8481 (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: uavC5caTcXUVnv3acA71Zo47Wqg23Vus613LVij7oUVMYbe4AEhSL5RfxZPCuCSEIEmzrt4d8+/VsSWwP98nlICLrb97x0MPwRPn54TGOBI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5441 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10138 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-ORIG-GUID: rFMxcVen2fNicaNslSX7SoXZjCaezGne X-Proofpoint-GUID: rFMxcVen2fNicaNslSX7SoXZjCaezGne Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patchset introduces support for the ACPI Error Record Serialization Table, ERST. For background and implementation information, please see docs/specs/acpi_erst.rst, which is patch 2/10. Suggested-by: Konrad Wilk Signed-off-by: Eric DeVolder --- v8: 15oct2021 - Added Kconfig option for ERST, per Ani Sinha - Fixed patch ordering, per Ani v7: 7oct2021 - style improvements, per Igor - use of endian accessors for storage header, per Igor - a number of optimizations and improvements, per Igor - updated spec for header, per Igor - updated spec for rst format, per Michael Tsirkin - updated spec for new record_size parameter Due to changes in the spec, I am not carrying the Acked-by from Ani Sinha. - changes for and testing of migration to systems with differing ERST_RECORD_SIZE v6: 5aug2021 - Fixed compile warning/error, per Michael Tsirkin - Fixed mingw32 build error, per Michael - Converted exchange buffer to MemoryBackend, per Igor - Migrated test to PCI, per Igor - Significantly reduced amount of copying, per Igor - Corrections/enhancements to acpi_erst.txt, per Igor - Many misc/other small items, per Igor v5: 30jun2021 - Create docs/specs/acpi_erst.txt, per Igor - Separate PCI BARs for registers and memory, per Igor - Convert debugging to use trace infrastructure, per Igor - Various other fixups, per Igor v4: 11jun2021 - Converted to a PCI device, per Igor. - Updated qtest. - Rearranged patches, per Igor. v3: 28may2021 - Converted to using a TYPE_MEMORY_BACKEND_FILE object rather than internal array with explicit file operations, per Igor. - Changed the way the qdev and base address are handled, allowing ERST to be disabled at run-time. Also aligns better with other existing code. v2: 8feb2021 - Added qtest/smoke test per Paolo Bonzini - Split patch into smaller chunks, per Igor Mammedov - Did away with use of ACPI packed structures, per Igor Mammedov v1: 26oct2020 - initial post --- Eric DeVolder (10): ACPI ERST: bios-tables-test.c steps 1 and 2 ACPI ERST: specification for ERST support ACPI ERST: PCI device_id for ERST ACPI ERST: header file for ERST ACPI ERST: support for ACPI ERST feature ACPI ERST: build the ACPI ERST table ACPI ERST: create ACPI ERST table for pc/x86 machines ACPI ERST: qtest for ERST ACPI ERST: bios-tables-test testcase ACPI ERST: step 6 of bios-tables-test.c docs/specs/acpi_erst.rst | 200 +++++++ hw/acpi/Kconfig | 6 + hw/acpi/erst.c | 1077 +++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 + hw/i386/acpi-build.c | 9 + hw/i386/acpi-microvm.c | 9 + include/hw/acpi/erst.h | 24 + include/hw/pci/pci.h | 1 + tests/data/acpi/microvm/ERST.pcie | Bin 0 -> 912 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 0 -> 5969 bytes tests/data/acpi/pc/ERST | 0 tests/data/acpi/q35/DSDT.acpierst | Bin 0 -> 8306 bytes tests/data/acpi/q35/ERST | 0 tests/qtest/bios-tables-test.c | 55 ++ tests/qtest/erst-test.c | 167 ++++++ tests/qtest/meson.build | 2 + 17 files changed, 1566 insertions(+) create mode 100644 docs/specs/acpi_erst.rst create mode 100644 hw/acpi/erst.c create mode 100644 include/hw/acpi/erst.h create mode 100644 tests/data/acpi/microvm/ERST.pcie create mode 100644 tests/data/acpi/pc/DSDT.acpierst create mode 100644 tests/data/acpi/pc/ERST create mode 100644 tests/data/acpi/q35/DSDT.acpierst create mode 100644 tests/data/acpi/q35/ERST create mode 100644 tests/qtest/erst-test.c