From patchwork Thu Nov 23 04:03:38 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: 168681 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp207160vqx; Wed, 22 Nov 2023 20:04:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+/1/Xylf9ZezOV41xSao6qDyFRWYbDfRbuHHE3lhP7SS0cCLr3x8r52avvwdKItBGXMfh X-Received: by 2002:a05:6a21:19b:b0:187:41d6:3687 with SMTP id le27-20020a056a21019b00b0018741d63687mr5105546pzb.11.1700712246639; Wed, 22 Nov 2023 20:04:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712246; cv=none; d=google.com; s=arc-20160816; b=ogYOYbgP+9temiWrCSd+DiGEI1G6VY18meykE8LHOKVk4r6qVcV9aAb0l9SJQgHtfr pQfXIy6pLPNTIR9plSGBoKjjNbvKEKRR2lXIgvdL0RnmIp9kY6vb08zHAteaYNsi1bZF R2AEWDciU3WorycFGUTu1VePVDTgLJ1TXZjluYP90qUQNfh76YowQmjxLJ8cZBiE+oh5 HqbXjp/yD2GAOTAIWBkE4jDSWe4yc742DaYZRzIcFdS4l9K/NR1bIEcJhlqOBRgzoYBx /gfI6ZyBf0UZv4s0SLVBh00KJqsIS+q6xEceCt2TmaDYfPmiaxNYMGpoQ3HmiXz6hz7T ntQw== 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=pC/YtTGFTSiQhnHu+mT0aM+X0vwySynBKZ9xUnt7Lio=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=Dh0RqUkQ+GRf3p0H+MmhbNVcsQT/e7RsJxgOk7ykLD/O65DxoLRk4Tb/hE3Ur/etMj FPI9nMHpwMFCBrh13ahq7V7EAuxaJ4YPYJeBtY2mec8q3QyH+yVXN/nzQ616IdDrybD0 yeht1tpUCut0VKt5hSsO+lbg7Mh6VE/txFu3484tMj/b2OvHKl7mZw+m2W+y/7OPvOWi uCtg7Ah6hYqx9b6xjwRu/4GVhTcN0+lEM+dqJdJSat37Pv+EEaxNCIVxewB7e+sg71sA C2EeMluc8jLJWsy9G5eggXOl6z7SBcz1Dwaw7Z0l57ENMXjM4+Gqy4wKA/VPD4JWO4Zl 3NlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d1eS7eAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a27-20020aa78e9b000000b006cb8beb01fbsi455288pfr.83.2023.11.22.20.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:04:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d1eS7eAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 8C0BF807DE21; Wed, 22 Nov 2023 20:04:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233910AbjKWEDx (ORCPT + 99 others); Wed, 22 Nov 2023 23:03:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232584AbjKWEDv (ORCPT ); Wed, 22 Nov 2023 23:03:51 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78D5B199; Wed, 22 Nov 2023 20:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700712237; x=1732248237; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=hkm+jeGPBOqrZ8gKj7Tyxv9MfRKh2Cd6aKQPwSKyuJM=; b=d1eS7eApVCh/pQwdbp/xbiJPrhGiPOLPYSyKJRnZU7fTPofz9YFbDTcT k03cuqwWlojb0oFp/E2gwgnT1fE6vBr3OVfnWUgS8M+sHHR/hLeWATifH GH53NmjOWkOX+uoal1MSR92LsWX6l576lFsiweZCK5DtZ402fbXftF4GC Osu7Vxf8ADPrdNNySQpL07z+IM+uHy5qVpv58N+IpTRX4qeEAtljlNNQ6 DkDiKMHUIA83Pm02kBCFMIALtHgy2iC71SjyYLvraMr5VeLC6ANe9fTwn 70DWNUPgI00mI6P1TCJXxTmkigO1P6qiCDQ7tY1PrE3fwsNGSmwRCMMDn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="5334658" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="5334658" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="837671146" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="837671146" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:56 -0800 Received: from debox1-desk4.lan (snpatel1-mobl.amr.corp.intel.com [10.209.89.91]) by linux.intel.com (Postfix) with ESMTP id B83C9580CA4; Wed, 22 Nov 2023 20:03:55 -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 V5 03/20] platform/x86/intel/vsec: remove platform_info from vsec device structure Date: Wed, 22 Nov 2023 20:03:38 -0800 Message-Id: <20231123040355.82139-4-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123040355.82139-1-david.e.box@linux.intel.com> References: <20231123040355.82139-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:04:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783326044391393801 X-GMAIL-MSGID: 1783326044391393801 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 --- 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 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,