From: Julien Grall <julien.grall@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@citrix.com>,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [PATCH 8/9] xen/arm: vgic-v3: Don't implement write-only register read as zero
Date: Fri, 13 Nov 2015 11:54:31 +0000 [thread overview]
Message-ID: <1447415672-31633-9-git-send-email-julien.grall@citrix.com> (raw)
In-Reply-To: <1447415672-31633-1-git-send-email-julien.grall@citrix.com>
A read to a write only register is unknown. Use a memorable value to
differentiate from an actual RAZ register.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
xen/arch/arm/vgic-v3.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c68afdb..44e926a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -217,12 +217,12 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
goto read_impl_defined;
case VREG64(GICR_SETLPIR):
- /* WO. Read as zero */
- goto read_as_zero_64;
+ /* WO. Read unknown */
+ goto read_unknown;
case VREG64(GICR_CLRLPIR):
- /* WO. Read as zero */
- goto read_as_zero_64;
+ /* WO. Read unknown */
+ goto read_unknown;
case 0x0050:
goto read_reserved;
@@ -239,15 +239,15 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
goto read_reserved;
case VREG64(GICR_INVLPIR):
- /* WO. Read as zero */
- goto read_as_zero_64;
+ /* WO. Read unknown */
+ goto read_unknown;
case 0x00A8:
goto read_reserved;
case VREG64(GICR_INVALLR):
- /* WO. Read as zero */
- goto read_as_zero_64;
+ /* WO. Read unknown */
+ goto read_unknown;
case 0x00B8:
goto read_reserved;
@@ -324,6 +324,10 @@ read_reserved:
v, gicr_reg);
*r = 0;
return 1;
+
+read_unknown:
+ *r = vgic_reg64_extract(0xdeadbeafdeadbeaf, info);
+ return 1;
}
static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
--
2.1.4
next prev parent reply other threads:[~2015-11-13 11:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 11:54 [PATCH 0/9] xen/arm: Bunch of fixes for the vGIC emulation Julien Grall
2015-11-13 11:54 ` [PATCH 1/9] xen/arm: vgic-v3: Use the correct offset GICR_IGRPMODR0 Julien Grall
2015-11-16 13:20 ` Ian Campbell
2015-11-13 11:54 ` [PATCH 2/9] xen/arm: vgic-v3: Only emulate identification registers requested by the spec Julien Grall
2015-11-16 13:27 ` Ian Campbell
2015-11-18 16:46 ` Julien Grall
2015-11-13 11:54 ` [PATCH 3/9] xen/arm: vgic: Properly emulate the full register Julien Grall
2015-11-16 13:29 ` Ian Campbell
2015-11-13 11:54 ` [PATCH 4/9] xen/arm: vgic-v3: Remove GICR_MOVALLR and GICR_MOVLPIR Julien Grall
2015-11-16 13:33 ` Ian Campbell
2015-11-18 16:58 ` Julien Grall
2015-11-13 11:54 ` [PATCH 5/9] xen/arm: vgic: Re-order the register emulations to match the memory map Julien Grall
2015-11-16 13:35 ` Ian Campbell
2015-11-13 11:54 ` [PATCH 6/9] xen/arm: vgic-v3: Emulate read to GICD_ICACTIVER<n> Julien Grall
2015-11-16 13:36 ` Ian Campbell
2015-11-13 11:54 ` [PATCH 7/9] xen/arm: vgic-v3: Remove spurious return in GICR_INVALLR Julien Grall
2015-11-16 13:36 ` Ian Campbell
2015-11-13 11:54 ` Julien Grall [this message]
2015-11-16 13:37 ` [PATCH 8/9] xen/arm: vgic-v3: Don't implement write-only register read as zero Ian Campbell
2015-11-13 11:54 ` [PATCH 9/9] xen/arm: vgic-v3: Make clear that GICD_*SPI_* registers are reserved Julien Grall
2015-11-16 13:39 ` Ian Campbell
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=1447415672-31633-9-git-send-email-julien.grall@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).