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 X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E77A4C56201 for ; Tue, 27 Oct 2020 08:12:48 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83785207C3 for ; Tue, 27 Oct 2020 08:12:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Cp1perTc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83785207C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EAD4D161C8E4D; Tue, 27 Oct 2020 01:12:47 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=216.205.24.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=david@redhat.com; receiver= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A7DC4161C8E49 for ; Tue, 27 Oct 2020 01:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603786363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NAcngyuptikvYGGpjHccIA10XCuP57p7z320i7MuxeE=; b=Cp1perTca7ew4Y15f97Qo81wQNADEPhZ6yXBDF3VvkfvdqAHKFpPKtIy8S6v2QyW0lx83F CFgeHJVpctAuEsaKDo9uw6F2j+3jrsoMcYdMCalgWEra+pqpDFH6rvb14DAAu6xl7P0uHo BzGGZlpcEiBUb2DtvRxgA/zaqMOsD7c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-Q8AvrUgQOMaVTr9oXfijqA-1; Tue, 27 Oct 2020 04:12:38 -0400 X-MC-Unique: Q8AvrUgQOMaVTr9oXfijqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338664085; Tue, 27 Oct 2020 08:12:33 +0000 (UTC) Received: from [10.36.113.185] (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB67E5B4B3; Tue, 27 Oct 2020 08:12:24 +0000 (UTC) Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages To: "Edgecombe, Rick P" , "rppt@kernel.org" , "akpm@linux-foundation.org" References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Date: Tue, 27 Oct 2020 09:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Message-ID-Hash: WPKCAXRGNKJ4PXABAG2BNFH2TUATMFRZ X-Message-ID-Hash: WPKCAXRGNKJ4PXABAG2BNFH2TUATMFRZ X-MailFrom: david@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "tycho@tycho.ws" , "cl@linux.com" , "hpa@zytor.com" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "linux-kselftest@vger.kernel.org" , "dave.hansen@linux.intel.com" , "will@kernel.org" , "linux-mm@kvack.org" , "kirill@shutemov.name" , "viro@zeniv.linux.org.uk" , "rppt@linux.ibm.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "willy@infradead.org" , "luto@kernel.org" , "arnd@arndb.de" , "shuah@kernel.org" , "tglx@linutronix.de" , "linux-nvdimm@lists.01.org" , "linux-riscv@lists.infradead.org" , "x86@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-fsdevel@vger.kernel.org" , "Reshetova, Elena" , "palmer@dabbelt.com" , "mingo@redhat.com" , "mtk.manpages@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "jejb@linux.ibm.com" , "paul.walmsley@sifive.com" , "mark.rutland@arm.com" X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 26.10.20 20:01, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 10:37 +0200, Mike Rapoport wrote: >> +++ b/arch/x86/mm/pat/set_memory.c >> @@ -2184,14 +2184,14 @@ static int __set_pages_np(struct page *page, >> int numpages) >> return __change_page_attr_set_clr(&cpa, 0); >> } >> >> -int set_direct_map_invalid_noflush(struct page *page) >> +int set_direct_map_invalid_noflush(struct page *page, int numpages) >> { >> - return __set_pages_np(page, 1); >> + return __set_pages_np(page, numpages); >> } >> >> -int set_direct_map_default_noflush(struct page *page) >> +int set_direct_map_default_noflush(struct page *page, int numpages) >> { >> - return __set_pages_p(page, 1); >> + return __set_pages_p(page, numpages); >> } > > Somewhat related to your other series, this could result in large NP > pages and trip up hibernate. > It feels somewhat desirable to disable hibernation once secretmem is enabled, right? Otherwise you'll be writing out your secrets to swap, where they will remain even after booting up again ... Skipping secretmem pages when hibernating is the wrong approach I guess ... -- Thanks, David / dhildenb _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org 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 X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44837C55179 for ; Tue, 27 Oct 2020 08:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0267220878 for ; Tue, 27 Oct 2020 08:12:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="izoUNn+I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508858AbgJ0IMo (ORCPT ); Tue, 27 Oct 2020 04:12:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23192 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2508846AbgJ0IMn (ORCPT ); Tue, 27 Oct 2020 04:12:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603786361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NAcngyuptikvYGGpjHccIA10XCuP57p7z320i7MuxeE=; b=izoUNn+IN3+rLS+uPI2ugr4fH+bhc/8RPUCdLmHQIEXxgvGOf/wvzyyTrPB7qcmHFQ2/9k jP0M+oSqKNyCy5F/nPCcgGu5+Edrzwpx40MNjSwx+9dsA4lbuVaukTsfGMoLisbpSEBr0C 4lEF0MXlDJeKQKu8jfH/D549QgKlgzc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-Q8AvrUgQOMaVTr9oXfijqA-1; Tue, 27 Oct 2020 04:12:38 -0400 X-MC-Unique: Q8AvrUgQOMaVTr9oXfijqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338664085; Tue, 27 Oct 2020 08:12:33 +0000 (UTC) Received: from [10.36.113.185] (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB67E5B4B3; Tue, 27 Oct 2020 08:12:24 +0000 (UTC) Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages To: "Edgecombe, Rick P" , "rppt@kernel.org" , "akpm@linux-foundation.org" Cc: "tycho@tycho.ws" , "cl@linux.com" , "hpa@zytor.com" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "linux-kselftest@vger.kernel.org" , "dave.hansen@linux.intel.com" , "will@kernel.org" , "linux-mm@kvack.org" , "kirill@shutemov.name" , "viro@zeniv.linux.org.uk" , "rppt@linux.ibm.com" , "linux-arch@vger.kernel.org" , "Williams, Dan J" , "bp@alien8.de" , "willy@infradead.org" , "luto@kernel.org" , "arnd@arndb.de" , "shuah@kernel.org" , "tglx@linutronix.de" , "linux-nvdimm@lists.01.org" , "linux-riscv@lists.infradead.org" , "x86@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-fsdevel@vger.kernel.org" , "Reshetova, Elena" , "palmer@dabbelt.com" , "mingo@redhat.com" , "mtk.manpages@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "jejb@linux.ibm.com" , "paul.walmsley@sifive.com" , "mark.rutland@arm.com" References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Date: Tue, 27 Oct 2020 09:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.10.20 20:01, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 10:37 +0200, Mike Rapoport wrote: >> +++ b/arch/x86/mm/pat/set_memory.c >> @@ -2184,14 +2184,14 @@ static int __set_pages_np(struct page *page, >> int numpages) >> return __change_page_attr_set_clr(&cpa, 0); >> } >> >> -int set_direct_map_invalid_noflush(struct page *page) >> +int set_direct_map_invalid_noflush(struct page *page, int numpages) >> { >> - return __set_pages_np(page, 1); >> + return __set_pages_np(page, numpages); >> } >> >> -int set_direct_map_default_noflush(struct page *page) >> +int set_direct_map_default_noflush(struct page *page, int numpages) >> { >> - return __set_pages_p(page, 1); >> + return __set_pages_p(page, numpages); >> } > > Somewhat related to your other series, this could result in large NP > pages and trip up hibernate. > It feels somewhat desirable to disable hibernation once secretmem is enabled, right? Otherwise you'll be writing out your secrets to swap, where they will remain even after booting up again ... Skipping secretmem pages when hibernating is the wrong approach I guess ... -- Thanks, David / dhildenb 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 X-Spam-Level: X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82241C4363A for ; Tue, 27 Oct 2020 08:12:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F5C420878 for ; Tue, 27 Oct 2020 08:12:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z4/v3wga"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="izoUNn+I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F5C420878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+oI1jnLJHrfN5d3pMB4L3AY2EHAVTtuL6k00SPlIIuo=; b=Z4/v3wga3rYkcD643s2NXe3WI 9hhhpTcG0IdA6a4rJLoDbN4cfFjZYtdF4w1xkOFLb+6DuNsfjvp1VqUOWCiMVXy9kTxFAbORy10AN 6zTZnLADFRqL85bARVl6abMO+0II40sZ1Nl8Sk8NSOo5GvKG7mu25BUjo1N/mH88ybJbLm94j1Rgs +AEboghcznIbt60mgFsn9j+Or6RFVjmMeghhiOzUXMc5ZfpaBocJIyAXoGQv9U9+X6eQkIZFTZnoP 4++oPDX4OuVhralGNuGLsRp8YgXArJrx//ExfiQ8tIT7neCKTJdtZmp91V8ouSH9Mt9pRsYFBahmL 9Ccf1EWXA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXK60-0000DV-8G; Tue, 27 Oct 2020 08:12:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXK5y-0000CS-FE for linux-riscv@lists.infradead.org; Tue, 27 Oct 2020 08:12:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603786361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NAcngyuptikvYGGpjHccIA10XCuP57p7z320i7MuxeE=; b=izoUNn+IN3+rLS+uPI2ugr4fH+bhc/8RPUCdLmHQIEXxgvGOf/wvzyyTrPB7qcmHFQ2/9k jP0M+oSqKNyCy5F/nPCcgGu5+Edrzwpx40MNjSwx+9dsA4lbuVaukTsfGMoLisbpSEBr0C 4lEF0MXlDJeKQKu8jfH/D549QgKlgzc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-Q8AvrUgQOMaVTr9oXfijqA-1; Tue, 27 Oct 2020 04:12:38 -0400 X-MC-Unique: Q8AvrUgQOMaVTr9oXfijqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338664085; Tue, 27 Oct 2020 08:12:33 +0000 (UTC) Received: from [10.36.113.185] (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB67E5B4B3; Tue, 27 Oct 2020 08:12:24 +0000 (UTC) Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages To: "Edgecombe, Rick P" , "rppt@kernel.org" , "akpm@linux-foundation.org" References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Date: Tue, 27 Oct 2020 09:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_041242_601973_74F24873 X-CRM114-Status: GOOD ( 15.37 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "linux-kselftest@vger.kernel.org" , "hpa@zytor.com" , "linux-riscv@lists.infradead.org" , "shuah@kernel.org" , "cl@linux.com" , "Reshetova, Elena" , "linux-arch@vger.kernel.org" , "tycho@tycho.ws" , "linux-nvdimm@lists.01.org" , "will@kernel.org" , "x86@kernel.org" , "willy@infradead.org" , "rppt@linux.ibm.com" , "mingo@redhat.com" , "mtk.manpages@gmail.com" , "arnd@arndb.de" , "jejb@linux.ibm.com" , "Williams, Dan J" , "bp@alien8.de" , "viro@zeniv.linux.org.uk" , "luto@kernel.org" , "paul.walmsley@sifive.com" , "kirill@shutemov.name" , "tglx@linutronix.de" , "linux-arm-kernel@lists.infradead.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "palmer@dabbelt.com" , "linux-fsdevel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 26.10.20 20:01, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 10:37 +0200, Mike Rapoport wrote: >> +++ b/arch/x86/mm/pat/set_memory.c >> @@ -2184,14 +2184,14 @@ static int __set_pages_np(struct page *page, >> int numpages) >> return __change_page_attr_set_clr(&cpa, 0); >> } >> >> -int set_direct_map_invalid_noflush(struct page *page) >> +int set_direct_map_invalid_noflush(struct page *page, int numpages) >> { >> - return __set_pages_np(page, 1); >> + return __set_pages_np(page, numpages); >> } >> >> -int set_direct_map_default_noflush(struct page *page) >> +int set_direct_map_default_noflush(struct page *page, int numpages) >> { >> - return __set_pages_p(page, 1); >> + return __set_pages_p(page, numpages); >> } > > Somewhat related to your other series, this could result in large NP > pages and trip up hibernate. > It feels somewhat desirable to disable hibernation once secretmem is enabled, right? Otherwise you'll be writing out your secrets to swap, where they will remain even after booting up again ... Skipping secretmem pages when hibernating is the wrong approach I guess ... -- Thanks, David / dhildenb _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45AB5C56201 for ; Tue, 27 Oct 2020 08:12:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B505020790 for ; Tue, 27 Oct 2020 08:12:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Cp1perTc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B505020790 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0E33F6B005D; Tue, 27 Oct 2020 04:12:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06BBB6B0062; Tue, 27 Oct 2020 04:12:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E272E6B006E; Tue, 27 Oct 2020 04:12:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id B367B6B005D for ; Tue, 27 Oct 2020 04:12:44 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5C72A824999B for ; Tue, 27 Oct 2020 08:12:44 +0000 (UTC) X-FDA: 77416989048.16.year77_51074332727a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 3D9DB100E690B for ; Tue, 27 Oct 2020 08:12:44 +0000 (UTC) X-HE-Tag: year77_51074332727a X-Filterd-Recvd-Size: 5348 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 08:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603786363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NAcngyuptikvYGGpjHccIA10XCuP57p7z320i7MuxeE=; b=Cp1perTca7ew4Y15f97Qo81wQNADEPhZ6yXBDF3VvkfvdqAHKFpPKtIy8S6v2QyW0lx83F CFgeHJVpctAuEsaKDo9uw6F2j+3jrsoMcYdMCalgWEra+pqpDFH6rvb14DAAu6xl7P0uHo BzGGZlpcEiBUb2DtvRxgA/zaqMOsD7c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-Q8AvrUgQOMaVTr9oXfijqA-1; Tue, 27 Oct 2020 04:12:38 -0400 X-MC-Unique: Q8AvrUgQOMaVTr9oXfijqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338664085; Tue, 27 Oct 2020 08:12:33 +0000 (UTC) Received: from [10.36.113.185] (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB67E5B4B3; Tue, 27 Oct 2020 08:12:24 +0000 (UTC) Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages To: "Edgecombe, Rick P" , "rppt@kernel.org" , "akpm@linux-foundation.org" Cc: "tycho@tycho.ws" , "cl@linux.com" , "hpa@zytor.com" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "linux-kselftest@vger.kernel.org" , "dave.hansen@linux.intel.com" , "will@kernel.org" , "linux-mm@kvack.org" , "kirill@shutemov.name" , "viro@zeniv.linux.org.uk" , "rppt@linux.ibm.com" , "linux-arch@vger.kernel.org" , "Williams, Dan J" , "bp@alien8.de" , "willy@infradead.org" , "luto@kernel.org" , "arnd@arndb.de" , "shuah@kernel.org" , "tglx@linutronix.de" , "linux-nvdimm@lists.01.org" , "linux-riscv@lists.infradead.org" , "x86@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-fsdevel@vger.kernel.org" , "Reshetova, Elena" , "palmer@dabbelt.com" , "mingo@redhat.com" , "mtk.manpages@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "jejb@linux.ibm.com" , "paul.walmsley@sifive.com" , "mark.rutland@arm.com" References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Date: Tue, 27 Oct 2020 09:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 26.10.20 20:01, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 10:37 +0200, Mike Rapoport wrote: >> +++ b/arch/x86/mm/pat/set_memory.c >> @@ -2184,14 +2184,14 @@ static int __set_pages_np(struct page *page, >> int numpages) >> return __change_page_attr_set_clr(&cpa, 0); >> } >> >> -int set_direct_map_invalid_noflush(struct page *page) >> +int set_direct_map_invalid_noflush(struct page *page, int numpages) >> { >> - return __set_pages_np(page, 1); >> + return __set_pages_np(page, numpages); >> } >> >> -int set_direct_map_default_noflush(struct page *page) >> +int set_direct_map_default_noflush(struct page *page, int numpages) >> { >> - return __set_pages_p(page, 1); >> + return __set_pages_p(page, numpages); >> } > > Somewhat related to your other series, this could result in large NP > pages and trip up hibernate. > It feels somewhat desirable to disable hibernation once secretmem is enabled, right? Otherwise you'll be writing out your secrets to swap, where they will remain even after booting up again ... Skipping secretmem pages when hibernating is the wrong approach I guess ... -- Thanks, David / dhildenb 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 X-Spam-Level: X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19347C4363A for ; Tue, 27 Oct 2020 08:13:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DA3C20878 for ; Tue, 27 Oct 2020 08:13:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pCprVCO/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Cp1perTc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DA3C20878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JfTmuDwtcb65OsenU1P7P1qWVanrSqGRhdUtgDSOCqw=; b=pCprVCO/DsvNK6Hp4fMQEfXHa gGSqu6gezUCNqpqDuj/B6fSCV3ZjayjlmOUACL9n7R/EzbSjSbHZjHp0vwQTDw6kDK66oZN5NQcGj 3lJDFZvcw8WHl1ulcDb8f+h70F/D/DorvTbDrKo3lv9lbo+Z3U+mdpMpKjAOeStYQq27QEzDs3y0t jdeLEIpvd3t0nROLvklzvM6qe4gvUj1p0rvYJVEKJg7/gtX2KHFY/9xIeeGfpe56Fg2Ss8QLQg+W8 UMnrMj3W/3tyg4jj0GmClROC6s7Ap/2p/EgLbTCEVWxfI8sIpTup5vzr1lNjCMtr5lDbva3BZVxHy bM6F5WiyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXK62-0000Eb-HW; Tue, 27 Oct 2020 08:12:46 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXK5z-0000Cm-Ji for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 08:12:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603786363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NAcngyuptikvYGGpjHccIA10XCuP57p7z320i7MuxeE=; b=Cp1perTca7ew4Y15f97Qo81wQNADEPhZ6yXBDF3VvkfvdqAHKFpPKtIy8S6v2QyW0lx83F CFgeHJVpctAuEsaKDo9uw6F2j+3jrsoMcYdMCalgWEra+pqpDFH6rvb14DAAu6xl7P0uHo BzGGZlpcEiBUb2DtvRxgA/zaqMOsD7c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-Q8AvrUgQOMaVTr9oXfijqA-1; Tue, 27 Oct 2020 04:12:38 -0400 X-MC-Unique: Q8AvrUgQOMaVTr9oXfijqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338664085; Tue, 27 Oct 2020 08:12:33 +0000 (UTC) Received: from [10.36.113.185] (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB67E5B4B3; Tue, 27 Oct 2020 08:12:24 +0000 (UTC) Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages To: "Edgecombe, Rick P" , "rppt@kernel.org" , "akpm@linux-foundation.org" References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Date: Tue, 27 Oct 2020 09:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_041243_750481_C77A2979 X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "linux-kselftest@vger.kernel.org" , "hpa@zytor.com" , "linux-riscv@lists.infradead.org" , "shuah@kernel.org" , "cl@linux.com" , "Reshetova, Elena" , "linux-arch@vger.kernel.org" , "tycho@tycho.ws" , "linux-nvdimm@lists.01.org" , "will@kernel.org" , "x86@kernel.org" , "willy@infradead.org" , "rppt@linux.ibm.com" , "mingo@redhat.com" , "mtk.manpages@gmail.com" , "arnd@arndb.de" , "jejb@linux.ibm.com" , "Williams, Dan J" , "bp@alien8.de" , "viro@zeniv.linux.org.uk" , "luto@kernel.org" , "paul.walmsley@sifive.com" , "kirill@shutemov.name" , "tglx@linutronix.de" , "linux-arm-kernel@lists.infradead.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "palmer@dabbelt.com" , "linux-fsdevel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 26.10.20 20:01, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 10:37 +0200, Mike Rapoport wrote: >> +++ b/arch/x86/mm/pat/set_memory.c >> @@ -2184,14 +2184,14 @@ static int __set_pages_np(struct page *page, >> int numpages) >> return __change_page_attr_set_clr(&cpa, 0); >> } >> >> -int set_direct_map_invalid_noflush(struct page *page) >> +int set_direct_map_invalid_noflush(struct page *page, int numpages) >> { >> - return __set_pages_np(page, 1); >> + return __set_pages_np(page, numpages); >> } >> >> -int set_direct_map_default_noflush(struct page *page) >> +int set_direct_map_default_noflush(struct page *page, int numpages) >> { >> - return __set_pages_p(page, 1); >> + return __set_pages_p(page, numpages); >> } > > Somewhat related to your other series, this could result in large NP > pages and trip up hibernate. > It feels somewhat desirable to disable hibernation once secretmem is enabled, right? Otherwise you'll be writing out your secrets to swap, where they will remain even after booting up again ... Skipping secretmem pages when hibernating is the wrong approach I guess ... -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel