Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-23 Thread Andrea Bolognani
On Fri, May 19, 2023 at 06:40:37PM +0200, Philippe Mathieu-Daudé wrote: > > On 18/5/23 08:03, Sunil V L wrote: > > > Agree. While I agree with Philippe, I think we better solve the current > > > problem by going back to v1 of the patch. > > BTW clarifying, I'm not rejecting this particular patch; I

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 18:34, Philippe Mathieu-Daudé wrote: On 18/5/23 08:03, Sunil V L wrote: On Thu, May 18, 2023 at 02:55:16PM +1000, Alistair Francis wrote: On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé wrote: On 8/5/23 12:00, Andrea Bolognani wrote: On Mon, May 08, 2023 at 11:37:43AM +05

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Philippe Mathieu-Daudé
On 18/5/23 08:03, Sunil V L wrote: On Thu, May 18, 2023 at 02:55:16PM +1000, Alistair Francis wrote: On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé wrote: On 8/5/23 12:00, Andrea Bolognani wrote: On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: On Mon, May 08, 2023 at 07:

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Sunil V L
On Fri, May 19, 2023 at 09:11:37AM -0700, Andrea Bolognani wrote: > On Tue, Apr 25, 2023 at 03:55:45PM +0530, Sunil V L wrote: > > qemu-system-riscv64 -bios \ > > -drive file=,if=pflash,format=raw,unit=0 \ > > -drive file=,if=pflash,format=raw,unit=1,readonly=on \ > > -machine virt > > I've noti

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Andrea Bolognani
On Tue, Apr 25, 2023 at 03:55:45PM +0530, Sunil V L wrote: > qemu-system-riscv64 -bios \ > -drive file=,if=pflash,format=raw,unit=0 \ > -drive file=,if=pflash,format=raw,unit=1,readonly=on \ > -machine virt I've noticed that edk2 for RISC-V, at least in the form it is currently packaged for Fedo

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Andrea Bolognani
On Thu, May 18, 2023 at 02:53:05PM +1000, Alistair Francis wrote: > On Wed, May 17, 2023 at 6:45 PM Andrea Bolognani wrote: > > On Wed, May 17, 2023 at 02:57:12PM +1000, Alistair Francis wrote: > At one point we loaded Oreboot in in flash and booted from that. I > think Oreboot then loaded OpenSBI

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-18 Thread Andrea Bolognani
On Wed, May 17, 2023 at 02:47:42PM +0200, Philippe Mathieu-Daudé wrote: > > > On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > > > > On amd64 and arm64 unit=0 is used for code and unit=1 is used for > > > > variables. > > > > Shouldn't riscv64 do the same? > > > > Good catch,

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-17 Thread Sunil V L
On Thu, May 18, 2023 at 02:55:16PM +1000, Alistair Francis wrote: > On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé > wrote: > > > > On 8/5/23 12:00, Andrea Bolognani wrote: > > > On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > > >> On Mon, May 08, 2023 at 07:37:23AM +0200, He

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-17 Thread Alistair Francis
On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé wrote: > > On 8/5/23 12:00, Andrea Bolognani wrote: > > On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > >> On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > >>> On 4/25/23 12:25, Sunil V L wrote: > Curre

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-17 Thread Alistair Francis
On Wed, May 17, 2023 at 6:45 PM Andrea Bolognani wrote: > > On Wed, May 17, 2023 at 02:57:12PM +1000, Alistair Francis wrote: > > On Mon, May 8, 2023 at 9:45 PM Andrea Bolognani wrote: > > > > > Taking a step back, what is even the use case for having M-mode code > > > > > in pflash0? If you want

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-17 Thread Philippe Mathieu-Daudé
On 8/5/23 12:00, Andrea Bolognani wrote: On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: On 4/25/23 12:25, Sunil V L wrote: Currently, virt machine supports two pflash instances each with 32MB size. However, the fi

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-17 Thread Andrea Bolognani
On Wed, May 17, 2023 at 02:57:12PM +1000, Alistair Francis wrote: > On Mon, May 8, 2023 at 9:45 PM Andrea Bolognani wrote: > > > > Taking a step back, what is even the use case for having M-mode code > > > > in pflash0? If you want to use an M-mode firmware, can't you just use > > > > -bios instea

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-16 Thread Sunil V L
On Wed, May 17, 2023 at 02:57:12PM +1000, Alistair Francis wrote: > On Mon, May 8, 2023 at 9:45 PM Andrea Bolognani wrote: > > > > On Mon, May 08, 2023 at 04:53:46PM +0530, Sunil V L wrote: > > > On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > > > > I think that it's more impor

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-16 Thread Sunil V L
On Mon, May 08, 2023 at 04:44:22AM -0700, Andrea Bolognani wrote: > On Mon, May 08, 2023 at 04:53:46PM +0530, Sunil V L wrote: > > On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > > > I think that it's more important to align with other architectures. > > > > > > The number of pe

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-16 Thread Alistair Francis
On Mon, May 8, 2023 at 9:45 PM Andrea Bolognani wrote: > > On Mon, May 08, 2023 at 04:53:46PM +0530, Sunil V L wrote: > > On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > > > I think that it's more important to align with other architectures. That's true, ideally we want to mat

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Andrea Bolognani
On Mon, May 08, 2023 at 04:53:46PM +0530, Sunil V L wrote: > On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > > I think that it's more important to align with other architectures. > > > > The number of people currently running edk2 on RISC-V is probably > > vanishingly small, and

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Sunil V L
On Mon, May 08, 2023 at 03:00:02AM -0700, Andrea Bolognani wrote: > On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > > On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > > > On 4/25/23 12:25, Sunil V L wrote: > > > > Currently, virt machine supports two pflash instan

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-08 Thread Andrea Bolognani
On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: > On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > > On 4/25/23 12:25, Sunil V L wrote: > > > Currently, virt machine supports two pflash instances each with > > > 32MB size. However, the first pflash is always assumed

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-07 Thread Sunil V L
On Mon, May 08, 2023 at 07:37:23AM +0200, Heinrich Schuchardt wrote: > On 4/25/23 12:25, Sunil V L wrote: > > Currently, virt machine supports two pflash instances each with > > 32MB size. However, the first pflash is always assumed to > > contain M-mode firmware and reset vector is set to this if

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-07 Thread Heinrich Schuchardt
On 4/25/23 12:25, Sunil V L wrote: Currently, virt machine supports two pflash instances each with 32MB size. However, the first pflash is always assumed to contain M-mode firmware and reset vector is set to this if enabled. Hence, for S-mode payloads like EDK2, only one pflash instance is availa

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-07 Thread Sunil V L
Hi Alistair, On Tue, Apr 25, 2023 at 03:55:45PM +0530, Sunil V L wrote: > Currently, virt machine supports two pflash instances each with > 32MB size. However, the first pflash is always assumed to > contain M-mode firmware and reset vector is set to this if > enabled. Hence, for S-mode payloads l

[PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-04-25 Thread Sunil V L
Currently, virt machine supports two pflash instances each with 32MB size. However, the first pflash is always assumed to contain M-mode firmware and reset vector is set to this if enabled. Hence, for S-mode payloads like EDK2, only one pflash instance is available for use. This means both code and