Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3393497ybp; Sun, 6 Oct 2019 10:58:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIqR0RegYi32koyuB8flCucXQ9ozTOzTqlWCVoapQ2EwLQDzXFyrtnRYvYISWQM09MvXkZ X-Received: by 2002:a50:a5f8:: with SMTP id b53mr25475327edc.39.1570384686481; Sun, 06 Oct 2019 10:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384686; cv=none; d=google.com; s=arc-20160816; b=mtIak8Aa1GpGMbDsbQudaZTufwaE6iJp9bv9HfrLHhAPHndvQfIOHh3ujOJnNC6WA0 E8sx5xciWI758TBwjXH4z1tMhvlkrnfK4xPgTY0HOwJlRKnCX3UduLooCRoF+/2/jVoE e3yw4br/Xt38XyFiizuZtIun8K9QyDlwZqsenXU5wGnlnCQJrSnPzeUWCndey1isq1Lg s5MBgU8nqJsB9f9nzu43fFbyVUwyIHnOzTZ2/K99ycy1qZPjyN8Qz2P3F1Fb8sEH6u+i pWLW6jtMADG8buXnarp5xJ07VYxgn8Ue6jiWCq60XqPhBDmI8dKivq2Vby5YkrioR3dj Bq2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=krH33cv99wG90Fk0b0ZMgsL+JXcz1U3XYOB1Ot1/o4k=; b=HVwViQ37/dPggpwKEB7u+uzpc+io5TeY4txsXK1LD0QgegmPP+Mi25oVe2gFqbfR9w /NNfpgDdgq2qVfAo6JyNlKvZCdhXuJIX7kBxaKMPXQMjFPf92eWN+hVxA+tBRJd+cXH/ +Ww5d93BiQUgWhDZRetjlrt9Zmg1gnoeRQWAmM4gBx9FhFRLhXUTWm9U5KRpLGPnW1gu OEF6IpbvL4NviBYWv0iokf3YNsfMNuEdz2KBKE4k5TGjVvYZ70IB8nCzSigRDOOJisNh j/B+0maqEvk0rBxtESpoUjHkUUuzcs+IC1+NHosf4SdASndjPDE6SyBQohfUHdQn4wec x8RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rW0t0iBu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si7635429edc.291.2019.10.06.10.57.42; Sun, 06 Oct 2019 10:58:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rW0t0iBu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730059AbfJFRfO (ORCPT + 99 others); Sun, 6 Oct 2019 13:35:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbfJFRfL (ORCPT ); Sun, 6 Oct 2019 13:35:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D144C20700; Sun, 6 Oct 2019 17:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383311; bh=ZrLi2JF1gXBIO8UjLt7eus8vyU6RSKJMJP9EwGTXIH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rW0t0iBuHqpJNgpdaCF5SWffOaFhQrVfNq1gQvNF8AlNsZAfyTV5zWT6IZ7EklbLc +bnT2MF2Htgye8kYsEuuAqWAaZT+Gs/Z56VAGnQYZlX8W9kqX3hJ0RdmE+UdhBfXCJ 197iCi2x9nUZD+lgnoMYxWkqFk4vDiUyHcAy/d/M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , "Aneesh Kumar K.V" , Michael Ellerman , Sasha Levin Subject: [PATCH 5.2 057/137] powerpc/64s/radix: Fix memory hotplug section page table creation Date: Sun, 6 Oct 2019 19:20:41 +0200 Message-Id: <20191006171213.394418830@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Piggin [ Upstream commit 8f51e3929470942e6a8744061254fdeef646cd36 ] create_physical_mapping expects physical addresses, but creating and splitting these mappings after boot is supplying virtual (effective) addresses. This can be irritated by booting with mem= to limit memory then probing an unused physical memory range: echo > /sys/devices/system/memory/probe This mostly works by accident, firstly because __va(__va(x)) == __va(x) so the virtual address does not get corrupted. Secondly because pfn_pte masks out the upper bits of the pfn beyond the physical address limit, so a pfn constructed with a 0xc000000000000000 virtual linear address will be masked back to the correct physical address in the pte. Fixes: 6cc27341b21a8 ("powerpc/mm: add radix__create_section_mapping()") Signed-off-by: Nicholas Piggin Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190724084638.24982-1-npiggin@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 8deb432c29754..2b6cc823046a3 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -901,7 +901,7 @@ int __meminit radix__create_section_mapping(unsigned long start, unsigned long e return -1; } - return create_physical_mapping(start, end, nid); + return create_physical_mapping(__pa(start), __pa(end), nid); } int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end) -- 2.20.1