Received: by 10.223.185.116 with SMTP id b49csp3553610wrg; Tue, 6 Mar 2018 00:40:33 -0800 (PST) X-Google-Smtp-Source: AG47ELtUmSYK0fZoX1ktWG0gjflUePX9qQdWL/bkyTVnog3IHphkmQPsOFFsM/mLiIZymIdZNOeC X-Received: by 2002:a17:902:26a:: with SMTP id 97-v6mr16116143plc.3.1520325633636; Tue, 06 Mar 2018 00:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520325633; cv=none; d=google.com; s=arc-20160816; b=TjrQBteO7U/whIUa24FyiMEyL1TyWO3gm7SCmDyvAlFDXZUOuQdCtZjf4b7tsn3iiO fYj2i+0jifICwHtojF/+1wBhWiteLt1MkGeQHXo4lKoh6Nl/y01CD2Y5gR8MaFp+OjFx PfsMqkgNCD+dT7oLHakFtb6pQfzk2uwy2z3irmr0hyI+e0Ffsw2nIljcnTnRjQHtaXZp n0GrRUh/MmdKiCbS6KZO4W44cYmRFjCuh9SYXXWZKqAua1HvoiLblxExlwlqXYj1TmDg hF8RowQyVHm3jWkWgQ1ZMWnL7i2kmzCwyJbOfHOpkxan3ifqHpegulgJfsbSu4tRGcom Mi2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=YzdoTKm0ZTdN4QiIHgImrxqS2hiTG7+WFHTZjE+FGLE=; b=mf4ezdlAUEIFNOvJmrJx0Vbwmab0Y2QQ28s+CEEMOr8pwedt3AdWq2FR5QVW1BebkD APsoBSMgikmOKrSzPv+NUsBW+QkrwT4fuA1EZ59un8+vItb76kEKGE8mm53VZX3D1sF8 EQ8dlUDEF06a+T4lDiIpVL69JfoXzb3UAo3MSOV1NsZFS42lgpcLOCe6XHkYpEe2eOAE XPZiwUHYbKwq6fozKbCth7biiskSUDizBTlh27RQsPQGWNEYMAdm+C2fKWrveHE6WfVr xroakDu/035whv2n4b7FE6zZci3PyOppKwvkMvGYThktBrw0i7V/iAkNtOxJjfkZuqoN kucQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=y7G2+Ucx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y28si11727447pfk.273.2018.03.06.00.40.19; Tue, 06 Mar 2018 00:40:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=y7G2+Ucx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753243AbeCFIjT (ORCPT + 99 others); Tue, 6 Mar 2018 03:39:19 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35961 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753077AbeCFIjH (ORCPT ); Tue, 6 Mar 2018 03:39:07 -0500 Received: by mail-wm0-f67.google.com with SMTP id 188so20485129wme.1 for ; Tue, 06 Mar 2018 00:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YzdoTKm0ZTdN4QiIHgImrxqS2hiTG7+WFHTZjE+FGLE=; b=y7G2+UcxS2UzCBD9nGQjoXrpauX9MfLi88kkf7Dudy8sSX0buXh7YzIvwIGfxlsQQ4 XTje1CmHhbaoY+fLsJrtpIKR5pwzBnor0QhFKwiKZYgzu4lG+rL8ABaJ8Z/MZ8ixQtRx m7q22oZmPUi/s5Y1jnqpJRELRR0bw0W8p/myiUSYqw7bYRoMBSaNt29bTDi1lOq5JMPt x2Xu1l8r+VKFffpJ8VHEReu/Ti9iar8RvoCHDbtd7gdNWKF75r/g1Xb54OC8UuDIX8+F hhNT4AQrcN7WydPs52RxAqRYIFYluL/DlqV4PuZiq3kqMA/RsJpQq0gP58hcNxNNQVKs O3sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YzdoTKm0ZTdN4QiIHgImrxqS2hiTG7+WFHTZjE+FGLE=; b=MHfWLLCdj/QzqZO+yNmuxiWDaGoGAh1PnHz1MrLHmzyEvMO50Hye+R9RMb5Ylzl3AM ZHKa6K0UTT2aTwpbB/e9KatyTbqwKpaPnZGcjn3Wrz1/h+kmLG0da7g5lxcjzEbfntLw FbmRBQA8w5lvYLP0CimSSs4SPasC4MdkxrVN/r2LPyhHrYd4DrKVY8GqUugOnJnc0VW0 yb9ZFNER5yxJ4WOqMWG7E5zACqJcVXsO9WJCjg2yU2r/ATBhRPT6zjBqK1z4U0LlK1ZZ xmpQ6IiGy0eHpZi2BrJWI3ENKdbjfvjs+jyaMal12mKy8onUatZrDn16OGvcPJapzaFn iHNA== X-Gm-Message-State: APf1xPAXX0zv1FR/9FId4AWKZTMPQi8YX4If8ShEKaa/PBpw9YF39zhp 4ZB4GIRGOsQ5ioKGHUF+Y+Jcsg== X-Received: by 10.80.183.175 with SMTP id h44mr21866098ede.287.1520325546799; Tue, 06 Mar 2018 00:39:06 -0800 (PST) Received: from node.shutemov.name ([86.57.210.234]) by smtp.gmail.com with ESMTPSA id m5sm13110027edb.97.2018.03.06.00.39.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 00:39:06 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id 95F3A648D520; Tue, 6 Mar 2018 11:38:51 +0300 (+03) Date: Tue, 6 Mar 2018 11:38:51 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky , Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC, PATCH 19/22] x86/mm: Implement free_encrypt_page() Message-ID: <20180306083851.g5yh6f66srvrtc5n@node.shutemov.name> References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-20-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 11:00:00AM -0800, Dave Hansen wrote: > On 03/05/2018 08:26 AM, Kirill A. Shutemov wrote: > > +void free_encrypt_page(struct page *page, int keyid, unsigned int order) > > +{ > > + int i; > > + void *v; > > + > > + for (i = 0; i < (1 << order); i++) { > > + v = kmap_atomic_keyid(page, keyid + i); > > + /* See comment in prep_encrypt_page() */ > > + clflush_cache_range(v, PAGE_SIZE); > > + kunmap_atomic(v); > > + } > > +} > > Did you miss adding the call sites for this? No. It is in "mm, rmap: Free encrypted pages once mapcount drops to zero". But the call is optimized out since anon_vma_encrypted() is always false so far. -- Kirill A. Shutemov