From patchwork Mon Sep 25 20:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 726084 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D65B179B4 for ; Mon, 25 Sep 2023 20:02:06 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2040.outbound.protection.outlook.com [40.107.96.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34A29B; Mon, 25 Sep 2023 13:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KLU7wd/CFGEb1J6yY1dUJhu8dBxSUMPpDdoz0xw3cgvKUwfugL6pA1pGCw/tyaJ8B6a4XEJReDLn00U7LDxunUYks1DtoeOy/UjRCiz6l4WsOfetWpQu7+tYL6hcl7FVbbjQmfwyaCZI92L3Mpt45UpU26q2rJozhber255w6pWOAZCcgFnMFaXLias0KC2eyQc3uNj0tQbIwdBt6aTFhJ/LrIjAw5N/NGGY+VMDHLwAZ0Uif03/vAEL/X84EyRNcNyO8Ac8ojJDpbr3PJoy4MvP5tEZQBgQVtmMeigNlcS7t/o0As9pxyjDR1U2wLdgLgD7T+vzhiLq12xqbUJPjw== 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=ytkOgpskYwZoJZVbt3J568BaIOsPqiD6LMACOafWDQ8=; b=O5LuN7TOt+MPSR3L4Kv4FZIDirq7MXWbUGkEGQSFOf69PM7lMZTcQ1rCYidKfz7N+1kaBnnoYxRLIjx1UpsLv9coowolCe54lreRl2zhxPWSmBTgf9y1kjBZ1yGgnTYm3hunHsztyCV6viSQ1Xdh8Yu49BfZUBcrPNJYTQm/LpH7QbZFws9lKppW9005TIdZLpokZUQBEDRpc1mJmsBDoXFdKKLt/40UTlYnaA5Bm0kSgTqlM3NaJoHf6hd1aICBwfvUwrCvzpLEGPcXYMPT+NbolEILZoBjI8+FHi5YxOHLxD0hgaHP+wdH7ibebEt1iYePlgci03mICuqDkvdK8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytkOgpskYwZoJZVbt3J568BaIOsPqiD6LMACOafWDQ8=; b=nQTItpUeab2QMwxCadJbK6s0lQxxwc0USZs8+dhtIvEnpDvlEEiZntr7pngCxva6W8epL5WqA5vuelifcm5W++EsO9WfhEUYTZi1NFy/wnDELWSZCm2A5th6viCY6PIDH3OVqY1B/PGOAMFoIbQamo/JtfnQdplfoIHBh0e+WnM= Received: from SN6PR05CA0023.namprd05.prod.outlook.com (2603:10b6:805:de::36) by DS0PR12MB9038.namprd12.prod.outlook.com (2603:10b6:8:f2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 20:02:02 +0000 Received: from SN1PEPF00026367.namprd02.prod.outlook.com (2603:10b6:805:de:cafe::c5) by SN6PR05CA0023.outlook.office365.com (2603:10b6:805:de::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.18 via Frontend Transport; Mon, 25 Sep 2023 20:02:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00026367.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 25 Sep 2023 20:02:02 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 25 Sep 2023 15:02:01 -0500 From: Ben Cheatham To: , , , CC: , , Subject: [PATCH v5 1/3] CXL, PCIE: Add cxl_rcrb_addr file to dport_dev Date: Mon, 25 Sep 2023 15:01:25 -0500 Message-ID: <20230925200127.504256-2-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> References: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026367:EE_|DS0PR12MB9038:EE_ X-MS-Office365-Filtering-Correlation-Id: a3daca96-f63b-4f24-90a7-08dbbe0248c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ar0oKXISdewBSjhI7ZCNkTHJI61WZtkwtNNUrKWl9oOpMRPalRpObVkn4UaG0Li4vFkexpF8kqcZTwpOBG2Qg+AbAxE97OfUr1IFzI3ySl6S9KxrNTY15wIGBEkKBfNDLmd1oIg5qJP7Ne1j+RU3/qQASNrA4EUzwcpYdt0s3sLcexp8uj8NbnDhEpIpXTg+MYkQ0yU49iu5URgOVVi3cZ9qKs8PeeCJxSzKQElEm/DD5e60cjj4uRov5fMGe5fv3X6h1v98vhg4upK+nYorWvlnJy94Iy7/y7ScrbZXLISYw3MVUtoPCMVgVHvUGe+IUqPvU9Rnu87WeGCXqQBqlqrL5HkN3Kl7YCLnIq54/A9C2t8HQIK+VRVgwQc+9roOL2aRGFkOudFdUG+xQg+fQVkr70p6kIGrP4qPnSKD2iBXBHv46Mt8tgppUG+EDQ1m2LhetZOLTSmHlfhODsYEZuGAO7pHOLiaWsdEX3seEbzQz4ixjpKrgDuEDIEDJmwLbAADdbVD22T91/102tTlysZT4nHtu2EWovb+9tfjiWRY/hX0P7szixMmSxBFJjP5aY1eU8K+8MyJ50KvZTHp1TwI5Vx2c7aw2rumK4rrKlHK6SHmxF9wbM5YyDr22hHGiynCILkEiXCB1fPOWflkIBaAXyNYkkSJHcjjsYmKC4wWpcuLbvBuKgx0MkVUIxmTZHzWKYkFjRNYS+4dVlGxOm+8jJ5/8gHFoUK+vev6NRL7FLQx8uT9rcwWSGHbDib22gHy0BtXdaeyzRh+5YBcFg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(39860400002)(396003)(346002)(136003)(230922051799003)(451199024)(82310400011)(186009)(1800799009)(40470700004)(46966006)(36840700001)(2906002)(316002)(5660300002)(4326008)(8676002)(8936002)(41300700001)(54906003)(70206006)(70586007)(110136005)(478600001)(6666004)(2616005)(1076003)(26005)(16526019)(426003)(336012)(7696005)(40460700003)(83380400001)(47076005)(36860700001)(82740400003)(81166007)(356005)(36756003)(40480700001)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 20:02:02.2354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3daca96-f63b-4f24-90a7-08dbbe0248c2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026367.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9038 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Add cxl_rcrb_addr to the dport_dev (normally represented by a pcie device) for CXL RCH root ports. The file will print the RCRB base MMIO address of the root port when read and will be used by users looking to inject CXL EINJ error types for RCH hosts. Signed-off-by: Ben Cheatham Reviewed-by: Jonathan Cameron --- Documentation/ABI/testing/sysfs-bus-cxl | 9 ++++ drivers/cxl/acpi.c | 2 + drivers/cxl/core/port.c | 58 +++++++++++++++++++++++++ drivers/cxl/cxl.h | 2 + 4 files changed, 71 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-cxl b/Documentation/ABI/testing/sysfs-bus-cxl index 087f762ebfd5..85621da69296 100644 --- a/Documentation/ABI/testing/sysfs-bus-cxl +++ b/Documentation/ABI/testing/sysfs-bus-cxl @@ -177,6 +177,15 @@ Description: integer reflects the hardware port unique-id used in the hardware decoder target list. +What: /sys/bus/cxl/devices/portX/dportY/cxl_rcrb_addr +What: /sys/devices/pciX/cxl_rcrb_addr +Date: August, 2023 +KernelVersion: v6.6 +Contact: linux-cxl@vger.kernel.org +Description: + (RO) The 'cxl_rcrb_addr' device file gives the MMIO base address + of the RCRB of the corresponding CXL 1.1 downstream port. Only + present for CXL 1.1 dports. What: /sys/bus/cxl/devices/decoderX.Y Date: June, 2021 diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index d1c559879dcc..3e2ca946bf47 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -676,6 +676,8 @@ static int cxl_acpi_probe(struct platform_device *pdev) if (IS_ERR(root_port)) return PTR_ERR(root_port); + set_cxl_root(root_port); + rc = bus_for_each_dev(adev->dev.bus, NULL, root_port, add_host_bridge_dport); if (rc < 0) diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 724be8448eb4..c3914e73f67e 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -875,6 +875,14 @@ struct cxl_port *find_cxl_root(struct cxl_port *port) } EXPORT_SYMBOL_NS_GPL(find_cxl_root, CXL); +static struct cxl_port *cxl_root; + +void set_cxl_root(struct cxl_port *root_port) +{ + cxl_root = root_port; +} +EXPORT_SYMBOL_NS_GPL(set_cxl_root, CXL); + static struct cxl_dport *find_dport(struct cxl_port *port, int id) { struct cxl_dport *dport; @@ -930,11 +938,56 @@ static void cond_cxl_root_unlock(struct cxl_port *port) device_unlock(&port->dev); } +static ssize_t cxl_rcrb_addr_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct cxl_dport *dport; + + if (!cxl_root) + return -ENODEV; + + dport = cxl_find_dport_by_dev(cxl_root, dev); + if (!dport) + return -ENODEV; + + return sysfs_emit(buf, "0x%llx\n", (u64) dport->rcrb.base); +} +DEVICE_ATTR_RO(cxl_rcrb_addr); + +static umode_t cxl_rcrb_addr_is_visible(struct kobject *kobj, + struct attribute *a, int n) +{ + struct device *dev = kobj_to_dev(kobj); + struct cxl_dport *dport; + + if (!IS_ENABLED(CONFIG_ACPI_APEI_EINJ) || !cxl_root) + return 0; + + dport = cxl_find_dport_by_dev(cxl_root, dev); + if (!dport || !dport->rch || dport->rcrb.base == CXL_RESOURCE_NONE) + return 0; + + return a->mode; +} + +static struct attribute *cxl_rcrb_addr_attrs[] = { + &dev_attr_cxl_rcrb_addr.attr, + NULL, +}; + +static const struct attribute_group cxl_rcrb_addr_group = { + .attrs = cxl_rcrb_addr_attrs, + .is_visible = cxl_rcrb_addr_is_visible, +}; + static void cxl_dport_remove(void *data) { struct cxl_dport *dport = data; struct cxl_port *port = dport->port; + if (dport->rch) + sysfs_remove_group(&dport->dport_dev->kobj, &cxl_rcrb_addr_group); + xa_erase(&port->dports, (unsigned long) dport->dport_dev); put_device(dport->dport_dev); } @@ -1021,6 +1074,11 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, if (rc) return ERR_PTR(rc); + rc = sysfs_create_group(&dport_dev->kobj, &cxl_rcrb_addr_group); + if (rc) + dev_dbg(dport_dev, "Couldn't create cxl_rcrb_addr group: %d\n", + rc); + return dport; } diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index 76d92561af29..4d5bce4bae7e 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -690,6 +690,8 @@ struct cxl_port *devm_cxl_add_port(struct device *host, resource_size_t component_reg_phys, struct cxl_dport *parent_dport); struct cxl_port *find_cxl_root(struct cxl_port *port); +void set_cxl_root(struct cxl_port *root_port); + int devm_cxl_enumerate_ports(struct cxl_memdev *cxlmd); void cxl_bus_rescan(void); void cxl_bus_drain(void); From patchwork Mon Sep 25 20:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 727164 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1B08179B4 for ; Mon, 25 Sep 2023 20:02:23 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA6510E; Mon, 25 Sep 2023 13:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ab5Lz4Ezs9/54pGusAJ+SkKWORpXm/IphOG5bX/iRPUImE20VJM8wnb1qRc7En+vLKXiQQr/GHYQOHDg/uZPvPvjdmyRm9vwApkXlKtJn1rNDNkxVs9B7sujUUDkd2nsOUNJO8N9qZWNNEeO54LAkE7MhwLgr9Ic8VZYtcK0NCY9eAq8GNlpC8PKghZ8/TzaoFrIqbg9yo2TBjFcCx9++YrrlMYUF0Jg6ohVqjV/IHWXRtvkUkFuaUBBThANDNL0Og2esFIHCYD1HF8mG7wSHF7/3w4ciuRSryoMGdy6vA18hScmnVcKaCTyyil2Jx7PD4sAGeEastMHwOIdraDudQ== 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=hFr85a3FD3FOunThPZ7hcSo+d37/Irdbc5+OynULZq4=; b=Gf5Mae2XbTfI4+0X6hh0SwP5AESlm8rqsqMeQRvU9jytVAAfZnDbBgV5XA0wixjP06FgHUnA9SS7QiF9qxFxR9aAWPYyJdr3GDMDsSQPT1xgcBTTlq1YOQBkql26kT4OFQ4LaKgYmxmse4Ntq6wghvsyxfsr7NPbQ6axTZelZcRjA/fotKs9/zFt0cUCjR1recwct6RYPnCWL5ynuXCvLDTyvUX9wGz+B5gFvfwA60Z/RX0skbQRGTh4b1zmxgc6iCdKV5JJ4DD608AfZKV6wpnh/tcSmy5wBTi2vGkXtM10NKdpSiZcwFqMcD3qeeCH8hCze83fH9mK5OOS8iTZ0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hFr85a3FD3FOunThPZ7hcSo+d37/Irdbc5+OynULZq4=; b=KXbJ1xf9RiLueONHkfiAn1qIwqAnHPWxdw+cP/d89Km5eqZK6l60UyzHgcH1DCMO+85xAV3YiG25ln6AIZVACBdzZlBmVQGlzvBP8Xb9xl3SZGbE6CX6DWQRK8hLQGXrFoXGNG6/WUaW7ty/3rmK4OZ6IvBww0iY0toJtI3z1Zc= Received: from SN6PR05CA0002.namprd05.prod.outlook.com (2603:10b6:805:de::15) by SJ1PR12MB6146.namprd12.prod.outlook.com (2603:10b6:a03:45b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Mon, 25 Sep 2023 20:02:18 +0000 Received: from SN1PEPF00026367.namprd02.prod.outlook.com (2603:10b6:805:de:cafe::b0) by SN6PR05CA0002.outlook.office365.com (2603:10b6:805:de::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.19 via Frontend Transport; Mon, 25 Sep 2023 20:02:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00026367.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 25 Sep 2023 20:02:18 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 25 Sep 2023 15:02:17 -0500 From: Ben Cheatham To: , , , CC: , , Subject: [PATCH v5 2/3] ACPI, APEI, EINJ: Add CXL 1.1 EINJ error type support Date: Mon, 25 Sep 2023 15:01:26 -0500 Message-ID: <20230925200127.504256-3-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> References: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026367:EE_|SJ1PR12MB6146:EE_ X-MS-Office365-Filtering-Correlation-Id: 88565e7b-3a4c-4876-7ace-08dbbe025242 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GuY3WNzoZsKmhYk1TZ3GVvsi/9jpfo7+lR0auTtdcqG6ABQtwbPYZ2TGy1BZx9UiOWEqqkK/LySrTS0SI0QlHqdw94vr7f5OLuTC9VGTUQcYT68Wgs96yrHnXazEtbxe91Nva0JfraQK8SnnzXKwxoglHPu3nqDVDgPnB176ZHxz5hXSowXvS6VuLQGvekAugfFTELtd4ivGxmM4y99WSITFk0R8F81NxOYxegEdAV+eE6+X87XjsxroWetsEkvhfea/XQtXGLJjFl7pUSpDkBpsZpmogAQiRkAK+Lmuj81k4E7pOVmQYpIHtIhe9CWazTi4lCeNXTAuKO0cqqIcerjw/Ed7Jrg0eiZUT1OiZ62QxpWpCXpDpdp9fZ+qhQnUlmub3nVGrYF3aKwSmcplKYu8uxr6IKRzk2dqzoMOLN9rPUBpRW83xBZAxtZZi4fBlP1Siz7opR3OBPSLGlbhOkW2o+rxw8AgMhOOf+N53qcKS5tyILk/UNYR9xD7qkWIIuitKRhjKN+lLA/WlGb2iziKV+2sOacKDy4+3K6fpkt5kU1T9C085gbN1eG7iRiPxAfJWFRNqOHtLXLlPChoIQ2RUNbGhkrAaE1b9Dp7fjA5xTB8NCXWey2XWOX0J6KSIuqnPpV9QpOnB//8kPLY0kxVhq2mRlAeWz4sOOvuA1aYKZc8wstgRAaG+yHHIu+p9qkn4JcRxc5Oa9v0ADFtac8MfRb7PYY9R1zS4vEX3MZ79SFbkBuaIbcVUOLK3uRc1yqujPZLbBUFA7kXxOtZrg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(1800799009)(82310400011)(186009)(451199024)(36840700001)(40470700004)(46966006)(1076003)(26005)(16526019)(8676002)(4326008)(2616005)(8936002)(40460700003)(2906002)(83380400001)(40480700001)(47076005)(5660300002)(36756003)(336012)(36860700001)(81166007)(426003)(356005)(478600001)(7696005)(6666004)(86362001)(82740400003)(54906003)(316002)(110136005)(70586007)(70206006)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 20:02:18.1888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88565e7b-3a4c-4876-7ace-08dbbe025242 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026367.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6146 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Add support for CXL EINJ error types for CXL 1.1 hosts added in ACPI v6.5. Because these error types target memory-mapped CXL 1.1 compliant downstream ports and not physical (normal/persistent) memory, these error types are not currently allowed through the memory range validation done by the EINJ driver. The MMIO address of a CXL 1.1 downstream port can be found in the cxl_rcrb_addr file in the corresponding dport directory under /sys/bus/cxl/devices/portX. CXL 1.1 error types follow the same procedure as a memory error type, but with param1 set to the downstream port MMIO address. Example usage: $ cd /sys/kernel/debug/apei/einj $ cat available_error_type 0x00000008 Memory Correctable 0x00000010 Memory Uncorrectable non-fatal 0x00000020 Memory Uncorrectable fatal 0x00000040 PCI Express Correctable 0x00000080 PCI Express Uncorrectable non-fatal 0x00000100 PCI Express Uncorrectable fatal 0x00008000 CXL.mem Protocol Correctable 0x00020000 CXL.mem Protocol Uncorrectable fatal $ echo 0x8000 > error_type $ echo 0xfffffffffffff000 > param2 $ echo 0x2 > flags $ cat /sys/bus/cxl/devices/portX/dportY/cxl_rcrb_addr 0xb2f00000 $ echo 0xb2f00000 > param1 $ echo 1 > error_inject Signed-off-by: Ben Cheatham --- drivers/acpi/apei/Kconfig | 2 ++ drivers/acpi/apei/einj.c | 24 +++++++++++++++++++++++- drivers/cxl/acpi.c | 1 + drivers/cxl/core/port.c | 17 +++++++++++++++++ drivers/cxl/cxl.h | 1 + include/linux/cxl.h | 11 +++++++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 include/linux/cxl.h diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 6b18f8bc7be3..eb9cc7157342 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -55,6 +55,8 @@ config ACPI_APEI_MEMORY_FAILURE config ACPI_APEI_EINJ tristate "APEI Error INJection (EINJ)" depends on ACPI_APEI && DEBUG_FS + imply CXL_BUS + imply CXL_ACPI help EINJ provides a hardware error injection mechanism, it is mainly used for debugging and testing the other parts of diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 013eb621dc92..8000417a5f26 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "apei-internal.h" @@ -36,6 +37,7 @@ #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \ ACPI_EINJ_MEMORY_UNCORRECTABLE | \ ACPI_EINJ_MEMORY_FATAL) +#define CXL_ERROR_MASK GENMASK(17, 12) /* * ACPI version 5 provides a SET_ERROR_TYPE_WITH_ADDRESS action. @@ -512,6 +514,22 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, return rc; } +static int is_valid_cxl_addr(u64 addr) +{ + struct cxl_dport *dport; + + if (IS_REACHABLE(CONFIG_CXL_ACPI)) + dport = cxl_find_rch_dport_by_rcrb((resource_size_t) addr); + else + return 0; + + if (!IS_ERR_OR_NULL(dport)) + return 1; + + pr_info("Could not find dport with rcrb 0x%llx\n", addr); + return 0; +} + /* Inject the specified hardware error */ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, u64 param4) @@ -537,8 +555,11 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, if (type & ACPI5_VENDOR_BIT) { if (vendor_flags != SETWA_FLAGS_MEM) goto inject; - } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) + } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) { goto inject; + } else if (type & CXL_ERROR_MASK && is_valid_cxl_addr(param1)) { + goto inject; + } /* * Disallow crazy address masks that give BIOS leeway to pick @@ -807,3 +828,4 @@ module_exit(einj_exit); MODULE_AUTHOR("Huang Ying"); MODULE_DESCRIPTION("APEI Error INJection support"); MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(CXL); diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index 3e2ca946bf47..a7adf3d9814e 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -756,6 +756,7 @@ static void __exit cxl_acpi_exit(void) { platform_driver_unregister(&cxl_acpi_driver); cxl_bus_drain(); + set_cxl_root(NULL); } /* load before dax_hmem sees 'Soft Reserved' CXL ranges */ diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index c3914e73f67e..cb653cb1a1ea 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -1147,6 +1147,23 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port, } EXPORT_SYMBOL_NS_GPL(devm_cxl_add_rch_dport, CXL); +struct cxl_dport *cxl_find_rch_dport_by_rcrb(resource_size_t rcrb_base) +{ + struct cxl_dport *dport; + unsigned long index; + + if (!cxl_root) + return ERR_PTR(-ENODEV); + + xa_for_each(&cxl_root->dports, index, dport) + if ((dport->rch && dport->rcrb.base != CXL_RESOURCE_NONE) + && dport->rcrb.base == rcrb_base) + return dport; + + return NULL; +} +EXPORT_SYMBOL_NS_GPL(cxl_find_rch_dport_by_rcrb, CXL); + static int add_ep(struct cxl_ep *new) { struct cxl_port *port = new->dport->port; diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index 4d5bce4bae7e..3e6779dbcd23 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -8,6 +8,7 @@ #include #include #include +#include #include /** diff --git a/include/linux/cxl.h b/include/linux/cxl.h new file mode 100644 index 000000000000..6702caa78e7a --- /dev/null +++ b/include/linux/cxl.h @@ -0,0 +1,11 @@ +#ifndef _LINUX_CXL_H +#define _LINUX_CXL_H + +#include +#include + +struct cxl_dport; + +struct cxl_dport *cxl_find_rch_dport_by_rcrb(resource_size_t rcrb_base); + +#endif From patchwork Mon Sep 25 20:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 726083 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3848D179B4 for ; Mon, 25 Sep 2023 20:02:33 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2064.outbound.protection.outlook.com [40.107.100.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E139B; Mon, 25 Sep 2023 13:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Guegc5P+FzlUKLi2vSa553SMeWNy8Amz3sKZaNolDAOI6A0M5/Wb85QTnNKtH7aMc0dmEhfeyTYH/rCRZp5s/Ke1+LR7NRY++GbftEAb1+H3tn1MBjm6HtsZyQfGu5aQS5I0SUrZGUc8N5z0bJVPgxOsZL+PC2HvRTj8AnSjeLYz/Af3BdBzg3o4yq1wqJE0xmPQfYZIp48HfPLEh0FXx1XRVrHq2WK4WyV9Nv2PcipUnp3Dktwv2yK2pnRqGyhC7h49Rz+IartzOW0Q6Pz8QRykcmUUqxTgfvZpj+U81XoIfhLjIr1AezX0/1HXg6va4q0t0hgzZ08Nl9TL8Hs/LQ== 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=JbKk1/q6uJY2Ni8c20DS7c9zdFz6tOATL3GvKDZU4Mk=; b=FC1EnNATfbVg1NNuo6PnkQdX8t9awwIO8R97V+ZrgobcpgU6RLLD/NMFRIw9VOwGg/DM/dIpUIDY5b7Sehd4rw845pUXRrudsNJeIpzTnyJo8olbsQyIRJoSHdm0opnfcqFNcCtRWVgM+Sq0/iC57N4CvmRxI9fnKphnGwHFFbzDDDZZAJyn+YqqAb//0eJopF9i+cFJLqxnNiW3khOHzvoG3BHVKc0Fg+wUQnhMHMuaqxnaCSvuxL8gumpd+8evuuNjBEg6PJ9pcrAWPTvwA8Id5/1kfXd2HV0M2GaErN7kzxORcLC9Z5A6J/JUtS8uNB1++CeAim9wepZosM7EdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JbKk1/q6uJY2Ni8c20DS7c9zdFz6tOATL3GvKDZU4Mk=; b=BajL0BB9jJhaYgTmlUL/jnYM+fOxMojg2IMK+vvwokGGkZZjf++Jaloyf7Uumldg82rBvDl35t1wMtuEkt7AjBYl7FBTK8xRB239yqJk0NzMpL0UJ/vRuekBNU6IN5YDSVOUOjQOBSpZDyacutDbBuC+d3++vVYPigZa/hnK0dI= Received: from SN6PR08CA0010.namprd08.prod.outlook.com (2603:10b6:805:66::23) by SJ1PR12MB6362.namprd12.prod.outlook.com (2603:10b6:a03:454::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Mon, 25 Sep 2023 20:02:29 +0000 Received: from SN1PEPF0002636E.namprd02.prod.outlook.com (2603:10b6:805:66:cafe::28) by SN6PR08CA0010.outlook.office365.com (2603:10b6:805:66::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.35 via Frontend Transport; Mon, 25 Sep 2023 20:02:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636E.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 25 Sep 2023 20:02:29 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 25 Sep 2023 15:02:28 -0500 From: Ben Cheatham To: , , , CC: , , Subject: [PATCH v5 3/3] ACPI, APEI, EINJ: Update EINJ documentation Date: Mon, 25 Sep 2023 15:01:27 -0500 Message-ID: <20230925200127.504256-4-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> References: <20230925200127.504256-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636E:EE_|SJ1PR12MB6362:EE_ X-MS-Office365-Filtering-Correlation-Id: e907ed87-3cac-41d8-e18a-08dbbe0258db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DHnrg01fa9STopqxB+/HepAs+xs7+8JdC4/SA4y4Q+uD07PZEWpU/drBdukm+xg8f+2xJF180SSlN3y2ffp9WtwGOHAl2oZdkvWQi35j1rCmOLksJhtwDlv4PbgucNLHsLLsiwVqnke+GndlykCt48niDwJKcPvg64jeZqnMJI6IQXvu+HjYf3/rhRhsRN0my89K67zNiHPFUmS+W2ruLsTk8+vSkdYuuPasYAixkyUxU0QfenOX0QlOja3gzAWMsK+cePLQ/PDiic/zFE44UruCc/xu/rAaptM0iTjvv7uQDp+vAObS/qrgYpEMrJgcRlXsjjNbDNUId/aPfpjLJh18t++w3usX23Axx6Cnw2zFAz+vEI0z8WPRN8IVws3VhiEWQC29/qJwOTkSaSRTLodCc5ITfiQlem8QbOlzIKtbOBvUmMIXzMCMmKqsHeb+nwLJbWZE8qzP/RNiNApC2Grjuy7wo3UUtpeHiJmK2JKIp6zNpNBwSmKEEMguaKDBlst5zuwudsBWN3f2+YN9mN4SOZ0nA98kDL5d1ezQRqMREa7PXQKHAu5YnNWKSEJkpiTRZgr9HzE9MV3bimwqqP2hG29DHM3P/JefyOLQqJNYpqOKJjrAacTM3lqOzbFCZ14RWnOPzXeQseMKwpLHLvQnn9LEJoIGq8XRsjCa1TBG3Uj7bYiYL9VirdnkWEZRlbzddvA/hrefu1/VMRY3aNeyGkIOB1y0Z81frro76rgZMTWYfFrOW5EaLswPW32WpTRJH7Z/bP8NI4qs0SNB4A== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(39860400002)(136003)(396003)(346002)(230922051799003)(186009)(1800799009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(8676002)(40460700003)(40480700001)(83380400001)(4326008)(86362001)(70586007)(81166007)(54906003)(478600001)(110136005)(2906002)(70206006)(316002)(8936002)(41300700001)(336012)(82740400003)(2616005)(16526019)(5660300002)(7696005)(47076005)(1076003)(36860700001)(15650500001)(426003)(26005)(356005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 20:02:29.2293 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e907ed87-3cac-41d8-e18a-08dbbe0258db X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6362 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Update EINJ documentation to include CXL errors in available_error_types table and usage of the types. Also fix a formatting error in the param4 file description that caused the description to be on the same line as the bullet point. Signed-off-by: Ben Cheatham Reviewed-by: Jonathan Cameron --- .../firmware-guide/acpi/apei/einj.rst | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index d6b61d22f525..c6f28118c48b 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -32,6 +32,9 @@ configuration:: CONFIG_ACPI_APEI CONFIG_ACPI_APEI_EINJ +To use CXL error types ``CONFIG_CXL_ACPI`` needs to be set to the same +value as ``CONFIG_ACPI_APEI_EINJ`` (either "y" or "m"). + The EINJ user interface is in /apei/einj. The following files belong to it: @@ -40,9 +43,9 @@ The following files belong to it: This file shows which error types are supported: - ================ =================================== + ================ ========================================= Error Type Value Error Description - ================ =================================== + ================ ========================================= 0x00000001 Processor Correctable 0x00000002 Processor Uncorrectable non-fatal 0x00000004 Processor Uncorrectable fatal @@ -55,7 +58,13 @@ The following files belong to it: 0x00000200 Platform Correctable 0x00000400 Platform Uncorrectable non-fatal 0x00000800 Platform Uncorrectable fatal - ================ =================================== + 0x00001000 CXL.cache Protocol Correctable + 0x00002000 CXL.cache Protocol Uncorrectable non-fatal + 0x00004000 CXL.cache Protocol Uncorrectable fatal + 0x00008000 CXL.mem Protocol Correctable + 0x00010000 CXL.mem Protocol Uncorrectable non-fatal + 0x00020000 CXL.mem Protocol Uncorrectable fatal + ================ ========================================= The format of the file contents are as above, except present are only the available error types. @@ -106,6 +115,7 @@ The following files belong to it: Used when the 0x1 bit is set in "flags" to specify the APIC id - param4 + Used when the 0x4 bit is set in "flags" to specify target PCIe device - notrigger @@ -159,6 +169,13 @@ and param2 (1 = PROCESSOR, 2 = MEMORY, 4 = PCI). See your BIOS vendor documentation for details (and expect changes to this API if vendors creativity in using this feature expands beyond our expectations). +CXL error types are supported from ACPI 6.5 onwards. To use these error +types you need the MMIO address of a CXL 1.1 downstream port. You can +find the address of dportY in /sys/bus/cxl/devices/portX/dportY/cxl_rcrb_addr +(it's possible that the dport is under the CXL root, in that case the +path would be /sys/us/cxl/devices/rootX/dportY/cxl_rcrb_addr). +From there, write the address to param1 and continue as you would for a +memory error type. An error injection example:: @@ -201,4 +218,4 @@ The following sequence can be used: 7) Read from the virtual address. This will trigger the error For more information about EINJ, please refer to ACPI specification -version 4.0, section 17.5 and ACPI 5.0, section 18.6. +version 4.0, section 17.5 and ACPI 6.5, section 18.6.