Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp609022pxf; Wed, 24 Mar 2021 11:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU/G0pToAqpMjfBXJMg11k4Qq2xD7xm0f6mjqlqlovM2ZVoLFIBa+PwLZY1d1Mk+rA1tq+ X-Received: by 2002:a05:6402:42d1:: with SMTP id i17mr4766383edc.131.1616610395393; Wed, 24 Mar 2021 11:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616610395; cv=none; d=google.com; s=arc-20160816; b=CHBBHCSNqE/6RYjWQ3ld9D9Yq1ELWsJ9+GSSiPWjJ5kw0SAwL50NgCVVWJVfeBbcSm FwFWITUKUMGvEAa5vGW/TpWECfaJK6G+jdWrs/X/aLT8j5WEZbF/so0TKMU8CCYOYGSx OWziMFqHEhdvJquVrCUOyHlWlA4M/8x4aRP56+PYVpxyYeZjxp3BM1Y4UBNjJMT5TX13 5kLZ6kmEfTNb0NAJr3VnMQFB9/nac2VsYkwEOEZSBqlaI5VZ+zGMqGXfKM+G5JnI3SGH UqFPUr3SCerql6LYoD+gIhLoVUC/2PEQsH1EK24i5zORbjWwiMc3cAN/rir1JEcST9+Z hQkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=KztgrnALvSd5tZeJXoWtW3rVCqmxZ6tnW6zkR8xcMTY=; b=flMh/Da+KZFKabR516etg6yKW1nMxkPog0bP/+opoIjkNQjR6NbWoVfDQvZBOhr6tw 5Iht8oDUURGXp8qwMsCaT3ucPjXR1S2y+3aRLMs6b9sHSKY9GG4FK9yR0a6G1GD6UNzl IjO1UJOOSYpBdaRyAdJb8b3udSpuLJpqcw7+MfSE4AjyPHeXP7+BbFqBS5SBCJMmobgy jwVTb1dMAqIUVuLMgQuEzCi2WF2RGsX61th03yBavxDDUG4G0+p9wGgwonJ6DNSmMERM +EpUbO9TsqKwyQRY3sEZ9DQoywr9rx2uh92FggKK6vjgZnKz5un7zUyHr+oBtsotlfKu 2Ndg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 ke3si2289099ejc.747.2021.03.24.11.26.12; Wed, 24 Mar 2021 11:26:35 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237354AbhCXSYp (ORCPT + 99 others); Wed, 24 Mar 2021 14:24:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:16715 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237298AbhCXSYZ (ORCPT ); Wed, 24 Mar 2021 14:24:25 -0400 IronPort-SDR: u0BXAHGzOwwtHi+J0WuD0hauc5P3vEw3lxRRv8ZSlpY/zLLge78r0pxCyli4dCNRDgnxVumjOK +2tDcyNNJ+yw== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="190857221" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="190857221" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 11:24:23 -0700 IronPort-SDR: H8fKkRDL6KDXqfGvIm5i/rDyWLDoiuYZ4U3ghKa7SfHZ8PkFVBZolHrPcKfXz3YJPYnLU4gbQW lA14730w3S1A== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="408967340" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 11:24:23 -0700 Date: Wed, 24 Mar 2021 11:24:22 -0700 From: Ira Weiny To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, Sean Christopherson , Jethro Beekman , Jarkko Sakkinen , Dave Hansen , Dave Hansen , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init() Message-ID: <20210324182422.GU3014244@iweiny-DESK2.sc.intel.com> References: <20210306002058.303796-1-ira.weiny@intel.com> <20210324094720.GA5010@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210324094720.GA5010@zn.tnic> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 24, 2021 at 10:47:20AM +0100, Borislav Petkov wrote: > On Fri, Mar 05, 2021 at 04:20:58PM -0800, ira.weiny@intel.com wrote: > > > Subject: Re: [PATCH v5] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init() > > The tip tree preferred format for patch subject prefixes is > 'subsys/component:', e.g. 'x86/apic:', 'x86/mm/fault:', 'sched/fair:', > 'genirq/core:'. Please do not use file names or complete file paths as > prefix. 'git log path/to/file' should give you a reasonable hint in most > cases. Fixed. > > > From: Ira Weiny > > > > kmap is inefficient and we are trying to reduce the usage in the kernel. > > Please use passive voice in your commit message: no "we" or "I", etc, > and describe your changes in imperative mood. > > Also, pls read section "2) Describe your changes" in > Documentation/process/submitting-patches.rst for more details. > > Bottom line is: personal pronouns are ambiguous in text, especially with > so many parties/companies/etc developing the kernel so let's avoid them > please. Fixed. > > > @@ -615,11 +614,14 @@ static long sgx_ioc_enclave_init(struct sgx_encl *encl, void __user *arg) > > if (copy_from_user(&init_arg, arg, sizeof(init_arg))) > > return -EFAULT; > > > > - initp_page = alloc_page(GFP_KERNEL); > > - if (!initp_page) > > + /* > > + * sigstruct must be on a page boundry and token on a 512 byte boundry > > + * kmalloc() gives us this alignment when allocating PAGE_SIZE bytes > > Please integrate scripts/checkpatch.pl into your patch creation > workflow. Some of the warnings/errors *actually* make sense. > > WARNING: 'boundry' may be misspelled - perhaps 'boundary'? > #90: FILE: arch/x86/kernel/cpu/sgx/ioctl.c:618: > + * sigstruct must be on a page boundry and token on a 512 byte boundry > ^^^^^^^ > > WARNING: 'boundry' may be misspelled - perhaps 'boundary'? > #90: FILE: arch/x86/kernel/cpu/sgx/ioctl.c:618: > + * sigstruct must be on a page boundry and token on a 512 byte boundry > ^^^^^^^ > > Also, do you see how other comments in this file are proper sentences? > Please formulate yours this way too. Thanks fixed. > > The change itself looks ok. Thanks, new version 5 sent. Ira > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette