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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9506DC55179 for ; Tue, 27 Oct 2020 09:49:03 +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 232DA21D24 for ; Tue, 27 Oct 2020 09:49:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="li/s39XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 232DA21D24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 9346F16411159; Tue, 27 Oct 2020 02:49:02 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=rppt@kernel.org; receiver= Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 361AD161C5249 for ; Tue, 27 Oct 2020 02:49:01 -0700 (PDT) Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7CAF20759; Tue, 27 Oct 2020 09:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792140; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=li/s39XFgB24jJSUCjqf8zNKcx6M9bh+uU6phnSX6LJCJRBegjZ0SOdTEugjflO1e WgquGhsCXXsZ3V2YD7JRAQc2nfgUEjBNCSoKoM6GZx5SGcpgMkSqE8zAapjDeCrodZ Fc2zbcZd41+mXwuTSqYXiceoEMKXjGqiG53f7j/s= Date: Tue, 27 Oct 2020 11:48:45 +0200 From: Mike Rapoport To: David Hildenbrand Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages Message-ID: <20201027094845.GJ1154158@kernel.org> References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Message-ID-Hash: PZXDW5K5O3D47MAGXOJNM7PLFCH2VY64 X-Message-ID-Hash: PZXDW5K5O3D47MAGXOJNM7PLFCH2VY64 X-MailFrom: rppt@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Edgecombe, Rick P" , "akpm@linux-foundation.org" , "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 Tue, Oct 27, 2020 at 09:12:23AM +0100, David Hildenbrand wrote: > 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 ... Completely agree. I'll look into preventing hibernation from touching secretmem. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike. _______________________________________________ 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 469B3C5DF9D for ; Tue, 27 Oct 2020 09:49:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E832F21D24 for ; Tue, 27 Oct 2020 09:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792144; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=PyAcT5UBCX4CtYYDfGjY3WfE+N3Z0Fq4KJ7f/XNgQr9el6CAMR773CQGNtAHgpRD4 4n4jW9c/T4j4XSz8w6SleBdEVcHB3YzSaNYaoigT2OpGd3tHGm1/mzj0seW8oXS2Xy GV/r04k/AboyG+l/LQEwQmhp3/X+wb7s/SmAayO8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895965AbgJ0JtC (ORCPT ); Tue, 27 Oct 2020 05:49:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:40918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895946AbgJ0JtB (ORCPT ); Tue, 27 Oct 2020 05:49:01 -0400 Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7CAF20759; Tue, 27 Oct 2020 09:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792140; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=li/s39XFgB24jJSUCjqf8zNKcx6M9bh+uU6phnSX6LJCJRBegjZ0SOdTEugjflO1e WgquGhsCXXsZ3V2YD7JRAQc2nfgUEjBNCSoKoM6GZx5SGcpgMkSqE8zAapjDeCrodZ Fc2zbcZd41+mXwuTSqYXiceoEMKXjGqiG53f7j/s= Date: Tue, 27 Oct 2020 11:48:45 +0200 From: Mike Rapoport To: David Hildenbrand Cc: "Edgecombe, Rick P" , "akpm@linux-foundation.org" , "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" Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages Message-ID: <20201027094845.GJ1154158@kernel.org> References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 09:12:23AM +0100, David Hildenbrand wrote: > 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 ... Completely agree. I'll look into preventing hibernation from touching secretmem. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike. 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 9D4FEC4363A for ; Tue, 27 Oct 2020 09:49:18 +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 293462225C for ; Tue, 27 Oct 2020 09:49: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="HlhDiAKf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="li/s39XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 293462225C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pQESv38fdhLefXghkhg91+8kWyYpQfkGnI9ZFCaCeuM=; b=HlhDiAKf2STMg0PjO87xnVWS9 f3D4vnvaEvAvwpEUcRRpLZTKoge/YHCJ36K+AdB2uPGdHbU86WEc3vPuo+SnIvMKI6Y/n2G/eKJHU vZ9VMOYCfPoof9PF3wfzS2TFJLcF/k7UJ1YT+3/6aORwLTdfZQ27Lssg4ehe0JXYe1OC/v18UF8kT 5bU2kgrB7l047R0XesuSmolib9v5pWjMESESwPFj5NRTyzzyYetganCa2bZPmPqX/v9yF3qzuVjGU EXXoQnq/sv/xUnonASpAIKwTXRE8tBNXel8p5pNpu35D04fIGeOrAmiiVUrvuf1J2miIaiYRDAp2T HSQxjj3Aw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLbJ-00069r-SG; Tue, 27 Oct 2020 09:49:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLbB-00065s-IJ; Tue, 27 Oct 2020 09:49:04 +0000 Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7CAF20759; Tue, 27 Oct 2020 09:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792140; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=li/s39XFgB24jJSUCjqf8zNKcx6M9bh+uU6phnSX6LJCJRBegjZ0SOdTEugjflO1e WgquGhsCXXsZ3V2YD7JRAQc2nfgUEjBNCSoKoM6GZx5SGcpgMkSqE8zAapjDeCrodZ Fc2zbcZd41+mXwuTSqYXiceoEMKXjGqiG53f7j/s= Date: Tue, 27 Oct 2020 11:48:45 +0200 From: Mike Rapoport To: David Hildenbrand Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages Message-ID: <20201027094845.GJ1154158@kernel.org> References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_054901_880693_3D4CF41A X-CRM114-Status: GOOD ( 17.30 ) 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" , "cl@linux.com" , "shuah@kernel.org" , "Williams, Dan J" , "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" , "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" , "linux-riscv@lists.infradead.org" , "palmer@dabbelt.com" , "linux-fsdevel@vger.kernel.org" , "akpm@linux-foundation.org" , "Edgecombe, Rick P" 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 Tue, Oct 27, 2020 at 09:12:23AM +0100, David Hildenbrand wrote: > 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 ... Completely agree. I'll look into preventing hibernation from touching secretmem. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike. _______________________________________________ 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 EFF43C4363A for ; Tue, 27 Oct 2020 09:49:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C6DB22283 for ; Tue, 27 Oct 2020 09:49:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="li/s39XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C6DB22283 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4786E6B005C; Tue, 27 Oct 2020 05:49:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DA236B005D; Tue, 27 Oct 2020 05:49:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 256006B0062; Tue, 27 Oct 2020 05:49:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id E90A96B005C for ; Tue, 27 Oct 2020 05:49:02 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7570C181AC9B6 for ; Tue, 27 Oct 2020 09:49:02 +0000 (UTC) X-FDA: 77417231724.18.hose32_22027bd2727b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 55CCA100ED0FE for ; Tue, 27 Oct 2020 09:49:02 +0000 (UTC) X-HE-Tag: hose32_22027bd2727b X-Filterd-Recvd-Size: 4750 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 09:49:01 +0000 (UTC) Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7CAF20759; Tue, 27 Oct 2020 09:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792140; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=li/s39XFgB24jJSUCjqf8zNKcx6M9bh+uU6phnSX6LJCJRBegjZ0SOdTEugjflO1e WgquGhsCXXsZ3V2YD7JRAQc2nfgUEjBNCSoKoM6GZx5SGcpgMkSqE8zAapjDeCrodZ Fc2zbcZd41+mXwuTSqYXiceoEMKXjGqiG53f7j/s= Date: Tue, 27 Oct 2020 11:48:45 +0200 From: Mike Rapoport To: David Hildenbrand Cc: "Edgecombe, Rick P" , "akpm@linux-foundation.org" , "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" Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages Message-ID: <20201027094845.GJ1154158@kernel.org> References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> 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 Tue, Oct 27, 2020 at 09:12:23AM +0100, David Hildenbrand wrote: > 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 ... Completely agree. I'll look into preventing hibernation from touching secretmem. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike. 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 0B306C4363A for ; Tue, 27 Oct 2020 09:49:33 +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 90BB420759 for ; Tue, 27 Oct 2020 09:49:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d0lQEijh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="li/s39XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90BB420759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t0zwVucyWv3et6S35Talsz58THQfQ6PpffNItwI3988=; b=d0lQEijh2QGEs0hxAaUnF4kh0 Nyys3kzlUWKhkXKphNoS80Q7ltcz+nIH83rNJGubuTSOR4JLSnKBsRRhDXJrT0NH2quRND2FI6CQC bcaWF7jpSiZ4Z0kQ0qIgboG8jPF4YxeFnhl4V10Jrdvj2olFf/D8iDqrSbsInc84SFlG+rAHPzezh Wemnx6wxop1FoE91F3cmfq9SqjauyhkTX59uzK50tEq6TLklIhsNbZf6RSYxEBFnluWhaDmW9efw9 QAKeC8tP+rL8W+CAzmrz67YsQCP++mXG6wvjMhIuiEzgg7OwAfM1TFOs4PN1AsfCd+Yjv+P9wc7EQ QlALUWaoA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLbH-00068e-2A; Tue, 27 Oct 2020 09:49:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLbB-00065s-IJ; Tue, 27 Oct 2020 09:49:04 +0000 Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7CAF20759; Tue, 27 Oct 2020 09:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603792140; bh=wcj6sqvr10YA2nIxp8QFswfSebjeDskPYpJl+9Hjv5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=li/s39XFgB24jJSUCjqf8zNKcx6M9bh+uU6phnSX6LJCJRBegjZ0SOdTEugjflO1e WgquGhsCXXsZ3V2YD7JRAQc2nfgUEjBNCSoKoM6GZx5SGcpgMkSqE8zAapjDeCrodZ Fc2zbcZd41+mXwuTSqYXiceoEMKXjGqiG53f7j/s= Date: Tue, 27 Oct 2020 11:48:45 +0200 From: Mike Rapoport To: David Hildenbrand Subject: Re: [PATCH v7 3/7] set_memory: allow set_direct_map_*_noflush() for multiple pages Message-ID: <20201027094845.GJ1154158@kernel.org> References: <20201026083752.13267-1-rppt@kernel.org> <20201026083752.13267-4-rppt@kernel.org> <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9202c4c1-9f1f-175f-0a85-fc8c30bc5e3b@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_054901_880693_3D4CF41A X-CRM114-Status: GOOD ( 17.30 ) 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" , "cl@linux.com" , "shuah@kernel.org" , "Williams, Dan J" , "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" , "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" , "linux-riscv@lists.infradead.org" , "palmer@dabbelt.com" , "linux-fsdevel@vger.kernel.org" , "akpm@linux-foundation.org" , "Edgecombe, Rick P" 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 Tue, Oct 27, 2020 at 09:12:23AM +0100, David Hildenbrand wrote: > 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 ... Completely agree. I'll look into preventing hibernation from touching secretmem. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel