Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3515108rdb; Wed, 13 Sep 2023 14:40:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyhRhBuU/UBHubWmI51INkEsOyE3bV3UONKXfBXnpWG6BYO29cV4m1GlAVFeiszy5jhvAF X-Received: by 2002:a17:902:b60e:b0:1c3:9aa7:66e1 with SMTP id b14-20020a170902b60e00b001c39aa766e1mr3347475pls.69.1694641235577; Wed, 13 Sep 2023 14:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694641235; cv=none; d=google.com; s=arc-20160816; b=DMWT+oHowHpPLl3CXG5f0HKYw5C+I3aOJzI7Z1v7vEf5+l5Gqj3L+jHVuzlNZIKq7i 9GABLbXN978aiY2sIw6DsQxcQvBuEYTLG/Lxw1rWecgggTP0n/nPgTwy4way9fpCbP4F tZ7aBgVrAbFNenhDtguaVNaUKF/t5mpgJxpwsk8Q593buoV5aYteg6yfEc+UXNJDQC89 ZSGlxoq290xLhxLp6hdyftZorsEgh3TvaNMrUK2H8peNPHL9LwXF+PWyHJ0/XaIrivCY JMlgIqvgP9olDN1HIWv/aVyKFmzQk8iHCQR96A/vxsSp1Ey204wgXj8YRtZs+9uY+ETS Wk0g== 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:cc:to:from :dkim-signature; bh=x60hwmu/3eRAgjUMDugaXXHQGYqucKV2m6BSqTzUYcg=; fh=8xS9zNNEexx7KHEczBpq5wXIDtxA/g5mXnxETx6X+p0=; b=zRr/dZ4w1sj38xn7vlpGY+/Nz9u6bAGJPC0y4ZwSQkyr0ZGi975H5S9c6C3hiFvL8L i3aHizINXmyjyr8/co4BircCCWQtBFFaDE8CDD5UIkISUhrnNXcCXCPy8cz7XFozKAmz JMDvXkBgIbLqnhv2qivDn9n9hjnHDNNgpJWucl2DekVn4Ph2gbY09G8E5m1B4aj7JREI tarBUoTrjIsUXEQIvotGKFIvXG43e0qcs+Z7POhp9eBO8Az0OUzDuN7kimdeaVglI+8R eofwcHb1gIt35kjpBb/OhIUi+gNGcBrcoGMmsGKeNdcLUfd592NGqnjGJoXBiQVf0q1+ BR8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UcDrEkDT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z16-20020a170902d55000b001bf095dfb7asi174205plf.231.2023.09.13.14.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UcDrEkDT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 65DC581CE13A; Wed, 13 Sep 2023 11:38:13 -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 S231964AbjIMSiJ (ORCPT + 99 others); Wed, 13 Sep 2023 14:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbjIMSh7 (ORCPT ); Wed, 13 Sep 2023 14:37:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDF9DA3; Wed, 13 Sep 2023 11:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694630275; x=1726166275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7jiyu/bEO46k0jXXC149ozOKb3OC/lXOxys31r8AOQ4=; b=UcDrEkDT3xdrOQNdO1It/PixlfB7HUjyEMkl5vulR7pmWhKlIMXEbHLF U24H+EmN/N2/lZSg4nUtSoH632fQQzRzVANxf+F6dGGaqjgiwvhAK2Lib FzLQTieB5a+l+RytnYTW1c2nRQMwKKhocVK4JGK9rvMoEulh5epcis5Ix hLYYat8Umfo4S2lWUlhuLMkLnZhCSWNzN2sCyQFrXRDkrx3vImNmfzpHH Bfg+PNjdNcpPc8x6aYty3akLGDVQlJfxvp3Dx4BF6KaS/T83F+VntNXvF bS7WjljqiRZC9lETcDFvXn9wPKhStLTJa3xIwY/BiZnSFdhGX6TdUJw/s w==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="369019143" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="369019143" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 11:37:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="744238584" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="744238584" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 11:37:55 -0700 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, pengfei.xu@intel.com Subject: [PATCH 04/10] platform/x86/intel/ifs: Scan test for new generations Date: Wed, 13 Sep 2023 11:33:42 -0700 Message-Id: <20230913183348.1349409-5-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230913183348.1349409-1-jithu.joseph@intel.com> References: <20230913183348.1349409-1-jithu.joseph@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 13 Sep 2023 11:38:13 -0700 (PDT) Make changes to scan test flow such that MSRs are populated appropriately based on the generation supported by hardware. Width of chunk related bitfields is ACTIVATE_SCAN and SCAN_STATUS MSRs are different in newer IFS generation compared to gen0. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Tested-by: Pengfei Xu --- drivers/platform/x86/intel/ifs/ifs.h | 14 ++++++++++++++ drivers/platform/x86/intel/ifs/runtest.c | 23 ++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 886dc74de57d..3265a6d8a6f3 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -205,6 +205,12 @@ union ifs_scan { u32 delay :31; u32 sigmce :1; }; + struct { + u16 start; + u16 stop; + u32 delay :31; + u32 sigmce :1; + } gen2; }; /* MSR_SCAN_STATUS bit fields */ @@ -219,6 +225,14 @@ union ifs_status { u32 control_error :1; u32 signature_error :1; }; + struct { + u16 chunk_num; + u16 chunk_stop_index; + u8 error_code; + u32 rsvd1 :22; + u32 control_error :1; + u32 signature_error :1; + } gen2; }; /* MSR_ARRAY_BIST bit fields */ diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index 1061eb7ec399..4bbab6be2fa2 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -171,6 +171,8 @@ static void ifs_test_core(int cpu, struct device *dev) union ifs_status status; unsigned long timeout; struct ifs_data *ifsd; + int to_start, to_stop; + int status_chunk; u64 msrvals[2]; int retries; @@ -179,13 +181,21 @@ static void ifs_test_core(int cpu, struct device *dev) activate.rsvd = 0; activate.delay = IFS_THREAD_WAIT; activate.sigmce = 0; - activate.start = 0; - activate.stop = ifsd->valid_chunks - 1; + to_start = 0; + to_stop = ifsd->valid_chunks - 1; + + if (ifsd->generation) { + activate.gen2.start = to_start; + activate.gen2.stop = to_stop; + } else { + activate.start = to_start; + activate.stop = to_stop; + } timeout = jiffies + HZ / 2; retries = MAX_IFS_RETRIES; - while (activate.start <= activate.stop) { + while (to_start <= to_stop) { if (time_after(jiffies, timeout)) { status.error_code = IFS_SW_TIMEOUT; break; @@ -202,7 +212,8 @@ static void ifs_test_core(int cpu, struct device *dev) if (!can_restart(status)) break; - if (status.chunk_num == activate.start) { + status_chunk = ifsd->generation ? status.gen2.chunk_num : status.chunk_num; + if (status_chunk == to_start) { /* Check for forward progress */ if (--retries == 0) { if (status.error_code == IFS_NO_ERROR) @@ -211,7 +222,9 @@ static void ifs_test_core(int cpu, struct device *dev) } } else { retries = MAX_IFS_RETRIES; - activate.start = status.chunk_num; + ifsd->generation ? (activate.gen2.start = status_chunk) : + (activate.start = status_chunk); + to_start = status_chunk; } } -- 2.25.1