Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Klaus Jensen
On Jul 13 12:34, Klaus Jensen wrote: > On Jul 13 11:31, Peter Maydell wrote: > > On Tue, 13 Jul 2021 at 11:19, Klaus Jensen wrote: > > > > > > On Jul 13 11:07, Peter Maydell wrote: > > > > Looking at the surrounding code, I notice that we guard this "read size > > > > bytes > > > > from &n->bar +

Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Klaus Jensen
On Jul 13 11:31, Peter Maydell wrote: > On Tue, 13 Jul 2021 at 11:19, Klaus Jensen wrote: > > > > On Jul 13 11:07, Peter Maydell wrote: > > > Looking at the surrounding code, I notice that we guard this "read size > > > bytes > > > from &n->bar + addr" with > > > if (addr < sizeof(n->bar)) {

Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Peter Maydell
On Tue, 13 Jul 2021 at 11:19, Klaus Jensen wrote: > > On Jul 13 11:07, Peter Maydell wrote: > > Looking at the surrounding code, I notice that we guard this "read size > > bytes > > from &n->bar + addr" with > > if (addr < sizeof(n->bar)) { > > > > but that doesn't account for 'size', so if t

Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Klaus Jensen
On Jul 13 11:07, Peter Maydell wrote: > On Tue, 13 Jul 2021 at 06:44, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > The new PMR test unearthed a long-standing issue with MMIO reads on > > big-endian hosts. > > > > Fix by using the ldn_he_p helper instead of memcpy. > > > > Cc: Gollu Appa

Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Peter Maydell
On Tue, 13 Jul 2021 at 06:44, Klaus Jensen wrote: > > From: Klaus Jensen > > The new PMR test unearthed a long-standing issue with MMIO reads on > big-endian hosts. > > Fix by using the ldn_he_p helper instead of memcpy. > > Cc: Gollu Appalanaidu > Reported-by: Peter Maydell > Signed-off-by: Kl

Re: [PATCH] hw/nvme: fix mmio read

2021-07-13 Thread Gollu Appalanaidu
On Tue, Jul 13, 2021 at 07:43:59AM +0200, Klaus Jensen wrote: From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix by using the ldn_he_p helper instead of memcpy. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Je

[PATCH] hw/nvme: fix mmio read

2021-07-12 Thread Klaus Jensen
From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix by using the ldn_he_p helper instead of memcpy. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 14 +++--- 1 file changed, 7