Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4036907pxb; Mon, 27 Sep 2021 08:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKy5TUOYkBW8j4AY2EEcMrVEcJEzyKmAl0RNZwXhzqjONv5hbbaTnPJ00+4CrJtNeZrWz/ X-Received: by 2002:a17:90b:3a90:: with SMTP id om16mr20469595pjb.194.1632755204052; Mon, 27 Sep 2021 08:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632755204; cv=none; d=google.com; s=arc-20160816; b=PUPO0GPSOTjNHZOWXyyIK41cx2WJ/6lXMmsvFtTWzavxgWqzR7dXa8NC1gOMar4geG NuOEfC0fCvaJci+WA46Pb87yhNt17jRYr3D7WlwnLZ3rUbnzIyNymMw5iN4Jim1+e3ue 0TO/EK3RpmkBW3dxM4Tsp6iBVk4szGIJsUTALAYwGQQ1x4MPgncraN9rGCSZWnwvohaK hRbGMh1Vuv6vmDEVnoIgeofCJdmLbpqrj8LwuhTxDGWKHMoYARTwoQpIdg0LTT/rWmix qIdgIjbP/7qrc10BetglpkGi2gR74ZgmBnTAjEvEjRxBowUo3bAZ1l7BwlbU6oX5yFAN ajaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=C3epFIds1GdiZHzRVp8oQ/YE01ZWNz++UB0u9toC/UY=; b=w/YXbzryveWc0SV5DJahWRljaxqT7MWjaP80iAWBfrEYQZJOrazgXjkYX877DOM/B/ zycHXHgV3NIXE4YMTUBmczmtwhvYDnCkPmYx17b5V9PB+BVQlnfne3zsYDDSOz0owP5w YewPj21D5MxqSBpPQuB7rpdK6R0UGoZja4pdRYy7CSfUsOy7EchA3HBnclvm/HlLhpni 8fj6ysjJzZrwBy9eBpS4dNaEUjhP7lRlSn2QPsOyxIWOZ0cIi9MUe4g7fKwpESccRhFF rXbwA5OBhtjA1+jUPahx7f2dfIOWm3/qcKQSEHkuT2fJ58ZzKqCSkKg7+pGFBdhgGmML w79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iUNNZRsQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si10957586plj.53.2021.09.27.08.06.31; Mon, 27 Sep 2021 08:06:44 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=iUNNZRsQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234816AbhI0PHU (ORCPT + 99 others); Mon, 27 Sep 2021 11:07:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24599 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234832AbhI0PHT (ORCPT ); Mon, 27 Sep 2021 11:07:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632755141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=C3epFIds1GdiZHzRVp8oQ/YE01ZWNz++UB0u9toC/UY=; b=iUNNZRsQsH+gbJ0cHC14zkRNjy5qXajHBNvOSxvk74j9Nqhv03vCo3Mdv8/boM7fhb5715 HSaX5PC1kihgoAQuqB9AU/9ttDw6NRAxfWZJxFnBHjPj7w0zajIFjE0GQGR1I+Dba6H5vd eg/MpslAJjWhsL7TwH4/oXzvzFJ2+9E= 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-598-wESedMfYNS2jvH245K4Uwg-1; Mon, 27 Sep 2021 11:05:39 -0400 X-MC-Unique: wESedMfYNS2jvH245K4Uwg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98FCA100C612; Mon, 27 Sep 2021 15:05:36 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7320860C13; Mon, 27 Sep 2021 15:05:19 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Mike Rapoport , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org Subject: [PATCH v1 0/4] mm/memory_hotplug: full support for Date: Mon, 27 Sep 2021 17:05:14 +0200 Message-Id: <20210927150518.8607-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Architectures that require CONFIG_ARCH_KEEP_MEMBLOCK=y, such as arm64, don't cleanly support add_memory_driver_managed() yet. Most prominently, kexec_file can still end up placing images on such driver-managed memory, resulting in undesired behavior. Teaching kexec to not place images on driver-managed memory is especially relevant for virtio-mem. Details can be found in commit 7b7b27214bba ("mm/memory_hotplug: introduce add_memory_driver_managed()"). Extend memblock with a new flag and set it from memory hotplug code when applicable. This is required to fully support virtio-mem on arm64, making also kexec_file behave like on x86-64. Alternative A: Extend kexec_walk_memblock() to consult the kernel resource tree whether IORESOURCE_SYSRAM_DRIVER_MANAGED is set. This feels wrong, because the goal was to rely on memblock and not the resource tree. Alternative B: Reuse MEMBLOCK_HOTPLUG. MEMBLOCK_HOTPLUG serves a different purpose, though. Cc: Andrew Morton Cc: Mike Rapoport Cc: Michal Hocko Cc: Oscar Salvador Cc: Jianyong Wu Cc: Aneesh Kumar K.V Cc: Vineet Gupta Cc: Geert Uytterhoeven Cc: Huacai Chen Cc: Jiaxun Yang Cc: Thomas Bogendoerfer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Eric Biederman Cc: Arnd Bergmann Cc: linux-snps-arc@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-mips@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linux-mm@kvack.org Cc: kexec@lists.infradead.org David Hildenbrand (4): mm/memory_hotplug: handle memblock_add_node() failures in add_memory_resource() memblock: allow to specify flags with memblock_add_node() memblock: add MEMBLOCK_DRIVER_MANAGED to mimic IORESOURCE_SYSRAM_DRIVER_MANAGED mm/memory_hotplug: indicate MEMBLOCK_DRIVER_MANAGED with IORESOURCE_SYSRAM_DRIVER_MANAGED arch/arc/mm/init.c | 4 ++-- arch/ia64/mm/contig.c | 2 +- arch/ia64/mm/init.c | 2 +- arch/m68k/mm/mcfmmu.c | 3 ++- arch/m68k/mm/motorola.c | 6 ++++-- arch/mips/loongson64/init.c | 4 +++- arch/mips/sgi-ip27/ip27-memory.c | 3 ++- arch/s390/kernel/setup.c | 3 ++- include/linux/memblock.h | 19 ++++++++++++++++--- include/linux/mm.h | 2 +- kernel/kexec_file.c | 5 +++++ mm/memblock.c | 13 +++++++++---- mm/memory_hotplug.c | 11 +++++++++-- 13 files changed, 57 insertions(+), 20 deletions(-) base-commit: 5816b3e6577eaa676ceb00a848f0fd65fe2adc29 -- 2.31.1