[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH] mem/cxl_type3: Fix overlapping region validation error
From: |
Xingtao Yao (Fujitsu) |
Subject: |
RE: [PATCH] mem/cxl_type3: Fix overlapping region validation error |
Date: |
Fri, 19 Jul 2024 00:50:47 +0000 |
> -----Original Message-----
> From: Peter Maydell <peter.maydell@linaro.org>
> Sent: Friday, July 19, 2024 1:12 AM
> To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Yao, Xingtao/姚 幸涛 <yaoxt.fnst@fujitsu.com>; fan.ni@samsung.com;
> qemu-devel@nongnu.org
> Subject: Re: [PATCH] mem/cxl_type3: Fix overlapping region validation error
>
> On Thu, 18 Jul 2024 at 17:37, Jonathan Cameron via
> <qemu-devel@nongnu.org> wrote:
> >
> > On Thu, 18 Jul 2024 05:07:53 -0400
> > Yao Xingtao <yaoxt.fnst@fujitsu.com> wrote:
> >
> > > When injecting a new poisoned region through qmp_cxl_inject_poison(),
> > > the newly injected region should not overlap with existing poisoned
> > > regions.
> > >
> > > The current validation method does not consider the following
> > > overlapping region:
> > > ┌───┬───────┬───┐
> > > │a │ b(a) │a │
> > > └───┴───────┴───┘
> > > (a is a newly added region, b is an existing region, and b is a
> > > subregion of a)
> > >
> > > Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
> > Looks correct to me.
> >
> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
> > I've queued it on my local branch.
> > I need to put together an updated public one.
> >
> > No huge rush to queue this up though I think as the effects
> > are minor.
>
> I think you can probably write this as
> ranges_overlap(start, len, p->start, p->length)
> using the utility function in include/qemu/ranges.h, which is
> a bit more readable than open-coding the overlap test.
Great! I will fix it in the next revision.
>
> (There's another couple of open-coded overlap tests in
> cxl-mailbox-utils.c.)
I will collect these issues and fix them in separate patches.
>
> thanks
> -- PMM