[SeaBIOS] Re: MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag

2022-01-21 Thread Igor Mammedov
On Thu, 20 Jan 2022 09:46:09 -0500 Godmar Back wrote: > [this is a follow-up email; I took qemu-discuss and qemu-devel off the > distribution list] > > On Thu, Jan 20, 2022 at 4:04 AM Igor Mammedov wrote: > > > > Legacy MP table is not actively maintained part of the code, > > hence it's

[SeaBIOS] Re: [PATCH 5/5] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: Commit 01f2736cc905d ("nvme: Pass large I/O requests as PRP lists") introduced multi-page requests using the NVMe PRP mechanism. To store the list and "first page to write to" hints, it added fields to the NVMe namespace struct. Unfortunately, that

[SeaBIOS] Re: [PATCH 1/5] nvme: Rework nvme_io_readwrite() to return -1 on error

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: Rename nvme_io_readwrite() to nvme_io_xfer() and change it so it implements the debugging dprintf() and it returns -1 on an error. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf Alex --- src/hw/nvme.c | 34

[SeaBIOS] Re: [PATCH 2/5] nvme: Add nvme_bounce_xfer() helper function

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: Move bounce buffer processing to a new helper function. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf Alex --- src/hw/nvme.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git

[SeaBIOS] Re: [PATCH 4/5] nvme: Pass prp1 and prp2 directly to nvme_io_xfer()

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: When using a prp2 parameter, build it in nvme_prpl_xfer() and pass it directly to nvme_io_xfer(). Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf Alex --- src/hw/nvme.c | 39 ++- 1 file

[SeaBIOS] Re: [PATCH 3/5] nvme: Convert nvme_build_prpl() to nvme_prpl_xfer()

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: Rename nvme_build_prpl() to nvme_prpl_xfer() and directly invoke nvme_io_xfer() or nvme_bounce_xfer() from that function. Signed-off-by: Kevin O'Connor --- src/hw/nvme-int.h | 1 - src/hw/nvme.c | 42 --

[SeaBIOS] Re: [PATCH 1/5] nvme: Rework nvme_io_readwrite() to return -1 on error

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 19:45, Kevin O'Connor wrote: Rename nvme_io_readwrite() to nvme_io_xfer() and change it so it implements the debugging dprintf() and it returns -1 on an error. Signed-off-by: Kevin O'Connor --- src/hw/nvme.c | 34 +- 1 file changed, 17

[SeaBIOS] Re: [PATCH] nvme: Only allocate one dma bounce buffer for all nvme drives

2022-01-21 Thread Alexander Graf via SeaBIOS
On 19.01.22 20:11, Kevin O'Connor wrote: There is no need to create multiple dma bounce buffers as the BIOS disk code isn't reentrant capable. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf Alex --- This is a minor cleanup on top of the previous nvme code series. -Kevin

[SeaBIOS] Re: [PATCHv2 0/6] Rework NVME page transfers and avoid fsegment allocation

2022-01-21 Thread Alexander Graf via SeaBIOS
On 21.01.22 17:48, Kevin O'Connor wrote: This is a resend of the previous series. Changes since last time: * Patch 1: Fix function comment on nvme_io_xfer() * Patch 3-5: Added "goto bounce" to nvme_io_xfer() as suggested by Alex * Patch 6: Added separate "single dma bounce buffer" patch to

[SeaBIOS] Re: [PATCHv2 3/6] nvme: Convert nvme_build_prpl() to nvme_prpl_xfer()

2022-01-21 Thread Alexander Graf via SeaBIOS
On 21.01.22 17:48, Kevin O'Connor wrote: Rename nvme_build_prpl() to nvme_prpl_xfer() and directly invoke nvme_io_xfer() or nvme_bounce_xfer() from that function. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf Alex --- src/hw/nvme-int.h | 1 - src/hw/nvme.c | 46

