[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] mem/cxl_type3: Fix overlapping region validation error
From: |
Peter Maydell |
Subject: |
Re: [PATCH] mem/cxl_type3: Fix overlapping region validation error |
Date: |
Thu, 18 Jul 2024 18:11:30 +0100 |
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.
(There's another couple of open-coded overlap tests in
cxl-mailbox-utils.c.)
thanks
-- PMM