Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E41EC636D7 for ; Wed, 15 Feb 2023 17:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjBORQe (ORCPT ); Wed, 15 Feb 2023 12:16:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbjBORQb (ORCPT ); Wed, 15 Feb 2023 12:16:31 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C15A25BAB; Wed, 15 Feb 2023 09:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676481390; x=1708017390; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to; bh=Re6lTdqWh6KrFv3eII8nENMCsO1LTov6DGFipWZOh58=; b=DbQSlSqWzgN8BcI+ztjmiu+8aCyEv1oj1XkqsX3ig5ewevRqsX/bsDr1 3N0wwza91yUFN3bnIIafymCp9Mxo0WVjY7GkxY8kkDIEf9BQu6nyHqDlc 0qmk4tbDfh5yc/zLTF37VZAFWEE+DIi7272AkZFVtrQc0fwneEQeRzg6O SUrjUjDXjc/LjUand8inmJprrBUi5ed/mZICIiCEVrBH3MABmhRf/8m+E 2/K2My/LiRUL8FBERF3UCa74Iy5m7/4NPoSxZSzJQZcuy7BUJUf1yiugB L63ocY24AV5ms3VlDq19/Pe2veCPQj4s3nVI+B5CehYpx3EhUod+jk/x2 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="393890125" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="393890125" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:11:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="998588989" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="998588989" Received: from chakanog-mobl.amr.corp.intel.com (HELO [10.209.64.107]) ([10.209.64.107]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:11:57 -0800 Content-Type: multipart/mixed; boundary="------------V56RL2ZG2Z0KQ0aAmFAITuEA" Message-ID: Date: Wed, 15 Feb 2023 09:11:56 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 4/7] platform/x86/intel/ifs: Implement Array BIST test Content-Language: en-US To: Jithu Joseph , 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, gregkh@linuxfoundation.org, rostedt@goodmis.org, 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, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-1-jithu.joseph@intel.com> <20230214234426.344960-5-jithu.joseph@intel.com> From: Dave Hansen In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------V56RL2ZG2Z0KQ0aAmFAITuEA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/15/23 08:58, Dave Hansen wrote: > On 2/14/23 15:44, Jithu Joseph wrote: > I'd probably do something like the attached patch. It gets rid of > 'data' and uses sane types for the bitfield. It does away with separate > variables and munging into/out of the msr[] array and just passes a > single command struct to the work function. It doesn't have any > uninitialized structure/bitfield fields. Real patch attached now. --------------V56RL2ZG2Z0KQ0aAmFAITuEA Content-Type: text/x-patch; charset=UTF-8; name="ifs-fun.patch" Content-Disposition: attachment; filename="ifs-fun.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvcGxhdGZvcm0veDg2L2ludGVsL2lmcy9pZnMuaCBiL2Ry aXZlcnMvcGxhdGZvcm0veDg2L2ludGVsL2lmcy9pZnMuaAppbmRleCAwMGJjODZkYjExOTMu LmZhMTMzNTA5NzZjOSAxMDA2NDQKLS0tIGEvZHJpdmVycy9wbGF0Zm9ybS94ODYvaW50ZWwv aWZzL2lmcy5oCisrKyBiL2RyaXZlcnMvcGxhdGZvcm0veDg2L2ludGVsL2lmcy9pZnMuaApA QCAtMTk5LDE0ICsxOTksMTEgQEAgdW5pb24gaWZzX3N0YXR1cyB7CiB9OwogCiAvKiBNU1Jf QVJSQVlfQklTVCBiaXQgZmllbGRzICovCi11bmlvbiBpZnNfYXJyYXkgewotCXU2NAlkYXRh OwotCXN0cnVjdCB7Ci0JCXUzMglhcnJheV9iaXRtYXNrCQk6MzI7Ci0JCXUzMglhcnJheV9i YW5rCQk6MTY7Ci0JCXUzMglyc3ZkCQkJOjE1OwotCQl1MzIJY3RybF9yZXN1bHQJCToxOwot CX07CitzdHJ1Y3QgaWZzX2FycmF5IHsKKwl1MzIJYXJyYXlfYml0bWFzazsKKwl1MTYJYXJy YXlfYmFuazsKKwl1MTYJcnN2ZAkJCToxNTsKKwl1MTYJY3RybF9yZXN1bHQJCToxOwogfTsK IAogLyoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvcGxhdGZvcm0veDg2L2ludGVsL2lmcy9ydW50 ZXN0LmMgYi9kcml2ZXJzL3BsYXRmb3JtL3g4Ni9pbnRlbC9pZnMvcnVudGVzdC5jCmlu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