Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp542077rdb; Tue, 19 Sep 2023 03:15:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqc8ZbmZKUvAtlWDWMKuXfMPoUqkRtrgk+FpbSQtMvWX3srwKPCWvCXAZA4t7lmiq1q60/ X-Received: by 2002:a05:6a00:178e:b0:68a:69ba:6791 with SMTP id s14-20020a056a00178e00b0068a69ba6791mr11968415pfg.8.1695118541479; Tue, 19 Sep 2023 03:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695118541; cv=none; d=google.com; s=arc-20160816; b=i4WkvPm1gOJ37oQwKgJ2JnLlAUOt5UyCLp6ltU0V7oPtWvadgHZSN2lldMlgL6OsKa WvJkjpkJCmUSJH8YqpOkaPHUqSxVCgUy4DaQkTzzmsw/L5vZ7Fk2rMEqSmIIb7Uz8LLt d506Yn92WYM2G7NgVqzIc/ZIOCszHYHX1VhRvQITioLh1ZJxLRVsk+xHs3hEfd3PWLA3 7A+xbFHf1PLgFkInXfvwzx3J4SgakfiToCytxJhyM1mj6vQtNRtMoqQFNDLh0USyM49f 1xu9oO8q6gI68oIw+j8xTCEufnI/HKrfNNPUW5/GVZ2QVFbaZGHbihHUf2R24bmx1Y3r Cjyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=gaw8n/uFUMcaez0c2F4VUIS/etxD+VORAXZp/6x5cYs=; fh=knovX9t61jpnbObYxxriknJ14Ci2g8GoY2rHFhQ2MlQ=; b=YtZLSQiNS/kwcJL1tVLG6QDxun4cuXcdrit891SsNrBKbImgVxagT2y1ZcpygCdZgO ZYBXmOe1Jq4pLYJHAdNSSO8C1fpVzOR+8rcEyMu8btp/EENPxpz6IUevsGya10wQqxrx Ib7BU104yxV6uVzyuJCQP+X+20Up+RCo22jBD3WVDuPtRW+HF0pH76gtYP2pU9p5RcKg 533K1MaupSV+a/NT1rmftVngtTPwcHO7VPuGmfzJPE/rRLbu/hNpGfK0BmIazfd7tgqP teFRiajXruzDn4DSx+AJWUKk7K3jvc0FsGZWqoEHG6cKulDVnMOQhB1L8bM7CgrHrTGG zEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5g6Mb5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cn4-20020a056a020a8400b00569466198c3si8974435pgb.751.2023.09.19.03.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5g6Mb5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 30CF98096595; Tue, 19 Sep 2023 00:44:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbjISHos (ORCPT + 99 others); Tue, 19 Sep 2023 03:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231803AbjISHoj (ORCPT ); Tue, 19 Sep 2023 03:44:39 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D75AFFC; Tue, 19 Sep 2023 00:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695109473; x=1726645473; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=DueEHAS4pNn6cHKKxtYpc8Y6eCVUjoxCLg1+H69gZ5U=; b=D5g6Mb5hqm+Ni8czkJ0Jawl3cbAgdYI5a+TSJJNnml1r+qp7CcZIQRPH aF4GP093vzcA4AJ3HAhZgcu7FDGZPR/DPE+Bkxc4sxHGx6uKyrHnZThfg rPtvlivKanANTtgKHv7ITazHsJ+HUHiggMGsQGS8FgBlexkwxA6gWc47H ZipsuC+zgRVXoCj6k0Zg7NE7paMjL82ki/HqbUVna6Anq5LOqoRkWOfKt vXifFu1jYvgt8bZJqpgByDu4Ubt0REcizO/VMtdHj4veI1EVOM5if3YEa 5bI4jkHDE3HxuR/6wS3GYlRn2kfz1PKkNlyHkI3HqLW4lkGfuSL0H42kJ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="378774247" X-IronPort-AV: E=Sophos;i="6.02,158,1688454000"; d="scan'208";a="378774247" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 00:44:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="722762868" X-IronPort-AV: E=Sophos;i="6.02,158,1688454000"; d="scan'208";a="722762868" Received: from laichele-mobl1.ger.corp.intel.com ([10.252.38.7]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 00:44:21 -0700 Date: Tue, 19 Sep 2023 10:44:14 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "Joseph, Jithu" cc: Hans de Goede , markgross@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rostedt@goodmis.org, ashok.raj@intel.com, tony.luck@intel.com, LKML , platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, pengfei.xu@intel.com Subject: Re: [PATCH 04/10] platform/x86/intel/ifs: Scan test for new generations In-Reply-To: <5a66a02d-3504-ab5f-5373-789c8789557f@intel.com> Message-ID: References: <20230913183348.1349409-1-jithu.joseph@intel.com> <20230913183348.1349409-5-jithu.joseph@intel.com> <74882e91-f41e-7672-3835-d74f1364bbdd@linux.intel.com> <5a66a02d-3504-ab5f-5373-789c8789557f@intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-534009368-1695109467=:1920" 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 00:44:50 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-534009368-1695109467=:1920 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Fri, 15 Sep 2023, Joseph, Jithu wrote: > On 9/15/2023 9:51 AM, Ilpo Järvinen wrote: > > On Wed, 13 Sep 2023, Jithu Joseph wrote: > > > >> 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; > > > > I don't like the way old struct is left without genx naming. It makes the > > code below more confusing as is. > > > > Given that less than half the fields (2/4 in ifs_scan and 2/5 in ifs_status ) are changing across > generations(and rest are common) , I felt the code would be more readable if the common fields are > accessed without generation as is done now. > > That said I don’t mind changing if you feel strongly about this I would certainly prefer the generation dependent fields to marked as such. However, it does not say you couldn't have the other fields remain w/o gen. How about this definition (it comes with the added benefit that you cannot accidently use start/stop without specifying gen which guards against one type of bugs): union ifs_scan { u64 data; struct { union { struct { u8 start; u8 stop; u16 rsvd; } gen0; struct { u16 start; u16 stop; } gen2; }; u32 delay :31; u32 sigmce :1; }; }; Note that I used start and stop in gen0 without the bitfield that seems unnecessary. -- i. --8323329-534009368-1695109467=:1920--