From patchwork Wed Oct 4 02:02:11 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: 148134 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2468903vqb; Tue, 3 Oct 2023 19:02:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlzHNlyJzp3voWZ/uJDaTp7cB03QLzhOcI879JrAUDtpIQAQk/ahst1PzBx0Z4Kz4k8rH/ X-Received: by 2002:a17:90a:8d83:b0:26d:43f0:7ce4 with SMTP id d3-20020a17090a8d8300b0026d43f07ce4mr1075993pjo.8.1696384967090; Tue, 03 Oct 2023 19:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696384967; cv=none; d=google.com; s=arc-20160816; b=dewZuNz8OFZRCDxWaiY2Ph+3XowckPB0KLDU1Q+BDmnjRMz0M1/8tEN/UyqZeYrgLJ 6AQWnVMO3rsJS4VFBd+SEZ7fjc6fUYraynk8nQUJuZMKWKG737iR4fNDoFT0BjTYuvxe LOMI3qYqxYfSncAdPPWD6VYiOdyC8/Cf3fW7SJVtqZweZZUDrZU7wVQCCsTb7Un4aIpJ B1jpuz6TXPnAS7s6MpfywD1Z0ll/K2pQgdCb3gs4WMyjjeeHOzF+E6fTu6D+jMUANCr0 JgSsN4FGb2+mZwUBI0jWR2orr5TN9nDWAQPuEnAf/0+KZnb88nUDcMf1FF4Fow8VDL42 SjdA== 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=LyrpcKy1dlIE7wUk7uG6mFo7w0EhmmXEvQiC7RGpjNk=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=OJ9n9xf4M+uIoqhKDTXbHtFFz7WsH/x6Gku42pqqQtAHcPWi5hj5G/6Bk7o1J0FEZn h1US9hB5RNNKP/uQvDtk9TFde7XXpc9dTf4u26EhfbQ1AGmaV1uEubcgziSCvmfjYgep 3MPM/o/n0vN7A50MgMZ7n0xvMttuqPK6XeYFP/cAVCn/UYH9n1j67+zyIwP2e4X9/5ZW C2NLLsn/banDoul9KjCms+kQKgEukEsSZ5v/Qxv6AVPOGwhvTt6AMxLwXkjLyz5UjVlP RnbENUWpgNJJ+lfpViQKvz95LYgdWhW3gZkv5hGo86zkLGYHUSR1n3H0VbEKgu6twwFH 0zpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QUXjr5Gs; 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 z2-20020a17090ab10200b00276671731e3si504286pjq.136.2023.10.03.19.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 19:02:47 -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=QUXjr5Gs; 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 2D84381BDF09; Tue, 3 Oct 2023 19:02:46 -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 S241071AbjJDCCo (ORCPT + 17 others); Tue, 3 Oct 2023 22:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240920AbjJDCCm (ORCPT ); Tue, 3 Oct 2023 22:02:42 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F1BAFF; Tue, 3 Oct 2023 19:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696384958; x=1727920958; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=5j+f3O2+RD5TW+OKSRMLyNTpv7InleN1F+Z72loLFxo=; b=QUXjr5GsmX3HqV7Z0WjGlerZAKy1YF7/zYAk/ATFfGD3Uepiho/ZN1dK NQ3vxaaa4fgQIzN8vdmqfzf+CFJvIjwQY6VbJHN3XB8VMSkCVjmWtfwhy cxJop+aE3Fxo7LYDilu/FVltBFEo8HXtdFuGHwb1Fte0bm2XNU8yDS/te AQhY/lEht9Y2M53lEqYqvph81rZcLj/BrbAxBeaRef49MxVexdCvIhTR+ S1ZA8NgxTBbysfQY0nA2o6fkVok/0Fj0bdyV/+8k3yfuO1Xim8jnVzp0q I1OPLL9ILTMYIPhGmiaIrr5PXUUPMsKi9A8n+Zw8mZlWPDedlCgMt2NFF g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="1625861" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="1625861" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 19:02:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="700926290" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="700926290" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 19:02:22 -0700 Received: from debox1-desk4.intel.com (unknown [10.209.24.172]) by linux.intel.com (Postfix) with ESMTP id 9889B580D95; Tue, 3 Oct 2023 19:02:22 -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 V2 02/13] platform/x86/intel/vsec: remove platform_info from vsec device structure Date: Tue, 3 Oct 2023 19:02:11 -0700 Message-Id: <20231004020222.193445-3-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231004020222.193445-1-david.e.box@linux.intel.com> References: <20231004020222.193445-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,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED 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]); Tue, 03 Oct 2023 19:02:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778788563172370410 X-GMAIL-MSGID: 1778788563172370410 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 --- 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 e82a009be630..b14eba545770 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 8900cb95afd3..d3fefba3e623 100644 --- a/drivers/platform/x86/intel/vsec.h +++ b/drivers/platform/x86/intel/vsec.h @@ -79,10 +79,10 @@ struct intel_vsec_device { struct pci_dev *pcidev; struct resource *resource; struct ida *ida; - struct intel_vsec_platform_info *info; int num_resources; void *priv_data; size_t priv_data_size; + unsigned long quirks; }; int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,