From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v3 2/3] arm64: implement update_fdt_pgprot() Date: Thu, 16 May 2019 10:44:28 -0700 Message-ID: <5cdda17d.1c69fb81.8e244.683a@mx.google.com> References: <20190516102817.188519-1-hsinyi@chromium.org> <20190516102817.188519-2-hsinyi@chromium.org> <5f598806-1c36-7c2a-0f47-da79ec7d28c6@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <5f598806-1c36-7c2a-0f47-da79ec7d28c6@arm.com> Sender: linux-kernel-owner@vger.kernel.org To: Hsin-Yi Wang , James Morse Cc: Rob Herring , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Frank Rowand , Catalin Marinas , Will Deacon , Andrew Morton , Mike Rapoport , Ard Biesheuvel , Miles Chen , Andrew Murray , Mark Rutland , Jun Yao , Yu Zhao , Robin Murphy , Laura Abbott , Kees Cook List-Id: devicetree@vger.kernel.org Quoting James Morse (2019-05-16 10:34:16) > Hi! >=20 > On 16/05/2019 17:48, Hsin-Yi Wang wrote: > > On Thu, May 16, 2019 at 11:32 PM Rob Herring wrote: > >> Doesn't kexec operate on a copy because it already does modifications. >=20 > It does! >=20 > > This patch is to assist "[PATCH v3 3/3] fdt: add support for rng-seed" > > (https://lkml.org/lkml/2019/5/16/257). I thought that by default > > second kernel would use original fdt, so I write new seed back to > > original fdt. Might be wrong. > >=20 > > ** "[PATCH v3 3/3] fdt: add support for rng-seed" is supposed to > > handle for adding new seed in kexec case, discussed in v2 > > (https://lkml.org/lkml/2019/5/13/425) > >=20 > > By default (not considering user defines their own fdt), if second > > kernel uses copied fdt, when is it copied and can we modify that? >=20 > Regular kexec's user-space already updates the dtb for the cmdline and ma= ybe the initrd. > For KASLR, it generates its own seed with getrandom(): >=20 > https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/tree/ke= xec/arch/arm64/kexec-arm64.c#n483 >=20 > If user-space can do it, user-space should do it! >=20 Doesn't it need to be done in two places? Userspace and also in the kernel when kexec_file_load() is used? At least, I see a bit of code that does kaslr seed updates to the copied dtb in setup_dtb() of arch/arm64/kernel/machine_kexec_file.c that probably needs to get an update for this new property too.