[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from p
Re: [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflashy
Thu, 8 Sep 2022 13:19:59 +0200
> Thanks Gerd. One question: Is it possible to have separate code + vars
> even when there is TF-A? My understanding is, TF-A will take one drive
> and will be hidden from the non-secure word. So, there is only one flash
> left for edk2. Is that correct?
> In RISC-V, I think we have the this situation always since M-mode is
> mandatory. The first flash is always reserved for secure fw. So, we will
> have to increase the number of flash supported to 3 to support edk2 use
Well. Adding one more flash is certainly the easiest approach. Another
possible option would be to have the secure world store the efi variables.
That might be needed anyway for secure boot support.
> I have a fix RISC-V which resolves truncate issue leveraging logic from
> x86. It also creates 2 flash drives within non-secure space.
> EDK2 also needs to be modified to work with smaller code flash. But
> because the patch takes care of the actual size, it allows to have
> bigger code and smaller var images.
The size of the code flash and thereby the address of the varstore is
known at compile time too, so yes, that approach should work fine.
Note that changing the flash size can lead to compatibility problems
(for example when live migrating), so I'd suggest to be generous with
code/vars sizes. On x64 the upstream default flash size is 2M and when
all compile-time options are enabled things don't fit any more.
So, assuming size figures are roughly the same for risc-v, I'd suggest
to go for 4M or 8M code flash and 1M vars flash.
> Same thing can be adopted to arm also since both seem to follow the same
Yes. The tricky part here is dealing with backward compatibility and
the transition from padded to non-padded images. I suspect at the end
of the day keeping the vars flash mapping fixed at 64M (and have a hole
between code and vars) will be easier.
> But I think that will be a separate patch than this series. I
> will run that as a separate RFC patch. Is that fine?
[PATCH V4 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel, Sunil V L, 2022/09/06
[PATCH V4 3/3] hw/riscv: virt: Enable booting S-mode firmware from pflash, Sunil V L, 2022/09/06
Re: [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash, Gerd Hoffmann, 2022/09/06
- Re: [PATCH V4 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location, (continued)