[SeaBIOS] Re: [PATCHv2 5/6] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Alexander Graf via SeaBIOS
On 21.01.22 17:48, Kevin O'Connor wrote: Commit 01f2736cc905d ("nvme: Pass large I/O requests as PRP lists") introduced multi-page requests using the NVMe PRP mechanism. To store the list and "first page to write to" hints, it added fields to the NVMe namespace struct. Unfortunately, that

[SeaBIOS] Re: [PATCH 5/5] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Alexander Graf via SeaBIOS
On 21.01.22 17:54, Kevin O'Connor wrote: On Fri, Jan 21, 2022 at 05:41:17PM +0100, Alexander Graf wrote: On 21.01.22 17:02, Kevin O'Connor wrote: On Fri, Jan 21, 2022 at 03:28:33PM +0100, Alexander Graf wrote: On 19.01.22 19:45, Kevin O'Connor wrote: if ((ns->block_size * count) >

[SeaBIOS] [PATCHv2 4/6] nvme: Pass prp1 and prp2 directly to nvme_io_xfer()

2022-01-21 Thread Kevin O'Connor
When using a prp2 parameter, build it in nvme_prpl_xfer() and pass it directly to nvme_io_xfer(). Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf --- src/hw/nvme.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git

[SeaBIOS] [PATCHv2 3/6] nvme: Convert nvme_build_prpl() to nvme_prpl_xfer()

2022-01-21 Thread Kevin O'Connor
Rename nvme_build_prpl() to nvme_prpl_xfer() and directly invoke nvme_io_xfer() or nvme_bounce_xfer() from that function. Signed-off-by: Kevin O'Connor --- src/hw/nvme-int.h | 1 - src/hw/nvme.c | 46 -- 2 files changed, 20 insertions(+), 27

[SeaBIOS] [PATCHv2 5/6] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Kevin O'Connor
Commit 01f2736cc905d ("nvme: Pass large I/O requests as PRP lists") introduced multi-page requests using the NVMe PRP mechanism. To store the list and "first page to write to" hints, it added fields to the NVMe namespace struct. Unfortunately, that struct resides in fseg which is read-only at

[SeaBIOS] [PATCHv2 2/6] nvme: Add nvme_bounce_xfer() helper function

2022-01-21 Thread Kevin O'Connor
Move bounce buffer processing to a new helper function. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf --- src/hw/nvme.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 608651a..d656e9b

[SeaBIOS] [PATCHv2 1/6] nvme: Rework nvme_io_readwrite() to return -1 on error

2022-01-21 Thread Kevin O'Connor
Rename nvme_io_readwrite() to nvme_io_xfer() and change it so it implements the debugging dprintf() and it returns -1 on an error. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf --- src/hw/nvme.c | 37 ++--- 1 file changed, 18 insertions(+), 19

