Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3102648pxb; Tue, 12 Jan 2021 06:29:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRBzJzebN3sqqAWTKyWuGbVM6hVs8e1yw+hIzaabbdJ3jxOqvQDbMKm54pxaZpTJqSj40o X-Received: by 2002:a17:906:195a:: with SMTP id b26mr3388970eje.4.1610461761306; Tue, 12 Jan 2021 06:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610461761; cv=none; d=google.com; s=arc-20160816; b=PhSJ414dFH2sL5iTNIkjLQLt0wjlTKqkG39LD0BKKFyuI7HN+91nGLTno/cmvI5v1K sG2ZK6rwCgA9FVXI3KYdZGE0BPs62jQy3pyNsGnkrTUXIvqcpYYPnVp8ufM8NeBOkOd6 iWR/1xGkPyXiF84fptaLLP/Ab+0KpySezilYOsJQdSV7WEYLDh2Pb8pGFTaMbC7DrwJ3 E/EdrBbW1UjYD2VgZ84/oQk3IjzfxxcyPRHOpPj+DmA08KZd6gYzbvFsMLCqLq2izepV pzIzGm6HzFn/032HVTomjgGMdmzwsw83Nr9zWl2B2Xng1rlv8yBbxBixnGA3Qn/VwPBj YiuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gqO1yWp5AB3IJei1IjrvC2R1TL1BEuYE5TsVy5/Jxdk=; b=YVQSP3g3L4i/hOVe6PSwLJiFbayCqlyM/1RtVhBe9xYRiqM+fNIThdALbPBG0IiCVs ggRcSuBFqDEJtIvcR0jrUZj0T5vlmT8SHXYf+ab/SzmZ1lsvJ/WJIPY9+KTYP7sZsVM8 KR/RXFaq2tu60oH9oNCj9hfSaD+MTiYlHPhSZhpqtYRU1+G5PWWmT/MdEf0hcaHDh+Vl cQXyj7VKoI5lOUskerrvtw/cXbVpMem9fz0uRWygR7hd7qebMDEvE1pc8VBZLa6El9Z+ T8EcGWKO/Zo+a2lWdAyozfLEa49xtsasS44SHMY/13FRKXWlBwWP2m2sZgFg0oBndk11 dM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Iy3BYVD4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si1422877edn.483.2021.01.12.06.28.57; Tue, 12 Jan 2021 06:29:21 -0800 (PST) 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=@google.com header.s=20161025 header.b=Iy3BYVD4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729066AbhALO1R (ORCPT + 99 others); Tue, 12 Jan 2021 09:27:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbhALO1Q (ORCPT ); Tue, 12 Jan 2021 09:27:16 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21AB1C061575 for ; Tue, 12 Jan 2021 06:26:36 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id t30so2728118wrb.0 for ; Tue, 12 Jan 2021 06:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gqO1yWp5AB3IJei1IjrvC2R1TL1BEuYE5TsVy5/Jxdk=; b=Iy3BYVD4JYi00Y+paAwHAKEJherb8Av77liX/FvqkRZWzDoitM0Q4XSnJqs1MUl4Bm 1G8CdVBIgQpBavCB0wJCuUqC3s343Qs5oaeGjQxkZgZN5sawE8xU7zgFHvG75x8EJ3Ap X3vC5k7XDCaOEsfK9sEmWHKxOLmW9XBCjSsCjEXOb2OVLHFGeUdslzfX0nm8mJruMeaf nh3z5xM8wwyS2BoFDnxlKeW2yq8t5SGrve88rD3UKhJL9RAQTTwf4LAReqBvY4XmEywi wUrPjW0fDWtuBFPiKl1upHvt9FFv7Asn4fitWBvSBi/fbJlG2ZjDCmvJWTRMdR03I8Jl sd7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gqO1yWp5AB3IJei1IjrvC2R1TL1BEuYE5TsVy5/Jxdk=; b=AeTy4FbDUJabepO/hymeC/pbAL3c3UIWSGdEnaG8mL+I+XFNdfBhNGLjjkhpTqGHCW nC39X4Rp5QpleIBGKsWv517kiCUJlmDmuifdcgIcuBtOLh951rXQ64ydxPuT3tkriLG+ 6Zs/qXmCGphyhesCR5Q+qO9BL/qydjHfljCOGB387S8pdpWp2h2iv2nbUpgmIQm0Aamf 38UvBh4UsPTAGvFT3ldEQXuuyJ+PYYX8yPNJ+WLXZy44DtaiYx4A2WTpc54Zttzv0eed woP0ATTzbBrGumzz7Wq2NtYFphXVh5Rx/uIGddjjv8ViMr87gxGjrIZ6xqjn01SRKSB4 Zhzw== X-Gm-Message-State: AOAM533QklVo/opSkrRYwk3Nx3ctzXKd7/W3l+tb/z7+Wz6RB+lRFNCZ PodUa2/wlVArsUhYQNyt+vtnWA== X-Received: by 2002:adf:ea04:: with SMTP id q4mr4592027wrm.195.1610461594673; Tue, 12 Jan 2021 06:26:34 -0800 (PST) Received: from google.com (49.222.77.34.bc.googleusercontent.com. [34.77.222.49]) by smtp.gmail.com with ESMTPSA id k10sm4764541wrq.38.2021.01.12.06.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:26:34 -0800 (PST) Date: Tue, 12 Jan 2021 14:26:31 +0000 From: Quentin Perret To: Rob Herring Cc: Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Frank Rowand , devicetree@vger.kernel.org, android-kvm@google.com, "linux-kernel@vger.kernel.org" , Android Kernel Team , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , linux-arm-kernel , Fuad Tabba , Mark Rutland , David Brazdil Subject: Re: [RFC PATCH v2 15/26] of/fdt: Introduce early_init_dt_add_memory_hyp() Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-16-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 12 Jan 2021 at 08:10:47 (-0600), Rob Herring wrote: > On Tue, Jan 12, 2021 at 3:51 AM Quentin Perret wrote: > > > > On Monday 11 Jan 2021 at 08:45:10 (-0600), Rob Herring wrote: > > > On Fri, Jan 8, 2021 at 6:16 AM 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. > > > > > > What happened to doing this with memblock? > > > > I gave it a go, but as mentioned in v1, I ran into issues for nomap > > regions. I want the hypervisor to know about these memory regions (it's > > possible some of those will be given to protected guests for instance) > > but these seem to be entirely removed from the memblocks when using DT: > > > > https://elixir.bootlin.com/linux/latest/source/drivers/of/fdt.c#L1153 > > > > EFI appears to do things differently, though, as it 'just' uses > > memblock_mark_nomap() instead of actively removing the memblock. And that > > means I could actually use the memblock API for EFI, but I'd rather > > have a common solution. I tried to understand why things are done > > differently but couldn't find an answer and kept things simple and > > working for now. > > > > Is there a good reason for not using memblock_mark_nomap() with DT? If > > not, I'm happy to try that. > > There were 2 patches to do that, but it never got resolved. See here[1]. Thanks. So the DT stuff predates the introduction of memblock_mark_nomap, that's why... By reading the discussions, [1] still looks a sensible patch on its own, independently from the issue Nicolas tried to solve. Any reason for not applying it? I'll try to rework my series on top and see how that goes. Thanks, Quentin [1] https://lore.kernel.org/linux-devicetree/1562920284-18638-1-git-send-email-karahmed@amazon.de/