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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 67B36C2D0E4 for ; Tue, 17 Nov 2020 19:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BE3B2465E for ; Tue, 17 Nov 2020 19:45:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uzOYWmAF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730198AbgKQTpH (ORCPT ); Tue, 17 Nov 2020 14:45:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:55836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbgKQTpG (ORCPT ); Tue, 17 Nov 2020 14:45:06 -0500 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D93CA24654; Tue, 17 Nov 2020 19:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605642306; bh=qNozKMsilVGHcKuDFqYgNc1oR4jJ69WTtekuHemKsA4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uzOYWmAFsp5u8A1goye7laB+uln8gqXV99XauIwSEYwYTGXnrkndJ1sdA0QPbsHW/ uXFPVcvnzkLe+GYCOMvNnDStRP9jwZYNOFkt+AwKP1ltA3sG4bxugT2gpWZQD9Krqq 7zwau8mE4xSeZENQKfIlP12S23rRKNZejLI/7ECQ= Received: by mail-ot1-f52.google.com with SMTP id a15so20644085otf.5; Tue, 17 Nov 2020 11:45:05 -0800 (PST) X-Gm-Message-State: AOAM5326K/lD+bUu0rZXSicp8roCoOvGJGIWq/L/L6aMsWuVHJNWs9DA UVPV6DhTCQZhkIOKRcpSoDzegIK1SfXcWlGQBQ== X-Google-Smtp-Source: ABdhPJw7Y8/Ws5bUvi26+LLUZzk81vYwcXh6i4hVHe44wC1JXmPPzqpT+2F4tA2/k2KaDRk1Kh11f9DUxexOONIhShQ= X-Received: by 2002:a05:6830:2259:: with SMTP id t25mr4284277otd.192.1605642305060; Tue, 17 Nov 2020 11:45:05 -0800 (PST) MIME-Version: 1.0 References: <20201117181607.1761516-1-qperret@google.com> <20201117181607.1761516-16-qperret@google.com> In-Reply-To: <20201117181607.1761516-16-qperret@google.com> From: Rob Herring Date: Tue, 17 Nov 2020 13:44:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 15/27] of/fdt: Introduce early_init_dt_add_memory_hyp() To: Quentin Perret Cc: Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Frank Rowand , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , open list , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Android Kernel Team , android-kvm@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 12:16 PM Quentin Perret wrote: > > Introduce early_init_dt_add_memory_hyp() to allow KVM to conserve a copy > of the memory regions parsed from DT. This will be needed in the context > of the protected nVHE feature of KVM/arm64 where the code running at EL2 > will be cleanly separated from the host kernel during boot, and will > need its own representation of memory. > > Signed-off-by: Quentin Perret > --- > drivers/of/fdt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 4602e467ca8b..af2b5a09c5b4 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -1099,6 +1099,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) > #endif > > +void __init __weak early_init_dt_add_memory_hyp(u64 base, u64 size) > +{ > +} > + > void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > { > const u64 phys_offset = MIN_MEMBLOCK_ADDR; > @@ -1139,6 +1143,7 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > base = phys_offset; > } > memblock_add(base, size); > + early_init_dt_add_memory_hyp(base, size); Can this be done right after we add all the memblocks using the memblock API? I thought EFI would also need to be handled, but looks like it just calls early_init_dt_add_memory_arch(). That's odd especially for ACPI systems... I don't really like putting what looks like an arm64 only hook here, but then I don't want an arm64 version of early_init_dt_add_memory_arch() either. We're almost to the point of getting rid of the arch specific ones. But I don't have a better suggestion currently. Rob 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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 DBDC6C63777 for ; Wed, 18 Nov 2020 10:39:26 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 2BBF420782 for ; Wed, 18 Nov 2020 10:39:25 +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="uzOYWmAF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BBF420782 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3E64A4B5AD; Wed, 18 Nov 2020 05:39:25 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t3QQVNomoDuW; Wed, 18 Nov 2020 05:39:24 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2FD2F4B79D; Wed, 18 Nov 2020 05:39:24 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 49FF44B759 for ; Tue, 17 Nov 2020 14:45:08 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qjXSIBLi+5JL for ; Tue, 17 Nov 2020 14:45:07 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 2AC974B6A7 for ; Tue, 17 Nov 2020 14:45:07 -0500 (EST) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E3FB32465E for ; Tue, 17 Nov 2020 19:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605642306; bh=qNozKMsilVGHcKuDFqYgNc1oR4jJ69WTtekuHemKsA4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uzOYWmAFsp5u8A1goye7laB+uln8gqXV99XauIwSEYwYTGXnrkndJ1sdA0QPbsHW/ uXFPVcvnzkLe+GYCOMvNnDStRP9jwZYNOFkt+AwKP1ltA3sG4bxugT2gpWZQD9Krqq 7zwau8mE4xSeZENQKfIlP12S23rRKNZejLI/7ECQ= Received: by mail-ot1-f52.google.com with SMTP id k3so20597653otp.12 for ; Tue, 17 Nov 2020 11:45:05 -0800 (PST) X-Gm-Message-State: AOAM530T4gU9PzjpcbL0pTGcVW8lAbbkX4/doKQjMPC5tgOeeAtR2taR kuSQJv2Lze5Me0ELbrByImw+a1Qpuq5lO4Xw7A== X-Google-Smtp-Source: ABdhPJw7Y8/Ws5bUvi26+LLUZzk81vYwcXh6i4hVHe44wC1JXmPPzqpT+2F4tA2/k2KaDRk1Kh11f9DUxexOONIhShQ= X-Received: by 2002:a05:6830:2259:: with SMTP id t25mr4284277otd.192.1605642305060; Tue, 17 Nov 2020 11:45:05 -0800 (PST) MIME-Version: 1.0 References: <20201117181607.1761516-1-qperret@google.com> <20201117181607.1761516-16-qperret@google.com> In-Reply-To: <20201117181607.1761516-16-qperret@google.com> From: Rob Herring Date: Tue, 17 Nov 2020 13:44:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 15/27] of/fdt: Introduce early_init_dt_add_memory_hyp() To: Quentin Perret X-Mailman-Approved-At: Wed, 18 Nov 2020 05:39:23 -0500 Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Android Kernel Team , Frank Rowand , android-kvm@google.com, Catalin Marinas , open list , "moderated list:ARM64 PORT \(AARCH64 ARCHITECTURE\)" , Marc Zyngier , Will Deacon , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 \(KVM/arm64\)" X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, Nov 17, 2020 at 12:16 PM Quentin Perret wrote: > > Introduce early_init_dt_add_memory_hyp() to allow KVM to conserve a copy > of the memory regions parsed from DT. This will be needed in the context > of the protected nVHE feature of KVM/arm64 where the code running at EL2 > will be cleanly separated from the host kernel during boot, and will > need its own representation of memory. > > Signed-off-by: Quentin Perret > --- > drivers/of/fdt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 4602e467ca8b..af2b5a09c5b4 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -1099,6 +1099,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) > #endif > > +void __init __weak early_init_dt_add_memory_hyp(u64 base, u64 size) > +{ > +} > + > void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > { > const u64 phys_offset = MIN_MEMBLOCK_ADDR; > @@ -1139,6 +1143,7 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > base = phys_offset; > } > memblock_add(base, size); > + early_init_dt_add_memory_hyp(base, size); Can this be done right after we add all the memblocks using the memblock API? I thought EFI would also need to be handled, but looks like it just calls early_init_dt_add_memory_arch(). That's odd especially for ACPI systems... I don't really like putting what looks like an arm64 only hook here, but then I don't want an arm64 version of early_init_dt_add_memory_arch() either. We're almost to the point of getting rid of the arch specific ones. But I don't have a better suggestion currently. Rob _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 950EAC63697 for ; Tue, 17 Nov 2020 19:46:42 +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 0EEAE20674 for ; Tue, 17 Nov 2020 19:46:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A4XHpAPy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uzOYWmAF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EEAE20674 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C4mYTU8wSNtnQIR5iJ4JJwp5MOu2D1tBg9Vb35wF5fc=; b=A4XHpAPywjp/2dQbjk11RDX1p SpzafRHTb4GNDJZEh0zqemYLV6VqKeZHYnX2ngGyZvU9Lg5DdJYWMyVU2Tz5lDrS7FW38bx7Zo9TX CRQBnkmTKcUfzntVZuRkNn5Xm0g9hcrPfblsNl2YJht7npqjCFoYpZL2KfC8f0Xzj6jVD8S9s1QcT H/0Y5R5/80ldVk1ZR/JU43likXoUblwS9MQ3biCyGmESddDVBtmxh1LBlp3nzxsWgiFEL4gKoAS2E GcP1ezoDuD5I+2ftaSj+ZozrYfXus1yzuSp4brABJdOE8ZqGOJjlSZ3AsUFyBTZOZsmoBy61MQrS2 H/iadLZ5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf6ud-0002qW-0M; Tue, 17 Nov 2020 19:45:11 +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 1kf6uZ-0002oX-Iq for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 19:45:08 +0000 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC38D24656 for ; Tue, 17 Nov 2020 19:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605642306; bh=qNozKMsilVGHcKuDFqYgNc1oR4jJ69WTtekuHemKsA4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uzOYWmAFsp5u8A1goye7laB+uln8gqXV99XauIwSEYwYTGXnrkndJ1sdA0QPbsHW/ uXFPVcvnzkLe+GYCOMvNnDStRP9jwZYNOFkt+AwKP1ltA3sG4bxugT2gpWZQD9Krqq 7zwau8mE4xSeZENQKfIlP12S23rRKNZejLI/7ECQ= Received: by mail-ot1-f50.google.com with SMTP id 79so20610420otc.7 for ; Tue, 17 Nov 2020 11:45:05 -0800 (PST) X-Gm-Message-State: AOAM533MA1EQtzfDG+0E/0uKg759W9tJh+hCJe0oie8citf0lbH9ZvRn 6T/UHTNfCVucmQW53Qqt+Vuwkf1UmhJExRHY1Q== X-Google-Smtp-Source: ABdhPJw7Y8/Ws5bUvi26+LLUZzk81vYwcXh6i4hVHe44wC1JXmPPzqpT+2F4tA2/k2KaDRk1Kh11f9DUxexOONIhShQ= X-Received: by 2002:a05:6830:2259:: with SMTP id t25mr4284277otd.192.1605642305060; Tue, 17 Nov 2020 11:45:05 -0800 (PST) MIME-Version: 1.0 References: <20201117181607.1761516-1-qperret@google.com> <20201117181607.1761516-16-qperret@google.com> In-Reply-To: <20201117181607.1761516-16-qperret@google.com> From: Rob Herring Date: Tue, 17 Nov 2020 13:44:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 15/27] of/fdt: Introduce early_init_dt_add_memory_hyp() To: Quentin Perret X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_144507_821289_06735397 X-CRM114-Status: GOOD ( 23.38 ) 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: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Android Kernel Team , Frank Rowand , Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , open list , James Morse , "moderated list:ARM64 PORT \(AARCH64 ARCHITECTURE\)" , Marc Zyngier , Will Deacon , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 \(KVM/arm64\)" , Julien Thierry 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, Nov 17, 2020 at 12:16 PM Quentin Perret wrote: > > Introduce early_init_dt_add_memory_hyp() to allow KVM to conserve a copy > of the memory regions parsed from DT. This will be needed in the context > of the protected nVHE feature of KVM/arm64 where the code running at EL2 > will be cleanly separated from the host kernel during boot, and will > need its own representation of memory. > > Signed-off-by: Quentin Perret > --- > drivers/of/fdt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 4602e467ca8b..af2b5a09c5b4 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -1099,6 +1099,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) > #endif > > +void __init __weak early_init_dt_add_memory_hyp(u64 base, u64 size) > +{ > +} > + > void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > { > const u64 phys_offset = MIN_MEMBLOCK_ADDR; > @@ -1139,6 +1143,7 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) > base = phys_offset; > } > memblock_add(base, size); > + early_init_dt_add_memory_hyp(base, size); Can this be done right after we add all the memblocks using the memblock API? I thought EFI would also need to be handled, but looks like it just calls early_init_dt_add_memory_arch(). That's odd especially for ACPI systems... I don't really like putting what looks like an arm64 only hook here, but then I don't want an arm64 version of early_init_dt_add_memory_arch() either. We're almost to the point of getting rid of the arch specific ones. But I don't have a better suggestion currently. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel