From patchwork Thu Dec 8 05:21:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 2756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp11085wrr; Wed, 7 Dec 2022 21:25:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Vzxwx+UBaD+iwpWcwEt6tAqe1lWJsv1dB6LDVCDfuK+Vp+syx5eZfDjIAjymEgKwoLIrc X-Received: by 2002:a17:906:402:b0:7a6:fc0f:6fe6 with SMTP id d2-20020a170906040200b007a6fc0f6fe6mr75444927eja.694.1670477101132; Wed, 07 Dec 2022 21:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670477101; cv=none; d=google.com; s=arc-20160816; b=tzUyD8+2bTaTP7nIPbq1aXvw4ZEi0JRwByxZlzNZO5uWhNPAz8z78y4EpF8SQX7Mse l3Ni8AWhDwM5dCExhHawm5/Xu4bfTsNbetNzYpsq+A8xqakRf7lrw48YIUROTiZz68/B n04ZYgHBS/zWPkMJAT5+tWrsX6GtBQWYF7mOY3+ajookvtc5wVrW00XRMyxUK0ApUFZQ zN9FR12bVCaXSL+NLvhL/4zLLF5obBVFEM00yqzBr4FIcYMxljMFf5sQWEtoYSoW6VmV NMgHsYRu2VaBXeoX0c4R0A+2PLxwch705ufDVqoWRnfF/Pp7BPW1Gy1C+unIG6lNu8Ju arjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RveLXu3q0v0sWq5Z80E4bBAT1nLzAGAW7xAAyCgSTS8=; b=CVqoflP6SISSR8pkS+iDE8K16WAmx9RiQLZwTGhn5sQsQFnVhdrvPd5IQ95xOzBf7c c/PUoySU6owt4NCNLu4bq/rji1YYpc6pJsN7tT63mVqFnIPG5PBNTZ+ZbP5sgyd/NPDd TEoWFG2OBfGoq6gKHH2aiItAMejQ12fVNc/Z/c1bRfWjitk1rElZf2tI7h0VXE7363A6 kXU9IJ1/KE8JdDvWdr6fbsUBIVSh82+ZNE5J1oKfAm5ZlQT4M2GMnwdglDYMEuvzvUkm WE3ihT/7kZWFQL0gQnqgDGXCE33JWR/Mn/7RKsRsRMJz/sGpJFurW0k29sdXCGJMd2Ol Y28w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="c6U/npNm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a05640251d000b0046906b7a5c8si6435475edd.559.2022.12.07.21.24.30; Wed, 07 Dec 2022 21:25:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="c6U/npNm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbiLHFVW (ORCPT + 99 others); Thu, 8 Dec 2022 00:21:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbiLHFVU (ORCPT ); Thu, 8 Dec 2022 00:21:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEB888B69; Wed, 7 Dec 2022 21:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670476879; x=1702012879; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=4anARoAcZ+FMWx+rU/JO2ajIw8NyiGsHus+CHa4WuRw=; b=c6U/npNmxwBCt3qWygl8Q7QxsVVJMQLS4snCKBW90hVVrQAP2QprQZK1 rFG2nyEYXGbzbEJTBa44zyFElQuZhtth/5lzGJsR30DxAoEZ2EciDZNsv oqCi5XKHQdBxiEcZygceU/rdfZy+S/l4qpf5qTCCfuKer3r3fMDSKxGZn cfH+ZlkZI8TxkcGKBxX8MsopxYVqjIZD01Di5ukD54l/m85AgS9qYU/Hl 5nFnJ9sTrUybj3evTJXG3E4mheu9CMkFeCuNbWSfKbSCZVVAsG/FUmVKS kLS4UHQAkN0Bn7gxmXcg6m4LDd7hI2huTZgBtM/EFSv2jGtpZryUG3pHG A==; X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="381367216" X-IronPort-AV: E=Sophos;i="5.96,226,1665471600"; d="scan'208";a="381367216" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 21:21:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="710324444" X-IronPort-AV: E=Sophos;i="5.96,226,1665471600"; d="scan'208";a="710324444" Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.209.25.22]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 21:21:17 -0800 From: ira.weiny@intel.com To: Dan Williams Cc: Ira Weiny , Bjorn Helgaas , Alison Schofield , Vishal Verma , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-cxl@vger.kernel.org Subject: [PATCH V3 0/8] CXL: Process event logs Date: Wed, 7 Dec 2022 21:21:06 -0800 Message-Id: <20221208052115.800170-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751622197188661982?= X-GMAIL-MSGID: =?utf-8?q?1751622197188661982?= From: Ira Weiny This code has been tested with a newer qemu which allows for more events to be returned at a time as well an additional QMP event and interrupt injection. Those patches will follow once they have been cleaned up. The series is now in 3 parts: 1) Base functionality including interrupts 2) Tracing specific events (Dynamic Capacity Event Record is defered) 3) cxl-test infrastructure for basic tests Changes from V2 Rebased on pending 6.3 changes CXL security patches from Dave J. Moving tracing to cxl core from Dan Feed back from Dan, Steven, Jonathan, and Dave. The series looks very different now with a lot of the patches squashed per Dan's feedback. - Link to v2: https://lore.kernel.org/r/20221201002719.2596558-1-ira.weiny@intel.com Changes from V1 Address comments, from Jonathan, Dave, and Alison Main comment was to allow for a full payload size number of event records to be processed on each Get event cyle. Pick up tags Changes from RFC v2 Integrated Davidlohr's irq patch, allocate up to 16 vectors, and base my irq support on modifications to that patch. Smita Check event status before reading each log. Jonathan Process more than 1 record at a time Remove reserved fields Steven Prefix trace points with 'cxl_' Davidlohr PUll in his patch Changes from RFC v1 Add event irqs General simplification of the code. Resolve field alignment questions Update to rev 3.0 for comments and structures Add reserved fields and output them Davidlohr Bueso (1): cxl/mem: Wire up event interrupts Ira Weiny (7): cxl/mem: Read, trace, and clear events on driver load cxl/mem: Trace General Media Event Record cxl/mem: Trace DRAM Event Record cxl/mem: Trace Memory Module Event Record cxl/test: Add generic mock events cxl/test: Add specific events cxl/test: Simulate event log overflow drivers/acpi/pci_root.c | 3 + drivers/cxl/core/mbox.c | 233 ++++++++++++++++ drivers/cxl/core/trace.h | 479 ++++++++++++++++++++++++++++++++ drivers/cxl/cxl.h | 12 + drivers/cxl/cxlmem.h | 180 ++++++++++++ drivers/cxl/cxlpci.h | 6 + drivers/cxl/pci.c | 130 +++++++++ include/linux/pci.h | 1 + tools/testing/cxl/test/Kbuild | 4 +- tools/testing/cxl/test/events.c | 314 +++++++++++++++++++++ tools/testing/cxl/test/events.h | 34 +++ tools/testing/cxl/test/mem.c | 33 ++- tools/testing/cxl/test/mock.h | 12 + 13 files changed, 1429 insertions(+), 12 deletions(-) create mode 100644 tools/testing/cxl/test/events.c create mode 100644 tools/testing/cxl/test/events.h base-commit: acb704099642bc822ef2aed223a0b8db1f7ea76e