From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::143; helo=mail-it1-x143.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x143.google.com (mail-it1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 93B0C2116822C for ; Fri, 19 Oct 2018 07:01:49 -0700 (PDT) Received: by mail-it1-x143.google.com with SMTP id k206-v6so4394103ite.0 for ; Fri, 19 Oct 2018 07:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TE+VzQfVreDumVjXGXIcXQhV1d6+qDqwZ6BuytwUcEw=; b=H8IeT0cYBPYfuN/lHiJLVXX/CW+97IJBCI3XR6FPu5iNj9i2jnurmrxJlzXwEzLmQm 3X8l6x4Rrq/9QTWOngyD8q3T+AG3W7rweY+A9KPNGZuS/R9brRoUpn4ACeJRiQ45wO/9 tO7YOnh0ZtZikilVs5VMUe0y+eV35H3jtPVOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TE+VzQfVreDumVjXGXIcXQhV1d6+qDqwZ6BuytwUcEw=; b=kZzQlox2LrHCVB6qFVypVMdGY/UFTTUmCigxnqhy7woXV1r8uFzE+B5J8MjWpFaXxv LlYFVesbJ9Dh7YBSTP5lPT2MRwUq+9aCgAqCI7CcQFbxlqRANTZLWUQkSgfj2PP1d+sl kPdlCEpvt0FMB6UyJDl8AC4V85nLo4SKi5us+olPVmkQlhzmwJRA3daTnEmXYuK5cakf JZtj5Op8ubLPct0P/SJJrWE0rsj/Q+eVB4/Aj2CDa6JKuj1sbPF0HM2NdgnQ73/pXELm hANriDn0upVnDMgRVM1F0w3XPgEBs7eo7r5Xy1ahEkWoRZpr516ywToIgtS4tAP2aJoJ OZAA== X-Gm-Message-State: ABuFfogDesMa12i7/k4I6JwGgAwQKbzPDyRru89cyGix6Q3lCulQqi71 Eb5qzXbnSIMSqvU0WpY2t4DTCpJIzv2K5uDX0ADhoQ== X-Google-Smtp-Source: ACcGV62w4Ty7Lwsjiqa3MbUnw1kvemcvDKR9rrBOy808SuWdI1z23mhdtdOIM1rD8r08Q2oW4WIL+M8mqFp78tI0dYY= X-Received: by 2002:a24:4ac5:: with SMTP id k188-v6mr3536332itb.158.1539957708495; Fri, 19 Oct 2018 07:01:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:5910:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 07:01:46 -0700 (PDT) In-Reply-To: <82759606-580e-0f35-3258-b57eb3f2d5d8@redhat.com> References: <20181012144009.48732-1-sami.mujawar@arm.com> <20181012144009.48732-5-sami.mujawar@arm.com> <82759606-580e-0f35-3258-b57eb3f2d5d8@redhat.com> From: Ard Biesheuvel Date: Fri, 19 Oct 2018 22:01:46 +0800 Message-ID: To: Laszlo Ersek Cc: Sami Mujawar , "edk2-devel@lists.01.org" , nd , Stephanie Hughes-Fitt , Drew Jones , Eric Auger Subject: Re: [PATCH v1 4/6] ArmVirtPkg: Save DT base address from X0 in PCD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2018 14:01:50 -0000 Content-Type: text/plain; charset="UTF-8" On 14 October 2018 at 05:35, Laszlo Ersek wrote: > On 10/12/18 16:40, Sami Mujawar wrote: >> Some virtual machine managers provide the base address of the DT >> in memory in the X0 register. Save the DT Base address in the >> PcdDeviceTreeInitialBaseAddress so that the firmware can use the >> PCD to parse the DT and obtain the platform information subsequently. >> >> This change also requires that the PcdDeviceTreeInitialBaseAddress >> be a Dynamic PCD. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Sami Mujawar >> --- >> The changes can be seen at https://github.com/samimujawar/edk2/commit/57ffa0da043fd73907b24a6833d2797ea3dae564 >> >> Notes: >> v1: >> - Enable loading of DT from base address passed in X0. [SAMI] >> >> ArmVirtPkg/ArmVirtPkg.dec | 12 ++++++++---- >> ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 9 +++++++-- >> 2 files changed, 15 insertions(+), 6 deletions(-) > > This patch seems to overlap with a feature that (I think) Ard, Drew and > Eric have discussed earlier, for QEMU (floating RAM base). I suggest > coordinating as early as possible. > This is the PrePi code, which we only use currently for ArmVirtQemuKernel and ArmVirtXen. PrePi is a hack which I am only willing to tolerate for legacy platforms, and for platforms that require relocation, i.e., where the runtime address of the SEC module is not known at link time. I have asked Sami [in person] to look into whether we can avoid using this PCD entirely, or at least avoid switching to a dynamic PCD. Instead, I would prefer an approach where we store the value of X0 in a global variable (which is permitted given that a self relocating PrePi can only execute from DRAM anyway), and create the FDT GUID HOB directly once we are running C code.