From patchwork Thu Oct 12 02:38:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "David E. Box" X-Patchwork-Id: 151642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp942525vqb; Wed, 11 Oct 2023 19:38:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWSfAPbemBhrJSbPeLt2GUVH0HPZmIJSJypqJvZ0/Bav6Fi0K2YVpnzIZ6/4tltAODf6h1 X-Received: by 2002:a17:90b:1bce:b0:27c:ebab:5c60 with SMTP id oa14-20020a17090b1bce00b0027cebab5c60mr6187589pjb.2.1697078337295; Wed, 11 Oct 2023 19:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697078337; cv=none; d=google.com; s=arc-20160816; b=gYU+9tdWYkUHHbXtXEbV3haxl1Aqh9WnYO1uI7tERjf1DBLL579UhiWqvms5jq+JVw ebGpwYhtkChXS8is8XkE8xzEEkValk10OTYGjSIv0/zZaz0DuvQtE7FiUxLXBKxNtzSm Tb6m6oOMZ8iQrkgivYrHwMhD41uE8Kdn3o9Dprvj9NIQ9Iyct7Qzf47Qr9zxkMO9PgND EbN+rv8mp+AcqTxjCvGLZvwS+qHZi0nyhpDH8rE1U1C3YNGUbmHp8l3XGTG3ZiA//O9G pOB9RtPc9XpRT4b6L31x9KNeWRYsJ7V8dwPGYijI4Ep6XIh7bx2XFQqzplhmUvR6b1h+ mA3Q== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RW6CoM5IOJ2gjAzELDEVyIvmvI+FCz70bTjE3qpfnx8=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=VvRM0jo7musS2+NY0jHoH0tHR7uI/XhJaNKUiuWxCm/XlmO6VW/EDMonTyNJkGRb2s LG+jpMB3N2OrhSIIj4EEft4jhnYdFr9EFhTSDewVWN+mIoM5J4AtjiJV9d2zj+zogA9E Vh8sTF00ExaP4yYXdxl0t/9AyftcqNEkexcF3V9lDzRO327Njy+j5jsosShPwMzTCuAa 62fQnqmpea2valyRX/KTxX3bM7mkhNsISdyKZ3rVK2O3PZNPjhnApLsQhTSGEkDOqoRR g/4bn3oa470V6MWOmucMaX1570xHY+zqMH1vtvLZ4Qe65k59oFZKPZzXhXG/ph1IZNgu NYZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CWgYxSN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 16-20020a17090a195000b0027ce5a78453si1134332pjh.29.2023.10.11.19.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 19:38:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CWgYxSN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6B901802FBA0; Wed, 11 Oct 2023 19:38:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376760AbjJLCis (ORCPT + 18 others); Wed, 11 Oct 2023 22:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233946AbjJLCin (ORCPT ); Wed, 11 Oct 2023 22:38:43 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80CDEB6; Wed, 11 Oct 2023 19:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697078322; x=1728614322; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=K3cYNR9dHNWIHJ58ypiFOF8RbjVsqUQwkNF18MKRWjs=; b=CWgYxSN95sIW9GyrosmSdr4X7kXPEIlWQIFA2BRpyEmvMIJVkMmSfrfz wgz7Axn9MQRZCv/UfMm8DM4UM0JAWPTu40s+zfXnSCJWxI6U55vn/GEZv 24gv/PWe0MAfF0lg0ZoThOySdiqc8V6Mno42tbdc7N8TdGL5Q6lOFi1oc 6zoUiOf7nblsuZ7hncZfTleXuQcDG4btAs8thRxjuu8ipIaoDXtoavNbR 0PvAvIUVbekqfolRHeGO6JV98thLGK4WeucB/H+fu1nuPW+p9qHJF3UJf 0hCBY8zBLX9lLz3V58tGYTqHy7rNWHT34asXCOOB/kPghccjDK5scSkP1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="3402622" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="3402622" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 19:38:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="783507853" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="783507853" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 19:38:41 -0700 Received: from debox1-desk4.intel.com (unknown [10.209.105.238]) by linux.intel.com (Postfix) with ESMTP id EB298580DBE; Wed, 11 Oct 2023 19:38:40 -0700 (PDT) From: "David E. Box" To: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com Subject: [PATCH V3 02/16] platform/x86/intel/vsec: remove platform_info from vsec device structure Date: Wed, 11 Oct 2023 19:38:26 -0700 Message-Id: <20231012023840.3845703-3-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231012023840.3845703-1-david.e.box@linux.intel.com> References: <20231012023840.3845703-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 19:38:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779515614583655000 X-GMAIL-MSGID: 1779515614583655000 In preparation for exporting an API to register Intel Vendor Specific Extended Capabilities (VSEC) from other drivers, remove the pointer to platform_info from intel_vsec_device. This prevents a potential page fault when auxiliary drivers probe and attempt to dereference this pointer to access the needed quirks field. Instead, just add the quirks to intel_vsec_device. Signed-off-by: David E. Box Reviewed-by: Ilpo Järvinen --- V3 - No change V2 - New patch splitting previous PATCH 1 drivers/platform/x86/intel/pmt/class.c | 2 +- drivers/platform/x86/intel/vsec.c | 2 +- drivers/platform/x86/intel/vsec.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/intel/pmt/class.c index f32a233470de..2ad91d2fd954 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -31,7 +31,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev) * differences from the server platforms (which use the Out Of Band * Management Services Module OOBMSM). */ - return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW); + return !!(ivdev->quirks & VSEC_QUIRK_EARLY_HW); } EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT); diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index 6bb233a23414..15866b7d3117 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -201,7 +201,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he intel_vsec_dev->pcidev = pdev; intel_vsec_dev->resource = res; intel_vsec_dev->num_resources = header->num_entries; - intel_vsec_dev->info = info; + intel_vsec_dev->quirks = info->quirks; if (header->id == VSEC_ID_SDSI) intel_vsec_dev->ida = &intel_vsec_sdsi_ida; diff --git a/drivers/platform/x86/intel/vsec.h b/drivers/platform/x86/intel/vsec.h index c242c07ea69c..8b9fad170503 100644 --- a/drivers/platform/x86/intel/vsec.h +++ b/drivers/platform/x86/intel/vsec.h @@ -79,11 +79,11 @@ struct intel_vsec_device { struct pci_dev *pcidev; struct resource *resource; struct ida *ida; - struct intel_vsec_platform_info *info; int num_resources; int id; /* xa */ void *priv_data; size_t priv_data_size; + unsigned long quirks; }; int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,