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=-5.5 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 730D9C55178 for ; Thu, 29 Oct 2020 08:16:29 +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 F2EB920720 for ; Thu, 29 Oct 2020 08:16:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tOtcHLPh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ay06rFUM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2EB920720 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-Type: Content-Transfer-Encoding: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=J48Az6EZ7V+QQuvysUmTgm92bn8GNxw8tiFs6ecWRpI=; b=tOtcHLPhGLExd8iD3dMFZSmJz lgvH1W/EuMEZiQI1g36EKGhIS65ezVCR4KLeLW9WL3rM8p0foAMFnfYsPw1HOznGxtasEzvk1eRDj PzmMqUIQYMBBjF5rcDvxSVrs8UKpHbeswUSPrjMWv+DtXX6zDl09BeFtYCwkgzSxbJtdS0nz1NGqK ycXraoTZ1H6RUgQGjkUdy+pkfQhy/FQ5jNDigPrO7t3o3StUbJdruKUm8koNiSu5mz97WiHmeVRoy 8wEOUjwcXkIRBY/juPmP6SXBFxj8BR5i/o99O1BZ1F28Z7STKkwE0CsyBLC2fikbbkDsasqG6l79F 00b4Vb6Ow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY36X-0006Tc-68; Thu, 29 Oct 2020 08:16:17 +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 1kY36O-0006QG-7z for linux-riscv@lists.infradead.org; Thu, 29 Oct 2020 08:16:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603959367; 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=2gRwEwp+09CxPY3cDDGs5AqZnz2L4R+qK1xrKBZP/ZQ=; b=ay06rFUMq495NziQvvXEmjfl27QqLzDhX+fa4jGpMV7iYUr5G+e63O1tBDFA9Ul5oLop5C a8/TWffcMSMt6xjNKzy/qVY40B4oOUr4YUDs597pgypjwNsoZinHd7ELIVZ9qacTMV1TPn dllYntmtt8eAzvq8drrXaCf8X0MpNOc= 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-521-GwWoSv2-OMqDqihE-45P3g-1; Thu, 29 Oct 2020 04:16:02 -0400 X-MC-Unique: GwWoSv2-OMqDqihE-45P3g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5ED20809DC9; Thu, 29 Oct 2020 08:15:57 +0000 (UTC) Received: from [10.36.112.181] (ovpn-112-181.ams2.redhat.com [10.36.112.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EBE05D9CC; Thu, 29 Oct 2020 08:15:48 +0000 (UTC) Subject: Re: [PATCH 0/4] arch, mm: improve robustness of direct map manipulation To: Mike Rapoport , Andrew Morton References: <20201025101555.3057-1-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <30075bb8-caed-c4de-c09e-e0f6fb964a8d@redhat.com> Date: Thu, 29 Oct 2020 09:15:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20201025101555.3057-1-rppt@kernel.org> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201029_041608_345217_5DBA49FC X-CRM114-Status: GOOD ( 21.96 ) 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: Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , linux-mm@kvack.org, Paul Mackerras , Pavel Machek , "H. Peter Anvin" , sparclinux@vger.kernel.org, Christoph Lameter , Will Deacon , linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Michael Ellerman , x86@kernel.org, Mike Rapoport , Christian Borntraeger , Ingo Molnar , Catalin Marinas , Len Brown , Albert Ou , Vasily Gorbik , linux-pm@vger.kernel.org, Heiko Carstens , David Rientjes , Borislav Petkov , Andy Lutomirski , Paul Walmsley , "Kirill A. Shutemov" , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Pekka Enberg , Palmer Dabbelt , Joonsoo Kim , "Edgecombe, Rick P" , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 25.10.20 11:15, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > During recent discussion about KVM protected memory, David raised a concern > about usage of __kernel_map_pages() outside of DEBUG_PAGEALLOC scope [1]. > > Indeed, for architectures that define CONFIG_ARCH_HAS_SET_DIRECT_MAP it is > possible that __kernel_map_pages() would fail, but since this function is > void, the failure will go unnoticed. > > Moreover, there's lack of consistency of __kernel_map_pages() semantics > across architectures as some guard this function with > #ifdef DEBUG_PAGEALLOC, some refuse to update the direct map if page > allocation debugging is disabled at run time and some allow modifying the > direct map regardless of DEBUG_PAGEALLOC settings. > > This set straightens this out by restoring dependency of > __kernel_map_pages() on DEBUG_PAGEALLOC and updating the call sites > accordingly. > So, I was primarily wondering if we really have to touch direct mappings in hibernation code, or if we can avoid doing that. I was wondering if we cannot simply do something like kmap() when trying to access a !mapped page. Similar to reading old-os memory after kexec when in kdump. Just a thought. -- Thanks, David / dhildenb _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv