qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
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
Date: Thu, 18 Jul 2024 18:11:30 +0100	[thread overview]
Message-ID: <CAFEAcA8UOwr6tuvPLZSPn8vzwpEnUrOW-2x184K2O281H7J07Q@mail.gmail.com> (raw)
In-Reply-To: <20240718173614.00006d13@Huawei.com>

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


  reply	other threads:[~2024-07-18 17:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240718090810uscas1p17441e84b4594875648bf24e07549166f@uscas1p1.samsung.com>
2024-07-18  9:07 ` [PATCH] mem/cxl_type3: Fix overlapping region validation error Yao Xingtao via
2024-07-18 16:36   ` Jonathan Cameron via
2024-07-18 17:11     ` Peter Maydell [this message]
2024-07-19  0:50       ` Xingtao Yao (Fujitsu) via
2024-07-18 17:34   ` Fan Ni
2024-07-19  0:41     ` Xingtao Yao (Fujitsu) via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA8UOwr6tuvPLZSPn8vzwpEnUrOW-2x184K2O281H7J07Q@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=fan.ni@samsung.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yaoxt.fnst@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).