From patchwork Fri Oct 15 19:02:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12562667 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 9B10EC433F5 for ; Fri, 15 Oct 2021 19:09:36 +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 193146108E for ; Fri, 15 Oct 2021 19:09:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 193146108E 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]:41792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSaF-0003nF-4e for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:09:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUV-0003uL-Bz for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:39 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:35630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUR-0007h8-DJ for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:38 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIgHi1024951; Fri, 15 Oct 2021 19:03:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=0pnkBo0Jo0Mv2Z/pP8Uw4ieZq+cGWDm3B+qrm35nYuQ=; b=YAds516/q87hcNcdCwpORYCSGHgFFpt6wTupTBgtmA2wNjG9bLFUO2gOp2zSNWMZjW4d OafyUgxbtNjKsl1B15ZtyDGa3+ZxX3HTXg4jIRxw3Q7tm3jTEC+gA42e26nqFXxTFoVc aHzjM2X0ZQOSzQniKCjhBZ554JKSA8FWkMGpXO6PjJFLFzE/x0X01e/HHxOWsflitg1i Xfj9HCb2RDmd+rrmUHHuV394Kkhd9MiIuXZFE9P/PJI+dKrEPrT7yRyQx7MnL4CUGfH+ Q72KyB6VyiJTs34Q6Mbhl4Irrdzieq6PVylxBwWVTIE1hPclWVqT9/sAESv5tuw0Y9E9 1A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqbgfseqd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:30 +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 19FJ0tso180973; 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KU1LH/bsYCGTJYkOh2gbAcGbvq6/JJyGacfT+Ca0HrIHb9M3SPqdZYnBx1SC3nj4Q5htY2QIiXAWDwE+I83US2pQ3MlO3/Le8UPiHGEnbSHA4xJpKXeJq7XZij+39yyemW6XBXyUJNm9nDkGRReoQXP+k0XzeA28Gf9a7rCWdcXkup4ivgC7wxJ9yIclmuiCf09tmzIC94vB5siuRQX3Yz7hNniWnbp0ZWOeOFFUaePNEnCqAOAFW58cavewqz5RqwKxo6dDYgvv4vVNrAqpLUmLyrPnD7Y5hkbqBtT3rXirN6Oll7MBaQfTETQVk29XOZDAS98475DAdAiZVcxe8A== 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=0pnkBo0Jo0Mv2Z/pP8Uw4ieZq+cGWDm3B+qrm35nYuQ=; b=LWkCJNJ8ZJ6vMq5yd9fQXrkTZaa9+Ty4wGw2x+96LKfApTZ+DaMxre/2rI9knlirmMJJFYldsB7hLPDLWLTIqJ2GnkQRSBeJpu4Ju+KHfxEC4Z78zGug8fsDd4Ty7Wn2jhcoRQMmDeOX2J1Eg5kAgPPvUMy3KnQF0bhLV5YyZoV8DBG7qDldnwPrAEBV2JTpEL06ZuccGY9z8/45DtlM3MKKv/xp3GnRa8s5snuhJJHd0DupbxOhTO5lHLIfj57Da+8GZ+Rn7qZfzWpjMeVsG8HYO3g4LIb+ufpxocShjAps5e9c6EGNa4vg35HKFXt6GgFc66IqGuh4g9ZeV5EsNQ== 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=0pnkBo0Jo0Mv2Z/pP8Uw4ieZq+cGWDm3B+qrm35nYuQ=; b=t6cMg1kKigiTv2ifdFxRCamEmDguCferVtuyTCmf1/b0kUQL94tsSBpPcZ92Tenxohl+1k4OwBXuI3Zp5neHelKtzbS/RcKP8jy/bLEm/TN+tzmjrVAxAI11NyUT8ZzcrUW8zI/3+IAYM12woRolXyvbK6VY5cls+AO5e5vm3oQ= 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:26 +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:26 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Date: Fri, 15 Oct 2021 15:02:51 -0400 Message-Id: <1634324580-27120-2-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 851028dd-84ab-41d9-7873-08d9900e77dd X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Zmvx+yMuwskMTpOe2up6YQlFsjRXrqpZ4onXMvyOztwK8iRHAp9dbCpu8Lfl3SxUmFJEITykVSj5DBrBfrMEMePKNQshGe6KCG0mZCkK9HQfADnzfC9jVqUSi40IRKF7TspFC239l4hhIYIfRSyLAKK9zk05XzCqSfLJ3XOXf33qvNw9p9UAOaStDR65QLxf6yyeBL3AKAt/hUJ0Eev3G0vHzp7dD8Ps0yCDfQJmSn253eYPTJBQgTfQ2f1q5gV+g+5rgYlSWzQYuI3wACrTrQLEfB8rDcMm6IvH2uMtYEH/HYhbz5ADsw5o3HpODfWjXdUsvmDZaKWAtKX5BBN/tTFHVUDGuk39myR9V7H2Y47bKS1+urXd1hZqwqFhnwhwOW9MQqkM7IWlbOikSg/RhAWQL0zUsKYM9dQj6FqciIR/mZ3GDmqrNSxGeJGLTWVa2JjsOAlE9lNT5K9p2UtstnB33voSXSIlZwAkS6Od78Sbqkh5v7iqDSSlhS3I1CVCfHpgthpNTqlZonZmx/P7uIttn7NUWsPkix9OkCA+2CT+cfOsETwP74BU7+/rx2A/uaY4krkyX+2EOwQMvKgPuf+aeS+jVv+/1qGZdJzHjHwITyaVqhf6UMkX+biPGzj1V3Ryf5e6BcPRWL9WQh1guxvbWdkJzlLUsG5TjCo4m+apIvJ0P2CsQl+KOUePsfiJK9cdqiN5+y8EWaV947HDg== 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)(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: dFzNkt3zpdVzeQl/sT2vBqbMpkIkVDndkTKGrzPGWPQJ2/SsYKTrt1cylLl+oEznFnBfwN67qsP9aOIZ4/Zx+eUaCsd4Mn24i5C8DdUOCKtbMPmCyC/UnszmEQS3vCol6cCG47enmGvBZXwpKitro+yLGvg8py2daMOiJE1bhNUDfvLWBCM2AnSyL1DNzRVHcQJtku2KFKVJ9VBOALm+nDU3npmsfo8gbZoAQb8K2CTvJIRCETcipD9SDj9gLHNV7CO3DS+iA1ZVyAsbB3Hq2vpfdQPK7De4fCOd5q9jGhT0tGGdQ0yOX8+kNaq+40XS3ngf96/cEerr+5TUQ9ouXFcQIGE130eLqrn11JrO6AlWw4qgEah0W1EHP3txe2uXKeFEiEEUCm+ZzBcOgBQKrhvzV1ep5i0S9uMlvQQCREMwGCMNkNfbd7SVJsEJHggARH6mgODl/RWJ3EtrYCbDk7gZ6qFxxGPDI/a8N1Dt8PqFPfglzvxCVqTdIHclay5UAhGvXhHZpDoumzLt8gmnu/JHQjYdgnyyGs6n11kaAbiQnxwJ8sBJDt5ecRkMnM9z5AfJDxqt3S3TVOZam1L/mFrtK3AXbVBPX6jzh5pyznGj0P7+Y/xLnNEgmXO7Q7fhx77N6pydJIoKHAw6RKYlYXa3abHDfP203PRBUsHxOlSFMAnP0rmxbnnOzetfDAUO35pDIAAXDSLjCPAyAZbxJx6ACrA1rWJRw9IZT63OchiiND9HmdHy3YI+iv/N04x0PBkbF91fT5LeUK5aWeqvfBD1vG/mzApqAdSfmXkom/89rycO0Gvpeo4doGvBiq7JZPqJYmfnbrOZgQ9YpqHn+eLQz1XGW29GvFQhnAm+KRJsseHjXFacq+70LMtqjAGGywb821RdLv6egYwUViC1wvLC51Dz4hrD9BBsE2AuF9h9NKR5DrnBeCnh7E4QHMc1PGq43AW9MT8OMCodFDWGYjcSl9OCC37gQTHgjPR9GaFjbaUkvOdAOCTCnCr2W/tWHIp/ElW3d23CQlcfJKZyGQDUMQ3R41lQvgzWfDPSb0UI4B0I6iYPaaK/SvgRDpLXI29hjJ0cw3mt0Q5N4ytJ0D6PfokrMYpFuosgfNSdMQ4EeKCVzCNoJBt4IDMWcZz2kAx/TeorAAbw8lMD2Wh5OwLwff1sr1eiRwls0k9SRHeRM+zQitNsKG1k1vqt3tcNvPKpeA6DdRoN4DyhV0jIW8YYiWhxsJPf/UPB3k3hPHQdE3Hi8WoVsRv/cXTOa9qrPRfa1kie0Gvt9hcGxbpxu8T7qVVDtlE/cyCLGs/sP8yawRT8rkwlfY10l4Vr4AHk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 851028dd-84ab-41d9-7873-08d9900e77dd 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:26.6223 (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: Vc7tUxXmnsMtBeAgWLQsABCgIehB1FYxQ0qA+JB0xWTJtSf3Ptl8YHK7hpIPMhpKknVw7UZ6gwmO8wZzycK4ygMocPaxPlJPvt0TtYc2PAg= 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: 0ZD75m9-BGTI5txXFhJfbjLhuKTWfr0e X-Proofpoint-GUID: 0ZD75m9-BGTI5txXFhJfbjLhuKTWfr0e Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov --- tests/data/acpi/microvm/ERST.pcie | 0 tests/data/acpi/pc/DSDT.acpierst | 0 tests/data/acpi/pc/ERST | 0 tests/data/acpi/q35/DSDT.acpierst | 0 tests/data/acpi/q35/ERST | 0 tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 6 files changed, 5 insertions(+) create mode 100644 tests/data/acpi/microvm/ERST.pcie create mode 100644 tests/data/acpi/pc/DSDT.acpierst create mode 100644 tests/data/acpi/pc/ERST create mode 100644 tests/data/acpi/q35/DSDT.acpierst create mode 100644 tests/data/acpi/q35/ERST diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/DSDT.acpierst b/tests/data/acpi/pc/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/pc/ERST b/tests/data/acpi/pc/ERST new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/DSDT.acpierst b/tests/data/acpi/q35/DSDT.acpierst new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/acpi/q35/ERST 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..c06241a 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/ERST", +"tests/data/acpi/q35/DSDT.acpierst", +"tests/data/acpi/q35/ERST", +"tests/data/acpi/microvm/ERST.pcie", From patchwork Fri Oct 15 19:02:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12562669 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 99377C433EF for ; Fri, 15 Oct 2021 19:09:36 +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 178996108B for ; Fri, 15 Oct 2021 19:09:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 178996108B 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]:41794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSaD-0003nJ-Aj for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUW-0003uh-1V for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:40 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:40060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUS-0007iH-W1 for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:39 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIeUA1024918; Fri, 15 Oct 2021 19:03:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=dC681MLFBirDfMmJE2l7FpL058tXQk8lhHMW0vSUFBBrtIxn55ahos1t53CsaD5qrWww e5GFaXJTrXRvpwZ7iUSI03cyfAzr647h9zuaT3bAV6NwLxwHaV2ODH1yQQgNEO1URLjK c0tbtXSWKxqcpm14m/NpzCaZJsvuJLanR4BdxY2fMFY5AH18q1eNbtg4blYVnZ2jKrBS 9GaE10mgpaDJ17PkXW9LWoYsQ61r7wMrvRxBMns604FgOmC55jG7xtXhlo32OloLSsE9 xK1XRZLQjI3wZnw05V8o/gU4SgLkms8kmravAf+oMwyNhqFc0GuozeFQf8d0wMfSvpU+ Ag== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqbgfseqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:32 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ0aMn082428; Fri, 15 Oct 2021 19:03:30 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2049.outbound.protection.outlook.com [104.47.74.49]) by aserp3030.oracle.com with ESMTP id 3bkyxxapvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTl3GEqMY/iEfxrwneu5zS+rBTfbli162o/PjtlW3Z3kpyk2H+abRLFJSUbrGDniaBA0WmbbiNCZzx/zg+w5gOlkYjxDhEsQDZaM88MMKEuk1GTmWsCBjIvwtIkstIt5AghnNXGeQrSB+wopSijvCSNJUmaYtuLc/5rfbm/idSOdqGy4JmVwFoozaIBYy9ShrDTtC/qZ5CvsRULx8IVmygza9EbIVFOBQVi5bucFYIe5GIOI+EzW1C5v9XZjrKP1Y+0h3VVEBhzKjC7hKyp3WiHI5aRrPQRbYzpnd2HiZQ3g4la1pkFFpF497fYlEXkReFZWLujx2D+yM6+S2ZcViw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=Oh/49gYoUw5uajIq6PAH6DD90mYoHamPMoqRgRZ/9tAZ84sJB9MKRwHjI1MWOgFZobSEf9U4x6Wzdm39nBMN37GxM8UlKlzwSjVdTUSrtRka5eupOlHRv12HO2nXi4js1/wppUZZFJ5P4gPAmb5JXhhLsmpKwSBbltvn9bbAqv24G/egwIkIPFi1+7donNpZd3h8kALxjvXDzdVD2DF+i53Boi2glN+Ht7Pz7GXhryKTUTgTrJrmkngxbYCfYsnCSJ97+W4aCJ2XoroDl7uBkklJQjLvBR+oAuEo6GM6ni/1ftF8upkX5USc0FbizWtbSF0WuiZ7dej7IaLJHGbJqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Svbr/JUHR+V6nUWPsWs23gY2WC2ULNMpPwKBALdQLwI=; b=ELmNm/AWpQklFyQD2LAYDxmMeBrAkg8MdJtGWYgdkBw1mHKw7CRvzTXM9B+1P1YO3uFgXLD+KjtcxNtmT2p8Nj6WZMNh9Ju4cDOytamxrDwtAY1CnnshbT51fDO0VPkpEKPiFpa9rLnQmASAE4Frkwl9KAP8NBJikQmIU2MTmUU= 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:28 +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:28 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 02/10] ACPI ERST: specification for ERST support Date: Fri, 15 Oct 2021 15:02:52 -0400 Message-Id: <1634324580-27120-3-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11fec5ac-0759-4fab-0e10-08d9900e78f1 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: uVy3eVMDkDcyNR0YD+MjUMn1DlzMy5Du/xwicW82cV8jJl7mPI28NzrjqakI5DEAbWLnJ1LWQEhH1KyFlKuXwwsn8ZqqUEdplhOvkq95zm38h19Dofz0xQNP0t3tdp8vw03jGbZxed1M8Sf+mUBT4lO/qnVYLok9/1a71O5oa7JlAGSmNnkKpQY3CASahLjLVVD1Lu5lrHc2UP4URbhF7ur5UDHmfNSyYWEa3cbDK5u9ycU7bwL+2QJmPGABQzIN9ExdufCRAv3/IGSLjsPVc5VIUbA2X5vGjzTDgoGq9VaepW4WNszXAcRbH1kNGBiSsrT3/QD2+IkkG8ZI2BrmQZEJPLcmhrLIjLQf0UeAwtkDbmsZGOuCNMruyI6bAhvlC97BysLp+ZcL03wI0o7iN1SdQwqetr38dmzYSigut1HCiK3OXqYbp5H5iDm8UCSja2Dq71di8hlgrEtOJ2vYul077XH9djsvNMCPym5COmLJ4JUvG6h09pLAI1CmlCMNubvoGz2nDOFWRSx6PaAKvk0IaptrR4PKBXN2ue9EbmEbmi43xjt9fqWN/ilpmPtl4uQfFGRUawV9KNjzumCLHibJjh5xhHOg0symjr8wRP8bJS5CAZmWME7uUHt3uV8sHoV9X4ecBWi8XGwXAp4UyB3PYwERjZBbI81wpydQi5jI093rZwCI/MDCmOBrnDsntwg8hQvLpZb96T9paw7dNw== 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)(45080400002)(38100700002)(316002)(6486002)(107886003)(38350700002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6oZSkSPqYHl1MIJKlasjokzeYtaiCuLM4iyvY3hMFKJ2dj4Hj4+1bqHh147Lul3KY2szhz2A4L+1CY9IhnWvl0EsE54iSwVultCWd3vujOSMXn2aEUPmX0snhYyBOcaXWMc+MYSnJDbnuZulcr0lKRtMT84I3CcioWj6GyRe80Oy3s9So1yTznYckAo7tSGPvtPm4Xv4m2rovpdgR3A1KyCy5QyIEUfgaUrXjAfnsmw3aF9Vw7JYPj0pvjdvHZ9DeaS7yKdo/K6Ewz2h/7OWeGdOzURbkklapYj90n/QJ0w7f3V0C8odaYzySOYNhJZ2tKxu9HE4xe3qqUgOtqrZakDd/dgDjPuE9WXeHJPLwdWa+ox8mmSZphQl0QV/fHRMMCWLpPBYkQEV2MapbOSHAzgintEsrvnzGpBTdez91PsJszQNtEC2Ji8qRggp+ePJDy+GXnVm+hx183J78sfBU41k3OgIzmQzcgQfRAyGjCjhY+GFI0IX9NnvAtk17I4IsjBPNQX95Koyl91iPnd8dIi8+QjiFyk+L4OtbRt4fAQcaGKB+B9djVuBxGsBLIZfoY9kysDTSJ69zMa80x59bWcdolMkGTtdL7ZvhFr6lL1NGSM0QDreR0AHGgqananiWso8/aujwTNOcr6BSEE1luxLsXDZ7MSmDtrqx5CS40I+troRIIhy3czg+uGZYM+cVus2YKdoCmPTaxWrgBNBFaxHCJfVJDDH3Wi7eYojVXO/L18yQGUBr3Wl4hInWBwAbom4yrpggpcx2A2Gyz3rV/UliWale1Zv0mInzAyh7rpv7y8MI70Yd0pebcCfam9atw1pclFiqTnG+QrjVa90/9jjPgPnkRi5n+ijB98dc9RAFQxmbbuICcdb8gDkSmmXXZ3V5QI6MuPKGGSpnuCKZKZto83XTTo/EIfty57FYnSMDMhTLn3WYjqreHvdy6iZzhqAUU9LVCEP2C1h9JSjJaTxM0AT8lTAT3lokfvfPgkrkkL/73Cm3+RnOupMhLGtnYfVncu/MpD9otvh6T99DkuaBhFKQSCjFrLq8EN3SERjIQik9C5SIz//45LzP2+cjR1FXclX4CoSl1yVe0SRM4w1Lw142725B0JWChYzMiC7FFrJP+n3egeYY/k7vBqHJmLHsa+VnhkEmz0ZbduEvNF9/BbQFzH/xZIs1diHrujEHAYQH8MsViV5Wv+keeIoe1xNCPHVsKe0Sup6Y3fxBpsh0wwEd++241MjUzUE7ynsADYfBkYp1A6c7rQ8cwGdT1IyUYdzq/+3HYbU8Ns8AenmiPoSP6kyejDGaFfA8t0h/StR6AV71Ule6Qg9RWyf X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11fec5ac-0759-4fab-0e10-08d9900e78f1 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:28.4622 (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: BQoOLPQWDWy6+WWKX9wplcAFI9PPAEwzVwBBj8gIjHO2Y5Yq3PLV2rOk0pYR3017Q+5HKH14feVUwZlGQ80mXPvY1QxXPN+2+ItScNKPaVk= 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 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=394 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-ORIG-GUID: iXnPYNKfZ1CZslGbaxIxjdVw1K5ltdxi X-Proofpoint-GUID: iXnPYNKfZ1CZslGbaxIxjdVw1K5ltdxi Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Information on the implementation of the ACPI ERST support. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- docs/specs/acpi_erst.rst | 200 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 docs/specs/acpi_erst.rst diff --git a/docs/specs/acpi_erst.rst b/docs/specs/acpi_erst.rst new file mode 100644 index 0000000..a8a9d22 --- /dev/null +++ b/docs/specs/acpi_erst.rst @@ -0,0 +1,200 @@ +ACPI ERST DEVICE +================ + +The ACPI ERST device is utilized to support the ACPI Error Record +Serialization Table, ERST, functionality. This feature is designed for +storing error records in persistent storage for future reference +and/or debugging. + +The ACPI specification[1], in Chapter "ACPI Platform Error Interfaces +(APEI)", and specifically subsection "Error Serialization", outlines a +method for storing error records into persistent storage. + +The format of error records is described in the UEFI specification[2], +in Appendix N "Common Platform Error Record". + +While the ACPI specification allows for an NVRAM "mode" (see +GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES) where non-volatile RAM is +directly exposed for direct access by the OS/guest, this device +implements the non-NVRAM "mode". This non-NVRAM "mode" is what is +implemented by most BIOS (since flash memory requires programming +operations in order to update its contents). Furthermore, as of the +time of this writing, Linux only supports the non-NVRAM "mode". + + +Background/Motivation +--------------------- + +Linux uses the persistent storage filesystem, pstore, to record +information (eg. dmesg tail) upon panics and shutdowns. Pstore is +independent of, and runs before, kdump. In certain scenarios (ie. +hosts/guests with root filesystems on NFS/iSCSI where networking +software and/or hardware fails, and thus kdump fails), pstore may +contain information available for post-mortem debugging. + +Two common storage backends for the pstore filesystem are ACPI ERST +and UEFI. Most BIOS implement ACPI ERST. UEFI is not utilized in all +guests. With QEMU supporting ACPI ERST, it becomes a viable pstore +storage backend for virtual machines (as it is now for bare metal +machines). + +Enabling support for ACPI ERST facilitates a consistent method to +capture kernel panic information in a wide range of guests: from +resource-constrained microvms to very large guests, and in particular, +in direct-boot environments (which would lack UEFI run-time services). + +Note that Microsoft Windows also utilizes the ACPI ERST for certain +crash information, if available[3]. + + +Configuration|Usage +------------------- + +To use ACPI ERST, a memory-backend-file object and acpi-erst device +can be created, for example: + + qemu ... + -object memory-backend-file,id=erstnvram,mem-path=acpi-erst.backing,size=0x10000,share=on \ + -device acpi-erst,memdev=erstnvram + +For proper operation, the ACPI ERST device needs a memory-backend-file +object with the following parameters: + + - id: The id of the memory-backend-file object is used to associate + this memory with the acpi-erst device. + - size: The size of the ACPI ERST backing storage. This parameter is + required. + - mem-path: The location of the ACPI ERST backing storage file. This + parameter is also required. + - share: The share=on parameter is required so that updates to the + ERST backing store are written to the file. + +and ERST device: + + - memdev: Is the object id of the memory-backend-file. + - record_size: Specifies the size of the records (or slots) in the + backend storage. Must be a power of two value greater than or + equal to 4096 (PAGE_SIZE). + + +PCI Interface +------------- + +The ERST device is a PCI device with two BARs, one for accessing the +programming registers, and the other for accessing the record exchange +buffer. + +BAR0 contains the programming interface consisting of ACTION and VALUE +64-bit registers. All ERST actions/operations/side effects happen on +the write to the ACTION, by design. Any data needed by the action must +be placed into VALUE prior to writing ACTION. Reading the VALUE +simply returns the register contents, which can be updated by a +previous ACTION. + +BAR1 contains the 8KiB record exchange buffer, which is the +implemented maximum record size. + + +Backend Storage Format +---------------------- + +The backend storage is divided into fixed size "slots", 8KiB in +length, with each slot storing a single record. Not all slots need to +be occupied, and they need not be occupied in a contiguous fashion. +The ability to clear/erase specific records allows for the formation +of unoccupied slots. + +Slot 0 contains a backend storage header that identifies the contents +as ERST and also facilitates efficient access to the records. +Depending upon the size of the backend storage, additional slots will +be designated to be a part of the slot 0 header. For example, at 8KiB, +the slot 0 header can accomodate 1021 records. Thus a storage size +of 8MiB (8KiB * 1024) requires an additional slot for use by the +header. In this scenario, slot 0 and slot 1 form the backend storage +header, and records can be stored starting at slot 2. + +Below is an example layout of the backend storage format (for storage +size less than 8MiB). The size of the storage is a multiple of 8KiB, +and contains N number of slots to store records. The example below +shows two records (in CPER format) in the backend storage, while the +remaining slots are empty/available. + +:: + + Slot Record + <------------------ 8KiB --------------------> + +--------------------------------------------+ + 0 | storage header | + +--------------------------------------------+ + 1 | empty/available | + +--------------------------------------------+ + 2 | CPER | + +--------------------------------------------+ + 3 | CPER | + +--------------------------------------------+ + ... | | + +--------------------------------------------+ + N | empty/available | + +--------------------------------------------+ + +The storage header consists of some basic information and an array +of CPER record_id's to efficiently access records in the backend +storage. + +All fields in the header are stored in little endian format. + +:: + + +--------------------------------------------+ + | magic | 0x0000 + +--------------------------------------------+ + | record_offset | record_size | 0x0008 + +--------------------------------------------+ + | record_count | reserved | version | 0x0010 + +--------------------------------------------+ + | record_id[0] | 0x0018 + +--------------------------------------------+ + | record_id[1] | 0x0020 + +--------------------------------------------+ + | record_id[...] | + +--------------------------------------------+ + | record_id[N] | 0x1FF8 + +--------------------------------------------+ + +The 'magic' field contains the value 0x524F545354535245. + +The 'record_size' field contains the value 0x2000, 8KiB. + +The 'record_offset' field points to the first record_id in the array, +0x0018. + +The 'version' field contains 0x0100, the first version. + +The 'record_count' field contains the number of valid records in the +backend storage. + +The 'record_id' array fields are the 64-bit record identifiers of the +CPER record in the corresponding slot. Stated differently, the +location of a CPER record_id in the record_id[] array provides the +slot index for the corresponding record in the backend storage. + +Note that, for example, with a backend storage less than 8MiB, slot 0 +contains the header, so the record_id[0] will never contain a valid +CPER record_id. Instead slot 1 is the first available slot and thus +record_id_[1] may contain a CPER. + +A 'record_id' of all 0s or all 1s indicates an invalid record (ie. the +slot is available). + + +References +---------- + +[1] "Advanced Configuration and Power Interface Specification", + version 4.0, June 2009. + +[2] "Unified Extensible Firmware Interface Specification", + version 2.1, October 2008. + +[3] "Windows Hardware Error Architecture", specfically + "Error Record Persistence Mechanism". From patchwork Fri Oct 15 19:02: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: 12562649 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 337F1C433F5 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 74C446108E for ; Fri, 15 Oct 2021 19:06:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 74C446108E 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]:33410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSXe-0006eC-EE for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUV-0003uO-DD for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:40 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:37714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUS-0007hD-KH for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:38 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIG5O7006620; Fri, 15 Oct 2021 19:03:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=0O8gFPL/awPaEk5pYdmF6P3YvaM2/9VEaKtCj7J0dmQ=; b=s7X+YK1xAVHW5jIUf1JWtue4gO1lSoskrNU20Gq60Tfsh4wMyqPXxEXQatJvqMQk12+h 7IohKKRWv105YgKjjuvVHuSH9iE2vgnOmbSJzm/xKE0+7NjcejOz5bV6ylLrvckWAeKZ 7X6/ssgUusM8seKeWheIoyNU3Jz9Ek6jTnjYp2uby5BlWxPNkOlbgAXcx4YqIBA5QTa/ Kl0iMPvLGjqjk1EFXsiYoLlhsZMzy8hR/0kJANeZYju1A5ZbHegdUFRMSbNZkTz+qvzs ZtzOKm4KjN8tZqAgsIUypYZieVhO+5AJXhMM5r1wAxl1QyZ52BYQIwPXAsp0jihYO0Da Mg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqes2g7aq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:32 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ0aMo082428; Fri, 15 Oct 2021 19:03:31 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2049.outbound.protection.outlook.com [104.47.74.49]) by aserp3030.oracle.com with ESMTP id 3bkyxxapvk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAKC6MqbWnljaVXc1bCqxEaarnUOIuRiU9bCw2lTdHnX1R95kLUEmne6S+XZ+SEM7r9cRs5t9SxDISsC/cvhH1VmQyvWsjSjI9fVre7WP4mrlKN/J7n/e2VTpUZ8ZWTXgGzqJ/2YKmCrzbnN/R4NBTQvUposywbwOTkyO5XDL80ong6AUezopuomFDjG9MXHf+/RWTb9uxreo0qboG/WxhYz7HfSSq0PJCIto587C7cDt3bxbuCku9QIto/iu/HFnrprPTybTBCe8PhOfWis5pMFvdw7LsnqnkYBYhZhAGimh6Zk0//43XiJ8LnDNIrHqAhIEKgO5mGxhlY+hhwtgQ== 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=0O8gFPL/awPaEk5pYdmF6P3YvaM2/9VEaKtCj7J0dmQ=; b=gyWw4NRe50akGG73Mz1o8UNs4TvRucwXyugogT4iqaF3UTEH94x0yxHrFEY5MSPBFn9l3ktyq6LAuVkyr+mr3bdTZkcuot1WTUuyoscVkfKGWTGy6l2QhHHGWBj+4U5OPNC2gdVCo6v/i4C0NzHf0OT4kYdOFKLty6jUgMUQwQI+QLnX3BZCMrT41tu9nD6M59zorqWih+MPqEHqzB8BrC6Yr3pjxx1G1K6HZkW8RoYWL2ii4czij4qcpFYD0l7hn4z+Q0bJ+8nv+/00VAUQRJQPypAzkafwmvR6ZOtkk1xkWyKlVtqCKKZ4mx1KqEhydurxah0RkIfPS9vB+4k6kA== 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=0O8gFPL/awPaEk5pYdmF6P3YvaM2/9VEaKtCj7J0dmQ=; b=zatkxHyxd0nfi1sIH7UsFLqo7Q5/PBdPDHlxZc5fkcaeAELBUS7Xl2F/FMTW5naSu5Gtte5ULaQjXXl2ZYICdow6wtIfJxdAR8ayAPQsAbUGdXrRNaEt+0yq+8nG0KBqsiL9o+bc/EUsYDQlrikwcXth948Ing3JQHSqm2v2lRA= 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:30 +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:30 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 03/10] ACPI ERST: PCI device_id for ERST Date: Fri, 15 Oct 2021 15:02:53 -0400 Message-Id: <1634324580-27120-4-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0fde777-5015-462c-8314-08d9900e7a02 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q4mF1Zln66q7vjSqEFb/RZUFYG6dfdeX3PRqa+Inw8dDQml5DDheBYN7juOp6BKaDOQgEjtx1MmZiLBRbiTgt+pWUq4Z37uspT3oaBWqLmZhplfml5f1INY62nJztpQxMqOT+uCV4SFXbI4vCt2ChkriXHSC5qT2f5hDbIt4eoEWgsvjzqwQMtlkv7kfy5RAdvwToyN+NAoEZVZU5IbCOnOnJPkrLySDsbJ/5q5tt9GZ9q6wR3RnW7zvcxAdsgpAUD3xImUYg6lMqrZU4KJUyROUP6va0AyBYulwnluR6WbMyouJo+OGiyxTXx+7wdi2lkCB9Nx5KuIBqWQZmRbtz/qDeS7gLCNs7+O1t96yNSo8STsZpuW/eVh6x6bgTlBcfXIDotD0kNvK5HX80BaZmeBQyIRCx7+9zFeOpMrW6cTmnZxC/jt9XRRtZEL36ZerHslgFOVrdjKr7bvCLIFoOvvQXST8/EfKdbOXGSw09Cj8KoGuaT784JFnmTBgwfcD3sUCkp6oQZVMMpCLh3qgYN4kbdrjUXh1IM3wzDmbXiJAotEhfqLKzmInOLrJrbhF9Rzg4RFl9zfB2X0eMq5glNUcaJqjOD3oN6u+PkozETH4/UeFq2+vBfCWJ21Nz622+7Ho6MmqZHBqpXADVsaMpLNP8tOXCefAQIFY9pWfMdeVeYv7u+nXCCoHR4N51RKPqaQD/jNdi3Lcab0I2TsvDQ== 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)(4744005)(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: GJ6ZdW+Cw7LOt1QjzlltYC0BRTrlknVHq7wOo3PF0792gz5j3eOnhEND0FWkbn0KY/gcwaCHBcwNUmMVRmiCRbmGJa4Le5brYrBuEbmMMYkA4OL4hLPfzyhDomzGhmU0Lp4Ds64tBUG2SB8dOp6zHBnVU8dN5A69fr8Km3nAShzIPzSx9v3VgGW2Ag7kHthp6mpZklOuSbB0ACa6IgLY8tayBB+kfmtpzN3/GzQs3d98ZpmxLouuHv4ZMGemLcJ8NX/5huvmZyyLQ3HfOEuwSKyoL+R1nfSjQilTCPv2C6D43D6Btyo2SRK4Tt/b9zLJ+GVJ9wojt3FIzyKbRLHTsvSzNG/gW3FLeZTeGDIfHdwPEbsTh+w1ioTO1Tb1r2C6xKwsnLBDo3JnXWt+IcpKpSY2dV0ytZSqQ1+F2RGCv1NsgukJ/Ev2Abt7fARQnjWVw303SEGleRHF4w37YpHj0oXbcNZRIC7aflQTvGaRFa1sTdZOcb4qAWD8Bhr59vCMABJPQZ1nr0h0rx2icZAnlUjf6lsvLo49Rnlq8cp+tcldklJwMh/LTDbhQqbZhIQHNoq+p+rJ7ZMa/wAkSK2Xx3z92GLPAWDSqkGZaJdXqu3Q6rW8QsksrrZRCaeNofwZ7f+NahThGl/c8KckPrShBmBCGRgWaq3UVpFmykUmBpZpBnR/zgug+VC9n4gvbI9h0luKQTwMHmz+jED7nO1ERVv7HQsYfKGHAzI2oGdd6PwAvLQNcwffybQle5RWeQxiLi7xixH43bt64D8nfiyHNRt343htdi4BbVXljmuo7G5vMDwu7MKFVHsQE03ZAGgYGsmxEq0CZ0qpj7F0vDxepds2PnGsMn/a7Q23ut2kBwQ5j6wmjM7r7eJZ2Oevv4XtgLw6k/Mem1dCcKGKhm5XCcCldV9WafFhCoR4l9+ZlLPHEY2W6TiOZ5z+sUdQZhxVBBhSQnndDISUX/VNPJIbgqdVx5YoNsewKK/LqKeMKxKWRGERDAO+7Gq6dRB5ZsEK6jdXGP1ZWgDUM/BnIplCyUPX2rUml0z0R1UQXwz0Arh4myZmB7+t7ex+5negeFvomSjbZnR5woYTkrGkY0H3uCT/CnkJmtsZgGo+YnhdXwbND8vmLpiUCB06hSBfI7tKA/RMTil7AdzxyNhY5XTTPrfE0tZUkMCkUR1L5thz/QCsV+ZT0L7PHkOG4aaR8jCykbGvGZe/0Ak11eGvDfjJPAE53he+vaQBY0CU5qAqzk2EmYOuRj8bHRLLZ+U4OmYV+ukjQDFELTs75zu4P5KoZiYobvW0Qd1JMTN8fSjhd3DrY7sKNK0iLrTnWePXnexO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0fde777-5015-462c-8314-08d9900e7a02 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:30.2195 (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: /t5lIX4P19a4NuRUgDCHSCE3FptzVRlwEtVvHS/wYb7fx8i7VV2RjDtAE8tzIN4vhs9R+HigEhYliomlRDUa1eX+APdIO5nF1h8AQRTCd/A= 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 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=951 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-GUID: -81xXppT46ZrrS-UPLe9f8oJs-y0UleC X-Proofpoint-ORIG-GUID: -81xXppT46ZrrS-UPLe9f8oJs-y0UleC Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change reserves the PCI device_id for the new ACPI ERST device. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov Acked-by: Ani Sinha --- include/hw/pci/pci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 7fc9013..45b79b1 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -108,6 +108,7 @@ extern bool pci_available; #define PCI_DEVICE_ID_REDHAT_MDPY 0x000f #define PCI_DEVICE_ID_REDHAT_NVME 0x0010 #define PCI_DEVICE_ID_REDHAT_PVPANIC 0x0011 +#define PCI_DEVICE_ID_REDHAT_ACPI_ERST 0x0012 #define PCI_DEVICE_ID_REDHAT_QXL 0x0100 #define FMT_PCIBUS PRIx64 From patchwork Fri Oct 15 19:02: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: 12562653 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 B0FE5C4332F for ; Fri, 15 Oct 2021 19:06:57 +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 256BC6105A for ; Fri, 15 Oct 2021 19:06:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 256BC6105A 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]:33510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSXg-0006i6-49 for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:06:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUW-0003uk-N2 for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:40 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:44740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUV-0007jy-3J for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:40 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIgHiA024951; Fri, 15 Oct 2021 19:03:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=ScSFAwmqzhfOLFafajzHE1kps1OMIZWRdwhBdZuPhxmb3kP9b8KnBgHbiLBCi9M0B2lq 873G/pKLL0Ji9jEXGChYIENZWoJBAT6DHhvcBAwYjAD0mMYrM0gIkxLzadn4+azamcXw 8GOGDhx87/TVux3BWexAKsO25JKIdECxEIQSOcfD35SOE3z3Qk7oO44cYANnHd5oz2ML tnsEASm2MjK6/OoBEGxOU3T0RCW51zCJwcPm3MKMl1xBN6tpmqkKGUA9CdJgBYljMTdP rbovx3lYHbfJQB7yhjYsdi6pq5xPAjV4X3jpXWrDArRBzXMn0K4rnArxRxOdUNfEXDqQ Rw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqbgfser4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:35 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ0bbr082576; Fri, 15 Oct 2021 19:03:34 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2040.outbound.protection.outlook.com [104.47.74.40]) by aserp3030.oracle.com with ESMTP id 3bkyxxaq0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dwjLHyVKlp514Po1yXtfQbet3/HE5RUtkv5HsRzvqGyV4RqGJfGs9T6+ASkhI5J+9k6BqTgj2wmzUhS4r7wXZTxq5z4sbgh1YIkRqDXGRhC7SO5ejS/Af85hCcI6wMZ5A68p4U5dRkGHw4id1MKdizTebgDbZmA4WLJmD2hWr+zwEClmiIfZBO63hcoBOfQXUfpKp9W6ydW9GDckOPSEx060gpoM2p75OCAFs5cOVLH+hc9C8TP9kjZrF0KTCWF3pp/Acfiu23cZZDYNlHrL+2uAQnBW46ljFVCt+/0hxABnbF6NfT/pq9YBNJprg31vAQrn0aeExr0d/p02ZsbHjA== 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=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=cYY54kvz2IrISmAik6Ml5w61xrzJexa3NT77G7Nh6X43OqtVHEUwfIj3oUiIYbORF81CyeTe40si//d7ekjrSr1q4DziRhOd1h3yEFsrcPvwngbEpR9fl/BzSkmf8wiuEwGDOSlZU9i3Px31nHFzbD2AAB6jDFrMbgkK3iWeVMWydZqn2MChB4aVGkxIaxtco9kgPSvSm6KVNwxGYWqpZ1q38xU6WUfQIkQ1DHQbt5Ms+8qCuy0cg11NlXQczpqYh9d/5YZjwYJ7TmV0WMfsKaxPprVKFLYM5NGAB2SsRQnbVwx9LyIApf9O1B+3uZcrHgqpgVMJgRO2Qd3nB0iflw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QVs4244pfx5/5CAw7lzpnnt08hn9BG2h/zZXOzp19ss=; b=T9M9agxxvprFiUt33K6AwFnrOonRt5Cqt4FlE+m72AEP4NCVCCKy6XxJiLnaMYIi5AGV0q3iqLdZBdys5gOwzbisfcKJQ9MGplQ4UcEbfBPaeMGlOLI6xH424ltVrRnKGhoQ6ltgZzASWweX++MBpFkh4Fj4oU8suaJToij7YWQ= 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:32 +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:32 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 04/10] ACPI ERST: header file for ERST Date: Fri, 15 Oct 2021 15:02:54 -0400 Message-Id: <1634324580-27120-5-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6579e7cd-3467-45fd-74fe-08d9900e7b42 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VEjVTm9NJWv0dJNbHFdgPIiTS+arp0VVcoEw05EJzjbxQfGjhcMjqZ3Ot8mwRmN/5i8QEcFrIWjg7K6463C9SDA1j9YqGov8kajV/GQN6SE/aB9damdITHxi95lT64lPqj6MQE1VTPeRXLG/GWzSGsUAsYrXhy98eIsBDRbLEDtP6mTr/cZGS8kvrZ9Kpk6vNzsk2Ayp6ay6sFLJwjb5/mme7MAcD8rH2h3EV7+Q0vGnW9ubPmIDS4wjUMLUssgdQd2NWzH3gH/jhOjTht8za7z/dIJBKZnaunMwQ7PAp9Pca3rADydwXwx9OCXsJMw2+KCGxR8Z9d4MwT50SytcoEbIfomB/yI6h57YI3Pfb1i9ii4EFg5v6QMTpxa3LcAzWVsC8tXLu/BTRW2Bllz1k9pFFVTfStotYKqEu0W6v0u31EslYWpou5ZWJCvwP5E12Rv2fdJ8ynhznYZMLrKmObz7GsOLGh+U1psCK1P8TW0K5CxjgDhr/Ak+3FCfj/SBRgUu8ZBP+DcPIOLtQOuDVUf2KxdeO98iPX3XMNq7xU5UReY6XaUtbG1srwk9K0gg7Ms7NeV41VBVa7gSWyF6VuXe6T+7XbLkr+HVtRCtGDJc/7A92dEZ76RJSc30nleLthm77UejGDFmzUqZ9AKnCs+Z0L+qGYa9yOa89wqKB8pVBtDzXZpWkgVA2jdlyAobcU/TWzq+Dtj/XoQyQFD9qQ== 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)(4744005)(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: 4Zk2NNqmJZJjPPsbtXCK6SjC+Wi1cV2x/ggPM13QTeZxVIBs/VJCT4GizgUdobx3U6qoq+jUrAxVtJu3zHky3+LmH4RPJ0aknCPe3HaVYP6fXkPk4TJvxYdEjlzf79JvPvce9kIPP7yIgqCwTX/rz3mCvzotNzW5j82YbzEcMjgwnj2yLbyfUDLEXaafkx+XJ8xOVhMdYW2b2l1U0+kr5ge2yG7BUZtPEKd6PYZyjF0w87vGLP8iduzcHRrAAFjW/lFfIdtb3SNoJlZopUEKLjeH0UYs4Yuqg6kDsO1eeXnI04GT5jwZE1rx9aBvWt65XfJhrtbSiSa2HZPyQUJX8tKCNgSXIBOMNwoRvAH4k3ecKcKdKCZbcUnvpUPMGGvbKhwjmKm6AF7rpghxPMGV7riRnXk32u4lIZNbycQ9SMA+lUb/WWBkXJc5fbhxx4ScGhh7QI3ERwJw2zztNzMFAJe8slfkujDWSKz20KKiL6qoOJw9NM07qtFz9kneSME4MmNi9fUSt3ni1VFWpSIzqE1xtyc+Anid+XZYc8C4D91nRbaO63QejuQOCLRH7uZyfVs3cdkqFK2C1D/d+prg65d4EVRKcLYzjFmEt96I+wqljvZdgAJF7XrZqa2189p9xcluwvSlw22ajojrhOGOdrKj1LmT3eMyEK3+5/psfpx+YDRnFgAMbkT5eVH1mYwwFX18iCZg3zjl8WZEpqMUkrUpOhj0VX43WQ5Sd6iV0ggO4r0vRsNKZvuhx/y6mtNtdzw7V+kWFmo3dSVA0Sa8fF6E1OHygceHDHDJUuF4KaweI1lbkWNbQUEzD1FN6YOt08qP56gbcXYLko29EPDg3mRo2ZnY28hdX/8jiwpGy8hcp19M8eEAPJ3VvSZr88WeYJP2AaEhHGlRABPyMBdZ1qF6kDUnyXLEuj0SEDCHmqcYPxQWZXSEu+BGHTshLSo7t1TlDcs2Q4dj/MsqKQtjlkd3zecEKCadydh6ihnc3voORJ9iwzIk2fswqU1d2+qzsqrFJ+cgOp+5KbttAe6jCxWfSN55lHbclDOBdYQBK42XxhNhSHEHNidyTrubvw7qqJD2OHrPQdk0Pnq4OOT9N57h5cDpvUzUqlZ45TJTQ/hO2KNdYbnapkIyBlMxoSSEw9gvX+0Q27ha4kvbxTgmnDnlguR/XX/SVd05Ml80OR9I8Al92xBJ7fVI6Dzzd4e9pAxWuB4Leuw3As8lOUULmwrbxVTGOUBLQ5+s5D/GJYQYVPpN1kV3wbb7VBsqFyUuHVhV1RWHMc6f7ZdoFjsEtUq3imy6VB+wWsIeYpCtB3hQglNFYp4gujFKw46HYYWg X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6579e7cd-3467-45fd-74fe-08d9900e7b42 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:32.3153 (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: a3aAKdBsg6jp5CrwShkbzKYIqi8E6kwRJmzzK2I/VFeefKdLWaHIZTHtrirECNjbDNna/8HV7oF3iLfxXTHe839yIu586d3b0XjiDEfWLuI= 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 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-ORIG-GUID: 1C7VrbsMmAb2BbRx9FF86URjvw_GknzV X-Proofpoint-GUID: 1C7VrbsMmAb2BbRx9FF86URjvw_GknzV Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change introduces the public defintions for ACPI ERST. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- include/hw/acpi/erst.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/hw/acpi/erst.h diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h new file mode 100644 index 0000000..9d63717 --- /dev/null +++ b/include/hw/acpi/erst.h @@ -0,0 +1,19 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef HW_ACPI_ERST_H +#define HW_ACPI_ERST_H + +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id); + +#define TYPE_ACPI_ERST "acpi-erst" + +#endif From patchwork Fri Oct 15 19:02: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: 12562673 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 6BEA8C433EF for ; Fri, 15 Oct 2021 19:09:50 +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 D13D76109E for ; Fri, 15 Oct 2021 19:09:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D13D76109E 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]:42858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSaS-0004Tz-VU for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:09:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUb-0003vo-HM for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:46 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:16406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUY-0007nR-4K for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:45 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIGUFe029664; Fri, 15 Oct 2021 19:03:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=+3esOokCJhypgxkd8esABZ5wlQJi8fLGTewxJg3WYG4=; b=jyvP30tx5vmyO66nKC724OgByaLqER1U2xByVxyoDAR+sRTEOsPhgSstzWAHYyq5PbTg ZhWHBoaPToLDaERiNgcGFFzThr2Q6mR6euNKefwTySu2KTX7URzJ4Qg5mTBf1D+33zC+ wf/LzBB/PuV3ZVg4uvT+TRC1r/q/bUAdrjCK1HJz4nEygh/Aw55dDcHeMDUDkAkemQeI KMOIgdRpyXgu/Dgb7yfPBZr6b2xm25x9NGr8D5N6E/stkxiwa16LCcUMRu2fW0HWdPFF TwYCBrMcyKyBQqvcZlOGIM1dUvVRczHLCY+LmDxy8Qr2T76cF2eCfxVadjODcyU4DG4y qQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3bphhuhc48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:39 +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 19FJ0t7v180935; Fri, 15 Oct 2021 19:03:36 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2042.outbound.protection.outlook.com [104.47.74.42]) by aserp3020.oracle.com with ESMTP id 3bmae4ndad-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jjuu9dOtYfyllceE7K8/Uii+hH7L7vvv3lusrG7oQBfizWrL7EGwQhnIfXwSxpyYB1SZqsXmEsGTsqH40s+84WXmmywYpyNZsPdw1OpZCduwqjyCXqvJxfZ5USNditDxDL0n9GKU8ZT0LUiR5l1PWWXpiviK8GP9C7Uon9pGGTmGCwvmKgW7UurRrcE9oEAbN1+8CwD+hp18rKx91SP7WeiqNfs/UULhmJML6Oaz2ZoVSW42jbdffz2/z9G0FV5QODn3JxkkxEe3HuWXk3sIiqlQcfhCxVljE8VX9iyUy1KIHYBK3XNqkUEbwETYESz/KMhD5Ax+lY/XcmozWeI74Q== 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=+3esOokCJhypgxkd8esABZ5wlQJi8fLGTewxJg3WYG4=; b=ohBRHr7Hv9N3NnlpbF+JxBjtJUk/r207A0mVDIoQYos4fnSi4jER5RijTJ8P9237OWi7uwA8tiGtLsLWfGEy7s86t9VVY/JjCwXd+eZf4MmK74SY3mf7S1EcQ98Gthl18xdU1vuWwTASMFVPYe1Ppi0flQ862Jn/ntImn8TAlHpGgUy+LAAr7xu76lM93rVlvFpwpn6lVZ6HVsCF9KoE38O1S5Sacg8h8oZt594Tobsk942PTzjqTs7CGmHC7U9fT+Ze14iwZ2+qIrwr0+LDUlP0LCLqpvEiGvQmE5eLU7KzHqMmRB5JVCea5YWSo9j0LHEMbq/dmlbwBnCtgi+njg== 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=+3esOokCJhypgxkd8esABZ5wlQJi8fLGTewxJg3WYG4=; b=mwyROLHnMFKyAA6xZzBCLjb+qbRGIivykLRjJD+zKlIRJrs+rEvHl1JrsWF64MoOJpxTPEOUtKMO0q9Axjr7KiCjnX2vNTdpCZFTX2U+XKu3y6Px0OiBiuXEpV+V4YLdwQCIA2XUBkE5EwT94XqBaTLIrltg1Lkwj4UOSsE7OGc= 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:34 +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:34 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 05/10] ACPI ERST: support for ACPI ERST feature Date: Fri, 15 Oct 2021 15:02:55 -0400 Message-Id: <1634324580-27120-6-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c6470b8-8fba-48e5-facc-08d9900e7c60 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yOf2VzL5mWflF+rVyKuNx0xpakKMU1fSazoJ5nKGSbC4b5XaGjXvaLDVe3elS7J4C1MuJaB6o/iMK7s4voL38cmkQI2XrvW/6n/jFZ+VbtU1/iSV3RlZJghYhXoR4vpGEkncDp4O6Mo+Kgn53n0Lk0ym4JzTOVVfH5t/BqD96iTf6DY5tq2iE5coz9jWW1F8NlXB4TuagGeU3arFTltNWAQDEOqBcO2KFdhjKLyOH0mU7ftBvIJxhSJdbbLd8SPtW4mW45gOqT97Q/ZC1WqD6RwTTITM2SOgoBCJ4oWRosAuXgkJANpJ/1vbB1oRsDOnvwbQkRvJyKLQ9JoBLh/VGlv4hfcfciM3DEX5FZffTJ2Mka+o+iwXyt87LT4UH+LZJCPJ5iNsySlTcyrSrKUN0CmFYX8+GAyqkNHejn7Xdznb53PtSGudqC0Dip3+aedz5oeK6yHZu1yB69dgPoV3t8v3e0imR36a6Oz6dI8yeVOs8upP3WXDlDb7jDUjF+aIaHmTh4y50V9PJ4NhvvWWIy6X5aKvjxfi4AZnj7HVG6ld1mIfgDEcMg5grwGfzOiwMNTslnXCpcbghctXb3dYrLPBz0Gqc1AUsCG8h50ncuXpkHH8bus+cpt6LAxmvqdXTFOLCi5h907KhE3lXp+i9l79Ek6m6Q1tYL3nTXkXrlc4mQKAbvbcNR8hdZAngDUcJJWYT0QoqhpMzpZSZ7VGvw== 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)(30864003)(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: EfREUOc0lFmYLoyMu0C/VDWhDEijDnpk6rEZg7b2L0dZRj/bg9zmEVarOFhCZ6Jla80FnnMF4+tj+p9mGJFZsN7GKuVfhYf9RRw6dAbhDGIj2u3ZgLyIABJwdqryBzZJFd9yLsK8gV+AU5LgGlodgY4anffMRMIdsvZyBIl7o++iCGUG8uLDf2QgpkkMhEHFH67J7yB1tQVpWoXMHYVyP1hEdWC/Wxy3EGbjECY5AFS5wBroR/oPNUeWJnsCSG9UW/WJmmKbsx76Q5+Ar71JlWwQ+AghvvdQtgwWMEThbXCg9Vj96Pv1+Uqe11OyFg/8PhGXjlzGYKNMMGcSxQ5uEpa0f6iom/mn8jzrns9xGr4kO5x6+toPkpVu4koLsIRLgqYlUgeQepIE6+bGTHctF2WS0AnHZJoZiTV3DAT6rwB8hpVXMUR5/oZO5ApIeXpfI4m0gqi1g5v6X2yuWNZgmtrURyie2dM7CvsqCHv0zT+lDG1Tb6GX5Ay/IOnBBlchnbFjnFuh3HoS4oeIgswkmzyfFFNsK6Ptc8jHlcQPAnc8Sb/XSLnvwGPu5PCjNvHOmS+vqNqobB8fw4xiq9wyS2xyil4TSpmN88XJrdnQlChwMt1bDmuSS0of2p5+jGHLWMRnMoadW8Mn+Txgpu0crICAVFPXtyH/NTcCOmKvr4/AVHnlVCpUP534gynwhbwIMzD8F8G1rLwDph8+GSKqNX0XBCEcv6indWrm0Z5l8Cen0rYCQpi4IVXHF2KaVqlT071CmPSqQvyUfBOnjTWdRLqF27jnwKfGMI90NudrHNf40EUoreBJrOpg8E1M1T7CGukUAOdZ/shDS4INnCAialGKAhN71Zij0PWa8mIWfUnxQDdSzk9dut9VZnr2QeIAGEiVjOjpdq5b4Mvoxtv5FkT6RJ+8npUGKELceS7s1qVOHO0JxjJm/qSseqP384P01BD+sHLr3TKnLBs4Wb/e9uTdKZn7wAK1OiK5PjrOfy4C3S7raMIm80b+90qF+FBtaVC9J105g1bRUDuDzeDUsvq+9dmNShLQ3dGgsGmgk2BvVoV2wiVq0MrzBx8CmE5nr96roVIau+ZRLBcCBQBGqTkAI5F4nxNRrBKwUyCQUXdte2nFnuv9SJ3jp0nK5L6BeZz8niOCuYD4EF+d3Wf/Xs/er4yPiP6rFNPpLI2ltkUTcE1gN4kKatW2BUxvOlwyecRECiCjOfWV1/+c39oCTLUBt5JBDPokmYE/kuCN2hUAYBBCmqnejqQsKeMA2pJDW4BDQBG/9uqWIktLB0sMHMA5YfMtQKtet90d4iUAuaOe0vW5V/iRGFITxRhrl0qh X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c6470b8-8fba-48e5-facc-08d9900e7c60 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:34.1542 (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: Wd6JlsssvwZUqR0t24PN19ZVCyWL9UQlXiLDgA9VeSOpNkMnNqXonkGcNzh+wCloeUW+8FEoPXW8DutJmr+TYyiPyd64gzuDyrVVu6kjHUE= 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: o8hAtRYLOVuOUHON3DZ0oqS-nfCAVv7h X-Proofpoint-GUID: o8hAtRYLOVuOUHON3DZ0oqS-nfCAVv7h 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 implements a PCI device for ACPI ERST. This implements the non-NVRAM "mode" of operation for ERST as it is supported by Linux and Windows. Signed-off-by: Eric DeVolder --- hw/acpi/Kconfig | 6 + hw/acpi/erst.c | 836 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/meson.build | 1 + hw/acpi/trace-events | 15 + 4 files changed, 858 insertions(+) create mode 100644 hw/acpi/erst.c diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 3b5e118..79dc7a1 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -10,6 +10,7 @@ config ACPI_X86 select ACPI_HMAT select ACPI_PIIX4 select ACPI_PCIHP + select ACPI_ERST config ACPI_X86_ICH bool @@ -56,3 +57,8 @@ config ACPI_HW_REDUCED select ACPI select ACPI_MEMORY_HOTPLUG select ACPI_NVDIMM + +config ACPI_ERST + bool + default y + depends on ACPI && PCI diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c new file mode 100644 index 0000000..4304f55 --- /dev/null +++ b/hw/acpi/erst.c @@ -0,0 +1,836 @@ +/* + * ACPI Error Record Serialization Table, ERST, Implementation + * + * ACPI ERST introduced in ACPI 4.0, June 16, 2009. + * ACPI Platform Error Interfaces : Error Serialization + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/qdev-core.h" +#include "exec/memory.h" +#include "qom/object.h" +#include "hw/pci/pci.h" +#include "qom/object_interfaces.h" +#include "qemu/error-report.h" +#include "migration/vmstate.h" +#include "hw/qdev-properties.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/acpi-defs.h" +#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "exec/address-spaces.h" +#include "sysemu/hostmem.h" +#include "hw/acpi/erst.h" +#include "trace.h" + +/* ACPI 4.0: Table 17-16 Serialization Actions */ +#define ACTION_BEGIN_WRITE_OPERATION 0x0 +#define ACTION_BEGIN_READ_OPERATION 0x1 +#define ACTION_BEGIN_CLEAR_OPERATION 0x2 +#define ACTION_END_OPERATION 0x3 +#define ACTION_SET_RECORD_OFFSET 0x4 +#define ACTION_EXECUTE_OPERATION 0x5 +#define ACTION_CHECK_BUSY_STATUS 0x6 +#define ACTION_GET_COMMAND_STATUS 0x7 +#define ACTION_GET_RECORD_IDENTIFIER 0x8 +#define ACTION_SET_RECORD_IDENTIFIER 0x9 +#define ACTION_GET_RECORD_COUNT 0xA +#define ACTION_BEGIN_DUMMY_WRITE_OPERATION 0xB +#define ACTION_RESERVED 0xC +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0xD +#define ACTION_GET_ERROR_LOG_ADDRESS_LENGTH 0xE +#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0xF +#define ACTION_GET_EXECUTE_OPERATION_TIMINGS 0x10 + +/* ACPI 4.0: Table 17-17 Command Status Definitions */ +#define STATUS_SUCCESS 0x00 +#define STATUS_NOT_ENOUGH_SPACE 0x01 +#define STATUS_HARDWARE_NOT_AVAILABLE 0x02 +#define STATUS_FAILED 0x03 +#define STATUS_RECORD_STORE_EMPTY 0x04 +#define STATUS_RECORD_NOT_FOUND 0x05 + + +/* UEFI 2.1: Appendix N Common Platform Error Record */ +#define UEFI_CPER_RECORD_MIN_SIZE 128U +#define UEFI_CPER_RECORD_LENGTH_OFFSET 20U +#define UEFI_CPER_RECORD_ID_OFFSET 96U +#define IS_UEFI_CPER_RECORD(ptr) \ + (((ptr)[0] == 'C') && \ + ((ptr)[1] == 'P') && \ + ((ptr)[2] == 'E') && \ + ((ptr)[3] == 'R')) + +/* + * NOTE that when accessing CPER fields within a record, memcpy() + * is utilized to avoid a possible misaligned access on the host. + */ + +/* + * This implementation is an ACTION (cmd) and VALUE (data) + * interface consisting of just two 64-bit registers. + */ +#define ERST_REG_SIZE (16UL) +#define ERST_ACTION_OFFSET (0UL) /* action (cmd) */ +#define ERST_VALUE_OFFSET (8UL) /* argument/value (data) */ + +/* + * ERST_RECORD_SIZE is the buffer size for exchanging ERST + * record contents. Thus, it defines the maximum record size. + * As this is mapped through a PCI BAR, it must be a power of + * two and larger than UEFI_CPER_RECORD_MIN_SIZE. + * The backing storage is divided into fixed size "slots", + * each ERST_RECORD_SIZE in length, and each "slot" + * storing a single record. No attempt at optimizing storage + * through compression, compaction, etc is attempted. + * NOTE that slot 0 is reserved for the backing storage header. + * Depending upon the size of the backing storage, additional + * slots will be part of the slot 0 header in order to account + * for a record_id for each available remaining slot. + */ +/* 8KiB records, not too small, not too big */ +#define ERST_RECORD_SIZE (8192UL) + +#define ACPI_ERST_MEMDEV_PROP "memdev" +#define ACPI_ERST_RECORD_SIZE_PROP "record_size" + +/* + * From the ACPI ERST spec sections: + * A record id of all 0s is used to indicate 'unspecified' record id. + * A record id of all 1s is used to indicate empty or end. + */ +#define ERST_UNSPECIFIED_RECORD_ID (0UL) +#define ERST_EMPTY_END_RECORD_ID (~0UL) +#define ERST_EXECUTE_OPERATION_MAGIC 0x9CUL +#define ERST_IS_VALID_RECORD_ID(rid) \ + ((rid != ERST_UNSPECIFIED_RECORD_ID) && \ + (rid != ERST_EMPTY_END_RECORD_ID)) +#define ERST_STORE_MAGIC 0x524F545354535245UL /* ERSTSTOR */ + +typedef struct { + uint64_t magic; + uint32_t record_size; + uint32_t storage_offset; /* offset to record storage beyond header */ + uint16_t version; + uint16_t reserved; + uint32_t record_count; + uint64_t map[]; /* contains record_ids, and position indicates index */ +} __attribute__((packed)) ERSTStorageHeader; + +/* + * Object cast macro + */ +#define ACPIERST(obj) \ + OBJECT_CHECK(ERSTDeviceState, (obj), TYPE_ACPI_ERST) + +/* + * Main ERST device state structure + */ +typedef struct { + PCIDevice parent_obj; + + /* Backend storage */ + HostMemoryBackend *hostmem; + MemoryRegion *hostmem_mr; + uint32_t storage_size; + uint32_t default_record_size; + + /* Programming registers */ + MemoryRegion iomem_mr; + + /* Exchange buffer */ + MemoryRegion exchange_mr; + + /* Interface state */ + uint8_t operation; + uint8_t busy_status; + uint8_t command_status; + uint32_t record_offset; + uint64_t reg_action; + uint64_t reg_value; + uint64_t record_identifier; + ERSTStorageHeader *header; + unsigned first_record_index; + unsigned last_record_index; + unsigned next_record_index; + +} ERSTDeviceState; + +/*******************************************************************/ +/*******************************************************************/ + +static uint8_t *get_nvram_ptr_by_index(ERSTDeviceState *s, unsigned index) +{ + uint8_t *rc = NULL; + off_t offset = (index * le32_to_cpu(s->header->record_size)); + + g_assert(offset < s->storage_size); + + rc = memory_region_get_ram_ptr(s->hostmem_mr); + rc += offset; + + return rc; +} + +static void make_erst_storage_header(ERSTDeviceState *s) +{ + ERSTStorageHeader *header = s->header; + unsigned mapsz, headersz; + + header->magic = cpu_to_le64(ERST_STORE_MAGIC); + header->record_size = cpu_to_le32(s->default_record_size); + header->version = cpu_to_le16(0x0100); + header->reserved = cpu_to_le16(0x0000); + + /* Compute mapsize */ + mapsz = s->storage_size / s->default_record_size; + mapsz *= sizeof(uint64_t); + /* Compute header+map size */ + headersz = sizeof(ERSTStorageHeader) + mapsz; + /* Round up to nearest integer multiple of ERST_RECORD_SIZE */ + headersz = QEMU_ALIGN_UP(headersz, s->default_record_size); + header->storage_offset = cpu_to_le32(headersz); + + /* + * The HostMemoryBackend initializes contents to zero, + * so all record_ids stashed in the map are zero'd. + * As well the record_count is zero. Properly initialized. + */ +} + +static void check_erst_backend_storage(ERSTDeviceState *s, Error **errp) +{ + ERSTStorageHeader *header; + uint32_t record_size; + + header = memory_region_get_ram_ptr(s->hostmem_mr); + s->header = header; + + /* Ensure pointer to header is 64-bit aligned */ + g_assert(QEMU_PTR_IS_ALIGNED(header, sizeof(uint64_t))); + + /* + * Check if header is uninitialized; HostMemoryBackend inits to 0 + */ + if (le64_to_cpu(header->magic) == 0UL) { + make_erst_storage_header(s); + } + + /* Validity check record_size */ + record_size = le32_to_cpu(header->record_size); + if (!( + (record_size) && /* non zero */ + (record_size >= UEFI_CPER_RECORD_MIN_SIZE) && + (((record_size - 1) & record_size) == 0) && /* is power of 2 */ + (record_size >= 4096) /* PAGE_SIZE */ + )) { + error_setg(errp, "ERST record_size %u is invalid", record_size); + } + + /* Validity check header */ + if (!( + (le64_to_cpu(header->magic) == ERST_STORE_MAGIC) && + ((le32_to_cpu(header->storage_offset) % record_size) == 0) && + (le16_to_cpu(header->version) == 0x0100) && + (le16_to_cpu(header->reserved) == 0) + )) { + error_setg(errp, "ERST backend storage header is invalid"); + } + + /* Check storage_size against record_size */ + if (((s->storage_size % record_size) != 0) || + (record_size > s->storage_size)) { + error_setg(errp, "ACPI ERST requires storage size be multiple of " + "record size (%uKiB)", record_size); + } + + /* Compute offset of first and last record storage slot */ + s->first_record_index = le32_to_cpu(header->storage_offset) + / record_size; + s->last_record_index = (s->storage_size / record_size); +} + +static void update_map_entry(ERSTDeviceState *s, unsigned index, + uint64_t record_id) +{ + if (index < s->last_record_index) { + s->header->map[index] = cpu_to_le64(record_id); + } +} + +static unsigned allocate_erst_record(ERSTDeviceState *s) +{ + unsigned rc = 0; /* 0 not a valid index */ + unsigned index = s->first_record_index; + + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) == ERST_UNSPECIFIED_RECORD_ID) { + rc = index; + break; + } + } + + return rc; +} + +static unsigned lookup_erst_record(ERSTDeviceState *s, + uint64_t record_identifier) +{ + unsigned rc = 0; /* 0 not a valid index */ + + /* Find the record_identifier in the map */ + if (record_identifier != ERST_UNSPECIFIED_RECORD_ID) { + /* + * Count number of valid records encountered, and + * short-circuit the loop if identifier not found + */ + uint32_t record_count = le32_to_cpu(s->header->record_count); + unsigned count = 0; + unsigned index; + for (index = s->first_record_index; index < s->last_record_index && + count < record_count; ++index) { + if (le64_to_cpu(s->header->map[index]) == record_identifier) { + rc = index; + break; + } + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + ++count; + } + } + } + + return rc; +} + +/* + * ACPI 4.0: 17.4.1.1 Serialization Actions, also see + * ACPI 4.0: 17.4.2.2 Operations - Reading 6.c and 2.c + */ +static unsigned get_next_record_identifier(ERSTDeviceState *s, + uint64_t *record_identifier, bool first) +{ + unsigned found = 0; + unsigned index; + + /* For operations needing to return 'first' record identifer */ + if (first) { + /* Reset initial index to beginning */ + s->next_record_index = s->first_record_index; + } + index = s->next_record_index; + + *record_identifier = ERST_EMPTY_END_RECORD_ID; + + if (le32_to_cpu(s->header->record_count)) { + for (; index < s->last_record_index; ++index) { + if (le64_to_cpu(s->header->map[index]) != + ERST_UNSPECIFIED_RECORD_ID) { + /* where to start next time */ + s->next_record_index = index + 1; + *record_identifier = le64_to_cpu(s->header->map[index]); + found = 1; + break; + } + } + } + if (!found) { + /* at end (ie scan complete), reset */ + s->next_record_index = s->first_record_index; + } + + return STATUS_SUCCESS; +} + +/* ACPI 4.0: 17.4.2.3 Operations - Clearing */ +static unsigned clear_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned index; + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(s->record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + /* No need to wipe record, just invalidate its map entry */ + uint32_t record_count; + update_map_entry(s, index, ERST_UNSPECIFIED_RECORD_ID); + record_count = le32_to_cpu(s->header->record_count); + record_count -= 1; + s->header->record_count = cpu_to_le32(record_count); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.2 Operations - Reading */ +static unsigned read_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_RECORD_NOT_FOUND; + unsigned exchange_length; + unsigned index; + + /* Check if backend storage is empty */ + if (le32_to_cpu(s->header->record_count) == 0) { + return STATUS_RECORD_STORE_EMPTY; + } + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Check for record identifier of all 0s */ + if (s->record_identifier == ERST_UNSPECIFIED_RECORD_ID) { + /* Set to 'first' record in storage */ + get_next_record_identifier(s, &s->record_identifier, true); + /* record_identifier is now a valid id, or all 1s */ + } + + /* Check for record identifier of all 1s */ + if (s->record_identifier == ERST_EMPTY_END_RECORD_ID) { + return STATUS_FAILED; + } + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, s->record_identifier); + if (index) { + uint8_t *nvram; + uint8_t *exchange; + uint32_t record_length; + + /* Obtain pointer to the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + /* Obtain pointer to slot in storage */ + nvram = get_nvram_ptr_by_index(s, index); + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, + &nvram[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + rc = STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + rc = STATUS_FAILED; + } + /* If all is ok, copy the record to the exchange buffer */ + if (rc != STATUS_FAILED) { + memcpy(exchange, nvram, record_length); + rc = STATUS_SUCCESS; + } + } else { + /* Set to 'first' record in storage */ + get_next_record_identifier(s, &s->record_identifier, true); + } + + return rc; +} + +/* ACPI 4.0: 17.4.2.1 Operations - Writing */ +static unsigned write_erst_record(ERSTDeviceState *s) +{ + unsigned rc = STATUS_FAILED; + unsigned exchange_length; + unsigned index; + uint64_t record_identifier; + uint32_t record_length; + uint8_t *exchange; + uint8_t *nvram = NULL; + bool record_found = false; + + exchange_length = memory_region_size(&s->exchange_mr); + + /* Validate record_offset */ + if (s->record_offset > (exchange_length - UEFI_CPER_RECORD_MIN_SIZE)) { + return STATUS_FAILED; + } + + /* Obtain pointer to record in the exchange buffer */ + exchange = memory_region_get_ram_ptr(&s->exchange_mr); + exchange += s->record_offset; + + /* Validate CPER record_length */ + memcpy((uint8_t *)&record_length, &exchange[UEFI_CPER_RECORD_LENGTH_OFFSET], + sizeof(uint32_t)); + record_length = le32_to_cpu(record_length); + if (record_length < UEFI_CPER_RECORD_MIN_SIZE) { + return STATUS_FAILED; + } + if ((s->record_offset + record_length) > exchange_length) { + return STATUS_FAILED; + } + + /* Extract record identifier */ + memcpy((uint8_t *)&record_identifier, &exchange[UEFI_CPER_RECORD_ID_OFFSET], + sizeof(uint64_t)); + record_identifier = le64_to_cpu(record_identifier); + + /* Check for valid record identifier */ + if (!ERST_IS_VALID_RECORD_ID(record_identifier)) { + return STATUS_FAILED; + } + + index = lookup_erst_record(s, record_identifier); + if (index) { + /* Record found, overwrite existing record */ + nvram = get_nvram_ptr_by_index(s, index); + record_found = true; + } else { + /* Record not found, not an overwrite, allocate for write */ + index = allocate_erst_record(s); + if (index) { + nvram = get_nvram_ptr_by_index(s, index); + } else { + rc = STATUS_NOT_ENOUGH_SPACE; + } + } + if (nvram) { + /* Write the record into the slot */ + memcpy(nvram, exchange, record_length); + memset(nvram + record_length, exchange_length - record_length, 0xFF); + /* If a new record, increment the record_count */ + if (!record_found) { + uint32_t record_count; + record_count = le32_to_cpu(s->header->record_count); + record_count += 1; /* writing new record */ + s->header->record_count = cpu_to_le32(record_count); + } + update_map_entry(s, index, record_identifier); + rc = STATUS_SUCCESS; + } + + return rc; +} + +/*******************************************************************/ + +static uint64_t erst_rd_reg64(hwaddr addr, + uint64_t reg, unsigned size) +{ + uint64_t rdval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + rdval = reg; + rdval >>= shift; + rdval &= mask; + + return rdval; +} + +static uint64_t erst_wr_reg64(hwaddr addr, + uint64_t reg, uint64_t val, unsigned size) +{ + uint64_t wrval; + uint64_t mask; + unsigned shift; + + if (size == sizeof(uint64_t)) { + /* 64b access */ + mask = 0xFFFFFFFFFFFFFFFFUL; + shift = 0; + } else { + /* 32b access */ + mask = 0x00000000FFFFFFFFUL; + shift = ((addr & 0x4) == 0x4) ? 32 : 0; + } + + val &= mask; + val <<= shift; + mask <<= shift; + wrval = reg; + wrval &= ~mask; + wrval |= val; + + return wrval; +} + +static void erst_reg_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + + /* + * NOTE: All actions/operations/side effects happen on the WRITE, + * by this implementation's design. The READs simply return the + * reg_value contents. + */ + trace_acpi_erst_reg_write(addr, val, size); + + switch (addr) { + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + s->reg_value = erst_wr_reg64(addr, s->reg_value, val, size); + break; + case ERST_ACTION_OFFSET + 0: + /* + * NOTE: all valid values written to this register are of the + * ACTION_* variety. Thus there is no need to make this a 64-bit + * register, 32-bits is appropriate. As such ERST_ACTION_OFFSET+4 + * is not needed. + */ + switch (val) { + case ACTION_BEGIN_WRITE_OPERATION: + case ACTION_BEGIN_READ_OPERATION: + case ACTION_BEGIN_CLEAR_OPERATION: + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + case ACTION_END_OPERATION: + s->operation = val; + break; + case ACTION_SET_RECORD_OFFSET: + s->record_offset = s->reg_value; + break; + case ACTION_EXECUTE_OPERATION: + if ((uint8_t)s->reg_value == ERST_EXECUTE_OPERATION_MAGIC) { + s->busy_status = 1; + switch (s->operation) { + case ACTION_BEGIN_WRITE_OPERATION: + s->command_status = write_erst_record(s); + break; + case ACTION_BEGIN_READ_OPERATION: + s->command_status = read_erst_record(s); + break; + case ACTION_BEGIN_CLEAR_OPERATION: + s->command_status = clear_erst_record(s); + break; + case ACTION_BEGIN_DUMMY_WRITE_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + case ACTION_END_OPERATION: + s->command_status = STATUS_SUCCESS; + break; + default: + s->command_status = STATUS_FAILED; + break; + } + s->busy_status = 0; + } + break; + case ACTION_CHECK_BUSY_STATUS: + s->reg_value = s->busy_status; + break; + case ACTION_GET_COMMAND_STATUS: + s->reg_value = s->command_status; + break; + case ACTION_GET_RECORD_IDENTIFIER: + s->command_status = get_next_record_identifier(s, + &s->reg_value, false); + break; + case ACTION_SET_RECORD_IDENTIFIER: + s->record_identifier = s->reg_value; + break; + case ACTION_GET_RECORD_COUNT: + s->reg_value = le32_to_cpu(s->header->record_count); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE: + s->reg_value = (hwaddr)pci_get_bar_addr(PCI_DEVICE(s), 1); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_LENGTH: + s->reg_value = le32_to_cpu(s->header->record_size); + break; + case ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES: + s->reg_value = 0x0; /* intentional, not NVRAM mode */ + break; + case ACTION_GET_EXECUTE_OPERATION_TIMINGS: + s->reg_value = + (100ULL << 32) | /* 100us max time */ + (10ULL << 0) ; /* 10us min time */ + break; + default: + /* Unknown action/command, NOP */ + break; + } + break; + default: + /* This should not happen, but if it does, NOP */ + break; + } +} + +static uint64_t erst_reg_read(void *opaque, hwaddr addr, + unsigned size) +{ + ERSTDeviceState *s = (ERSTDeviceState *)opaque; + uint64_t val = 0; + + switch (addr) { + case ERST_ACTION_OFFSET + 0: + case ERST_ACTION_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_action, size); + break; + case ERST_VALUE_OFFSET + 0: + case ERST_VALUE_OFFSET + 4: + val = erst_rd_reg64(addr, s->reg_value, size); + break; + default: + break; + } + trace_acpi_erst_reg_read(addr, val, size); + return val; +} + +static const MemoryRegionOps erst_reg_ops = { + .read = erst_reg_read, + .write = erst_reg_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +/*******************************************************************/ +/*******************************************************************/ +static int erst_post_load(void *opaque, int version_id) +{ + ERSTDeviceState *s = opaque; + + /* Recompute pointer to header */ + s->header = (ERSTStorageHeader *)get_nvram_ptr_by_index(s, 0); + trace_acpi_erst_post_load(s->header, le32_to_cpu(s->header->record_size)); + + return 0; +} + +static const VMStateDescription erst_vmstate = { + .name = "acpi-erst", + .version_id = 1, + .minimum_version_id = 1, + .post_load = erst_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT8(operation, ERSTDeviceState), + VMSTATE_UINT8(busy_status, ERSTDeviceState), + VMSTATE_UINT8(command_status, ERSTDeviceState), + VMSTATE_UINT32(record_offset, ERSTDeviceState), + VMSTATE_UINT64(reg_action, ERSTDeviceState), + VMSTATE_UINT64(reg_value, ERSTDeviceState), + VMSTATE_UINT64(record_identifier, ERSTDeviceState), + VMSTATE_UINT32(next_record_index, ERSTDeviceState), + VMSTATE_END_OF_LIST() + } +}; + +static void erst_realizefn(PCIDevice *pci_dev, Error **errp) +{ + ERSTDeviceState *s = ACPIERST(pci_dev); + + trace_acpi_erst_realizefn_in(); + + if (!s->hostmem) { + error_setg(errp, "'" ACPI_ERST_MEMDEV_PROP "' property is not set"); + return; + } else if (host_memory_backend_is_mapped(s->hostmem)) { + error_setg(errp, "can't use already busy memdev: %s", + object_get_canonical_path_component(OBJECT(s->hostmem))); + return; + } + + s->hostmem_mr = host_memory_backend_get_memory(s->hostmem); + + /* HostMemoryBackend size will be multiple of PAGE_SIZE */ + s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp); + + /* Initialize backend storage and record_count */ + check_erst_backend_storage(s, errp); + + /* BAR 0: Programming registers */ + memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s, + TYPE_ACPI_ERST, ERST_REG_SIZE); + pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem_mr); + + /* BAR 1: Exchange buffer memory */ + memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev), + "erst.exchange", + le32_to_cpu(s->header->record_size), errp); + pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, + &s->exchange_mr); + + /* Include the backend storage in the migration stream */ + vmstate_register_ram_global(s->hostmem_mr); + + trace_acpi_erst_realizefn_out(s->storage_size); +} + +static void erst_reset(DeviceState *dev) +{ + ERSTDeviceState *s = ACPIERST(dev); + + trace_acpi_erst_reset_in(le32_to_cpu(s->header->record_count)); + s->operation = 0; + s->busy_status = 0; + s->command_status = STATUS_SUCCESS; + s->record_identifier = ERST_UNSPECIFIED_RECORD_ID; + s->record_offset = 0; + s->next_record_index = s->first_record_index; + /* NOTE: first/last_record_index are computed only once */ + trace_acpi_erst_reset_out(le32_to_cpu(s->header->record_count)); +} + +static Property erst_properties[] = { + DEFINE_PROP_LINK(ACPI_ERST_MEMDEV_PROP, ERSTDeviceState, hostmem, + TYPE_MEMORY_BACKEND, HostMemoryBackend *), + DEFINE_PROP_UINT32(ACPI_ERST_RECORD_SIZE_PROP, ERSTDeviceState, + default_record_size, ERST_RECORD_SIZE), + DEFINE_PROP_END_OF_LIST(), +}; + +static void erst_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + trace_acpi_erst_class_init_in(); + k->realize = erst_realizefn; + k->vendor_id = PCI_VENDOR_ID_REDHAT; + k->device_id = PCI_DEVICE_ID_REDHAT_ACPI_ERST; + k->revision = 0x00; + k->class_id = PCI_CLASS_OTHERS; + dc->reset = erst_reset; + dc->vmsd = &erst_vmstate; + dc->user_creatable = true; + dc->hotpluggable = false; + device_class_set_props(dc, erst_properties); + dc->desc = "ACPI Error Record Serialization Table (ERST) device"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + trace_acpi_erst_class_init_out(); +} + +static const TypeInfo erst_type_info = { + .name = TYPE_ACPI_ERST, + .parent = TYPE_PCI_DEVICE, + .class_init = erst_class_init, + .instance_size = sizeof(ERSTDeviceState), + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + } +}; + +static void erst_register_types(void) +{ + type_register_static(&erst_type_info); +} + +type_init(erst_register_types) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 7d8c0eb..8637c8b 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -21,6 +21,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 974d770..2250126 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -55,3 +55,18 @@ piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64 # tco.c tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)" tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d" + +# erst.c +acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%04" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_reg_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%04" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%06" PRIx64 " <== 0x%016" PRIx64 " (size: %u)" +acpi_erst_mem_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%06" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)" +acpi_erst_pci_bar_0(uint64_t addr) "BAR0: 0x%016" PRIx64 +acpi_erst_pci_bar_1(uint64_t addr) "BAR1: 0x%016" PRIx64 +acpi_erst_realizefn_in(void) +acpi_erst_realizefn_out(unsigned size) "total nvram size %u bytes" +acpi_erst_reset_in(unsigned record_count) "record_count %u" +acpi_erst_reset_out(unsigned record_count) "record_count %u" +acpi_erst_post_load(void *header, unsigned slot_size) "header: 0x%p slot_size %u" +acpi_erst_class_init_in(void) +acpi_erst_class_init_out(void) From patchwork Fri Oct 15 19:02: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: 12562671 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 00FD5C433F5 for ; Fri, 15 Oct 2021 19:09:40 +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 809D46108E for ; Fri, 15 Oct 2021 19:09:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 809D46108E 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]:42026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSaI-0003w6-KT for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:09:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUY-0003vA-4T for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:44 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:9316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUV-0007ke-UL for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:41 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIQR5q013290; Fri, 15 Oct 2021 19:03:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=hsCQ08OMTCt57ojTlBVlHNET6qdDThP/HZhwO0+IHTI=; b=HNabvc702bYWR35nLRMRTbQDiwQ7f/BKEJ84JSDF1WPY+UjhG07kVX6yLGc2JGEKzJS3 95WstN7Z5ORB7rDN84CIMFLR4gsuAIOSjzGWXI8G6LNrrQQBT1raImLoZPRU/mbLZXrz he9xZjVikRhHDbVSW1vVXCUz/LSlCDDMwMEvfxmQ/zUiWBwHkOaufbydzt23Gj+SOgSx Zfwo1v0ovprdeKn1jp1jhhHJumFJiNgLtBLnqLT+xOXecgtX44a41Z0x+A3JZW7fSqlZ 21BjEDsSd1vFt3VB77oEc3zTI/J4NfTmCeAjb2ST0c8/KfI8OrXG/rRyhg4LOc8AW89V wA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqbgp9jvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:38 +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 19FJ0t7w180935; Fri, 15 Oct 2021 19:03:37 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2042.outbound.protection.outlook.com [104.47.74.42]) by aserp3020.oracle.com with ESMTP id 3bmae4ndad-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Js2Hn0krww3ptqky0ZsG9B3QKDu6nn4fZRudCXaEU1Y6vAlzFbd1M7lKomPXwRtCZvI/XEE36PIBmGbmauTD0gMDigYif373GijWebS841Fcv/f7fDdmR3zCm2lleGP0LiXyKf5I72A5+A6923uwKeZQmaxVC3rooWI39SC6hrd4upP0+Z6HAV5wL9AHITLmDIzkJ4d22RWhO50qO9S6Wu1fXH7wCUqbqSUrhOa5iCAMy/OJIYIymBOY1wlE/Mf7pehccwBa5lyZ6iEtQ89Sq5Thr9qOWniocMo0VYvLNhHadoR28sBHRrcSa6g+shWqrSzTF4GLrLDlQ0u5MXVX2Q== 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=hsCQ08OMTCt57ojTlBVlHNET6qdDThP/HZhwO0+IHTI=; b=ebggWXd0y+YHWifWwHGn6PbDlWSYPhvbHtIx2J/Lcgq833iGgs7Tc4XDnBV9MiyRey+yoHg2HSb7smW33no0xeBmdsR6Mq7y6h2XbQ5JsN7V4Fg1mlRc9VQROLJWqhg74XHZ7CXM89f5g6J+1jUVEcAkOxSye3loJAMbuLl9Jpnaue3Q84c6e3RPvPc6AKt3jOHvclU0pIXyrS3KIAe/6/RQaj5nXW4gq1nRm7GWD85LyqNegqBhJiJwe2vXp/dEy1eI6Vb7r/Rgh9Nud37jCbtHpRi6M13ORoN0HBtQOPmFZp+8i5dmUK8UCTOeoAkP4zlEF/W3SsKBkmBTslpoTg== 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=hsCQ08OMTCt57ojTlBVlHNET6qdDThP/HZhwO0+IHTI=; b=b2Lts8fsbW8n4uDGon3e5k45Nq9GymNJuTtkcg66koRKszIrMWflHKLQz07NNuMhsgDmPK5iOtXtw1mMdJK4RBEIeCl/GIPjMLri4+OqAtrsmPQgS/g3vxy6x5tmQ4XNk99UtKKhdXf7H0b9l6oviIT1aMKM8vOB+2B0J+zsLD0= 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:36 +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:36 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 06/10] ACPI ERST: build the ACPI ERST table Date: Fri, 15 Oct 2021 15:02:56 -0400 Message-Id: <1634324580-27120-7-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b48820f-e133-432b-dda7-08d9900e7d68 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /C8pCuyF7n8QyyyXQfk51JJFlkM3cpOgijPopmk8zSeONcBn1p8E+ALGC9Crx5DywsmipyWMkfxUaHH+I5RuKIhzjFmIDQQ2/2yWE29hkxeGqF2HAoBC8PvqzMurixKlkVHUrQv461i+UfHeYqaqx0tNtjwLMcYVbQ5oPejaj5ysuwgq1PijKMd58phZZeUjOPZCUTpsuETdRf8fjXgiEILAmBNB0NxBCR1PtIq6qfeh3181/3yOSTLrjG7gqMf/NWk2fBMupoFaNdWBvsFtHM66UVYr+3XhdHJBhZLdkUW+t1yZr568JBqMuUlUautMJRMKWGpVmAYIHvfTwnsrvv1b8GX0NewanpFAkdzecTshAycJpT/Sks5tGfd6GYbu/jGI2BCvKD7OMRseuyoIXC0GVnPlsyQnKezDtxX36mgJ6dRekDMJFZjpO7XmI1I6CI4pAz/x8Isx6BJsjKap50c1DF5eP3IkBlZ2r4s9Oq6qKXbCK+eamYuM5TrlD7vUa0sgooUCQCJZUFt+iA6nbrPMPqRBFy4k3E4okuz1mHP8tzkj6JeEaCZisY3ZulLufLxVNRktdD63NrC+HYW99swN0UDTNJgcW1Gk6yi6Tr/wsRl9mCO2FV++ic+NJVgXKvvJPqTPAh4WBHwa+FhhEdOgYTSgHGLTFhS3S+hk1pUSGw1/hbr/j9aOQgTzeoOSoXDdJZL5i9SzEaA/U5DK8A== 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: GAtn8wp6hg0rfEBN9Gjh84tDIWgFIKe2FrhWxqheHO3YWOcMhMovBHgOaqK52z89Nuf4kvI4tJqWqd7q4CP4qpWeCGoqfjvgJ248a+Rnd9NGvvFvtZI4nqJLAS1VBc33THnLxUn/7X99KeSpRjbeTWje8CQEs3D15Rv/fP5AFcwQrUg/GgF36AIQzE06QdhvFJAfWil0qn9c/ai9CAbdngc0MJp6xNI5WNBMnxHd2a0aWgPwiLUybx7eCfwS3AR6pyKEZwe8OxLE+yo0a3F3FTHWwpRgNJJrQyCgm0OXfUWziJSZdYbDu5+q5lkUzk0nFemWJymS6RncbQTaBxGIH1MVrnMx/NhUeOuZRfvCoWaQHFnvRor7ZEUVxVccvkXO8Wo87ph++RQAngdp3HDbNFxi1Bd8aJ80LP7PN7UsQf5IK982T986yD4i0r1n6fBlY2F38dyLywqfvAuPk5u+4tmhjJ67BMdEu5NBhdLM8tcjNULVN81Tgpmw7dSfKcEedVdPl8xp38XrJaDMh/wHsj+IoNa535FSVM9/cI6zT8yIW94hdyRwwRJqw2mOprp4BTx2wDiPBNk1iH9QrPxpUJdaBADqsvNU9p44doigfQKfB2AVdYKNlsyTwBccAakg0TCvGoQTd+umvM/1f2P167G5ORABsBJr49nmwOQTbsEVSYYxZx+vUDvN+AQfOL1yAUmEjNNlM9hXTQ3DRpQQ06sUocSlEP9Nvy+LnhkyGJqBFPK+w9SHzo4s6x7bXixwhwNhmM2SIEa+EzgQ/MnPwAh7VPpltDv/0dgoKz/eQyyi2f4W77FVbp+Ijms/bABb4hs7reaA4atHN+vfH9xs2TIiaqRPv/0TOO0gv1qY8IjmKadLgWY4NQtq5ArTqHl0eVIzXUE0bovIYVQAd3SLsS0Wv/4ulsVXeJ46kPh20thYdY9vBDnS08KOoWYF4TejjHEAv4RohaZlOMmCJDY2++7MfrVb59ZKWtn0YpnQwAOOg06PA8pFvRClECdChx7njL/4rX8dAHAY18+scYLv+9Rm7SobOTnQKDf8Q+9IVVkB4LcL1u1E5qoHYwcDiNb6tpzaEz6DjFW/Ycu4QGfwhdbUUCAXauZbQAj/iMONTt8HdhbqRMY1OOdDXM4Mofc9NqhV5KEboJVuwelHUwSLKtZyld63FrcBLYx+zfoo5UyqkIroBh+3ERO0dKgow1RTAxrYpsxcyMNYfqAFmerb0GXlOGhf/s3e79PjEc2Vhap9sUMxvSznDhaHvbKUNduSBAyRAR55wMrrI4u9F4fw6t0VSDwhWu2f3NBzJHHMdBNjBDAooDg5n0P5oyObRuRL X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b48820f-e133-432b-dda7-08d9900e7d68 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:35.9762 (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: 6Ji6iIwzgeeUm/zidBNpJv2W60j5iq8jTrFLapaXTvU9rUGoyjbs2f8RM0BRWP7VatCM7YMc0zR/URurhP1uyF6anc3nIZ9cAxUbqX1Flwg= 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-GUID: iB5XNs0DmkALvsWanUQflXgQlv5palX6 X-Proofpoint-ORIG-GUID: iB5XNs0DmkALvsWanUQflXgQlv5palX6 Received-SPF: pass client-ip=205.220.177.32; envelope-from=eric.devolder@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device. Signed-off-by: Eric DeVolder --- hw/acpi/erst.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index 4304f55..06a87af 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -701,6 +701,247 @@ static const MemoryRegionOps erst_reg_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; + +/*******************************************************************/ +/*******************************************************************/ + +/* ACPI 4.0: Table 17-19 Serialization Instructions */ +#define INST_READ_REGISTER 0x00 +#define INST_READ_REGISTER_VALUE 0x01 +#define INST_WRITE_REGISTER 0x02 +#define INST_WRITE_REGISTER_VALUE 0x03 +#define INST_NOOP 0x04 +#define INST_LOAD_VAR1 0x05 +#define INST_LOAD_VAR2 0x06 +#define INST_STORE_VAR1 0x07 +#define INST_ADD 0x08 +#define INST_SUBTRACT 0x09 +#define INST_ADD_VALUE 0x0A +#define INST_SUBTRACT_VALUE 0x0B +#define INST_STALL 0x0C +#define INST_STALL_WHILE_TRUE 0x0D +#define INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E +#define INST_GOTO 0x0F +#define INST_SET_SRC_ADDRESS_BASE 0x10 +#define INST_SET_DST_ADDRESS_BASE 0x11 +#define INST_MOVE_DATA 0x12 + +/* ACPI 4.0: 17.4.1.2 Serialization Instruction Entries */ +static void build_serialization_instruction_entry(GArray *table_data, + uint8_t serialization_action, + uint8_t instruction, + uint8_t flags, + uint8_t register_bit_width, + uint64_t register_address, + uint64_t value, + uint64_t mask) +{ + /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */ + struct AcpiGenericAddress gas; + + /* Serialization Action */ + build_append_int_noprefix(table_data, serialization_action, 1); + /* Instruction */ + build_append_int_noprefix(table_data, instruction , 1); + /* Flags */ + build_append_int_noprefix(table_data, flags , 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0 , 1); + /* Register Region */ + gas.space_id = AML_SYSTEM_MEMORY; + gas.bit_width = register_bit_width; + gas.bit_offset = 0; + switch (register_bit_width) { + case 8: + gas.access_width = 1; + break; + case 16: + gas.access_width = 2; + break; + case 32: + gas.access_width = 3; + break; + case 64: + gas.access_width = 4; + break; + default: + gas.access_width = 0; + break; + } + gas.address = register_address; + build_append_gas_from_struct(table_data, &gas); + /* Value */ + build_append_int_noprefix(table_data, value , 8); + /* Mask */ + build_append_int_noprefix(table_data, mask , 8); +} + +/* ACPI 4.0: 17.4.1 Serialization Action Table */ +void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, + const char *oem_id, const char *oem_table_id) +{ + GArray *table_instruction_data; + unsigned action; + hwaddr bar0, bar1; + AcpiTable table = { .sig = "ERST", .rev = 1, .oem_id = oem_id, + .oem_table_id = oem_table_id }; + + bar0 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 0); + trace_acpi_erst_pci_bar_0(bar0); + bar1 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 1); + trace_acpi_erst_pci_bar_1(bar1); + +#define MASK8 0x00000000000000FFUL +#define MASK16 0x000000000000FFFFUL +#define MASK32 0x00000000FFFFFFFFUL +#define MASK64 0xFFFFFFFFFFFFFFFFUL + + /* + * Serialization Action Table + * The serialization action table must be generated first + * so that its size can be known in order to populate the + * Instruction Entry Count field. + */ + table_instruction_data = g_array_new(FALSE, FALSE, sizeof(char)); + + /* Serialization Instruction Entries */ + action = ACTION_BEGIN_WRITE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_BEGIN_READ_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_BEGIN_CLEAR_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_END_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_SET_RECORD_OFFSET; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET , 0, MASK32); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_EXECUTE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_VALUE_OFFSET , ERST_EXECUTE_OPERATION_MAGIC, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_CHECK_BUSY_STATUS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER_VALUE , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0x01, MASK8); + + action = ACTION_GET_COMMAND_STATUS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK8); + + action = ACTION_GET_RECORD_IDENTIFIER; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + action = ACTION_SET_RECORD_IDENTIFIER; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET , 0, MASK64); + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_GET_RECORD_COUNT; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_BEGIN_DUMMY_WRITE_OPERATION; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 32, + bar0 + ERST_VALUE_OFFSET, 0, MASK32); + + action = ACTION_GET_EXECUTE_OPERATION_TIMINGS; + build_serialization_instruction_entry(table_instruction_data, + action, INST_WRITE_REGISTER_VALUE, 0, 32, + bar0 + ERST_ACTION_OFFSET, action, MASK8); + build_serialization_instruction_entry(table_instruction_data, + action, INST_READ_REGISTER , 0, 64, + bar0 + ERST_VALUE_OFFSET, 0, MASK64); + + /* Serialization Header */ + acpi_table_begin(&table, table_data); + + /* Serialization Header Size */ + build_append_int_noprefix(table_data, 48, 4); + + /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); + + /* + * Instruction Entry Count + * Each instruction entry is 32 bytes + */ + build_append_int_noprefix(table_data, + (table_instruction_data->len / 32), 4); + + /* Serialization Instruction Entries */ + g_array_append_vals(table_data, table_instruction_data->data, + table_instruction_data->len); + g_array_free(table_instruction_data, TRUE); + + acpi_table_end(linker, &table); +} + /*******************************************************************/ /*******************************************************************/ static int erst_post_load(void *opaque, int version_id) From patchwork Fri Oct 15 19:02: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: 12562679 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 840DBC433FE for ; Fri, 15 Oct 2021 19:16:04 +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 F1B49610D2 for ; Fri, 15 Oct 2021 19:16:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F1B49610D2 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]:59782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSgU-0007RQ-PP for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUd-0003wU-79 for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:48 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:61400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUb-0007qC-Am for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:46 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIG5OH006620; Fri, 15 Oct 2021 19:03:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=jp++JV+8pxvYJ5zQW3RqnwtcuRUF57wFMcWCVyBOvKo=; b=mkJEMDtn5+HgPwaazOmTr+vnaNE3hjeWWzugz/0Kf7Vat/vnFXE0ctJ9jXV9RfvRzT8X /GyFgfqh6xs9CzxWe/kaYnZP+w3S5TM+lcQiVp2oV4al36XYBUKEQJuh2OM4Fks82Eah oMAnPZWcxyWzII9iEsSbTTwLXvFXQ1J2jdDbxUYDPniwZqEwhbAjqNQYmuDRdGawMVER CNFBcnsFNHj+AAYjk8pmMe+9wJOtZpOqtMuZH5eSZb+MO6+VkwzV87eVwhtJNzKdNCQm xWA8+rToahxC3iKkZatYJeZMwGpvez3oTVrSpOrmRe5sdMxd6nDw5CJkABDEJiosE7jn Tw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqes2g7bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:41 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ1Jhr069241; Fri, 15 Oct 2021 19:03:40 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2048.outbound.protection.outlook.com [104.47.74.48]) by userp3030.oracle.com with ESMTP id 3bkyvew18h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aeuGRVC1W17C6CaSM3Mkchkxugnzrx1EShC0OPTeOY1jFbvSEC4iI+cb5TNS2/hCffl72w2VrXPPGe4HxrJA98pXwCfSbIQTeVgTliEItA21UMojwXn9mzrW0sDV+VDcTzqBgyO/a2XfAklC6e7DakzgM+bub5Diz132bIjiP4yOhWqpl2aB19eFFXHPqYViRBjWjeqj+LmXwzEtHDloFNKRYiMp20y0+t9UF6P6oajm7rYKMrAB5ICObnVpeRlX5qa08tXnlTWI5dnpxHCWzVlxWqqct5P5KYVugr+g44d+QDbpT5WT5IRchl3SvT408OYVb4axMCbxr6ujN0nwyw== 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=jp++JV+8pxvYJ5zQW3RqnwtcuRUF57wFMcWCVyBOvKo=; b=RhFkRqCctF8JeCF1TJfwY+F8+2+9SJerhdytAOLHRqwwZcKOXfRe/+8ZYR3qxdlWJgdTudQxarm2DL8SuootV+Kr3mOr5+Mt5ueBAGrFmQwSZHVPcqASAjeoLdVuTfZmBESUgiN3JStl+z5bE3x6sMenCqpTBR4wZOsSuo3krTUuxbjz5Whp1jt4RC5OC8goiRcGyhqh3K7ccaXId4T0eCj/9k5B6zr7n8Kb77LzD5p88cz2WBhYCfg8stul7bbRnXTw7MzjRgmfhxj1bQWtmb1Iy2dyYw9g+GW9hmJvBO+cdo+Dhqob0h6KYhtolC6HJfYiJXPEkiqU3EQ+bOEh5w== 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=jp++JV+8pxvYJ5zQW3RqnwtcuRUF57wFMcWCVyBOvKo=; b=RV+WLXwxHt4aZfFMQ8DXos8RN6nPJ6t3Dr7j8S9tY4HVlo8BkfLz2wKJ/JP/HyM9EMmTsU6/jwWbOa6Wm1/aVNe8oJ1enrVBNhlQq7Gv994dYOgaf2hCxFH/UeE8szxNXHcB24BBrzvhAwcwLEXs2C5Hp2YpJjK30JduGRbj8hw= 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:37 +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:37 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Date: Fri, 15 Oct 2021 15:02:57 -0400 Message-Id: <1634324580-27120-8-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af76c25d-0230-4be5-e4dd-08d9900e7e83 X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cb90R/NzKXR3o7C4G3w4d194D0EsxIxz0syWa3IxLExWAFgkNE/EMqO5j1taz0AZMytoRxJhSf3K9a9fYVlabJn76coGqiMbI1mRv6anMT8cDeqgEZ6VXlbXb4LrIhS/EzCRw2gtFMGp9z5sZI7euqC744Q5A4pv8lyWM9CVELJQs4UP3DSaZoC3uyb59z8rfdVi+jOk/aZMzvhSbGaQnm/TcAZWxHl8tHbxdQ5+weC6evHUk+bjFyzZg2hRoUtykwT4Jmkts+J+zNytqkiy7GQ8AyqTJPOmXhd9WP7xrCBgNaD/nrwOtOS534Y2ggnSf0tayKdwpujF5k6lKqmg+JwXrOQXOLM2zrS0Z6Q/C1WvpEYD1y4NOXG3RGfgOPlZIayFmL2Yo4rA4NxHbijpiqKLDn3eKnGLwYTIzxoYK13z3eswkBr7Yvh3hbDjn7yYbKNXSIC1z/Dn7eVMdfHN8eMeBuVy8/VYKwgsSIfWRmEdhtKeFtJ68+jWnMj/3eaSXSOewvbrdUCa1iq8cmntGTQA7jDLIvgxUkdIHEZJBXVvZ/EVTttNdycN4YHMwrd/8seppp2jfhA3QRtte7nUip+SdDfgfdhz7Omgb84AvbHYi/uPgDMK8ZV7HGqjiL6f5Bm5BChW10s9r8EyjBdUxsf3uZbL8DUHz1HvGI6V5sPw7/Smi/Yu3MiVVs5nbYrmp59cO25To5VVauVj8HaOFg== 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)(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: cdVMMGgil4L+56AxgbnszAygx/nM+sON/EE3mITeUJj3s93OREHGst1p2EdTvDBXhz2NdxK2Xskby5xLeEAnTzyWAQR3rkeiiXwfetWmHCw+F9WwqRsT++FpNm4RAtvMjFMM46ptxEqcRo2jxwIVQ8fRPpelsUbju7VJADAm55LifywhWla+cRo1eWx6J2FxSgMyHFRUnBtHigrylzIl0reA4rZfVoNR1/3E4nqwae/R4IBPb4Fwfbavf1MuWxQAHe9j7mfP64GZJD/cGA6btQfoYZLLB898nngyuP5avH8RODQPNXJDWdWIiZvmQcArjeOtN4M0SRoebveJv+6bPO+6sAimvi9sRAC8ct8qSz4XvH9mprzgVvfQ03v8GbKR1/1H7Gf8tjhsLqeZwBUSWdTsaZGBS4GbFzI1xo2phlITTmg2Q3ztXQ4fyQgv0zPAC6mWysJLarNUY4H2ihHd4ZCPvQEvta2/IWk87aQwoUFaYXJza7tHgarhRvefpgg1zJFQepXXpVhMq0C3s4k/gG9e6kiy4D+I7zgVFs6kn6yQIs/K9oZQc30Uyy/LWvo8Yoq918Kdee7KVMe8Y+74ZQE7gM8z9EW5Etg3Zq1aUrbztYYQnZuOfdamtZK7O3LdPytkCHjOflwA8RRzzrAKXl8G4oKaxlXUoBkDRlhgfrQyhpE2CQOYQhszQbcpC5Zahr9ubg9nuA8O116lxPW4bDOhnTsacFae1G6z+hAhlgPy7TKJzWDC8580KFR1EVmC5NqwW+tsxa8Mmg75vBw+yaapEOncFD2I0bERI21UPVSzMF7BR8uPyVTZ9T8StXs+gpkPm+vJ198JDB2iy6rfNP/EQVnqNbiYDzQlVm9Pw45tbkiKsYikLfb2wX0YOCOVwgvvnubhx6RdG3ujjkUnTlG+IcgOGRTFUS9/9QLWjBURQXjLnTyJJyI7os+CufimChuZiWzWoH+saq9yAvJICcBYEjUnfoFELpptLTa6e8LIZ3cT2+3hXngS2zu5C6/a62nUnMI4VrGKfJdBK3EUEw2onYSoNU79xwJTcFBH19ZIXbWvnPbzNMThBydvxc715iXU9EOAx8yxNKUF+44Pi7N6achuw8aSTflXh8AekEatpEyzOpot+eGQDdPLfJycOTjgp9G+gJwDlfr8ZIJ/See9ip8xPbemhDmmmmz6YnKLlQQafAcpGKfIryzyC4yCptoZ7fQYfJaHhguaatn+DR33StUmlcat0tsfUnbAsqXwDEIixzAPszoz1ccdRr7WG5WSTEN6Vks5/8SZmu3RCDa9hwpkvQlLdRB8I0EejIsLvBXxZFYWPW6DGXhjn3dv X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af76c25d-0230-4be5-e4dd-08d9900e7e83 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:37.7773 (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: a2ZvBQM82eNtfm8rsP9Yzde21OFWJzRtfJfEhgYHALiYQonOHzkuGnwKvBKDMa9ezgYWyAj8ac43qj8O44AVnBuvgX7kpAJjnDYjZqQ/KU8= 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 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-GUID: ElxfQWcw5T2WvcLyT-ViMudKyRTmczgL X-Proofpoint-ORIG-GUID: ElxfQWcw5T2WvcLyT-ViMudKyRTmczgL Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change exposes ACPI ERST support for x86 guests. Signed-off-by: Eric DeVolder --- hw/i386/acpi-build.c | 9 +++++++++ hw/i386/acpi-microvm.c | 9 +++++++++ include/hw/acpi/erst.h | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 81418b7..9c2f9d9 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -43,6 +43,7 @@ #include "sysemu/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" +#include "hw/acpi/erst.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" @@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) GArray *tables_blob = tables->table_data; AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL }; Object *vmgenid_dev; + Object *erst_dev; char *oem_id; char *oem_table_id; @@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + vmgenid_dev = find_vmgenid_dev(); if (vmgenid_dev) { acpi_add_table(table_offsets, tables_blob); diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index 196d318..662c8ad 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -30,6 +30,7 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" +#include "hw/acpi/erst.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h" @@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables, X86MachineState *x86ms = X86_MACHINE(mms); GArray *table_offsets; GArray *tables_blob = tables->table_data; + Object *erst_dev; unsigned dsdt, xsdt; AcpiFadtData pmfadt = { /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */ @@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables *tables, ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, x86ms->oem_table_id); + erst_dev = find_erst_dev(); + if (erst_dev) { + acpi_add_table(table_offsets, tables_blob); + build_erst(tables_blob, tables->linker, erst_dev, + x86ms->oem_id, x86ms->oem_table_id); + } + xsdt = tables_blob->len; build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id, x86ms->oem_table_id); diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h index 9d63717..b747fe7 100644 --- a/include/hw/acpi/erst.h +++ b/include/hw/acpi/erst.h @@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, #define TYPE_ACPI_ERST "acpi-erst" +/* returns NULL unless there is exactly one device */ +static inline Object *find_erst_dev(void) +{ + return object_resolve_path_type("", TYPE_ACPI_ERST, NULL); +} #endif From patchwork Fri Oct 15 19:02: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: 12562677 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 24660C43217 for ; Fri, 15 Oct 2021 19:12:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 995E061041 for ; Fri, 15 Oct 2021 19:12:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 995E061041 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]:50646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSd4-0001Nl-IY for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:12:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUd-0003wX-OH for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:48 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:62392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUb-0007qI-OX for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:47 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIG6PI006631; Fri, 15 Oct 2021 19:03:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=bJTGvmMR66d41qQOba3qeGy98nzk06u8PuHi2byqZQw=; b=RzOWmDyJfJva+h1OgVoS5fWPPwSdDqveRixsCfb/Nj+Q1Wu4jzRxVpjZbqjmCCLreJdY qBy0ykpOPZpWzG4OrEt0F6B2+YP+Sb4GRh5K3H/VrcOLcNNUUPHJoojKAzi9NgkW/+qe 3oxKsK/TtaAelKBX5IX4F6NmUw2OWK++Nni3wbHS17Sh9LZQoTLQadq4Brc/uZY4HLvF WsMMCOmOwMN/wrdsz6k/R/Ay5c/OwceESh9q3FDUi0jS3QFRYmxN9iqVhm+d+XKMLI2N hf5WoeLiKTAs+oGYPCSYPvsKaB79VmVkNWjfZuyrUpYuCjGPM1HYt4Ihkga+ZFRKxsP0 bg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqes2g7bs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:42 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ1Jhs069241; Fri, 15 Oct 2021 19:03:41 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2048.outbound.protection.outlook.com [104.47.74.48]) by userp3030.oracle.com with ESMTP id 3bkyvew18h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h+6qhWsMNkBqblMqKf8ogz/y6Z5O7DcbAcPl48nY/dwPepwi4U8V0/TIVgJOzUTghJhguVPjfszPQjY5fw9jZqCXjfgqsvA39Te0/v33DO6trAjnY8cfRGIsPt0IqJ3t+QqO4wO/GdhEzL5HaLMuZgcxKBEXIuAYr/KZVDUfVfNJeZX0pGS0yn9I+sCeD3yFUIY7lTlS5oFNrBO0IGNCc+8OWp6GYsvbUVYid5D2kEQgTzEjcWfb357N3RotuxDPNCHkDOFQjAtk/jo4tjmylkwZEOh++VzFWOROvjOHdZoEXHlFYteREM83mHAbQVkUT90TVcISGQsSCHJBnd7KDg== 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=bJTGvmMR66d41qQOba3qeGy98nzk06u8PuHi2byqZQw=; b=DAN9Hd5XdnOO+f0PT6PYLdJjdCOuUFAO7fphpHxdNjJp9sDsH3S5RCy/CpI4eCZrFacwOO2hqlwcYPrY8z5tg6qEGJ09TtZLJ+l4gFkLXy9hi4KniuiBDHQsHk9QhgU4+YQc9nLeqxLz6S2ssZhKKgAMFitGGVeGGqKL6Tqf7gbMqQLPECEVC7cq3QLIWDIQwuZrRvp3PbWkS3o81MnZjWlmd9eaZOCk8pKMugN9g2Qbm/g+bQoch4crFg0om+oFJnLwvNoWUm5v7+9UNyIlhOnVDQtUBgEjQyY/UN3V9uxTRlBqXdj11EpqSAVx98Z5UScUgov43WbgviSlzh+L9g== 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=bJTGvmMR66d41qQOba3qeGy98nzk06u8PuHi2byqZQw=; b=nQwAP393SqQbhLO2l1c6p7E6bPWmLGlTA+Kp8BEMYPJkOsGU2TEFlJnJ40xSrMVPIaP8XrcR9sgchaxpOGve7QgQnQex5Vu2WTlgVsQhEf30Es0fcU2HRjHpYCF638368jJGt8Ps1ZQH7K6iCjkYs3a9InMmxIGEmjUt+m1WjzY= 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:39 +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:39 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 08/10] ACPI ERST: qtest for ERST Date: Fri, 15 Oct 2021 15:02:58 -0400 Message-Id: <1634324580-27120-9-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b5893b5-8fb8-477d-4cb2-08d9900e7f8d X-MS-TrafficTypeDiagnostic: CO6PR10MB5441: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1lNvwbsvXfg1GRXa2PCCbHs+9V2+bFw+xrxhwuhMuIogt+um9jCmKpr7TxIdKbYXNPB8hRSCKN6w1R2ZczssOiS8VdqowMtQTuHC40U0HOHLWj9QUynDN6xu3+ttXUKLRjfW9cxZJnfvreCGEXHzIXHBBCF/PJ6GRD+DvKWKMVBcBoZiAm4fE1GDuuj1i9kLIgJWR15ZRuvheCIm2di9RBZaBPq2EMNr3NsFKqTmktDqaEAieF1gJNTRUAGYKymah6TrPoUA4vkYR8w0y9qswaEPf69Jif0BotcuYk5WeJfqWMWYQxuAqJLAa9eh9PNRygSPvwfGJqgHFwXb1Q5wqhglENNU5qDSyyJEeOu9URLuIVHxaExd1Q1nBiWstDi+IantutjqsCoN5osQcRRMN8+Ager5UQ6jHj6xywrr7TXOLmFbTJc5K2+3Z03aRsIFM41uA6sMveAByfT5Br5mIHTY/C23vFZYocLYJ8EXwq4aY4kZfQkqJ8JBxGpBPbPkkQbSNqbABGcZazOIOX6LCax9eaWgaLKT1rVAMiB2ryPLQNSwdOI1k+ZgN/RHLwEfExaeL/KcYK1nxZcr3K1gCGm3/lE/VRIbUmaKd7+9aXn+gNClEZ2FLj7CDWezk3z4q1S9vSufZ+zg+/x4c5Q3KfVBXINJgTY79NG4EdfO+MhJaN//R9R/INiA5lHt3/RCKbEkQs0ErH7d4CRSn8EXvA== 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: t3kF0+C633f5T1htZwQfrechlX96LY8hBCnzE+PATL2b7T+wcrVPie/XIagWSlt1duAG09wHMsSysXLSOL7XqJAXipqj48UE0RnaVn2eoaMoFoJC1l9+Y3z82YI3RhLKK75MoHuTDyUJb5hTjRicl76LsWbKjemSBgV1mlh9wLWGslbFAqU9PlcYC4MxzEsf8swk2M1ZbC23fikML8s+TdMjtYaW5Z1Xkix6rOm0fnEBGMQHP5fXWcyD6Ky8ZzGTr9ddgNe6d1uCkmiKNcOWr6rGJ8Tv5n2MJSMd7OSvIOM/dyeGx1YxDF79Eo8iELr+SCwHxyiBU6+ORq8+sTNEKdD2r9Zk8NIQjGyutLIubhWpCGDcSXfN6gXNIYXgLOK/KQPSR+AgYZms2ER5mMBwA0M/vupbzHm9iI1MclzlLxgyZA+OHUSp0GP49Js6Y5NSBVz9cLchkL6XKbalL5PnN6PZEa0mHljFdyaOWbx9X6bJmPs2pFP6eLHI4d69RX3R/AzwDM3A6HWLEJKRvUIlpU8AlxU+H5mbA3P4HEOC2c44luChENQ9IQUo93M0Y+67BLx11sxMs5fCfDnaQIrVmNlbsXpyyFnad82LYuzJh+j7jBuXo0YbWirQ3CB2b7cg61DprNQmMl61dr9LUkMTLJIfdsEFzt22jHP1p/UXuELNgi6DMLKSzeWu7BlAzkcGZYsuOvvoIn35+ROxcpAIcuF9yrLNwWLkhlP2pPqusPa1BzWN2iYvwJB6a34IgIwsmibupMgCE9t+5D0nLz3SssH/JWRqyzjq2ZWEzALd385EIZ9YYaNkCO/Yahbls5ioLJyg9i/duxpr34xu/A+wdwu63xIIDoh1Dz7xmGTq/Wg/je8VQrunc7cBAR4+rb3IjCcDLxf/ieVy5ys0pAZm+h7c9Ck2E1ExNBGmS2HVZ1zzS/FugtJElAR4lfZ0Hrn+lmHw74fvZEPnYYQ0dZGzFIyrLlkstbZOaIhAScsqB7uYWPKNICTmert8xoWkbRT9V0cfCq1WcCcsj2kGAXmxVpoC8IQEmBYhX2+qT7jHnyqBnXQ/ocY18ncpVxvKDftHOU4XmwpHO6OO5U33Uan1ksq104p9SR4ptEv5YWjpk1IOTeUpJjkVoQfufzPMJMw6cV0M3bRN9O3rhIqQEl4Uj1CqQeMxCxCz512I1TGv+5vmg/feJVc2nagJ0gs5xirni/Lk3YINOUUMKANPAmK7RZ8y7cGkNCWP0okGs3TatWyqnQN/BkAypMiONPSyfFMzpWuU1ZZigSCD+416nZlr+fGIkWKX72EXMKCjWKVHSA6N+cfbpuqbE49l3g6DshTp X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b5893b5-8fb8-477d-4cb2-08d9900e7f8d 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:39.4788 (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: gjf8JIjZ6Qf7HDLmW3bAVIQC3kCFxF/7LicZjLkllb1fzrCYFD7iLdaI3iROhe/SIPe04b9pOTOHygB2SED8rK3kbiKTDiFm70aLoBfARW0= 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 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-GUID: gtCH61IUy5wK8T0FCMtX6NUt8BDqn67E X-Proofpoint-ORIG-GUID: gtCH61IUy5wK8T0FCMtX6NUt8BDqn67E Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest. Signed-off-by: Eric DeVolder --- tests/qtest/erst-test.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 169 insertions(+) create mode 100644 tests/qtest/erst-test.c diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c new file mode 100644 index 0000000..370c119 --- /dev/null +++ b/tests/qtest/erst-test.c @@ -0,0 +1,167 @@ +/* + * QTest testcase for acpi-erst + * + * Copyright (c) 2021 Oracle + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include +#include "libqos/libqos-pc.h" +#include "libqos/libqtest.h" +#include "qemu-common.h" + +static void save_fn(QPCIDevice *dev, int devfn, void *data) +{ + QPCIDevice **pdev = (QPCIDevice **) data; + + *pdev = dev; +} + +static QPCIDevice *get_device(QPCIBus *pcibus) +{ + QPCIDevice *dev; + + dev = NULL; + qpci_device_foreach(pcibus, 0x1b36, 0x0012, save_fn, &dev); + g_assert(dev != NULL); + + return dev; +} + +typedef struct _ERSTState { + QOSState *qs; + QPCIBar reg_bar, mem_bar; + uint64_t reg_barsize, mem_barsize; + QPCIDevice *dev; +} ERSTState; + +#define ACTION 0 +#define VALUE 8 + +static const char *reg2str(unsigned reg) +{ + switch (reg) { + case 0: + return "ACTION"; + case 8: + return "VALUE"; + default: + return NULL; + } +} + +static inline uint32_t in_reg32(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint32_t res; + + res = qpci_io_readl(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %08x", name, res); + + return res; +} + +static inline uint64_t in_reg64(ERSTState *s, unsigned reg) +{ + const char *name = reg2str(reg); + uint64_t res; + + res = qpci_io_readq(s->dev, s->reg_bar, reg); + g_test_message("*%s -> %016llx", name, (unsigned long long)res); + + return res; +} + +static inline void out_reg32(ERSTState *s, unsigned reg, uint32_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%08x -> *%s", v, name); + qpci_io_writel(s->dev, s->reg_bar, reg, v); +} + +static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v) +{ + const char *name = reg2str(reg); + + g_test_message("%016llx -> *%s", (unsigned long long)v, name); + qpci_io_writeq(s->dev, s->reg_bar, reg, v); +} + +static void cleanup_vm(ERSTState *s) +{ + g_free(s->dev); + qtest_shutdown(s->qs); +} + +static void setup_vm_cmd(ERSTState *s, const char *cmd) +{ + const char *arch = qtest_get_arch(); + + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + s->qs = qtest_pc_boot(cmd); + } else { + g_printerr("erst-test tests are only available on x86\n"); + exit(EXIT_FAILURE); + } + s->dev = get_device(s->qs->pcibus); + + s->reg_bar = qpci_iomap(s->dev, 0, &s->reg_barsize); + g_assert_cmpuint(s->reg_barsize, ==, 16); + + s->mem_bar = qpci_iomap(s->dev, 1, &s->mem_barsize); + g_assert_cmpuint(s->mem_barsize, ==, 0x2000); + + qpci_device_enable(s->dev); +} + +static void test_acpi_erst_basic(void) +{ + ERSTState state; + uint64_t log_address_range; + uint64_t log_address_length; + uint32_t log_address_attr; + + setup_vm_cmd(&state, + "-object memory-backend-file," + "mem-path=acpi-erst.XXXXXX," + "size=64K," + "share=on," + "id=nvram " + "-device acpi-erst," + "memdev=nvram"); + + out_reg32(&state, ACTION, 0xD); + log_address_range = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xE); + log_address_length = in_reg64(&state, VALUE); + out_reg32(&state, ACTION, 0xF); + log_address_attr = in_reg32(&state, VALUE); + + /* Check log_address_range is not 0, ~0 or base */ + g_assert_cmpuint(log_address_range, !=, 0ULL); + g_assert_cmpuint(log_address_range, !=, ~0ULL); + g_assert_cmpuint(log_address_range, !=, state.reg_bar.addr); + g_assert_cmpuint(log_address_range, ==, state.mem_bar.addr); + + /* Check log_address_length is bar1_size */ + g_assert_cmpuint(log_address_length, ==, state.mem_barsize); + + /* Check log_address_attr is 0 */ + g_assert_cmpuint(log_address_attr, ==, 0); + + cleanup_vm(&state); +} + +int main(int argc, char **argv) +{ + int ret; + + g_test_init(&argc, &argv, NULL); + qtest_add_func("/acpi-erst/basic", test_acpi_erst_basic); + ret = g_test_run(); + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c9d8458..15ae6d9 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -68,6 +68,7 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ACPI') ? ['erst-test'] : []) + \ (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ qtests_pci + \ ['fdc-test', @@ -246,6 +247,7 @@ qtests = { 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], 'cdrom-test': files('boot-sector.c'), 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, + 'erst-test': files('erst-test.c'), 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], 'migration-test': files('migration-helpers.c'), 'pxe-test': files('boot-sector.c'), From patchwork Fri Oct 15 19:02: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: 12562675 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 F2E18C4332F for ; Fri, 15 Oct 2021 19:12:30 +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 7678A60E0C for ; Fri, 15 Oct 2021 19:12:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7678A60E0C 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]:50424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSd3-0001Em-Ay for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUg-0003xL-Dk for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:55 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:27276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUc-0007qR-0v for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:50 -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 19FI19nW007394; Fri, 15 Oct 2021 19:03:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=NbM1uYoCA/XcZj7C7eIJtD4iTl23PjIQZIIrfLnFMhc=; b=lZ9xRiZO1XS3RL610dHdKFRSemwuPuCJP/twF+wn6Sp2LpP/CCorkhSMEeCoN/xSMu/0 qxD7EnxvkhOyt4MC6wlSrjRbVjYBEPbYmDHGBVI1DL81ktzh7PxhTGolN+Pw7Wa3Jb7k 0BXTbqn/mJCO5pEwMq0iYKmU2GconcADZkKbYm2Hz8FRl33QlOIsZHwljHHw3kOcGTal hq5mgaMUn8jIi/FGy8cbCeJPJ85LLTX6D/7tqAWgByZR+1LCXortmub7nAE77Nz2fRoK cVFBY9xEh2YKzAX80Ji09ci1/rkPQ7Q7BC16epIfG3I4nZHma/dVk4yDXkcNlfJHvkiC cQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3bpfsytrkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:44 +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 19FJ0sp4180781; Fri, 15 Oct 2021 19:03:43 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by aserp3020.oracle.com with ESMTP id 3bmae4ndfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnpX+Rp6meXHvNkdjAfJkiHnV+6uX0OIoRdkMGTfeEQ47MaFKcBZ7ySv75P8xC2a30BAd0h2h0qkdjEPxwRfZy5l1G8eCxOHtFRNUoimW+lvs+lIuYhIUKUZfViPrvnGffJbaKmPUnIn+wJxEQMWWXcG0lxJLEtIekv+zIf30nAd0TOtekUBPjr7pnlHfwFimjQL7rllXfGEwMfzhDbuCoAGZGi94e0aP2tdE6rhFTFw5Nj1XTI1OHI1bvOEsAHYrIzNCoqIRYRG4222h8HSSQN/lo5oOejHyYQaEfNOa7tXTeoRc1iz1dMzO7DeaiKUZ7jYrk+n4ZPKw+0U/ij9YA== 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=NbM1uYoCA/XcZj7C7eIJtD4iTl23PjIQZIIrfLnFMhc=; b=TGwq5U6nbDYdB3Fv733L3rGsBR9ayV0YQQVGqcAqruibb2V82QHzbayrStjDFucMLwl+qX4L+OOKMwqGrDEZ0KyVCo4NzkJslkzc8P8NnadnA/OVLJrAH3rMXSIQejyaeriloGYciZlKIoTuC/WW6pHsRUMod8CzIt/WQJBfKC13zeBTrVOeqp2xs7oGJ/pgQSItG4+axnQY2MrYRevN78P38VMbE/APx74tuhGTEeh/VoSdhn96+dX7jIK1fm5zu+JvK+rsFGjaLInkr/3uwjijF8tjX5qoClqWOR4+m6C0XZeCf5iZULQ7tvQdSlwbWGtokFLLmExcwnaiUCxrPw== 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=NbM1uYoCA/XcZj7C7eIJtD4iTl23PjIQZIIrfLnFMhc=; b=EE78Sd9IHtSs7kd51/Gonk8vyt1wsMZ173OJiYWESH9PcAwwsjVIdF7IKAIg0j4W+v2kClOVJJ7NB4T5k8nCnbBXLtRrMlMISVjk13jm/AuI8UkjFO7Fa6SVolcBUTowZ3523yu2JbVDexiOcqEk9DgOnp6oqQEVeWA5OzT1e+4= 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 MWHPR1001MB2288.namprd10.prod.outlook.com (2603:10b6:301:2c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Fri, 15 Oct 2021 19:03:41 +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:41 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 09/10] ACPI ERST: bios-tables-test testcase Date: Fri, 15 Oct 2021 15:02:59 -0400 Message-Id: <1634324580-27120-10-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae7180b3-340d-46b6-f5ea-08d9900e80a6 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2288: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:415; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7aAdwn0s9oP4eVJ8NIKi3cTCrL45fXF253NwWjKMnqVDEwMb+OnH7FIqTc+4YfBsx6SRqcGmD4dotUlBMrDQNk5h5YR4reDsH1kzfiU8ucnZntj18ZzmjFCb96hQ32WVXPNX0+mzrj0eo+SaL7p9Nlz9hLW6XPPGp5E3rws7JdYY+nFeqr86pam1SIuvNRjuXtn0DC+13r9mThhRmngMZUfNLjUImrJAPDrg8LrgoLVbvSQsLdYz3DtKZi5fGoT1ikS2/AzENH0S1agUdn7xqIr2Y/K2kV5XDgjDFsHsHHO5R5pY5Z3wNC4aj50AKMNdYZlr+1SDZ/Hfl91L4TvNvaYtAVALSEzU653CLKOY/eNUICI3O/H1nN/IAgIIr0zfjN9zB9cS4Ja7JKdYGTWsPeYq6IOJ7pKCZVpufDmafWuT+Mv3w8RU/MeWLchErGg3p9PNMu0yM5Nhvb5j2XfVG+1ThUZw4khQemKU5DQ4SCsOGuvGR6fymUUVQN1BS8S+3cZnKDkbOfuio/rPXVvrJ/Hg9DPOttQzIAgnlR8cImrRvvrBGlv0c2rm+KYQXEBKMdqHHCywTZfzLXGcEe1+TrdCmGBVg+dDxnaiBedBiMOlUxcnLyFoNjWmMx0luUYG6ExyZqNVBkto/vrUBTaqrahDBuNWny/yw0s2HrJCacCIkPWhg9FfTOKDyQfbEjekb4nXHlqSbkcn77o7Fqxcqg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(6486002)(316002)(107886003)(956004)(6916009)(38100700002)(66946007)(8676002)(36756003)(4326008)(186003)(6666004)(508600001)(26005)(8936002)(2906002)(66556008)(66476007)(38350700002)(7696005)(52116002)(2616005)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J9HQpnpVPxa7yk+8fTBc6oflMbmKFZYXqqECPpI0S6Yt+OGG+x0UfeDsaArv1UEmAOLkyA7pUWuhWSv3UWvzzlMmqKggBbrkI69va/LOWsGTv49EhrMbcJv8TSqin1aZwJxLzOO9MW1yJL0TpqTNg7LKsX0EoxWzFHnyXcTmlJOzmR5RMRnPOWGhxhnJNVKUDJthKRdfk352tLEZ2hefie3faelCPUUuNqs3GCRa+0whj1bqaImclsCYPZ242OloZ+kp9YNRGbrt258UUXUIF3vzVYc2yUI/buIORky2c48V7jfUazNRMnqd67kSw5O5vv71AOv5+IH5p48+6XKsLgIpxducK+JxdceGR8rDJvcG77gLzFtgnaZbw/5k8CuOTWVMwrChARZXrn/q0glLPdEZNUm+M6CtRPygonNySDHMd1EzVggRuyQOwslYVKqJSG9jUVZtOATqQGi5tX+cV4U7MLBJAjaRJJk3zErvULk1BmtRRF7WtZb0oNhgdc1CnEt3cs/U5bYg9y+NI/e4a6EHPbtWULJlsJYSWJ8aJGvrxE9MIU86Ubi4R6/tREnysSPXSJV6Oajvn/RtF7egg1NvSEHmmwxGblfWAy8moRcyUve727X58mfEzziQ4pvazgOBKOELXnpRsAbftMC57T2aglnZkJZC/XReudswip+SRxYDPUX+9gbkUDur5mgxKzdbCotGYYwMsot5pkizoSDJz26CKNha8K8+mh8m/WdRbUNZ1zz3GAU9BLOlSopKPSBGklh/DDIpqxNleDrJcPfS01c2bI/SdHob0K7NFW+zjAqg+tjNTGt2VM6eB4w9VI2x0aIUc58dPI99AiUBfw/Bv70uhFnlZsAyoUOmsQaDgMwbZPFCx4c0qmzSI2rn91wKb2EdMII7+z9oHzWIN+iK6zUaJXqIv2VWTz1cknmg7ipXsvIoZJuXDXAM8mltzT7ViStxXa0XvSqPlJ9YmNEzMWWY5ae8SMeW9IYQGR/5XJpeJIQ13OmYZgVt8tHnu8QXfpXgtSIi6lxKZqLii4LtQzCVokRFt+bH63RrbZMUEJfQDAdB16pLIIr3gEKUUP9KKVDKQxlRZ0HpGEcv7SwfzWmxJS16yUkepOSQsQKOicDmUHwnEBbu1UDN8HjS8SaGN7AYuhpgwAIJkFsrUbPYJjG+//gaOLW75a/z4gfs4iPJAu9FTej9CGIVakHTxs87QDd1SHbyTzAGt8l9zNAWugv56gnyTuKy5u1KtYkYFVsO2Bewp82RVBnD4+Rg+HSalppa6FFtxk3bfzTvODktM8Y4KUE9OaPnkH1AYf0hm0o+7rqpkKKu5up91bBc X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae7180b3-340d-46b6-f5ea-08d9900e80a6 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:41.3885 (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: sIWr+RZSZgi4dAmaiugGlt8HUgIpLCdVwEn3mkD9KSnWhT+MYFwdvHgAFpTClx1xJEjWESBVu0F/4VOhz/3ZJ/y6zlT8CXCdZDCW7KggM7g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2288 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: GTJzIumZ2aRqizSIibCxEVZNUNJPidyf X-Proofpoint-GUID: GTJzIumZ2aRqizSIibCxEVZNUNJPidyf 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 change implements the test suite checks for the ERST table. Signed-off-by: Eric DeVolder --- tests/qtest/bios-tables-test.c | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 4f11d03..617eaf6 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1381,6 +1381,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } +static void test_acpi_erst(const char *machine) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = machine; + data.variant = ".acpierst"; + params = g_strdup_printf( + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + free_test_data(&data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); +} + +static void test_acpi_piix4_erst(void) +{ + test_acpi_erst(MACHINE_PC); +} + +static void test_acpi_q35_erst(void) +{ + test_acpi_erst(MACHINE_Q35); +} + +static void test_acpi_microvm_erst(void) +{ + gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); + gchar *params; + test_data data; + + test_acpi_microvm_prepare(&data); + data.variant = ".pcie"; + data.tcg_only = true; /* need constant host-phys-bits */ + params = g_strdup_printf(" -machine microvm," + "acpi=on,ioapic2=off,rtc=off,pcie=on" + " -object memory-backend-file,id=erstnvram," + "mem-path=%s,size=0x10000,share=on" + " -device acpi-erst,memdev=erstnvram", tmp_path); + test_acpi_one(params, &data); + g_free(params); + g_assert(g_rmdir(tmp_path) == 0); + g_free(tmp_path); + free_test_data(&data); +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -1566,7 +1617,11 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm); if (strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_erst); } + qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_erst); + qtest_add_func("acpi/q35/acpierst", test_acpi_q35_erst); + } else if (strcmp(arch, "aarch64") == 0) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); From patchwork Fri Oct 15 19:03:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 12562655 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 AB394C433F5 for ; Fri, 15 Oct 2021 19:07:06 +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 25DBD60F6F for ; Fri, 15 Oct 2021 19:07:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 25DBD60F6F 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]:33954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSXo-00070A-VG for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 15:07:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUl-0003xy-N1 for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:55 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:12740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSUh-0007uj-Lb for qemu-devel@nongnu.org; Fri, 15 Oct 2021 15:03:55 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19FIi0UC024966; Fri, 15 Oct 2021 19:03:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=LCdtDt/Ba10+aNqhz1gNkesbsXVQs/WiKkEhkxxyl6E=; b=XsMxQZVG+QVAi1jc4y81zclAKcNEOLr99LQp73o/QHavJVJb3AWU9q+L4wmU30vUVQqT LqBXMCJ4iKEvDSEMH+RWO61j8UDzNMSGxLVl9iM4RWtosur48uYtoBuKQzU9ExjPsS6D bY+kQ7ZcBt70KDosW0BCMNTPGm58zjkZONOUKR4vlfdhn8Lax1/WqOEN/2HoMTifrRdg KhFEqSS+2q9k7rxuS2gWzWI+oJev/zxCefr3WlXRZpZEKaQPEhcoJzZvuody5wlDIsWz Jxbtyk/TExXkldfg1bgFx77sA8DjJb64iCkDpzYdbvQIocKx0j0UQtALLcTseaHtih/B Sg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3bqbgfserw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19FJ1JCL069131; Fri, 15 Oct 2021 19:03:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by userp3030.oracle.com with ESMTP id 3bkyvew1ch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Oct 2021 19:03:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmzf8p9PuLYWcIkPSu2Ul48zYDPMabbyhIaaMX0M5KiPFk4uf3SCWtvksLIWijAGVG4fF+Ytt0jNB+03xv5lz/+aiSM2IGztQr3iAmL3Twon1FG+xrukPAfubutEY1/42snefqR36Ujo4S58QSCamDonGFO6oAWXhK/q8ll3J1iehtSDBXz1a5RpnFpbEf+DpULbtuPSxTIY1kyXaBsie1/44B4zCJwSwzhK/yhHGh3x/+MKXVWqO9xbu9cH3dfgDMgI0vR/Y1M4KFnlBgXSSXNWWwbOnKGbhvcugb2PA2uB2mBdWk3/Q/fviU3qhqHOHWv3IJZqyRIPBuVDDZl/ag== 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=LCdtDt/Ba10+aNqhz1gNkesbsXVQs/WiKkEhkxxyl6E=; b=bMQ5gmoxg3Gm+xVcNAYMqxeE9IwQrtQ7kG8ntwu1Zc4DySUWac0cCc/3fPtpmQmbr43iYNrqE5oXjMCxdPsDWrPEb7jdVgUkSbOcTLQuZ2p+93239QrBc6xO/j9vkjWUWXye3NQXO7s+w316/luhcw3Edqt6Eo7+szpx8koIhdK7wKpPFt2m4SZwiOoIGrE+wad9NMW6W4ogfR72SHKhzsh49Wm+lqxACkr3j28Lt7SBlouYSiBFcovX46Es3sMHry0mYrBynO1vzCHCfiRwmzvTeGhiAxXg4jm680aZh04qyou+JOUsQg6ZhaxdFs2pITwru0sS8leetQKRL6gJcw== 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=LCdtDt/Ba10+aNqhz1gNkesbsXVQs/WiKkEhkxxyl6E=; b=MPJStf40Lpk4e1YT6vioBPTyXW4vPCmH4TYCw8+YarFeZLVmotgmZXViCJ3ocFE+wDqjQDGsxvwGcUsJYTlrZBGwXI/WtdTc7dXbWmqkMptFzkB+4dw4eABjpYZ7BFgof9r0bf8y0kDhz+NPdDEsWuGbwhhwc9fOynounQvHXBk= 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 MWHPR1001MB2288.namprd10.prod.outlook.com (2603:10b6:301:2c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Fri, 15 Oct 2021 19:03:43 +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:43 +0000 From: Eric DeVolder To: qemu-devel@nongnu.org Subject: [PATCH v8 10/10] ACPI ERST: step 6 of bios-tables-test.c Date: Fri, 15 Oct 2021 15:03:00 -0400 Message-Id: <1634324580-27120-11-git-send-email-eric.devolder@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> References: <1634324580-27120-1-git-send-email-eric.devolder@oracle.com> 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:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22d0e168-3ba7-42de-e3f3-08d9900e81d5 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2288: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SDHn4jSTmXqWfU5EPqTduMMunuDV6d9jbcb0j9flGoiy9ndkIVtccvcTWEDDDZHCaxQpWbVRVm5sHRlXLOvtBaHLethLrnEqbRCeSSavDTK48o1+8HRwmQEuG3xj2OoWrKfxq9MS2VVxuvhvovd+ng8xsqO+2IDrPMEF97VFsquBrgQ9134zV2Vzzjvup+edy819uGlIThtUa7XogRjLD1WW7oC1Z/HRGGhc9wQjc/8/Azm+2eFwYCe24e5ODciuVDT+00Zs9rChobULOYu3wJn6OLbGmUGZgWnWjnd3Gf/nSGS4mNkST5UISrWBDg09dfsL+bR7o8oR9Ej7+0GHwu67VcOhQBUvU2vtNtxKa3QS/TKPpfC3iknp4X+GQSboN3uC5f4Ck8gHoLxLGOc/GwhhmaYNeAAUWxq5tEm+yQJc7t3n1oag1cabnN2osDB97z9CDOswnvi52j+LHf2VqqrAEXDIL+rHecFaGQi94A3Hgvt5w7YDYaoQWqxxPTDZtn0N+rV4DsVTIHwF1UEj3hzTxo6xsxZ1CpCf7/aqa5jBCxPRdFbAiQQX8qkSve1wuCqb4WP2HKdQBZgwj3Y/b+yUbOtnra9BtEDcz8HIVka09V0nEJWjbIhYqoXxGviyRzwzzzsNg9xgvSdRl3uWS4CQT3y5Nia8nbrTlHIe1+erb+UUOXbw3F7C/KD3x9bSNUmHZe9D/0R/lmNXahq7Fw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(6486002)(316002)(107886003)(83380400001)(4001150100001)(956004)(6916009)(38100700002)(66946007)(8676002)(36756003)(4326008)(186003)(6666004)(508600001)(26005)(8936002)(2906002)(66556008)(66476007)(38350700002)(30864003)(7696005)(52116002)(2616005)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7atR62U/MqjmJYjt1Et4+bWf36OO0Lvch33Bgy1u0vDDlYr/Zj83/8Gt26N3Z7T8orcj+x3UpVki+gkYw1hHWpRTZIK+MX8Yn2bxOup5fHzDTVkTjh4nOctiANc+A034xiFx4buok8LCJdMm2ZpaQw4fTNTsqjYMC2ijLJqJc8/ImJif6Xb5qNOBAjkcoJ0dKYvr5O4RiNpXCs+r7BIIqccMj7IhrkVkD5LFfqP6EFt1MAga0iTgxnErLYLfg14na3/zwUwg35qeWDwFc/SXwJCpIAkue4Kp4o3c7dMkinZxiaq3MqIP5CfAto4buA/nrzQYhcr6cQX5YxL2RC0/V7FGGrOjMeETIXj9uhaW9tmRvKd06lLUaxMLGNYASbO3Uomk3fSdasCLOaHcxwHlRhDb953+1pZGY6YrqvzBnRQAXRwsBFiIVSyAtKL7p8zUIxT/yR1OU60aKVeUqOpRfDc3O68N+CWcrTzUU1ZLKgejDhq6L3BQHlA31HdpLwZl6b9OoV/7CxttLM2BGkeCm8wQRKmWHZknhDaG3ZTByg+3mwDX7X1VXmZTVCGUw81EM9UcI+JuO6LkqMa6bMB01Ia4VPSv9A58n20vjn5AlKL6bfOPNvJYbid9iiSUhSr7Ud41RlO7MXmZVfPoJUK8lP0Mlp1MTPj6iQNBDFk41iyJmQ1iKZHEJMuySNPa+VRIRCoUX5PYNzaR4KDpzpHeOCkd7F8e9/6rGhOgrVmbJiAGZQGnD1NK/PMebHl8/fmqjA4UilyEIq2wZE6RxKHH5LoyP/kKeBJfwXnroHEalX5Y7nrYTuG0H8iGoZbDYOLR06+i8SDSLmu0MJTXkyCOTHaghdGZkjfsiYuJPyzzgFp0EivBXGzMT3KkVhW3lJU/S/kMkvGz7iztlnjpfm7Mk7y/NSEeSAA8hZRzn6twoXQSuBjwD/BMDIIwt0hIc/XWJR3IdkBKOw2+ogiDAR2n2kJCC6EQdsU26OKFNwm5zn1ix2FEvxsoS8BrCr6DDroRW4oQm+1LAgfAxsR7gZOmCT4bMr/m6vKR9PnKy2QHC+AlqeNAxCvMfOezj07+HluIFRxn16rGgS+78FRsduI+uQk+HXX1YFpsjU3R2XeJx7oRuG9ml5Reu6VMl/sqTsLGy+3XdwrulQPe0VLDNh2ROHlEcOsK2aQYK9V5WPzweYhu8c/TGXr27HLPmpk97DVcEMNppBhsA+dVwHMX2Twe7rEC5C3bMcj80NuFQemo5AbbjtoScUSd/UfSkXGb5UNDk0HV99eTXphY8Zhsu8cmBeL1Nvx4sIEUUCv/b5qPKcF7wnnG5pUzR8Pq33bYK0Yt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22d0e168-3ba7-42de-e3f3-08d9900e81d5 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:43.3459 (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: 3OPI99pmP8z9+rrzCcb4ZmUJP1KZ7owISheq3jXfUyYd0x34CLez0R9L7pDzIVZULBi4FB4cuLp/NsDq1vSXegou4u1JgCLYkMARdvssWnA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2288 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10138 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110150116 X-Proofpoint-ORIG-GUID: WXgZyoagxKs4Lqnv4IC4THslHOe0fnW8 X-Proofpoint-GUID: WXgZyoagxKs4Lqnv4IC4THslHOe0fnW8 Received-SPF: pass client-ip=205.220.165.32; envelope-from=eric.devolder@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, konrad.wilk@oracle.com, pbonzini@redhat.com, ani@anisinha.ca, imammedo@redhat.com, boris.ostrovsky@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6. Below is the disassembly of an ERST table, tests/data/acpi/pc/ERST. This is a PCI device and as such its base address can change; it is possible for the address fields to differ between this and other ERST tables. [000h 0000 4] Signature : "ERST" [Error Record Serialization Table] [004h 0004 4] Table Length : 00000390 [008h 0008 1] Revision : 01 [009h 0009 1] Checksum : D6 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 4] Serialization Header Length : 00000030 [028h 0040 4] Reserved : 00000000 [02Ch 0044 4] Instruction Entry Count : 0000001B [030h 0048 1] Action : 00 [Begin Write Operation] [031h 0049 1] Instruction : 03 [Write Register Value] [032h 0050 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [033h 0051 1] Reserved : 00 [034h 0052 12] Register Region : [Generic Address Structure] [034h 0052 1] Space ID : 00 [SystemMemory] [035h 0053 1] Bit Width : 20 [036h 0054 1] Bit Offset : 00 [037h 0055 1] Encoded Access Width : 03 [DWord Access:32] [038h 0056 8] Address : 00000000FEBF3000 [040h 0064 8] Value : 0000000000000000 [048h 0072 8] Mask : 00000000000000FF [050h 0080 1] Action : 01 [Begin Read Operation] [051h 0081 1] Instruction : 03 [Write Register Value] [052h 0082 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [053h 0083 1] Reserved : 00 [054h 0084 12] Register Region : [Generic Address Structure] [054h 0084 1] Space ID : 00 [SystemMemory] [055h 0085 1] Bit Width : 20 [056h 0086 1] Bit Offset : 00 [057h 0087 1] Encoded Access Width : 03 [DWord Access:32] [058h 0088 8] Address : 00000000FEBF3000 [060h 0096 8] Value : 0000000000000001 [068h 0104 8] Mask : 00000000000000FF [070h 0112 1] Action : 02 [Begin Clear Operation] [071h 0113 1] Instruction : 03 [Write Register Value] [072h 0114 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [073h 0115 1] Reserved : 00 [074h 0116 12] Register Region : [Generic Address Structure] [074h 0116 1] Space ID : 00 [SystemMemory] [075h 0117 1] Bit Width : 20 [076h 0118 1] Bit Offset : 00 [077h 0119 1] Encoded Access Width : 03 [DWord Access:32] [078h 0120 8] Address : 00000000FEBF3000 [080h 0128 8] Value : 0000000000000002 [088h 0136 8] Mask : 00000000000000FF [090h 0144 1] Action : 03 [End Operation] [091h 0145 1] Instruction : 03 [Write Register Value] [092h 0146 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [093h 0147 1] Reserved : 00 [094h 0148 12] Register Region : [Generic Address Structure] [094h 0148 1] Space ID : 00 [SystemMemory] [095h 0149 1] Bit Width : 20 [096h 0150 1] Bit Offset : 00 [097h 0151 1] Encoded Access Width : 03 [DWord Access:32] [098h 0152 8] Address : 00000000FEBF3000 [0A0h 0160 8] Value : 0000000000000003 [0A8h 0168 8] Mask : 00000000000000FF [0B0h 0176 1] Action : 04 [Set Record Offset] [0B1h 0177 1] Instruction : 02 [Write Register] [0B2h 0178 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0B3h 0179 1] Reserved : 00 [0B4h 0180 12] Register Region : [Generic Address Structure] [0B4h 0180 1] Space ID : 00 [SystemMemory] [0B5h 0181 1] Bit Width : 20 [0B6h 0182 1] Bit Offset : 00 [0B7h 0183 1] Encoded Access Width : 03 [DWord Access:32] [0B8h 0184 8] Address : 00000000FEBF3008 [0C0h 0192 8] Value : 0000000000000000 [0C8h 0200 8] Mask : 00000000FFFFFFFF [0D0h 0208 1] Action : 04 [Set Record Offset] [0D1h 0209 1] Instruction : 03 [Write Register Value] [0D2h 0210 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0D3h 0211 1] Reserved : 00 [0D4h 0212 12] Register Region : [Generic Address Structure] [0D4h 0212 1] Space ID : 00 [SystemMemory] [0D5h 0213 1] Bit Width : 20 [0D6h 0214 1] Bit Offset : 00 [0D7h 0215 1] Encoded Access Width : 03 [DWord Access:32] [0D8h 0216 8] Address : 00000000FEBF3000 [0E0h 0224 8] Value : 0000000000000004 [0E8h 0232 8] Mask : 00000000000000FF [0F0h 0240 1] Action : 05 [Execute Operation] [0F1h 0241 1] Instruction : 03 [Write Register Value] [0F2h 0242 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [0F3h 0243 1] Reserved : 00 [0F4h 0244 12] Register Region : [Generic Address Structure] [0F4h 0244 1] Space ID : 00 [SystemMemory] [0F5h 0245 1] Bit Width : 20 [0F6h 0246 1] Bit Offset : 00 [0F7h 0247 1] Encoded Access Width : 03 [DWord Access:32] [0F8h 0248 8] Address : 00000000FEBF3008 [100h 0256 8] Value : 000000000000009C [108h 0264 8] Mask : 00000000000000FF [110h 0272 1] Action : 05 [Execute Operation] [111h 0273 1] Instruction : 03 [Write Register Value] [112h 0274 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [113h 0275 1] Reserved : 00 [114h 0276 12] Register Region : [Generic Address Structure] [114h 0276 1] Space ID : 00 [SystemMemory] [115h 0277 1] Bit Width : 20 [116h 0278 1] Bit Offset : 00 [117h 0279 1] Encoded Access Width : 03 [DWord Access:32] [118h 0280 8] Address : 00000000FEBF3000 [120h 0288 8] Value : 0000000000000005 [128h 0296 8] Mask : 00000000000000FF [130h 0304 1] Action : 06 [Check Busy Status] [131h 0305 1] Instruction : 03 [Write Register Value] [132h 0306 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [133h 0307 1] Reserved : 00 [134h 0308 12] Register Region : [Generic Address Structure] [134h 0308 1] Space ID : 00 [SystemMemory] [135h 0309 1] Bit Width : 20 [136h 0310 1] Bit Offset : 00 [137h 0311 1] Encoded Access Width : 03 [DWord Access:32] [138h 0312 8] Address : 00000000FEBF3000 [140h 0320 8] Value : 0000000000000006 [148h 0328 8] Mask : 00000000000000FF [150h 0336 1] Action : 06 [Check Busy Status] [151h 0337 1] Instruction : 01 [Read Register Value] [152h 0338 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [153h 0339 1] Reserved : 00 [154h 0340 12] Register Region : [Generic Address Structure] [154h 0340 1] Space ID : 00 [SystemMemory] [155h 0341 1] Bit Width : 20 [156h 0342 1] Bit Offset : 00 [157h 0343 1] Encoded Access Width : 03 [DWord Access:32] [158h 0344 8] Address : 00000000FEBF3008 [160h 0352 8] Value : 0000000000000001 [168h 0360 8] Mask : 00000000000000FF [170h 0368 1] Action : 07 [Get Command Status] [171h 0369 1] Instruction : 03 [Write Register Value] [172h 0370 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [173h 0371 1] Reserved : 00 [174h 0372 12] Register Region : [Generic Address Structure] [174h 0372 1] Space ID : 00 [SystemMemory] [175h 0373 1] Bit Width : 20 [176h 0374 1] Bit Offset : 00 [177h 0375 1] Encoded Access Width : 03 [DWord Access:32] [178h 0376 8] Address : 00000000FEBF3000 [180h 0384 8] Value : 0000000000000007 [188h 0392 8] Mask : 00000000000000FF [190h 0400 1] Action : 07 [Get Command Status] [191h 0401 1] Instruction : 00 [Read Register] [192h 0402 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [193h 0403 1] Reserved : 00 [194h 0404 12] Register Region : [Generic Address Structure] [194h 0404 1] Space ID : 00 [SystemMemory] [195h 0405 1] Bit Width : 20 [196h 0406 1] Bit Offset : 00 [197h 0407 1] Encoded Access Width : 03 [DWord Access:32] [198h 0408 8] Address : 00000000FEBF3008 [1A0h 0416 8] Value : 0000000000000000 [1A8h 0424 8] Mask : 00000000000000FF [1B0h 0432 1] Action : 08 [Get Record Identifier] [1B1h 0433 1] Instruction : 03 [Write Register Value] [1B2h 0434 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1B3h 0435 1] Reserved : 00 [1B4h 0436 12] Register Region : [Generic Address Structure] [1B4h 0436 1] Space ID : 00 [SystemMemory] [1B5h 0437 1] Bit Width : 20 [1B6h 0438 1] Bit Offset : 00 [1B7h 0439 1] Encoded Access Width : 03 [DWord Access:32] [1B8h 0440 8] Address : 00000000FEBF3000 [1C0h 0448 8] Value : 0000000000000008 [1C8h 0456 8] Mask : 00000000000000FF [1D0h 0464 1] Action : 08 [Get Record Identifier] [1D1h 0465 1] Instruction : 00 [Read Register] [1D2h 0466 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1D3h 0467 1] Reserved : 00 [1D4h 0468 12] Register Region : [Generic Address Structure] [1D4h 0468 1] Space ID : 00 [SystemMemory] [1D5h 0469 1] Bit Width : 40 [1D6h 0470 1] Bit Offset : 00 [1D7h 0471 1] Encoded Access Width : 04 [QWord Access:64] [1D8h 0472 8] Address : 00000000FEBF3008 [1E0h 0480 8] Value : 0000000000000000 [1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF [1F0h 0496 1] Action : 09 [Set Record Identifier] [1F1h 0497 1] Instruction : 02 [Write Register] [1F2h 0498 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [1F3h 0499 1] Reserved : 00 [1F4h 0500 12] Register Region : [Generic Address Structure] [1F4h 0500 1] Space ID : 00 [SystemMemory] [1F5h 0501 1] Bit Width : 40 [1F6h 0502 1] Bit Offset : 00 [1F7h 0503 1] Encoded Access Width : 04 [QWord Access:64] [1F8h 0504 8] Address : 00000000FEBF3008 [200h 0512 8] Value : 0000000000000000 [208h 0520 8] Mask : FFFFFFFFFFFFFFFF [210h 0528 1] Action : 09 [Set Record Identifier] [211h 0529 1] Instruction : 03 [Write Register Value] [212h 0530 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [213h 0531 1] Reserved : 00 [214h 0532 12] Register Region : [Generic Address Structure] [214h 0532 1] Space ID : 00 [SystemMemory] [215h 0533 1] Bit Width : 20 [216h 0534 1] Bit Offset : 00 [217h 0535 1] Encoded Access Width : 03 [DWord Access:32] [218h 0536 8] Address : 00000000FEBF3000 [220h 0544 8] Value : 0000000000000009 [228h 0552 8] Mask : 00000000000000FF [230h 0560 1] Action : 0A [Get Record Count] [231h 0561 1] Instruction : 03 [Write Register Value] [232h 0562 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [233h 0563 1] Reserved : 00 [234h 0564 12] Register Region : [Generic Address Structure] [234h 0564 1] Space ID : 00 [SystemMemory] [235h 0565 1] Bit Width : 20 [236h 0566 1] Bit Offset : 00 [237h 0567 1] Encoded Access Width : 03 [DWord Access:32] [238h 0568 8] Address : 00000000FEBF3000 [240h 0576 8] Value : 000000000000000A [248h 0584 8] Mask : 00000000000000FF [250h 0592 1] Action : 0A [Get Record Count] [251h 0593 1] Instruction : 00 [Read Register] [252h 0594 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [253h 0595 1] Reserved : 00 [254h 0596 12] Register Region : [Generic Address Structure] [254h 0596 1] Space ID : 00 [SystemMemory] [255h 0597 1] Bit Width : 20 [256h 0598 1] Bit Offset : 00 [257h 0599 1] Encoded Access Width : 03 [DWord Access:32] [258h 0600 8] Address : 00000000FEBF3008 [260h 0608 8] Value : 0000000000000000 [268h 0616 8] Mask : 00000000FFFFFFFF [270h 0624 1] Action : 0B [Begin Dummy Write] [271h 0625 1] Instruction : 03 [Write Register Value] [272h 0626 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [273h 0627 1] Reserved : 00 [274h 0628 12] Register Region : [Generic Address Structure] [274h 0628 1] Space ID : 00 [SystemMemory] [275h 0629 1] Bit Width : 20 [276h 0630 1] Bit Offset : 00 [277h 0631 1] Encoded Access Width : 03 [DWord Access:32] [278h 0632 8] Address : 00000000FEBF3000 [280h 0640 8] Value : 000000000000000B [288h 0648 8] Mask : 00000000000000FF [290h 0656 1] Action : 0D [Get Error Address Range] [291h 0657 1] Instruction : 03 [Write Register Value] [292h 0658 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [293h 0659 1] Reserved : 00 [294h 0660 12] Register Region : [Generic Address Structure] [294h 0660 1] Space ID : 00 [SystemMemory] [295h 0661 1] Bit Width : 20 [296h 0662 1] Bit Offset : 00 [297h 0663 1] Encoded Access Width : 03 [DWord Access:32] [298h 0664 8] Address : 00000000FEBF3000 [2A0h 0672 8] Value : 000000000000000D [2A8h 0680 8] Mask : 00000000000000FF [2B0h 0688 1] Action : 0D [Get Error Address Range] [2B1h 0689 1] Instruction : 00 [Read Register] [2B2h 0690 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2B3h 0691 1] Reserved : 00 [2B4h 0692 12] Register Region : [Generic Address Structure] [2B4h 0692 1] Space ID : 00 [SystemMemory] [2B5h 0693 1] Bit Width : 40 [2B6h 0694 1] Bit Offset : 00 [2B7h 0695 1] Encoded Access Width : 04 [QWord Access:64] [2B8h 0696 8] Address : 00000000FEBF3008 [2C0h 0704 8] Value : 0000000000000000 [2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF [2D0h 0720 1] Action : 0E [Get Error Address Length] [2D1h 0721 1] Instruction : 03 [Write Register Value] [2D2h 0722 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2D3h 0723 1] Reserved : 00 [2D4h 0724 12] Register Region : [Generic Address Structure] [2D4h 0724 1] Space ID : 00 [SystemMemory] [2D5h 0725 1] Bit Width : 20 [2D6h 0726 1] Bit Offset : 00 [2D7h 0727 1] Encoded Access Width : 03 [DWord Access:32] [2D8h 0728 8] Address : 00000000FEBF3000 [2E0h 0736 8] Value : 000000000000000E [2E8h 0744 8] Mask : 00000000000000FF [2F0h 0752 1] Action : 0E [Get Error Address Length] [2F1h 0753 1] Instruction : 00 [Read Register] [2F2h 0754 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [2F3h 0755 1] Reserved : 00 [2F4h 0756 12] Register Region : [Generic Address Structure] [2F4h 0756 1] Space ID : 00 [SystemMemory] [2F5h 0757 1] Bit Width : 40 [2F6h 0758 1] Bit Offset : 00 [2F7h 0759 1] Encoded Access Width : 04 [QWord Access:64] [2F8h 0760 8] Address : 00000000FEBF3008 [300h 0768 8] Value : 0000000000000000 [308h 0776 8] Mask : 00000000FFFFFFFF [310h 0784 1] Action : 0F [Get Error Attributes] [311h 0785 1] Instruction : 03 [Write Register Value] [312h 0786 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [313h 0787 1] Reserved : 00 [314h 0788 12] Register Region : [Generic Address Structure] [314h 0788 1] Space ID : 00 [SystemMemory] [315h 0789 1] Bit Width : 20 [316h 0790 1] Bit Offset : 00 [317h 0791 1] Encoded Access Width : 03 [DWord Access:32] [318h 0792 8] Address : 00000000FEBF3000 [320h 0800 8] Value : 000000000000000F [328h 0808 8] Mask : 00000000000000FF [330h 0816 1] Action : 0F [Get Error Attributes] [331h 0817 1] Instruction : 00 [Read Register] [332h 0818 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [333h 0819 1] Reserved : 00 [334h 0820 12] Register Region : [Generic Address Structure] [334h 0820 1] Space ID : 00 [SystemMemory] [335h 0821 1] Bit Width : 20 [336h 0822 1] Bit Offset : 00 [337h 0823 1] Encoded Access Width : 03 [DWord Access:32] [338h 0824 8] Address : 00000000FEBF3008 [340h 0832 8] Value : 0000000000000000 [348h 0840 8] Mask : 00000000FFFFFFFF [350h 0848 1] Action : 10 [Execute Timings] [351h 0849 1] Instruction : 03 [Write Register Value] [352h 0850 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [353h 0851 1] Reserved : 00 [354h 0852 12] Register Region : [Generic Address Structure] [354h 0852 1] Space ID : 00 [SystemMemory] [355h 0853 1] Bit Width : 20 [356h 0854 1] Bit Offset : 00 [357h 0855 1] Encoded Access Width : 03 [DWord Access:32] [358h 0856 8] Address : 00000000FEBF3000 [360h 0864 8] Value : 0000000000000010 [368h 0872 8] Mask : 00000000000000FF [370h 0880 1] Action : 10 [Execute Timings] [371h 0881 1] Instruction : 00 [Read Register] [372h 0882 1] Flags (decoded below) : 00 Preserve Register Bits : 0 [373h 0883 1] Reserved : 00 [374h 0884 12] Register Region : [Generic Address Structure] [374h 0884 1] Space ID : 00 [SystemMemory] [375h 0885 1] Bit Width : 40 [376h 0886 1] Bit Offset : 00 [377h 0887 1] Encoded Access Width : 04 [QWord Access:64] [378h 0888 8] Address : 00000000FEBF3008 [380h 0896 8] Value : 0000000000000000 [388h 0904 8] Mask : FFFFFFFFFFFFFFFF And the diff of DSDT (note this seems to suggest that some other device is omitted from the .acpierst configuration, but otherwise DSDT is unchanged). --- dsdt-noacpierst.dsl 2021-10-14 15:44:13.000000000 -0400 +++ dsdt-acpierst.dsl 2021-10-14 15:47:14.000000000 -0400 @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/pc/DSDT, Thu Oct 14 15:44:13 2021 + * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Oct 14 15:47:14 2021 * * Original Table Header: * Signature "DSDT" - * Length 0x00001772 (6002) + * Length 0x00001751 (5969) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x9E + * Checksum 0x95 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Device (S18) { - Name (_SUN, 0x03) // _SUN: Slot User Number Name (_ADR, 0x00030000) // _ADR: Address - Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device - { - PCEJ (BSEL, _SUN) - } - + Name (ASUN, 0x03) Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method { - Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN)) + Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN)) } } @@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS " Method (DVNT, 2, NotSerialized) { - If ((Arg0 & 0x08)) - { - Notify (S18, Arg1) - } - If ((Arg0 & 0x10)) { Notify (S20, Arg1) Signed-off-by: Eric DeVolder --- tests/data/acpi/microvm/ERST.pcie | Bin 0 -> 912 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 0 -> 5969 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 0 -> 8306 bytes tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- 4 files changed, 5 deletions(-) diff --git a/tests/data/acpi/microvm/ERST.pcie b/tests/data/acpi/microvm/ERST.pcie index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2 100644 GIT binary patch literal 912 zcmaKpO%8%E5QPUQ|KVrvh9h_c12J)@5f?5!k_Ygv*jGA8UW7?#`}+D#XXyDpKHiZ? z@anI_W$gOrZRl(SB7!yMqx}#E4EC&a5=}m^g_!0^0`kEl)DOuIXM6D@@*xq*8vyqH z)b0KTlmlgmH~xt7vGp5lnFb*Ui&1&BGpsO$pT3_)pk?J?$-jLiezjJ$6`=r)uYry0Rn7KuJIp&j)|! zckaizM=~sYzU*-I~PkUtAn>Dr`~u=;o(_O$t$PK8~R}U#&P6`{0u*{ zz`m8fl|Wu#ucTKJu-TjNQ`rN~%rBccG0yWwF_}_zQl+X71|-_g)Pr`x1*Xgb!&xdP4yUPQ>QealcAR5Lj8F@vR~&d_hFrfVBOumUtb3< zL8GI#8|W0leXv|!GGL=~vE5*uM7z%Af!czNXYqlQL#IT$!9xR0zORu68XY#=M-SGy z3b+$tZv(*Hu4BBt4F>MUo>Padde^ZZU%V_4TiQ&t&6ruaomTLcp<9-2bBZ=qyp40+ ziEQ&$6L)c>%cI)0;%&VWL5E5@F~Or>jX}g)!VlmH>3A6L#ZGj;i8(jvxl3w$XL%gc z#4Y0Q*ces>sy7Obm6bTnr@oqih!n=P&+!w*&jZjVy;9R95=2i+)QqA9kLa1VJk2ES zOh6C4;>puBt75SyO`ippr%I9Z{pk6j=(st4aP-WP=ov412KgP0p3z1}&)7R9%3U9d z&O-shXOD!>df~G};j<@%&-TL`!{M=J{^0EAj)b4{!p{wbpF1J^oV~LmWA@f?c-apx zmJl5aIOP$4%5j~Id6TV0{V^u0sG`|bSAOB2V2gb1@Ki7>g+T~D<}I$cZmy;lKl#kP zxAm*k{f|HWWb1z8<4?h6y1Bg6FLiOw7Z@DC0gGYf$3^AUwgVosAOD1e9Hex!P-c3u zY%#r3y2G$SrRg@$K+^S+fmJX`o|0}AmQ(0%hN|GcJ*{Ry{RpZVR_9(>4G!#sMm9K*-Kb2oqvI?7dL24<1WVww+F6k zrAwi@3blP`ov2|RQA!4yn|HMt+&l|rp;ky|p}*s4Bhi{tS7b7IwWYtO z($_%y0DUt+12O0t{g&d0!qm$i(>FX+UGsM;osE9mca!r!@5Ld6Jt2$-nabyyC?4*zT@l2 z4LgzF3U^-%E&8T*RhMxH{B|{Nmd$hyhrlm@q(4&m{QfcO=jBztZw|gWU^0Q+lFdc4 z;t%ATAUG5ws_1bncmXfi8SEC{UBmF!TrD{!GvtiVS87Q`#ts;JTa>Png~+QvKOAg( z=l%H)^?9Gb?Lui47fY7Bv8_MKSPiRTs@3YkU)Q{@YvnKAT;;J8U>fgQ>9qeF0+gJ! zS_V9pumOy9sSU)%^lS1X17&Pw`o1`MA>W^ePI^H@E*S%`|HOx^c$lLHVkhwcpCba771jDZ#SdZmhM`3K=q{% zNdudV5*`|Tn?lmSM!~R<_iYsI+Q3HPu(0YhlR~GImZVAKI~h z+O@D02|KpVC?DEYlCeYxd&-j!?Kerrtt;#;Pd>DJ8RM1`cI=OKE&Yg{vc{!8uv6Z~ u5j$m$OK@OMk$l8{6J=Z)1AB{Pv}@<7F~|QN>AydkHSF$IS^vS{(*FTuhT2R3 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/DSDT.acpierst b/tests/data/acpi/q35/DSDT.acpierst index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b0eafe90e5832935557ec5e6802c0147c88f379c 100644 GIT binary patch literal 8306 zcmb7JOKcm*8J^`sS}m8-lAKLj4?W=zfLoCk@fbxO1*Dn5-Fp1J;Tp& zsF;NxdzG!a@%!EI%P@TR)6m$C*rl(WTbH(@k8gyR7=f-`iY$vxoa%f(sPudLuI0PU zlG$%GJ-d9@GR?j#&XQ)o>~)yg-)efSus+-02;9`oH<;^PSRJ<0gWcSs<@8$rI`{3$ z>0f+#;ob6`pa1ihH{Y;Q0G!2N6MxS|bO=8Tt(9=-d@;CUd_;79ZFRW##eiQHZ4O-49~jM+3e^!xK@H2SMJWzPG| zX_-Q0)ol3Hu2gA28>#B;HT-Ui*^J$NkYTCbb%)}`SE_BV=y$w+vG77a=$2VTEn!4W z+aH9M6Ataq2O%4TnbGKg4d*`}Y_s2O+w9-}OCPWUYeDoaXU%^yM}4{bfTb8iZ@%{o z^@hf~w|}x3l>2;$QGNwo@td8^gcVx0v$pVTQUVFp+kbAY;sGq~Q4+mJuVk6y)>7RF zS;!2dZd_)U@%Kyu)q49+wl=m7SqqCA%e2yGXoPzEXV?Ais?41d_uJ60j+Lz&?&;(>!zTt;+3>{Rij}|&_=rD8HXhp% zJIE!C>vUkZmxoJ(tJZ9kPbXNGZAamaZN?6^O~2{ZSi$b&uMzE1eYwzskGbucsY`wi!W#Zhxd5z_5YPS*y>M}?oXs~=Xg??Zr30xcz3&44Cjq?DN zAu*AkV-uVSY#b3&LKBQL0p(1D#6)j6Hp!W?2T4Xu2~7$npqz=2n6e7ymB8{mDbAG8 zlwiuvBUE*!HJxeBl+d(b%FZKHb5IbA10Ri~xtv^1TTt`niEGo$IuXgV{xPK2sXybG24X=^%dT_-|S zXI9gh)pTZcod{K(^P0|iP3OF>6QQbeLDRXQ>0HotB2;xcnodX4>F7EUsycI;&YY$* zr|U$h>db38^P0}Qt`niEb5YZ|sOenPbs|)C7Brm&O=m&ZiBQ$Kr0HDJbS~*S5vn?m zX*!Q-I*;i(5vn@zC4r|;zK51Ioy)pTgsRTtn$F{z&f~gHgsRRHoLP?FgeN$&62I(D z2&VfmB&HW*PioAQ8uO&iM5r=PY0Og^^OVj+s4`D$%+nh4w9Z7RG9S~Jk7>-ubS6TT z`8a1vmwB8sV$!cw44b8RiI>`2&F5Mfg+STVW0xbnJ`cVN(L&R zye1haLa7r5DzKah16818paRO7WS|J8P8g`bawZH^fs%m=C})y^B9!+N1}dAz;Y%GRDqI#3Mglifg+STVW0xbnJ`cVN(L&RoJj_XQ0jz%3M^;B zKouw%sDN@N87M-j69y``0?L_Wpa`W- z7^uKf}LawZul zLa7r5DzKah16818paRO7WS|J8P8g`bawZH^fs%m=C})y^B9uB|paRR8Fi-_b1}dPO zNd}5g>V$y`EN8+%6(|{~fN~}oC_PNRBNTC_*{5WS|JKRCKZr3uQxl!2el2pnphj&(NQ8 z@A^-lP11jd(D|B$_;F%0-FPl|5uhF4ShlW{LY;IyTU^w@owYQ5! zmbn8fQ+Teq>2~G-=#+BvR_3!AHpf?j-e)(d%}V3gj6U4878sqO6CEtQtk2>bp)8j? zY%JH%Vvvb$2f1U`;%D=0E(v#Icz-jziLrW7Sm5hG2h;`hrd-JNy=K5ZqH}AHw=B?l z6a&KT@OZf&bOPh%ZrledPwjE_%2;(Qo_y!(6{UKGSFfOdYV}HCdi6?gzeU=`QW}=~ zV(nJq5z4ztd6$=W$I81$ly~Fu-k5j`3tHbQjL zm6xxMm9HLAz8aUWjh9b9Liw6fzQ)Vf#>&@@C|`@q*T>7xJVN=pQohd1*T>4&k0@V{ z%Qwc$&ptx=hEl%4%Qwc#H;yRZK=~BC%Erq(qP%>0;IjhLU98{gZG{;=R#B+U2Plu11iFBfEYPyN%bXiY_FP({WqD@cdoO-yP zy}uB&D%fhlwu+s^n!mI0ve=zySQj6z`1_q|AfHkTlM~*Qb^Wbk_TlW6Juo^9E^>p!5N%!;mGZ5wX09T;w> z^@@Q7@Dd$r21~kb%fljjo{&j5sIC_Q_sZQO)|#8`rWrA6#8ZFnBG-csiB4wAuHP(` zR!h_kv2m0x*>^^a2eeEDDw9+K&(Fz&ksgPl6{zC1T8@O%r2pOi^u3pF|MiJYIjLTnn z`N3r)VwWQ$jM(;9>-KL4p>b;mO<}Y%UXlwQZ^TU*F5en&#ckR7dN?=OwnixPbu{hz z@X3jhqx&B1+@L;gvuoSv)$JFD&riVklY!f}V!I+D8oY^rvMaKL#(lGG%NcD>2?m(5vH(80M+H>wWwZ zJ=2)~_+fhBxi$~z>BbCbmAko&WiqTb(06EI9-F4!42fa8SFRRLVe-`dYQI`K%i