Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7018485rdb; Fri, 15 Dec 2023 15:26:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEMllW1YI4PWk+qVA3U0uAMX+4ZpAM+mzTebjcZRHP0m9MDLdHsQ/6g2t0H8HQzlKyLzNN X-Received: by 2002:ac2:4f90:0:b0:50b:ebd1:6e8a with SMTP id z16-20020ac24f90000000b0050bebd16e8amr4858349lfs.133.1702682804764; Fri, 15 Dec 2023 15:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702682804; cv=none; d=google.com; s=arc-20160816; b=b2+rbG8JzFr6MAxsl6PuNPwkGbIlIEKgWJZi6NNNQCfwN6xqVjIEUZxTlr7OWpuzUO FvU/3kyIgs4RrQFRlQSErRyCMueyc7uMQpc8A70NBFOkI3xfAlW/thV+Mzd2CtODwPWi jMUEs9pUW5SzZWWaHfxVyBQ8eIzhCAD/36aPJY98vkrGIzJm/btNXejBLWCjpJ5OtjLu 4vQgquH8yfmgzfQOX0CF+B0Ph/qPyJ2Yk+gbnINRodxHyiI1SM1C6VinXqU8UQJTPvOE +IgW4aoxhy0MR3HA+X9FlUck3kycCY7hv1sjHxw56/Mx9N0wGE2mzlReI36qgKqzlcZ1 Xurw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=yzkfDzQUzcf/8xRhoHZuMGg4MzoaaWEzHuIL6sU7To8=; fh=j/WuaxXDipctjTgovwSDaJ0q8r49CO2pXF5RLNCJnrQ=; b=MHGgLKWL6wXnBTgM7INdbSFQicKXmGjl9jvDbDju5GOb8wz/WGGssYdj2pGIO5kUN/ 86GuLrmTY0d4KmjxMrm/kc3mS7yO9KejGbtV0UFJ0BcFUoEZBdVhR1sZXL495C1hHAKr pSZao/eXMedz0lrO5CDdD8aGSaqZSvAXz5CcnSerL2MxaMyp7Ybia78l0uhAToC6IQv/ jVZj9sXaLWW0OA1mgXJsTM5KCAWfKqNwMne9+2YcXhgAYsYcXBHJMplgw2M3ot8IC6K1 JxevdfU75vA2Qi5sEIWvBZYoz4AykIUJ0KH7g5Lyhhf+/jWvINW98jALRbs/KhhNfems sn7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=URYmGtaX; spf=pass (google.com: domain of linux-kernel+bounces-1812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f10-20020a17090624ca00b009fd1bc17db0si7886006ejb.74.2023.12.15.15.26.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 15:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=URYmGtaX; spf=pass (google.com: domain of linux-kernel+bounces-1812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 59E2F1F24312 for ; Fri, 15 Dec 2023 23:26:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 784A81DDF1; Fri, 15 Dec 2023 23:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="URYmGtaX" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) (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 B9E8018034; Fri, 15 Dec 2023 23:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702682789; x=1734218789; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=3xKqnFB4W5k8UZ3XimdoyygtjqnO8wYj5wwpupdnA+M=; b=URYmGtaXwZaY3/0t6rJ6R6Bnw5M4RIIlP3iml42eb/F+oQopzGIWVzIF 41H1zxQJMX+enrP974OQy6DkQomS1cODC0mMrQiCQJnJ/cnDl8ILlVMsA koJkKJtmmxYGvCLGkci5rUeNzv9faQtczaO/CeAWX/fLgAVStDzU6uu3T /lGBkQ2lnOUDIfA2NO8LxIQWViXPTcMGXsc02Gj4W6M5xJMYj+zTyoGO7 /BKHHA0fAu4SEyIxih4ActhF5lar5uYbwQkQvCPp2N8r2L/UA30fRRtPI xYe4lW7Mv34JZykGCqWNjiTOY3G8Fht3HhUKqatQWUw3rz30f+SmiUVMF w==; X-IronPort-AV: E=McAfee;i="6600,9927,10925"; a="395079624" X-IronPort-AV: E=Sophos;i="6.04,280,1695711600"; d="scan'208";a="395079624" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 15:26:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10925"; a="724605076" X-IronPort-AV: E=Sophos;i="6.04,280,1695711600"; d="scan'208";a="724605076" Received: from iweiny-desk3.amr.corp.intel.com (HELO localhost) ([10.213.164.93]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 15:26:27 -0800 From: Ira Weiny Subject: [PATCH v4 0/7] efi/cxl-cper: Report CPER CXL component events through trace events Date: Fri, 15 Dec 2023 15:26:26 -0800 Message-Id: <20231215-cxl-cper-v4-0-01b6dab44fcd@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAKLgfGUC/3XNwW7DIAyA4VepOI/JBkJgp73HtAMYWJDapIIo6 lTl3Ud6qrLmaPDv785qLDlW9nG6sxKXXPM0tkG9nRgNbvyJPIc2MwFCggbkdDtzusbChU6JjLS kSbO27l2N3Bc30rAFF1fnWLaPa4kp3x7G13ebh1znqfw+yAW31xfXF+TArfVOyWRS38NnHud4f qfpst08CALahI7QOK+fgk1dxJEkWihRBUtSOw/iv4QC9wEhagvgne7MXpJHkmwhoLFBY+ptp19 Kchf0KRgtQ4Agur2kjiTVQtV7bwETyi4+h+u6/gGuWzUM9wEAAA== To: Dan Williams , Jonathan Cameron , Smita Koralahalli , Shiju Jose Cc: Yazen Ghannam , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, Ira Weiny , Bjorn Helgaas X-Mailer: b4 0.13-dev-2539e X-Developer-Signature: v=1; a=ed25519-sha256; t=1702682786; l=3579; i=ira.weiny@intel.com; s=20221222; h=from:subject:message-id; bh=3xKqnFB4W5k8UZ3XimdoyygtjqnO8wYj5wwpupdnA+M=; b=JuXfQqh3TbymZ5dI72fAeYajBa6O+cQ8wS+BQBvK0bfTSQMyVEZJLgox4gdRFGI7LdlYilUPn moSFGUgr9UoC16WOjS1mfjVA8PL8q4xCH6roQ6Eglfae7hkqwA/FvsC X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=brwqReAJklzu/xZ9FpSsMPSQ/qkSalbg6scP3w809Ec= Series status/background ======================== Smita has been a great help with this series. Dan had a better idea for how to register the call between the efi and cxl subsystems so this is reworked for V2-4. Dependencies ============ NOTE this patch depends on Dan's addition of a device guard[1]. Therefore, the base commit is not a stable commit. I've pushed a branch with this commit included for testing if folks are interested.[2] [1] https://lore.kernel.org/all/170250854466.1522182.17555361077409628655.stgit@dwillia2-xfh.jf.intel.com/ [2] https://github.com/weiny2/linux-kernel/tree/cxl-cper-2023-12-15 Cover letter ============ CXL Component Events, as defined by EFI 2.10 Section N.2.14, wrap a mostly CXL event payload in an EFI Common Platform Error Record (CPER) record. If a device is configured for firmware first CXL event records are not sent directly to the host. The CXL sub-system uniquely has DPA to HPA translation information. It also already has event format tracing. Restructure the code to make sharing the data between CPER/event logs most efficient. Then send the CXL CPER records to the CXL sub-system for processing. With event logs the events interrupt the driver directly. In the EFI case events are wrapped with device information which allows the CXL subsystem to identify the PCI device. Previous version considered matching the memdev differently. However, the most robust was to find the PCI device via Bus, Device, Function and use the PCI device to find the driver data. CPER records are identified with GUID's while CXL event logs contain UUID's. The UUID is reported for all events. While the UUID is redundant for the known events the UUID's are already used by rasdaemon. To keep compatibility UUIDs are injected for CPER records based on the record type. In addition this series cleans up the UUID defines used between the event processing and cxl_test code. Signed-off-by: Ira Weiny --- Changes in v4: - lkp: Fix 0day build issues [Functionally the same as v3] - Link to v3: https://lore.kernel.org/r/20231213-cxl-cper-v3-0-7fd863dd0d25@intel.com Changes in v3: - djbw: use scope based cleanup functions - iweiny: further clean ups - Link to v2: https://lore.kernel.org/r/20231211-cxl-cper-v2-0-c116900ba658@intel.com --- Ira Weiny (7): cxl/trace: Pass uuid explicitly to event traces cxl/events: Promote CXL event structures to a core header cxl/events: Create common event UUID defines cxl/events: Separate UUID from event structures cxl/events: Create a CXL event union firmware/efi: Process CXL Component Events cxl/memdev: Register for and process CPER events drivers/cxl/core/mbox.c | 93 +++++++++++------------ drivers/cxl/core/trace.h | 30 ++++---- drivers/cxl/cxlmem.h | 110 ++++++--------------------- drivers/cxl/pci.c | 55 +++++++++++++- drivers/firmware/efi/cper.c | 15 ++++ drivers/firmware/efi/cper_cxl.c | 46 ++++++++++++ drivers/firmware/efi/cper_cxl.h | 29 +++++++ include/linux/cxl-event.h | 161 +++++++++++++++++++++++++++++++++++++++ include/linux/pci.h | 2 + tools/testing/cxl/test/mem.c | 163 +++++++++++++++++++++++----------------- 10 files changed, 484 insertions(+), 220 deletions(-) --- base-commit: 6436863dfabce0d7ac416c8dc661fd513b967d39 change-id: 20230601-cxl-cper-26ffc839c6c6 Best regards, -- Ira Weiny