[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: About Arm guests accessing to GICD_ICPENR

  • To: Julien Grall <julien@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Hongda Deng <Hongda.Deng@xxxxxxx>
  • Date: Tue, 7 Sep 2021 08:05:33 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QV8b/SNLW0Tjhqdk11/RrqSAJCoIZ01fAAKzO7ivC+4=; b=PDxu0c5eqWgrZuvPAVWn4NdCZ6ytlBPiZKsOTxlz3sY4aMxwNXW7nZuzbkhhgMoEX05SnguB7b0zFG27MrS1rF9yiLcgIxURQTe1/gG3Gu3faCT2pNdEoK+20U1e29h55CdW+T9k1X6rShGxHrDDdcinL1WmCu/jJsyzdSST4KvUGYVHCRH6uGNSQuzdeOsWoT6GfLUF+7Ljh8y4E4dFgbB7f7/bR7RbO5//FfrUoMIBEHkOo+IHXbwTIQTh295zc2hcU3SuU7b3aSFpP5mxLLG3AR54LaeQCdKAEd6kVRKwRIS80SfQ/UE+52bNADmBG/3aAIMMeyPthfeI2aZA7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QMRYR7P8r53exVm7qnHJMIZp3PJQPhNaNQCa9oxXrU0CaR8ohsxdtewRTm2WKt6vnJRCYTXMDBJcws7KK8k9eKGzH2xys34utm2CDCYuFWWt7NXyGgyGYm+Gaqagx3451yTe4qoOG2086NbAtl343OLEPmz2dWuXRtNkbd50HSh3FKlv6nJ+D7I2543PUVKMsuAEcVUInLep3mChy0jSQk2LmcAKI3BIQzAdlAmFa+vDKi3kplYZHmba3/b2HVx/hUnqj6FNW9FkePmT2j6/sOPiF7ODnlgdqNnreQuUndr8tN6DTa/zQ7h0LdopXH5jWDSG0qMkSFqCiVQhh5p0ig==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Tue, 07 Sep 2021 08:05:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AdejvyF8C7fiPQEXRRSQQzNI/V0p1g==
  • Thread-topic: About Arm guests accessing to GICD_ICPENR

Hi Julien,

> On 06/09/2021 10:04, Hongda Deng wrote:
> > Hi Julien,
> Hi Hongda,
> > Xen provides vGIC to support Xen guests, and currently xen will return IO
> > unhandled when guests access GICD ICPENRn registers. This works fine with
> Linux
> > guests, for Linux won't access these registers. But for Zephyr, this 
> > mechanism
> > will cause IO dataabort on Zephyr's initialization which makes Zephyr get in
> > fatal error.
> >
> > One method to ease this is to let vGIC ignore GICD ICPENRn registers 
> > access. I
> > tested it with Linux guests and Zephyr guests, and both works fine. And I 
> > found
> > in this patch[1] that it would be more complex to touch the read part for
> > I{S,C}PENDR and the write part for ICPENDR,
> Read to I{S,C}PENDR should already return. AFAIK, what's left
> unimplemented is write to ICPENDR.
> > so could we ignore GICD ICPENDRn
> > registers access to ease Zephyr's initialization problem?
> Would you be able to provide more information on how Zephyr is using it?

Zephyr will try to clear pending state at its initialization, and the code can 
found here[1].

> >
> > If Xen wants a complete GICD ICPENDRn emulation to fix it, do you have any
> > suggestions.
> Emulating ICPENDR is not easy with the existing vGIC. It would be great
> to finally have a vGIC spec compliant, but I also appreciate this is
> going to take some time.

Yes, I agree with that.

> Ignoring the access is probably the best we can do. However, this is
> also a risky approach because Zephyr (or another OS) may genuinely want
> to clear an already pending interrupt. So I would suggest to walk the
> interrupts that are meant to be modified and check whether they are
> already pending. If they are then print a message.

OK, I would add this check and warning message to my current patch to fix it 
in current stage. Is it OK?

> This would make clear to the developper that something may go wrong
> later on.
> Cheers,
> --
> Julien Grall

[1] https://github.com/zephyrproject-rtos/zephyr/blob/eaf6cf745df3807e6e




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.