Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1556pxb; Mon, 31 Jan 2022 03:47:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCCF5RahvU2/MsQE6MEqCEsTC7EeiNEhZyxwEtutifY4aLF3KnJPMQv9a4YswaDTedpe3B X-Received: by 2002:a17:90a:ad4a:: with SMTP id w10mr23981449pjv.169.1643629644060; Mon, 31 Jan 2022 03:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629644; cv=none; d=google.com; s=arc-20160816; b=F5FPFmW8JkRtcfYvmGkpwrvkl5NszGw63PwGkajt6R9bckIamzfFcvAzDA2mevR0yn TxZtyQmMKjxyQkdklg4EUFnmbH7b72WKZ9vvo/FShKmZidKZBrsM8kV/ZU7NfJPmyAmO rMZk3rHhHUZuQ9EUY9yOoMUFbb5qeHxr1qDEMo6JmB5yWgAa4MvCeYjR8nbnlo2EjnYA AoqsdC8v29Gc7UyBUOpt4N8845ARpg6SHVp64Wk0kWBMN9yL7WxViLg5p7U4QJ49UNSN zRnMEdiOlEDLuQrhCnesdgo7OXz1GyxLF97iOS9ifgrqfTPXJEL1pF52cLKDafVOVnBL qA6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=zQaItFgu3lhtEkFUMIhmibdM8cA83Ht65mG9ycq/B3c=; b=YA+n+NhH5u1IUc9Vba+5CAwmL5LdVhA7g/8QHH9KQ1OHPviclRN5Yrjeb+O+CLJt4H IzD0z3SInxuL2y7Emg8As/7I3l3eVfZu/izpJhJB0U+MDQ4ZCNOgHSFBI631lafVXYBM NXJKqmPUXH0Uzo3Y1qfc9Pv532eZ359ujHLNa6XEq6p3esGCQSy/IjweHRHbfEZdhEME TaYSicjyAgmRwHnp6oWvh2r9eFQ+VL/z5vE4SorV1ghjd49FCe7uJgq0VTI0Sh96Rani MqOViQ4vpaUazFpfhgU8CYTC0jt+gYK5TpK/AMchZfEfaiQed2Zs2eByz0Z5ArgmNlkz zx6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O1WRmTyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si9273472pjq.106.2022.01.31.03.47.13; Mon, 31 Jan 2022 03:47:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O1WRmTyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351758AbiA1WoR (ORCPT + 99 others); Fri, 28 Jan 2022 17:44:17 -0500 Received: from mga06.intel.com ([134.134.136.31]:39221 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344236AbiA1WoM (ORCPT ); Fri, 28 Jan 2022 17:44:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643409852; x=1674945852; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=o0hjxthhhxBCb83EUCWwEsDk1eXQKwyFRTUgSJyDeXg=; b=O1WRmTybbMriKLPH/pAhco0o92QbIfQmjkX8tsiZ/7IBg4avbq4ZaF0O o06dff14YaKqmQxp72cwbzFSsBS5/F/Uu19B8kYjQZSFfQ1Vfw8S3nRZT QhEVYDoFH+TUbgV4SXOhdhWjy6GEU/PQlYWJr9iXVnuJwBee9PkqMsmvD m8iaPLw/iwfPkPWzs8WOUN6gnlz9GTx6hkeUyRspfc3l2J08/5lG3nD++ DigKCoPEWj/s/XF1C4K0eKX9DEfFrPQ7E7/b0xnyVjTR/Z5LQz61FBAM+ OQ+xWnflgTvClI3cwv/38s94H5Y+645gdx1vQCBDzdcAvQtAl2IGzevU0 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10241"; a="307940309" X-IronPort-AV: E=Sophos;i="5.88,325,1635231600"; d="scan'208";a="307940309" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 14:43:55 -0800 X-IronPort-AV: E=Sophos;i="5.88,325,1635231600"; d="scan'208";a="697239820" Received: from zhenkuny-mobl2.amr.corp.intel.com (HELO [10.209.84.59]) ([10.209.84.59]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 14:43:55 -0800 Message-ID: <7bb7d2be-9fa0-1b0d-17d1-adb7d58d5389@intel.com> Date: Fri, 28 Jan 2022 14:43:54 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.2 Content-Language: en-US To: ira.weiny@intel.com, Dave Hansen , "H. Peter Anvin" , Dan Williams Cc: Fenghua Yu , Rick Edgecombe , linux-kernel@vger.kernel.org References: <20220127175505.851391-1-ira.weiny@intel.com> <20220127175505.851391-4-ira.weiny@intel.com> From: Dave Hansen Subject: Re: [PATCH V8 03/44] x86/pkeys: Create pkeys_common.h In-Reply-To: <20220127175505.851391-4-ira.weiny@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/27/22 09:54, ira.weiny@intel.com wrote: > From: Ira Weiny > > Protection Keys User (PKU) and Protection Keys Supervisor (PKS) work in > similar fashions and can share common defines. Specifically PKS and PKU > each have: > > 1. A single control register > 2. The same number of keys > 3. The same number of bits in the register per key > 4. Access and Write disable in the same bit locations > > Given the above, share all the macros that synthesize and manipulate > register values between the two features. Share these defines by moving > them into a new header, change their names to reflect the common use, > and include the header where needed. I'd probably include *one* more sentence to prime the reader for the pattern they are about to see. Perhaps: This mostly takes the form of converting names from the PKU- specific "PKRU" to the U/S-agnostic "PKR". > Also while editing the code remove the use of 'we' from comments being > touched. > > NOTE the checkpatch errors are ignored for the init_pkru_value to > align the values in the code. > > Signed-off-by: Ira Weiny Either way, this looks fine: Acked-by: Dave Hansen