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

Re: [XEN v2] GICv3: Emulate GICD_IGRPMODR as RAZ / WI


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 24 Oct 2022 10:06:42 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vHSOAM9cz3HYxb2meNSJMTfre4ZFZdxUU8qU9e6Rv0w=; b=PiaKPolovkdkYNa33uPNvjvlrPrTfWlVgUW3i6B8I85bHKIRCARP8wUss8dBvHRBy/dW5q51wsYti8iUkyrfIFJWFewC3kanMhCJeSRNrD9TEprgVQqpKC2IGW8sWjI4+EQMIeY+xLPvD5eubpZQSn1oNPvlFOCjuyNO7ZMsyMBORd8X7RM9yFOgtYx07EqBQHvpMjKB0Qj8sa7ZPaJ6VKCl4aB5rWl6rYmB/CCIYg5XA0B29GIkcLBr8yvbGmXOhIu83HYchDw14FbwLlxLnQIKhP1yMiWIyhVTpBN0HwXS08r/86A4gHOf3mvkUCBfDPB/yk7vrmuEsFmM00fbbg==
  • 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vHSOAM9cz3HYxb2meNSJMTfre4ZFZdxUU8qU9e6Rv0w=; b=Y/YswKnTKw19Y7dXiEPPZYqDped1q79G7p0htuI64F0GSQlGj+8hdXPYXCp3aZB71RtqjoslZ8fVd4kwrzKEyvVjp6t1UUDf15FAM3RhBHLGxuVY6LP7XMYZIrnwI5H4qR3LhvQ1gTRwOLUJE6QGz55SJ8agaUAbIlA4P4rKe5xu4BjEH7epurUUiNKC9Syz0jIEoyFz99xKFtBONNn9mE8dzjESdwlTyCg4qBcio0B09wnJ00HJ+kvnNgcIFEkJj+9wyWmYWtBAVIwESPUYbl5yAliS7CqbA9NoQgWK6myIERMLQ5QKhMqTnFS4HTCCE0q36aPa9xqX27AS+IBFHw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=CgAxS4v0WvVsvBUkERKoJpAn8ZMED9QcGuU/fpsEWioRxPaxogI8o9SUyAMief2dAGASrKDUUlqqOPkBUBR+fM/xyXXJoe5PzdBi//lCnGC6SPaydzYcBd/SI31IqhIzHx/tVlOMPRqlUMsDTXW+9cVF9al7xjgqP3i+SBKmauELNAZgFvozVbNb1lWxA9/mEaINY7OjSFlaXYel92+ElqUSc+8V/3qtO1htuSCu+Eh/HiREoi7XRfmbFpji54oVtnKTaIgFL5YEL9AIE6ZQNACy/+qzATiVOouaF+sRLQoFQsWA0ay2XhOZyYiWp7SUb1XNa7gk/4s1ArtP0n4dgA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LxU8rBrQkgQQ3U9UHg2Tc2OhqZHqiq0iiSGVLewuYqPMK3U80By9NVt7QTLQjrY2BZma0o2lFwuvjLGrWTItc2CRBzKKz/qWG62epESGRfYLBlIgX2x+ZP8UzBVMleYXa1Tk2Abrch5w34K0l1Cdzcp4NNDSAlqe/DyRqV8XCe1lR6TtkUOqIS/pNVhxYXHg8vkd7FAuEM7uA/FxyrNdYgVJM+xId7DpTVCNxkKjX93uDOPV3TCYNTT0JJMMI6VKxcE52HfEebT3zO9aKxQ/h187J5nADVZLSK1VSfWjpYmqQdzlJQ1boQynY6jgr20b4Al6B3cn1eiu3KnwG4QQ+Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "stefanos@xxxxxxxxxx" <stefanos@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 24 Oct 2022 10:06:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHY5HCY/1GJrkxfi0yPJz1IUtcgr64dV76A
  • Thread-topic: [XEN v2] GICv3: Emulate GICD_IGRPMODR as RAZ / WI

Hi Ayan,

> On 20 Oct 2022, at 11:41, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> Refer GIC v3 specification (Arm IHI 0069H ID020922), IGRPMODR (similar to
> IGROUPR) is relevant only when the guests run in secure/non-secure mode.

This sentence is a bit misleading as guests are always running in either secure 
or non-secure.
We should just say that we do not want guest to change the group of interrupts 
so we do as if all guests are running in non-secure.

> As Xen does not implement security extensions for guests, so the registers
> are emulated as read as zero/write ignore.

I would rephrase this as “Xen does support to run in secure mode so emulate all 
registers as the hardware does in non-secure.”

On a side note, the question might come at some point if we support to run from 
secure mode on hardware supporting it, it could be that dom0 or Xen itself 
would need to modify those.

The code is ok, just the commit message would need a bit of rework I think.

Cheers
Bertrand

> 
> Signed-off-by: Ayan Kumar Halder <ayankuma@xxxxxxx>
> ---
> 
> Observed the issue while running Zephyr on R52.
> Also, found that KVM has similar behaviour.
> 
> Changes from:-
> v1 - Moved the definitions of GICD_IGRPMODR, GICD_IGRPMODRN to gic_v3
> specific header.
> 
> xen/arch/arm/include/asm/gic_v3_defs.h | 2 ++
> xen/arch/arm/vgic-v3.c                 | 4 ++++
> 2 files changed, 6 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/gic_v3_defs.h 
> b/xen/arch/arm/include/asm/gic_v3_defs.h
> index 34ed5f857d..728e28d5e5 100644
> --- a/xen/arch/arm/include/asm/gic_v3_defs.h
> +++ b/xen/arch/arm/include/asm/gic_v3_defs.h
> @@ -30,6 +30,8 @@
> #define GICD_CLRSPI_NSR              (0x048)
> #define GICD_SETSPI_SR               (0x050)
> #define GICD_CLRSPI_SR               (0x058)
> +#define GICD_IGRPMODR                (0xD00)
> +#define GICD_IGRPMODRN               (0xD7C)
> #define GICD_IROUTER                 (0x6000)
> #define GICD_IROUTER32               (0x6100)
> #define GICD_IROUTER1019             (0x7FD8)
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 7fb99a9ff2..0c23f6df9d 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -685,6 +685,7 @@ static int __vgic_v3_distr_common_mmio_read(const char 
> *name, struct vcpu *v,
>     switch ( reg )
>     {
>     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
> +    case VRANGE32(GICD_IGRPMODR, GICD_IGRPMODRN):
>         /* We do not implement security extensions for guests, read zero */
>         if ( dabt.size != DABT_WORD ) goto bad_width;
>         goto read_as_zero;
> @@ -781,6 +782,7 @@ static int __vgic_v3_distr_common_mmio_write(const char 
> *name, struct vcpu *v,
>     switch ( reg )
>     {
>     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
> +    case VRANGE32(GICD_IGRPMODR, GICD_IGRPMODRN):
>         /* We do not implement security extensions for guests, write ignore */
>         goto write_ignore_32;
> 
> @@ -1192,6 +1194,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, 
> mmio_info_t *info,
>     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
>     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
>     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
> +    case VRANGE32(GICD_IGRPMODR, GICD_IGRPMODRN):
>         /*
>          * Above all register are common with GICR and GICD
>          * Manage in common
> @@ -1379,6 +1382,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, 
> mmio_info_t *info,
>     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
>     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
>     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
> +    case VRANGE32(GICD_IGRPMODR, GICD_IGRPMODRN):
>         /* Above registers are common with GICR and GICD
>          * Manage in common */
>         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
> -- 
> 2.17.1
> 


 


Rackspace

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