diff mbox series

[RFC,3/3] hw/cxl/cxl-device-utils: Allow incorrect read lengths

Message ID 20210201152655.31027-4-Jonathan.Cameron@huawei.com
State New
Headers show
Series hw/arm/virt: CXL enablement including gpex-acpi | expand

Commit Message

Jonathan Cameron Feb. 1, 2021, 3:26 p.m. UTC
This is currently needed to avoid an issue in the Linux RFC
in which a read is issued that is not a multiple of DW.
On arm64 that results in byte reads being issued and a bus
error returned.

It is not yet obvious at what level this should be fixed,
so paper over it to get things working.

Not-signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 hw/cxl/cxl-device-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.19.1

Comments

Ben Widawsky Feb. 3, 2021, 4:10 p.m. UTC | #1
On 21-02-01 23:26:55, Jonathan Cameron wrote:
> This is currently needed to avoid an issue in the Linux RFC

> in which a read is issued that is not a multiple of DW.

> On arm64 that results in byte reads being issued and a bus

> error returned.

> 

> It is not yet obvious at what level this should be fixed,

> so paper over it to get things working.

> 

> Not-signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---

>  hw/cxl/cxl-device-utils.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c

> index d0d0a47122..52dd03384a 100644

> --- a/hw/cxl/cxl-device-utils.c

> +++ b/hw/cxl/cxl-device-utils.c

> @@ -181,11 +181,11 @@ static const MemoryRegionOps mailbox_ops = {

>      .write = mailbox_reg_write,

>      .endianness = DEVICE_LITTLE_ENDIAN,

>      .valid = {

> -        .min_access_size = 4,

> +        .min_access_size = 1,

>          .max_access_size = 8,

>      },

>      .impl = {

> -        .min_access_size = 4,

> +        .min_access_size = 1,

>          .max_access_size = 8,

>      },

>  };


I think this is now addressed in my v3. I'm happy to carry these patches around
in my branch if it helps.

They all lgtm
Jonathan Cameron Feb. 3, 2021, 5:26 p.m. UTC | #2
On Wed, 3 Feb 2021 08:10:32 -0800
Ben Widawsky <ben@bwidawsk.net> wrote:

> On 21-02-01 23:26:55, Jonathan Cameron wrote:

> > This is currently needed to avoid an issue in the Linux RFC

> > in which a read is issued that is not a multiple of DW.

> > On arm64 that results in byte reads being issued and a bus

> > error returned.

> > 

> > It is not yet obvious at what level this should be fixed,

> > so paper over it to get things working.

> > 

> > Not-signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > ---

> >  hw/cxl/cxl-device-utils.c | 4 ++--

> >  1 file changed, 2 insertions(+), 2 deletions(-)

> > 

> > diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c

> > index d0d0a47122..52dd03384a 100644

> > --- a/hw/cxl/cxl-device-utils.c

> > +++ b/hw/cxl/cxl-device-utils.c

> > @@ -181,11 +181,11 @@ static const MemoryRegionOps mailbox_ops = {

> >      .write = mailbox_reg_write,

> >      .endianness = DEVICE_LITTLE_ENDIAN,

> >      .valid = {

> > -        .min_access_size = 4,

> > +        .min_access_size = 1,

> >          .max_access_size = 8,

> >      },

> >      .impl = {

> > -        .min_access_size = 4,

> > +        .min_access_size = 1,

> >          .max_access_size = 8,

> >      },

> >  };  

> 

> I think this is now addressed in my v3. I'm happy to carry these patches around

> in my branch if it helps.


That would be great if you don't mind.

Thanks!

> 

> They all lgtm
diff mbox series

Patch

diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
index d0d0a47122..52dd03384a 100644
--- a/hw/cxl/cxl-device-utils.c
+++ b/hw/cxl/cxl-device-utils.c
@@ -181,11 +181,11 @@  static const MemoryRegionOps mailbox_ops = {
     .write = mailbox_reg_write,
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
-        .min_access_size = 4,
+        .min_access_size = 1,
         .max_access_size = 8,
     },
     .impl = {
-        .min_access_size = 4,
+        .min_access_size = 1,
         .max_access_size = 8,
     },
 };