[SeaBIOS] Re: [PATCH 5/5] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Kevin O'Connor
On Fri, Jan 21, 2022 at 05:41:17PM +0100, Alexander Graf wrote: > On 21.01.22 17:02, Kevin O'Connor wrote: > > On Fri, Jan 21, 2022 at 03:28:33PM +0100, Alexander Graf wrote: > > > On 19.01.22 19:45, Kevin O'Connor wrote: > > > >if ((ns->block_size * count) > (NVME_PAGE_SIZE * 2)) { > > >

[SeaBIOS] Re: MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag

2022-01-21 Thread Igor Mammedov
On Wed, 19 Jan 2022 15:48:20 + Peter Maydell wrote: > On Wed, 19 Jan 2022 at 14:44, Godmar Back wrote: > > after upgrading to 6.2.0, I observed that code such as MIT's xv6 (see > > [1]) is no longer able to detect multiple CPUs. Their code works in > > 6.1.1, however. > > Hi; this isn't

[SeaBIOS] [PATCH] sercon: Fix missing GET_LOW() to access rx_bytes

2022-01-21 Thread Kevin O'Connor
The variable rx_bytes is marked VARLOW, but there was a missing GET_LOW() to access rx_bytes. Fix by copying rx_bytes to a local variable and avoid the repetitive segment memory accesses. Reported-by: Gabe Black Signed-off-by: Volker RĂ¼melin Signed-off-by: Kevin O'Connor --- src/sercon.c |

[SeaBIOS] Re: [PATCH 5/5] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Kevin O'Connor
On Fri, Jan 21, 2022 at 03:28:33PM +0100, Alexander Graf wrote: > > On 19.01.22 19:45, Kevin O'Connor wrote: > > Commit 01f2736cc905d ("nvme: Pass large I/O requests as PRP lists") > > introduced multi-page requests using the NVMe PRP mechanism. To store the > > list and "first page to write to"

[SeaBIOS] Re: [PATCH 5/5] nvme: Build the page list in the existing dma buffer

2022-01-21 Thread Alexander Graf via SeaBIOS
On 21.01.22 17:02, Kevin O'Connor wrote: On Fri, Jan 21, 2022 at 03:28:33PM +0100, Alexander Graf wrote: On 19.01.22 19:45, Kevin O'Connor wrote: Commit 01f2736cc905d ("nvme: Pass large I/O requests as PRP lists") introduced multi-page requests using the NVMe PRP mechanism. To store the list

[SeaBIOS] [PATCHv2 6/6] nvme: Only allocate one dma bounce buffer for all nvme drives

2022-01-21 Thread Kevin O'Connor
There is no need to create multiple dma bounce buffers as the BIOS disk code isn't reentrant capable. Also, verify that the allocation succeeds. Signed-off-by: Kevin O'Connor Reviewed-by: Alexander Graf --- src/hw/nvme-int.h | 3 --- src/hw/nvme.c | 21 +++-- 2 files

[SeaBIOS] Re: [PATCHv2 3/6] nvme: Convert nvme_build_prpl() to nvme_prpl_xfer()

2022-01-21 Thread Kevin O'Connor
On Fri, Jan 21, 2022 at 11:48:45AM -0500, Kevin O'Connor wrote: > Rename nvme_build_prpl() to nvme_prpl_xfer() and directly invoke > nvme_io_xfer() or nvme_bounce_xfer() from that function. > > Signed-off-by: Kevin O'Connor > --- > src/hw/nvme-int.h | 1 - > src/hw/nvme.c | 46

[SeaBIOS] Re: [PATCH] smm: Suppress gcc array-bounds warnings

2022-01-21 Thread Kevin O'Connor
On Thu, Jan 13, 2022 at 05:27:11PM +0100, Paul Menzel wrote: > Dear Kevin, > > > Am 13.01.22 um 17:19 schrieb Kevin O'Connor: > > Add a hack to suppress spurious gcc array-bounds warning. > > Wow, thank you for fixing it. Maybe elaborate a little, what version it > started with, and reference

[SeaBIOS] [PATCHv2 0/6] Rework NVME page transfers and avoid fsegment allocation

2022-01-21 Thread Kevin O'Connor
This is a resend of the previous series. Changes since last time: * Patch 1: Fix function comment on nvme_io_xfer() * Patch 3-5: Added "goto bounce" to nvme_io_xfer() as suggested by Alex * Patch 6: Added separate "single dma bounce buffer" patch to this series * Patch 6: Add checking for malloc

[SeaBIOS] Re: MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag

2022-01-21 Thread Ani Sinha
On Fri, 21 Jan 2022, Igor Mammedov wrote: > As for adding ACPI support to xv6, is not so difficult if you only use > it for detecting CPUs. You only need to locate RSDP which points to > a list of ACPI tables ((X)RSDT) and then jump and parse MADT table > which is analog of MP table. It's all

[SeaBIOS] Re: MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag

2022-01-21 Thread Godmar Back
[this is a follow-up email; I took qemu-discuss and qemu-devel off the distribution list] On Thu, Jan 20, 2022 at 4:04 AM Igor Mammedov wrote: > > Legacy MP table is not actively maintained part of the code, > hence it's configuration which is not tested. > However if someone is interested in