[edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG

Laszlo Ersek posted 3 patches 9 months, 2 weeks ago
[edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG
Posted by Laszlo Ersek 9 months, 2 weeks ago
Riscv64 KVM services SBI calls internally, so OpenSBI is not used in such
setups. Restrict the "-bios" flag accordingly. Thanks: Andrei, Drew.

Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Andrew Jones <ajones@ventanamicro.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/RiscVVirt/README.md | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
index dbb40bbe89b0..193e4afe8dee 100644
--- a/OvmfPkg/RiscVVirt/README.md
+++ b/OvmfPkg/RiscVVirt/README.md
@@ -86,3 +86,8 @@ then specify that binary for QEMU, with the following additional command line
 option:
 
     -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
+
+Note that the above only makes a difference with software emulation (which you
+can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
+KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
+any externally loaded OpenSBI binary is ignored.



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108576): https://edk2.groups.io/g/devel/message/108576
Mute This Topic: https://groups.io/mt/101334264/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG
Posted by Andrew Jones 9 months, 2 weeks ago
On Wed, Sep 13, 2023 at 12:55:49PM +0200, Laszlo Ersek wrote:
> Riscv64 KVM services SBI calls internally, so OpenSBI is not used in such
> setups. Restrict the "-bios" flag accordingly. Thanks: Andrei, Drew.
> 
> Cc: Andrei Warkentin <andrei.warkentin@intel.com>
> Cc: Andrew Jones <ajones@ventanamicro.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  OvmfPkg/RiscVVirt/README.md | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> index dbb40bbe89b0..193e4afe8dee 100644
> --- a/OvmfPkg/RiscVVirt/README.md
> +++ b/OvmfPkg/RiscVVirt/README.md
> @@ -86,3 +86,8 @@ then specify that binary for QEMU, with the following additional command line
>  option:
>  
>      -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
> +
> +Note that the above only makes a difference with software emulation (which you
> +can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
> +KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
> +any externally loaded OpenSBI binary is ignored.
>


Reviewed-by: Andrew Jones <ajones@ventanamicro.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108637): https://edk2.groups.io/g/devel/message/108637
Mute This Topic: https://groups.io/mt/101334264/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG
Posted by Andrew Jones 9 months, 2 weeks ago
On Thu, Sep 14, 2023 at 09:23:12AM +0200, Andrew Jones wrote:
> On Wed, Sep 13, 2023 at 12:55:49PM +0200, Laszlo Ersek wrote:
> > Riscv64 KVM services SBI calls internally, so OpenSBI is not used in such
> > setups. Restrict the "-bios" flag accordingly. Thanks: Andrei, Drew.
> > 
> > Cc: Andrei Warkentin <andrei.warkentin@intel.com>
> > Cc: Andrew Jones <ajones@ventanamicro.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> > ---
> >  OvmfPkg/RiscVVirt/README.md | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> > index dbb40bbe89b0..193e4afe8dee 100644
> > --- a/OvmfPkg/RiscVVirt/README.md
> > +++ b/OvmfPkg/RiscVVirt/README.md
> > @@ -86,3 +86,8 @@ then specify that binary for QEMU, with the following additional command line
> >  option:
> >  
> >      -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
> > +
> > +Note that the above only makes a difference with software emulation (which you
> > +can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
> > +KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
> > +any externally loaded OpenSBI binary is ignored.
> >
> 
> 
> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>

Eh, sorry for the redundant r-b and my 'ignored' comment still stands,
i.e. I wouldn't mind seeing a v2 with s/ignored/rejected/

Thanks,
drew


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108640): https://edk2.groups.io/g/devel/message/108640
Mute This Topic: https://groups.io/mt/101334264/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG
Posted by Andrew Jones 9 months, 2 weeks ago
On Wed, Sep 13, 2023 at 12:55:49PM +0200, Laszlo Ersek wrote:
> Riscv64 KVM services SBI calls internally, so OpenSBI is not used in such
> setups. Restrict the "-bios" flag accordingly. Thanks: Andrei, Drew.
> 
> Cc: Andrei Warkentin <andrei.warkentin@intel.com>
> Cc: Andrew Jones <ajones@ventanamicro.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  OvmfPkg/RiscVVirt/README.md | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> index dbb40bbe89b0..193e4afe8dee 100644
> --- a/OvmfPkg/RiscVVirt/README.md
> +++ b/OvmfPkg/RiscVVirt/README.md
> @@ -86,3 +86,8 @@ then specify that binary for QEMU, with the following additional command line
>  option:
>  
>      -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
> +
> +Note that the above only makes a difference with software emulation (which you
> +can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
> +KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
> +any externally loaded OpenSBI binary is ignored.
>

With the 'virt' machine model -bios is actually forbidden with accel=kvm,
not just ignored.

Otherwise,

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>

Thanks,
drew


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108609): https://edk2.groups.io/g/devel/message/108609
Mute This Topic: https://groups.io/mt/101334264/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/3] OvmfPkg/RiscVVirt/README: explain that "-bios" is only useful with TCG
Posted by Laszlo Ersek 9 months, 2 weeks ago
On 9/13/23 18:28, Andrew Jones wrote:
> On Wed, Sep 13, 2023 at 12:55:49PM +0200, Laszlo Ersek wrote:
>> Riscv64 KVM services SBI calls internally, so OpenSBI is not used in such
>> setups. Restrict the "-bios" flag accordingly. Thanks: Andrei, Drew.
>>
>> Cc: Andrei Warkentin <andrei.warkentin@intel.com>
>> Cc: Andrew Jones <ajones@ventanamicro.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Cc: Sunil V L <sunilvl@ventanamicro.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  OvmfPkg/RiscVVirt/README.md | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
>> index dbb40bbe89b0..193e4afe8dee 100644
>> --- a/OvmfPkg/RiscVVirt/README.md
>> +++ b/OvmfPkg/RiscVVirt/README.md
>> @@ -86,3 +86,8 @@ then specify that binary for QEMU, with the following additional command line
>>  option:
>>  
>>      -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
>> +
>> +Note that the above only makes a difference with software emulation (which you
>> +can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
>> +KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
>> +any externally loaded OpenSBI binary is ignored.
>>
> 
> With the 'virt' machine model -bios is actually forbidden with accel=kvm,
> not just ignored.

Thanks, I think I should then say:

  therefore any OpenSBI binary specified with `-bios` is rejected

(I think I can still technically merge this series myself on github,
once it's been reviewed, so I could fix this up, to keep the churn low
for the maintainers.)

Unfortunately, I can't test KVM here; got no riscv64 hardware. (And I'm
not really considering nesting KVM under TCG! :) Even if TCG emulated
the virtualization extensions (?), the speed would probably be unbearable.)

> 
> Otherwise,
> 
> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
> 
> Thanks,
> drew
> 

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108641): https://edk2.groups.io/g/devel/message/108641
Mute This Topic: https://groups.io/mt/101334264/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-