toggle quoted message
Show quoted text
We have two options here:
- EDK2 can use 0xA000000 + <opensbi_imp_id> as SBI Extension
- OpenSBI provides a way to EDK2 for overriding SBI implementation ID (preferably using some API)
If we go with Option1 above then we don’t need separate SBI implementation ID for EDK2.
Let us know what you guys think in this context.
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Sent: 12 April 2020 14:50
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; Anup Patel <Anup.Patel@...>; Jonathan Behrens <behrensj@...>
Cc: Atish Patra <Atish.Patra@...>; Schaefer, Daniel (DualStudy) <daniel.schaefer@...>; tech-unixplatformspec@...
Subject: RE: [RISC-V] [tech-unixplatformspec] [RISC-V] [software] Add SBI extension space for firmware code base implementation
This is the PR according to the discussion we had in mail thread. However you may see some confusions from this change.
EDK2 is a SBI implementation? Actually edk2 is not one of the SBI implementations, edk2 fully compliant with OpenSBI and additionally provides the firmware code base SBI extension.
We can explain this in the external Firmware code base SBI extension spec (edk2 RISC-V OpenSBI spec), says edk2 SBI implementation actually goes alone
with SBI OpenSBI implementation.
What is the SBI implementation version associated with EDK2 SBI implementation? This is another confusion because the major SBI implementation is OpenSBI.
We also can explain this in the external Firmware code base SBI extension spec, says edk2 SBI implementation version is the version of SBI OpenSBI implementation.
Apart from the above proposal, can we have more clear definitions for Firmware code base SBI extension in SBI spec instead of fixing those confusions in the extern
spec? The below proposal makes more sense?
Define another table for firmware code base, e.g. SBI Firmware Code Base ID. In the table we can have edk2, uboot, Coreboot and etc..
Create a new SBI Base function, sbi_get_firmware_code_base_id() which returns the SBI Firmware Code Base ID.
Create a new SBI Base function, sbi_get_firmware_code_base_version() for the version control of firmware code base SBI extension
Firmware code base SBI extension is from 0xA000000 to 0xAffffff with Firmware Code Base ID in low bits.
I feel the later one makes more sense and clear, how do you think?
Cool. This works for edk2. I will have another PR for this.
For edk2, we will request a new SBI implementation ID (4) and register firmware code base extension SBI in edk2 SEC phase.
I agree with Jonathan's proposal. Let's have SBI FW extension ID depend on SBI implementation ID.
We can target this for SBI v0.3 spec along with System Reboot extension.
What I was suggesting is something like:
> Implementation specific SBI extension Space, Extension IDs 0x0A000000 through 0x0AFFFFFF. Low bits from SBI Implementation ID.
In this scheme, each SBI implementation would have one extension reserved for it: BBL gets 0x0A000000, OpenSBI gets 0x0A000001, Xvisor gets 0x0A000002, KVM gets 0x0A000003, etc. That might not seem like a lot of space, but each extension
can have up to 2^32 different functions (including ones for version number discovery, etc.) so it shouldn't actually be limiting.
As a side note, I don't think edk2 has an SBI Implementation ID assigned yet. You should just be able to ask for one and get it.
On Fri, Apr 10, 2020 at 2:23 AM Chang, Abner (HPS SW/FW Technologist) <abner.chang@...> wrote:
> -----Original Message-----
> From: tech-unixplatformspec@... [mailto:tech-
> unixplatformspec@...] On Behalf Of Atish Patra
> Sent: Friday, April 10, 2020 11:32 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>;
> Cc: Schaefer, Daniel (DualStudy) <daniel.schaefer@...>; tech-
> unixplatformspec@...; Anup Patel <Anup.Patel@...>
> Subject: Re: [RISC-V] [tech-unixplatformspec] [RISC-V] [software] Add SBI
> extension space for firmware code base implementation
> On Fri, 2020-04-10 at 01:08 +0000, Chang, Abner (HPS SW/FW
> Technologist) wrote:
> > Got it, Software ML removed.
> > Johnathan, do you mean to define it as below?
> > Firmware Base Extension, Extension ID: 0xxxxxxxxx (FWBE) , and the
> > SBI functions definition is firmware code base implementation-
> > specific.
> I prefer this one as well. But you should pick any value within experimental
Not quite follow this, why pick up one from experimental range? The extension ID must be in the range of 0x0800000-0x08ffffff?
I am not sure about the purpose of the extension but if it has the
> potential to be a generic SBI extension for firmwares, you should propose it
> to the Unix Platform working group. We can add it to the official spec.
For those SBI extension which is generic to all firmware code bases, then we should just propose it to the official SBI spec and don’t not have to go with Firmware Base Extension.
Firmware Base Extension is classified to those firmware code base specific SBI, for example to load an edk2 driver into M-mode managed memory and executed in M-mode which is behaved as secured system manage mode driver. So the detail Firmware Base Extension
would be defined in the separate spec and not part of official sbi spec. Occupied an SBI extension ID is to avoid conflicts.
> > This also works for me and better than to reserve a range of IDs.
> > Thanks
> > Abner
> > From: software@... [mailto:software@...] On
> > Behalf Of Jonathan Behrens
> > Sent: Friday, April 10, 2020 12:39 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
> > Cc: Atish Patra <Atish.Patra@...>; Anup Patel
> > >; Schaefer, Daniel (DualStudy) <daniel.schaefer@...>;
> > software@...;
> > Subject: Re: [RISC-V] [software] Add SBI extension space for firmware
> > code base implementation
> > I think
tech-unixplatformspec@... might be the right list?
> > To address the PR itself, I'd personally prefer to have this space
> > allocated based on SBI implementation IDs analogously to how the
> > vendor space is allocated. It also probably makes sense to pick a
> > different address range so experimental extension space doesn't have
> > to move.
> > Jonathan
> > On Thu, Apr 9, 2020 at 4:39 AM Abner Chang via
> > abner.chang=hpe.com@...> wrote:
> > > Seems opensbi ML is no longer exist? Use
> > > insrtead.
> > >
> > > From: Chang, Abner (HPS SW/FW Technologist)
> > > Sent: Thursday, April 9, 2020 4:23 PM
> > > To: Atish Patra <Atish.Patra@...>; Anup Patel <
> > > anup.patel@...>
> > > Cc: opensbi@...; Schaefer, Daniel (DualStudy) <
> > > daniel.schaefer@...>
> > > Subject: Add SBI extension space for firmware code base
> > > implementation
> > >
> > > Hi Atish and Anup,
> > > We are working on some edk2-specific SBI extension which intends to
> > > be used by upper layer edk2 drivers. We originally consider to use
> > > Vendor Extension space however vendor may have its own proprietary
> > > SBI extension as well. In order to prevent from the conflicts of SBI
> > > extension space, we propose to have a range for firmware code base.
> > > The changes look like the PR below,
> > >
> > > https://github.com/riscv/riscv-sbi-doc/pull/43
> > >
> > > How do you think?
> > > Thanks
> > > Abner