From patchwork Wed Nov 29 22:21:16 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: 171628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:296:b0:164:83eb:24d7 with SMTP id ek22csp15817rwb; Wed, 29 Nov 2023 14:22:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYMJuDUeXF7lDVThxbfbOBcCv1JRkqMhhTCzuA++ht6iAkNCaIaxUwmk2mrphWyKxrZ+Uj X-Received: by 2002:a17:903:454:b0:1cc:510b:36c with SMTP id iw20-20020a170903045400b001cc510b036cmr20459471plb.54.1701296523688; Wed, 29 Nov 2023 14:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701296523; cv=none; d=google.com; s=arc-20160816; b=JZIN3NuEQ8DlGVPOiq8ktfLjqR4OkDAu5JPPhQzaCqZ9PPGukcFUN50Onx8Y0QUEmp poU0p94dJoMMyYAq1PSexxsKPx4PntBIvO5THx1UyyRCnk6nLhdWjO+Gpwmhk0kUfFuC eZMusZGTAOs5KscDgBW3mS6fVEJFMusAELw525JB/D8nnKC4v3bgjC1pvQIK6ln7xrut afk8vNmskLFPmmDNltWM/O/9d2nXdxB625nhEq5ZLOtwkn7lFHG8KU8dHSFMam541JJ9 3U1Iz2kbs++g+tMw3oH8Ek23sSDgrvFUuQA5odVQlyzXQSfGKa+1FP2biUK+yHztWtvi naEg== 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=A5XYqvRM1aNWSOKq1ZLVWGfhX1+krjtxkdzmOTfxz8M=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=cE/Z/4PTihH7SvoDZ8IvStQk7lyOcKxOkzc2GXD+cg2mz/q2UVZsSsAwOT3EnBblTN 8HgRD248602f19e1fm9IFv8as1HztLPSt8B4F4btN9wmOtc7LuIfpFT+V5OLAIyfKrTQ gLErB0lKNOZPGAxwCmAogWqFvJ90NsbwAq6WrEfWuca38+jQpMlF9P2nGJJeKM/GesGQ tIAYY+c6vXLDg3B+j5fMX8oGytd9+ektvbApr0nBBaSfvCW311figwyVyexDhV1VqKwp z6U9Oph6UiBC0lYkOPoa3179mEj7NIuIk5JEJxzOVrd03IeKSi+xXCpZAUFLX1XLdB/L UoSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tx0dKP7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id e13-20020a170902d38d00b001cffdad3b26si3880168pld.620.2023.11.29.14.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tx0dKP7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id C5F448043AF3; Wed, 29 Nov 2023 14:21:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234917AbjK2WVj (ORCPT + 99 others); Wed, 29 Nov 2023 17:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234830AbjK2WVd (ORCPT ); Wed, 29 Nov 2023 17:21:33 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90457BD; Wed, 29 Nov 2023 14:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701296499; x=1732832499; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pE3sub0j+/JrDbkd6ddVl6W0ILnvFOW3qKEc09tjz0w=; b=Tx0dKP7KkB2ZOvlefKh5ECao2OxG5NQHQ33TYcjMt6qkgg2NqePv0yxl lhPyDtlznobP8cEXbR6aDJ2zH2W5ABSfYk4PoP7sfduM+oYKK5CiNImrc J6xCkhPTKPxFpWE4YRa8kTFnptJk7Eic2ilQ5x9OW/SX1eXpTMzD+O2Ud exmmsQQWTExcSyRdFdGlX8+GNr0FdfMK05m3I8Yuo/rz87BL2Y+MLA/Ea 007q4Zvr7tZzlPgLzDbI3aDULObl26h80JusamsDM3rYme6eEMb24Tj4D oMQeZI+0xr91UhT8ZJlWYhGwRf0rhm9RUSs7EJeb0NF/70wO2mXObvcsQ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="11937002" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="11937002" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 14:21:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="798070413" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="798070413" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 14:21:33 -0800 Received: from debox1-desk4.lan (unknown [10.209.108.167]) by linux.intel.com (Postfix) with ESMTP id 2FA445807E2; Wed, 29 Nov 2023 14:21:33 -0800 (PST) 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 V6 04/20] platform/x86/intel/vsec: remove platform_info from vsec device structure Date: Wed, 29 Nov 2023 14:21:16 -0800 Message-Id: <20231129222132.2331261-5-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129222132.2331261-1-david.e.box@linux.intel.com> References: <20231129222132.2331261-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 14:22:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783938703555939970 X-GMAIL-MSGID: 1783938703555939970 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 --- V6 - No change V5 - No change V4 - No change 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 c83e2c549fc7..ba352af65dde 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -193,7 +193,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,