From mboxrd@z Thu Jan 1 00:00:00 1970 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 A4A93C43334 for ; Wed, 22 Jun 2022 15:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235394AbiFVPHy (ORCPT ); Wed, 22 Jun 2022 11:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343920AbiFVPHx (ORCPT ); Wed, 22 Jun 2022 11:07:53 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51EBA393F7; Wed, 22 Jun 2022 08:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655910471; x=1687446471; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=spGuvBmrzu5CQX1DEn7d16VfVTAFMeRLkLyRMCTgqtI=; b=mIv24N/h1ry+ejUcipwuX0mrP4sXGlRLO3JloZ0FeZy8zbgYRUP2skWY mQmrLK4o7rzGfG11aLljLKsZtUrU9SPmDm0q3PX/X0yrZrFL0PfTgLsaf So/i93RKq3+CdXobkcm1TBKJW/1sIw2AaxvsFBtNorXi5yGKM9ZJCteZZ VTzAEnEkptI7LWlEK2n4RWgUYSKi24E5UO48SyLX/UMYvmm3SLQgahCpC Pf+dJmirTGVaFgVRfNM85HU57vFa8f/WV6MxuD5KRoznh3EFSP+KvZDfJ KcKU1+TfAz74BduG1FnFLGWqELn3Mze5OhcPoPAmyrMxiC5Nu712u57aC A==; X-IronPort-AV: E=McAfee;i="6400,9594,10385"; a="366763810" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="366763810" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 08:07:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="677596461" Received: from bshakya-mobl.amr.corp.intel.com (HELO [10.212.188.76]) ([10.212.188.76]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 08:07:49 -0700 Message-ID: <677c46db-02ef-24b8-c25f-762b41fb8bdb@intel.com> Date: Wed, 22 Jun 2022 08:07:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/4] x86/cpuid: refactor setup_clear_cpu_cap/clear_feature Content-Language: en-US To: Maxim Levitsky , linux-kernel@vger.kernel.org Cc: "Chang S. Bae" , Jiri Olsa , linux-perf-users@vger.kernel.org, Peter Zijlstra , "H. Peter Anvin" , "David S. Miller" , Borislav Petkov , Kees Cook , Mark Rutland , Alexander Shishkin , Namhyung Kim , Tim Chen , Pawan Gupta , Herbert Xu , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Jane Malalane , Tony Luck , Ingo Molnar , Thomas Gleixner , Arnaldo Carvalho de Melo , "open list:CRYPTO API" , Paolo Bonzini References: <20220622144820.751402-1-mlevitsk@redhat.com> <20220622144820.751402-3-mlevitsk@redhat.com> From: Dave Hansen In-Reply-To: <20220622144820.751402-3-mlevitsk@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On 6/22/22 07:48, Maxim Levitsky wrote: > Simplify the code a bit by always passing &boot_cpu_data > in case the setup_clear_cpu_cap was called. > > Also unify clear_cpu_cap and do_clear_cpu_cap. Please always add a "()" suffix to functions. "foo" is a variable, but "foo()" is a function. I also really like when a changelog has a clear problem statement. I _think_ the problem here is something along the lines of the 'c' argument to clear_feature() having different behavior when it is NULL versus '&boot_cpu_data'. Basically, there's no reason to support clearing a bit in '&boot_cpu_data' without also setting that bit in 'cpu_caps_cleared'. > { > - do_clear_cpu_cap(NULL, feature); > + clear_cpu_cap(&boot_cpu_data, feature); > }