Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3659108pxb; Mon, 1 Feb 2021 00:53:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMzqOZfOv4BIkexB1dmVKxeRDx2yxjyf2SKnU21fe0YNPmwa5XQZSBRf2j+yQgUqYlIp3P X-Received: by 2002:a17:906:780b:: with SMTP id u11mr16952615ejm.492.1612169586075; Mon, 01 Feb 2021 00:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612169586; cv=none; d=google.com; s=arc-20160816; b=Rjsq0vubRhsARY+HR8UBkLTXDqf3NrzQvB6FmKYVuWn9eRgy8Hr6qeBBVwwtx22yDJ OuIM3ja0cmgEHTppUbwgGr17l9mjUoYQURYzZ3oYcNG7pemiUHstYzLwg7dhAzB5lv4V wgeTcxcJghXOTvOatat3ywHPUx4qp60Gq7kBcRinqS/oduShsC4eNkE3QmCWD4WyE8LZ NcIzb8fvAQTkwCOXkNk5uJ3xY/DjvhGzMwc9odAyuKy2NIA8VD0crI3ZIFZ1x7VlDbGd t9OoT7eLgB4OBbMIULcEY3vshBQZSM9vIsvPL1/0bb6QCdhmlCGVuQ8WNXvvhs/eD7zJ vSLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IpQ8g4KpVRrhCWJ47QRTJtxg75Bvmi8TXjdGJU/RBFE=; b=wDbZGwxxNfW1V0vt/cZY/pCPmFQxjXznJ2M8CgerX0n+gwat4Jd49uYl+cobRsGJtC 9ver+eW0L4z3uZ/KbyLhVreFM643zip4/1uR5O73JFu61K6GuytMKW6ZwBt8HOAn5UdI 6P29A49gmzlJXKxoy/d+7i7sin1XVm+MO6sJk+7aLxp5XIbOTdaBzGbsBbOdfqXuDDJQ jwsO22Bm8pxCU0cT2xaIJp9nzyxBLlsAi6WE/YBgpBKQdGjnB/WusjBRHNnRF5oDA6ee /FXX4WEODx5/0/HeKWNHR88xdGhZ+v8yhQmtUGdtVSK+fbXrgkj8Pacfho043YZC5hAE RDtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WoKJJ0Q4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si10715512eju.570.2021.02.01.00.52.42; Mon, 01 Feb 2021 00:53:06 -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=@infradead.org header.s=casper.20170209 header.b=WoKJJ0Q4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbhBAItI (ORCPT + 99 others); Mon, 1 Feb 2021 03:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232177AbhBAItE (ORCPT ); Mon, 1 Feb 2021 03:49:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBDAC061573; Mon, 1 Feb 2021 00:48:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IpQ8g4KpVRrhCWJ47QRTJtxg75Bvmi8TXjdGJU/RBFE=; b=WoKJJ0Q4q+pUmOyxczhhYj0bmN bCgw8idFFIiXrGjY62xgh2BpmI/RTRwnmNZ5pmxUotzJ/XkWCYYaxspr4C2TB6WYCsMHpTJGrn+j3 ewjfnff6oKHrvSrNRPY6iQlyb+unxvyo8ifSrU9xtJnLog5HU4W5/y1dq4jaA0zj4IVpnkNuRaRgL ILv4nXrku7ZKXAPZ2FM3hoex+0v24PtwoJ8XQWnVcHov9hxIs/0fPAj4BRfvvzthY4PVBYYzErsDL NsdQ1Xhca4DBQm7j0pu5vEapE2uGBhzZy5rEMZYe3r66W3UVgDn27d3B4mAz0eNESGqD9ZGTVyR7q qooZHt2Q==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l6UsW-00DYS1-OF; Mon, 01 Feb 2021 08:48:12 +0000 Date: Mon, 1 Feb 2021 08:48:12 +0000 From: Christoph Hellwig To: Sean Christopherson Cc: ira.weiny@intel.com, Jarkko Sakkinen , linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org Subject: Re: [PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init() Message-ID: <20210201084812.GA3229269@infradead.org> References: <20210129001459.1538805-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 09:37:30AM -0800, Sean Christopherson wrote: > On Thu, Jan 28, 2021, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > There is no reason to alloc a page and kmap it to store this temporary > > data from the user. > > Actually, there is, it's just poorly documented. The sigstruct needs to be > page aligned, and the token needs to be 512-byte aligned. kmcalloc doesn't > guarantee alignment. IIRC things will work until slub_debug is enabled, at > which point the natural alignment behavior goes out the window. Well, there still is absolutely no need for the kmap as you can use page_address for a GFP_KERNEL allocation.