From patchwork Fri Oct 25 14:14:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13850769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13FC1D0C615 for ; Fri, 25 Oct 2024 14:16:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C30A6B00A3; Fri, 25 Oct 2024 10:16:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 973436B00A4; Fri, 25 Oct 2024 10:16:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83B1B6B00A5; Fri, 25 Oct 2024 10:16:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5CD9A6B00A3 for ; Fri, 25 Oct 2024 10:16:09 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6D91EA0C24 for ; Fri, 25 Oct 2024 14:15:33 +0000 (UTC) X-FDA: 82712323302.25.1171CF2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id B6F601C0019 for ; Fri, 25 Oct 2024 14:15:58 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C9r6rA0a; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729865714; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RqrSCL9SnqQxdMhiUeTqL0vv0HNcmyIpWy8EeAUhBAs=; b=4SmCbiQ2+za7ulTXxSf7ieHzBBpsTxfn1RiYFCYTbyTnQPeS2WepGKryxF9IXaMxUIUv8u bjeQqR8Er5cnFPl4KFVgRsxU2zx3vG8WgfGk9ryNnd/SydWVArK5EZEoA8Y6qbSxS2Cu7D t1mhfxm6k3vxLbMnyO1I63HW9bJhPoA= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C9r6rA0a; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729865714; a=rsa-sha256; cv=none; b=Z572+f35Td2JglTY+y5HnW8KQfb07DIzmQiLRSeHR4sBrAsl8eKkNI8riMLCdWYKZpqFg/ FKUWzBHXd6zr4uVdbLAsJ2sfORIoM+97rNJEFdC1utIiAhYysxihgM8sCPXJwnW/zGC31J qtY/nPDMRXxjIdb4UkLQIIKIdVzgMBo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729865766; 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: in-reply-to:in-reply-to:references:references; bh=RqrSCL9SnqQxdMhiUeTqL0vv0HNcmyIpWy8EeAUhBAs=; b=C9r6rA0aoWWpbjb8Ba3OVDYB0V8tBX+mamaKMmGG9SDO87KpbGMXUxNh28nH+RHcTd3ZZQ xPp8HH6K72/NXBIVqtFg9kk3IvXR6k/tqODMQPv0woV0dP4Kxd47fH2FTsjf/ge8sdEKrB qVauuuVoXGvRUZFCO98eeCum4rkHNXU= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-378-QVg6coorOeq0mXJ05YLkIw-1; Fri, 25 Oct 2024 10:16:03 -0400 X-MC-Unique: QVg6coorOeq0mXJ05YLkIw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6CF7E1955F3F; Fri, 25 Oct 2024 14:15:58 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.22.65.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2459119560A2; Fri, 25 Oct 2024 14:15:50 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, virtualization@lists.linux.dev, linux-doc@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Huth , Cornelia Huck , Janosch Frank , Claudio Imbrenda , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Eric Farman , Andrew Morton , Jonathan Corbet Subject: [PATCH v3 7/7] s390/sparsemem: provide memory_add_physaddr_to_nid() with CONFIG_NUMA Date: Fri, 25 Oct 2024 16:14:52 +0200 Message-ID: <20241025141453.1210600-8-david@redhat.com> In-Reply-To: <20241025141453.1210600-1-david@redhat.com> References: <20241025141453.1210600-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspam-User: X-Stat-Signature: i4rpotr3ixztq5q3fw8dpf6j7q44csq7 X-Rspamd-Queue-Id: B6F601C0019 X-Rspamd-Server: rspam11 X-HE-Tag: 1729865758-871761 X-HE-Meta: U2FsdGVkX192sdvdpx7+Qnejcv3NfblGLQomDDnd4FY41EnAVRABHPnYfRmL12FmXLgIiVi7hOh/ZK2075yy0OvzYxjptqpOj5HN82HsrxfNL6va4dRGNLj4tMyD7n0wg/ZIj0/6xhlvFqX/3K2qykOsiTfSItrviKhVIN6Y6SsGQAXGwLLFWWYLVNAQah5USbhrN4xGqLBSSQNDCETnsg6d22axOv53XPhPXadAWnDMmQ9xLHyNu9yGtTrX6/cKKrAIHA5qT5YQ49MrX2r95z0MqEH90w2MBW6OxLUDAs8B0Xvf54UTH6AxNTCOqNMu0GmdF5eoR+NX144f3GvmAANnGMlmAlEDUTdMVOj4dpq7XxL/WwcBscr45i9DdSSNes8vpykw/U9slxAJPuFCmKEmMQgRDyDGIhTv2Vrfj2232LeH+93iJWtAvKlDBnUHtFPnQu7LV+JH8GYMtwgj3AC5E48M/q/5NE3UtI691dwqXMV3aD3eCwZU34S2oxuv9OmXdgBOmA7mOCuFDuN5Sh7V7vARs7cTW7uPndasCm53RdBH909fgnCeOICV4pxk40vik/51reAMeo6Oiw/kvF2SzlA5DlBT4n6Jz4LkGMgmCHUp6REzObzvUV12eHE2cEH7Diks/b0Ac1Difg/xjqTYkCT3RAcCFDn9+ndCzQ4J6P+OAucQXF6Jm/oZeRNf6u3mipJBfEpF+qmt0LpOXRouNGCUs3/K/RaYmVPC4nhfjIN/mncusJbbjYwXmuZl8QQgsIC1BvpfGg+xn+uZFd5S6ek54eUCkALs8unmEm5b9f+UFILBCqtbAPhoY8VSH5DK4kmFyzzMbR/BjkAMoon9TGlIM/JSSi42xzzUlLWFC0+OD1btXFYksrEMcuFVABLpJYW2EdPQOaWI+QwteNO31PVlQBgl/4Og2cP00t5GqVD/30TwajYFogZzGr3/Xgrf59OKwUCGBeduYAa xW0CuvEn rLlZiVql5KkjDID/fYo/0IXjfblsW101H2eA0dcLat3nwM1oPiA6V8NpCugOk81JHBU1xjPINoC2Pb+v15pb/G76BuIPu16I2LbtSFbWrYZrsGxmT2vf7EToXwhkQ2jb1t5/IJ+W94Mmfuid0DWaOQb0mCycWmrURb8Hzc7vQz9M6Nnwci3YN2dT3JUYv73Y9hmKBAr04DimGEWML1c632/iY/WXClBOkS7ot+EMMVTExmzC1lI6fu/+YVPMBt0X2ImNVJ4XPWQNPxEvmowbXTYc4xZdwErB+GK8885MWOQ824PO0sL9k0arJmlDVhl1wFJdYWM+a8aWyZtNJJ4TQYu4TuqS0O6o04pZcQ9KNLOe3TeUz0hmC6wwVHg== 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: List-Subscribe: List-Unsubscribe: virtio-mem uses memory_add_physaddr_to_nid() to determine the NID to use for memory it adds. We currently fallback to the dummy implementation in mm/numa.c with CONFIG_NUMA, which will end up triggering an undesired pr_info_once(): Unknown online node for memory at 0x100000000, assuming node 0 On s390, we map all cpus and memory to node 0, so let's add a simple memory_add_physaddr_to_nid() implementation that does exactly that, but without complaining. Signed-off-by: David Hildenbrand Reviewed-by: Heiko Carstens --- arch/s390/include/asm/sparsemem.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/s390/include/asm/sparsemem.h b/arch/s390/include/asm/sparsemem.h index ff628c50afac..6377b7ea8a40 100644 --- a/arch/s390/include/asm/sparsemem.h +++ b/arch/s390/include/asm/sparsemem.h @@ -5,4 +5,12 @@ #define SECTION_SIZE_BITS 27 #define MAX_PHYSMEM_BITS CONFIG_MAX_PHYSMEM_BITS +#ifdef CONFIG_NUMA +static inline int memory_add_physaddr_to_nid(u64 addr) +{ + return 0; +} +#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid +#endif /* CONFIG_NUMA */ + #endif /* _ASM_S390_SPARSEMEM_H */