linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Zhou Wang <wangzhou1@hisilicon.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <wangwudi@hisilicon.com>,
	<liuyonglong@huawei.com>, <prime.zeng@hisilicon.com>,
	<yuzenghui@huawei.com>, Nianyao Tang <tangnianyao@huawei.com>,
	Kunkun Jiang <jiangkunkun@huawei.com>
Subject: Re: [PATCH] irqchip/gicv3-its: Add workaround for HIP09/HIP10/HIP10C erratum 162100803/162200807/162400807
Date: Mon, 15 Sep 2025 15:46:54 +0100	[thread overview]
Message-ID: <86tt13bwo1.wl-maz@kernel.org> (raw)
In-Reply-To: <5a42235e-f0d9-bbae-7742-d25025878820@hisilicon.com>

On Mon, 15 Sep 2025 15:06:35 +0100,
Zhou Wang <wangzhou1@hisilicon.com> wrote:
> 
> On 2025/9/15 20:23, Marc Zyngier wrote:
> > On Wed, 10 Sep 2025 04:27:15 +0100,
> > Zhou Wang <wangzhou1@hisilicon.com> wrote:
> >>
> 
> [...]
> 
> >>>
> >>> You are telling the ITS that it is allowed to go and access
> >>> unspecified data (16 bit worth of translations). That's not
> >>> acceptable. If you *have* to do that, then override the size in the
> >>> driver code to actually allocate the corresponding memory.
> >>
> >> Then we have to override the ITT memory to 2 ^ 16 * 8 for one device
> >> :(
> > 
> > But what's the alternative? Letting the ITS speculate in random
> > memory, possibly under the control of userspace or a guest? I don't
> > think that's acceptable.
> 
> Seems that only a bad device who could send an interrupt which is not be
> declared may bring a problem here.
> 
> Not sure how dose userspace or a guest make a problem here?

Assign a device to a guest, let it generate an MSI with an event-id
that's in the correct range, observe it accessing the memory.

All you need is to be in control of how the device generates MSIs.

> >>>> +#ifdef CONFIG_HISILICON_ERRATUM_162100803
> >>>> +	{
> >>>> +		.desc = "ITS: Hip09 erratum 162100803",
> >>>> +		.iidr = 0x00051736,
> >>>> +		.mask = 0xffffffff,
> >>>> +		.init = its_enable_quirk_162100803,
> >>>> +	},
> >>>> +	{
> >>>> +		.desc = "ITS: Hip10 erratum 162200807",
> >>>> +		.iidr = 0x01051736,
> >>>> +		.mask = 0xffffffff,
> >>>> +		.init = its_enable_quirk_162100803,
> >>>> +	},
> >>>> +	{
> >>>> +		.desc = "ITS: Hip10c erratum 162400807",
> >>>> +		.iidr = 0x00061736,
> >>>> +		.mask = 0xffffffff,
> >>>> +		.init = its_enable_quirk_162100803,
> >>>
> >>> Can you try to merge these three entries and adjust the mask
> >>> accordingly? mask=0xeffcffff should do the trick, assuming that you
> >>> don't have any other hardware overlapping this.
> >>
> >> The iidrs are different, how to merge these entries?
> > 
> > By using the mask:
> > 
> > 	{
> > 		.desc = "ITS: Hip10 erratum, will eat your vSGIs",
> > 		.iidr = 0x01051736,
> > 		.mask = 0xeffcffff,
> > 		.init = its_enable_quirk_162100803,
> > 	},
> > 
> > will match all three platforms, assuming I got the mask correctly.
> 
> iidrs are differet, so one iidr can not match all. e.g.
> for iidr = 0x00061736, mask with 0xeffcffff will be 0x00041736, which
> will not be 0x01051736.

Sorry, copy paste, and wrong mask. This works (I actually checked):

	{
		.desc = "ITS: Hip10 erratum, will eat your vSGIs",
		.iidr = 0x00041736,
		.mask = 0xfefcffff,
		.init = its_enable_quirk_162100803,
	},

	M.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2025-09-15 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 11:06 [PATCH] irqchip/gicv3-its: Add workaround for HIP09/HIP10/HIP10C erratum 162100803/162200807/162400807 Zhou Wang
2025-09-09 13:57 ` Marc Zyngier
2025-09-10  3:27   ` Zhou Wang
2025-09-15 12:23     ` Marc Zyngier
2025-09-15 14:06       ` Zhou Wang
2025-09-15 14:46         ` Marc Zyngier [this message]
2025-09-26  7:22           ` Zhou Wang

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=86tt13bwo1.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=jiangkunkun@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=liuyonglong@huawei.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=tangnianyao@huawei.com \
    --cc=wangwudi@hisilicon.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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).