xen/arm: vgic to ignore GICD ICPENRn registers access
PATCH v2 1/1 xen/arm: vgic to ignore GICD ICPENRn registers access
Currently, Xen will return IO unhandled when guests access GICD ICPENRn registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.html
--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 10 deletions(-)
xen/arch/arm/vgic-v2.c +25 -1
@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: vGICD: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, r, gicd_reg -GICD_ICPENDR ); -return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: vGICD: ICPENDR%d=0x%08x\n" , + v, gicd_reg -GICD_ICPENDR , irq_pending); + goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;
xen/arch/arm/vgic-v3.c +31 -9
@@ -816,11 +816,35 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: %s: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, name, r, reg -GICD_ICPENDR ); -return 0 ; + + irq_start = (reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: %s: ICPENDR%d=0x%08x\n" , + v, name, reg -GICD_ICPENDR , irq_pending); + goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;
@@ -978,19 +1002,17 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,case VREG32 (GICR_ICFGR1 ):case VRANGE32 (GICR_IPRIORITYR0 ,GICR_IPRIORITYR7 ):case VREG32 (GICR_ISPENDR0 ): -/* -* Above registers offset are common with GICD. -* So handle common with GICD handling -*/ +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/ return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, info, gicr_reg, r);case VREG32 (GICR_ICPENDR0 ):if ( dabt.size !=DABT_WORD ) goto bad_width; -printk (XENLOG_G_ERR -"%pv: vGICR: SGI: unhandled word write %#" PRIregister" to ICPENDR0\n" , - v, r); -return 0 ; +return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, + info, gicr_reg, r);case VREG32 (GICR_IGRPMODR0 ):/* We do not implement security extensions for guests, write ignore */
Signature · 1 line
2.17.1
Hi,
Quoted 9 lines · Hongda Deng
Currently, Xen will return IO unhandled when guests access GICD ICPENRn registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
The link you provide only states that I am happy with the warning. This doesn't seem relevant for a future reader. Did you intend to point to something different?
Quoted 18 lines
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.htmlSigned-off-by Hongda Deng <[email protected]>--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 10 deletions(-)xen/arch/arm/vgic-v2.c +0
-0@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ):
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 492
Quoted 10 lines
xen/arch/arm/vgic-v2.c +6
-0+ { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: vGICD: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, r, gicd_reg -GICD_ICPENDR );
As I wrote in v1, we should avoid to print a message when we know there is no pending interrupts.
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 497
Quoted 6 lines
xen/arch/arm/vgic-v2.c +5
-1-return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight)
You need to hold v->arch.vgic.lock (with interrupt disabled) to go through the list of inflight irqs. Otherwise, the list may be modified while you are walking it.
However, I am a little bit concerned with this approached (I noticed Stefano suggested). The list may in theory contains a few hundreds interrupts (a malicious OS May decide to never read IAR). So we are potentially doing more work than necessary (we need to think about the worse case scenario).
Instead, I think it would be better to go through the 32 interrupts and for each of them:
1) find the pending_irq() using irq_to_pending()
2) check if the IRQ in the inflight list with list_empty(&p->inflight)
In addition to that, you want to check that the rank exists so we don't do any extra work if the guest is trying to clear an interrupts above the number of interrupts we support.
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 509
Quoted 12 lines
xen/arch/arm/vgic-v2.c +12
-0+ { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: vGICD: ICPENDR%d=0x%08x\n" , + v, gicd_reg -GICD_ICPENDR , irq_pending);
This message is a bit confusing. I think it would be worth to print a message for every interrupt not cleared. Maybe something like:
"%pv trying to clear pending interrupt %u."
Quoted 31 lines
xen/arch/arm/vgic-v2.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;xen/arch/arm/vgic-v3.c +13
-1@@ -816,11 +816,35 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: %s: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, name, r, reg -GICD_ICPENDR ); -return 0 ; + + irq_start = (reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq )
xen/arch/arm/vgic-v3.c static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v, · line 845
Quoted 10 lines
xen/arch/arm/vgic-v3.c +10
-0+continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: %s: ICPENDR%d=0x%08x\n" , + v, name, reg -GICD_ICPENDR , irq_pending);
My remarks apply for GICv3 as well. Note that in the case of GICv3 v may not be current.
That said, the code is quite similar and not trivial. Can we provide an helper that can be used for the two GICs?
Quoted 7 lines
xen/arch/arm/vgic-v3.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;@@ -978,19 +1002,17 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,case VREG32 (GICR_ICFGR1 ):
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info, · line 1008
Quoted 10 lines
xen/arch/arm/vgic-v3.c +4
-4case VRANGE32 (GICR_IPRIORITYR0 ,GICR_IPRIORITYR7 ):case VREG32 (GICR_ISPENDR0 ): -/* -* Above registers offset are common with GICD. -* So handle common with GICD handling -*/ +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/
This looks like a spurious change.
Quoted 5 lines
xen/arch/arm/vgic-v3.c +0
-0return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, info, gicr_reg, r);case VREG32 (GICR_ICPENDR0 ):
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info, · line 1018
Quoted 10 lines
xen/arch/arm/vgic-v3.c +2
-4if ( dabt.size !=DABT_WORD ) goto bad_width; -printk (XENLOG_G_ERR -"%pv: vGICR: SGI: unhandled word write %#" PRIregister" to ICPENDR0\n" , - v, r); -return 0 ; +return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, + info, gicr_reg, r);case VREG32 (GICR_IGRPMODR0 ):/* We do not implement security extensions for guests, write ignore */
Cheers,
Signature · 1 line
Julien Grall
Quoted 63 lines · Julien Grall
Quoted 9 lines · Hongda Deng
Currently, Xen will return IO unhandled when guests access GICD ICPENRn registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
The link you provide only states that I am happy with the warning. This doesn't seem relevant for a future reader. Did you intend to point to something different?
Quoted 19 lines
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.htmlSigned-off-by Hongda Deng <[email protected]>--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 10 deletions(-)xen/arch/arm/vgic-v2.c +1
-0@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v,mmio_info_t *info, return 1;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + {xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, · line 493
Quoted 10 lines
xen/arch/arm/vgic-v2.c +5
-0+struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: vGICD: unhandled word write %#"PRIregister" to ICPENDR%d\n", v, r, gicd_reg - GICD_ICPENDR);As I wrote in v1, we should avoid to print a message when we know there is no pending interrupts.
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 497
Quoted 6 lines
xen/arch/arm/vgic-v2.c +5
-1-return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight)You need to hold
v->arch.vgic.lock(with interrupt disabled) to go through the list of inflight irqs. Otherwise, the list may be modified while you are walking it.However, I am a little bit concerned with this approached (I noticed Stefano suggested). The list may in theory contains a few hundreds interrupts (a malicious OS May decide to never read IAR). So we are potentially doing more work than necessary (we need to think about the worse case scenario).
Quoted 8 lines
Instead, I think it would be better to go through the 32 interrupts and for each of them:
1) find thepending_irq()usingirq_to_pending()
2) check if the IRQ in the inflight list withlist_empty(&p->inflight)In addition to that, you want to check that the rank exists so we don't do any extra work if the guest is trying to clear an interrupts above the number of interrupts we support.
This is a good approach and it should be fast.
In the normal case, iterating over inflight_irqs should be fine because there are typically no more than 2-3 inflight interrupts. So in the normal case iterating over inflight_irqs will be typically faster but in the worst case it could be bad because the theoretical max is high: it is only bounded by the total amount of interrupts assigned to the domU and by the vgic IRQ limit. So theoretically it is possible that we could have to walk a list with a hundred elements or more.
Your suggestion has the advantage that the compute time becomes deterministic. Alternatively, we could #ifdef DEBUG the walk over the inflight_irqs list. I am fine either way but I prefer your suggestion.
Hi,
Quoted 22 lines
-----Original Message-----
From: Julien Grall <[email protected]>
Sent: 2021年10月13日 5:58
To: Hongda Deng <[email protected]>; [email protected]; [email protected]
Cc: Bertrand Marquis <[email protected]>; Wei Chen <[email protected]>
Subject: Re: [PATCH v2] xen/arm: vgic to ignore GICD ICPENRn registers accessHi,
Quoted 9 lines · Hongda Deng
Currently, Xen will return IO unhandled when guests access GICD ICPENRn registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
Quoted 4 lines
The link you provide only states that I am happy with the warning. This doesn't seem relevant for a future reader. Did you intend to point to something different?
Yes, I would attach this link [1] then, which explains how zephyr accesses ICPENDR at its initialization. ( Though I still don't understand why zephyr would clear this register at initialization while linux wouldn't )
Quoted 28 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v,
Quoted 15 lines
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.htmlSigned-off-by Hongda Deng <[email protected]>--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 10 deletions(-)xen/arch/arm/vgic-v2.c +0
-0@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v,
mmio_info_t*info,xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
Quoted 12 lines
xen/arch/arm/vgic-v2.c +6
-0return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { + struct pending_irq *iter; + unsigned int irq_start; + unsigned int irq_end; + uint32_t irq_pending = 0; + if ( dabt.size != DABT_WORD ) goto bad_width; printk(XENLOG_G_ERR "%pv: vGICD: unhandled word write %#"PRIregister" to
Quoted 6 lines
ICPENDR%d\n",
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 492
Quoted 1 line
xen/arch/arm/vgic-v2.c +0
-0v, r, gicd_reg - GICD_ICPENDR);As I wrote in v1, we should avoid to print a message when we know there is no pending interrupts.
These are not the modifications made in this patch, and same codes also exist for ICACTIVER. I didn't delete them for that I think they are used to give some useful and coherent messages to user for reference. Should we delete it for both or only for ICPENDR?
Quoted 10 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 497
Quoted 6 lines
xen/arch/arm/vgic-v2.c +5
-1-return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight)You need to hold
v->arch.vgic.lock(with interrupt disabled) to go through the list of inflight irqs. Otherwise, the list may be modified while you are walking it.
Ack.
Quoted 6 lines
However, I am a little bit concerned with this approached (I noticed Stefano suggested). The list may in theory contains a few hundreds interrupts (a malicious OS May decide to never read IAR). So we are potentially doing more work than necessary (we need to think about the worse case scenario).
Quoted 9 lines
Instead, I think it would be better to go through the 32 interrupts and for each of them:
1) find thepending_irq()usingirq_to_pending()
2) check if the IRQ in the inflight list withlist_empty(&p->inflight)In addition to that, you want to check that the rank exists so we don't do any extra work if the guest is trying to clear an interrupts above the number of interrupts we support.
Agreed, and that's quite helpful.
Quoted 16 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 509
Quoted 12 lines
xen/arch/arm/vgic-v2.c +12
-0+ { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: vGICD: ICPENDR%d=0x%08x\n" , + v, gicd_reg -GICD_ICPENDR , irq_pending);This message is a bit confusing. I think it would be worth to print a message for every interrupt not cleared. Maybe something like:
Quoted 2 lines
"%pv trying to clear pending interrupt %u."
I was thinking that there may be too many interrupts there, to print each with one message line would be too superfluous.
But that worst case scenario should not be usual, and print a message for each interrupt would be much clearer.
Ack.
Quoted 37 lines
xen/arch/arm/vgic-v3.c static int
Quoted 10 lines
xen/arch/arm/vgic-v2.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;xen/arch/arm/vgic-v3.c +0
-0@@ -816,11 +816,35 @@ static int__vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
Quoted 26 lines
xen/arch/arm/vgic-v3.c +18
-1return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: %s: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, name, r, reg -GICD_ICPENDR ); -return 0 ; + + irq_start = (reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + }
Quoted 9 lines
xen/arch/arm/vgic-v3.c static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v, · line 845
Quoted 5 lines
xen/arch/arm/vgic-v3.c +5
-0+ +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: %s: ICPENDR%d=0x%08x\n" , + v, name, reg -GICD_ICPENDR , irq_pending);My remarks apply for GICv3 as well. Note that in the case of GICv3 v may not be current.
I am a bit confused why v may not be current for GICv3? Does that mean that for SPI we should use vgic_get_target_vcpu() to get its correct vcpu on GICv3 and multi cores?
Quoted 3 lines
That said, the code is quite similar and not trivial. Can we provide an helper that can be used for the two GICs?
Yes, to provide a helper function in vgic.c would be more helpful.
Quoted 19 lines
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct
Quoted 6 lines
xen/arch/arm/vgic-v3.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;@@ -978,19 +1002,17 @@ static int vgic_v3_rdistr_sgi_mmio_write(structvcpu *v,
mmio_info_t*info,xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info, · line 1008
Quoted 11 lines
xen/arch/arm/vgic-v3.c +4
-4case VREG32 (GICR_ICFGR1 ):case VRANGE32 (GICR_IPRIORITYR0 ,GICR_IPRIORITYR7 ):case VREG32 (GICR_ISPENDR0 ): -/* -* Above registers offset are common with GICD. -* So handle common with GICD handling -*/ +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/
Quoted 2 lines
This looks like a spurious change.
I moved this comment to the left by one space to apply format style to be coherent with others.
I will undo this modification and write another patch to fix it if needed.
Quoted 13 lines
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
Quoted 7 lines
xen/arch/arm/vgic-v3.c +0
-2return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, info, gicr_reg, r);case VREG32 (GICR_ICPENDR0 ):if ( dabt.size !=DABT_WORD ) goto bad_width; -printk (XENLOG_G_ERR - "%pv: vGICR: SGI: unhandled word write %#"PRIregister" toICPENDR0\n",
Quoted 5 lines
xen/arch/arm/vgic-v3.c +2
-2- v, r); -return 0 ; +return __vgic_v3_distr_common_mmio_write ("vGICR: SGI" , v, + info, gicr_reg, r);
Quoted 8 lines
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info, · line 1018
Quoted 3 lines
xen/arch/arm/vgic-v3.c +0
-0case VREG32 (GICR_IGRPMODR0 ):/* We do not implement security extensions for guests, write ignore */ Cheers,
--
Julien Grall
This is quite a good approach as Stefano said and helps a lot to me.
But I am still confused about the difference between vGICv2 and vGICv3 on checking inflight irqs.
I will send patch version3 ASAP.
[1] https://github.com/zephyrproject-rtos/zephyr/blob/eaf6cf745df3807e6e
cc941c3a30de6c179ae359/drivers/interrupt_controller/intc_gicv3.c#L274
Cheers,
Hongda
Quoted 1 line · Hongda Deng
Hi,
Hi,
Quoted 22 lines
Quoted 22 lines
-----Original Message-----
From: Julien Grall <[email protected]>
Sent: 2021年10月13日 5:58
To: Hongda Deng <[email protected]>; [email protected]; [email protected]
Cc: Bertrand Marquis <[email protected]>; Wei Chen <[email protected]>
Subject: Re: [PATCH v2] xen/arm: vgic to ignore GICD ICPENRn registers accessHi,
Quoted 9 lines · Hongda Deng
Currently, Xen will return IO unhandled when guests access GICD ICPENRn registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
Quoted 8 lines
Quoted 4 lines
The link you provide only states that I am happy with the warning. This doesn't seem relevant for a future reader. Did you intend to point to something different?
Yes, I would attach this link [1] then, which explains how zephyr accesses ICPENDR at its initialization. ( Though I still don't understand why zephyr would clear this register at initialization while linux wouldn't )
I am confused as well. From my understanding, clearing ICPENDR at initialization is pointless for level interrupts if you didn't quiesce the device beforehand.
The git history doesn't seem to give much details on the reason. But looking at the code, I am wondering if the intention was to clear the active bit rather than the pending bit.
Quoted 32 lines
Quoted 32 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v,
Quoted 16 lines
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.htmlSigned-off-by Hongda Deng <[email protected]>--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 10 deletions(-)xen/arch/arm/vgic-v2.c +0
-0@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v,
mmio_info_t*info,xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
Quoted 12 lines
xen/arch/arm/vgic-v2.c +6
-0return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { + struct pending_irq *iter; + unsigned int irq_start; + unsigned int irq_end; + uint32_t irq_pending = 0; + if ( dabt.size != DABT_WORD ) goto bad_width; printk(XENLOG_G_ERR "%pv: vGICD: unhandled word write %#"PRIregister" toICPENDR%d\n",
Quoted 1 line
xen/arch/arm/vgic-v2.c +0
-0v, r, gicd_reg - GICD_ICPENDR);
Quoted 8 lines
Quoted 3 lines
As I wrote in v1, we should avoid to print a message when we know there is no pending interrupts.
These are not the modifications made in this patch, and same codes also exist for ICACTIVER. I didn't delete them for that I think they are used to give some useful and coherent messages to user for reference. Should we delete it for both or only for ICPENDR?
Looking at the implementation ICACTIVER, we simply ignore the write so it makes sense to print a message everytime.
This is quite different to the implementation of ICPENDR as we will partially emulate it. We technically emulated the register correctly when there is no pending interrupts, so I think it is wrong to print a message state this wasn't handled properly.
Therefore, I would like this message to only appear when we know the write wasn't handled properly.
Quoted 24 lines
Quoted 10 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 497
Quoted 6 lines
xen/arch/arm/vgic-v2.c +5
-1-return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight)You need to hold
v->arch.vgic.lock(with interrupt disabled) to go through the list of inflight irqs. Otherwise, the list may be modified while you are walking it.Ack.
Quoted 11 lines
However, I am a little bit concerned with this approached (I noticed Stefano suggested). The list may in theory contains a few hundreds interrupts (a malicious OS May decide to never read IAR). So we are potentially doing more work than necessary (we need to think about the worse case scenario).
Instead, I think it would be better to go through the 32 interrupts and for each of them:
1) find thepending_irq()usingirq_to_pending()
2) check if the IRQ in the inflight list withlist_empty(&p->inflight)
Quoted 6 lines
Quoted 4 lines
In addition to that, you want to check that the rank exists so we don't do any extra work if the guest is trying to clear an interrupts above the number of interrupts we support.
Agreed, and that's quite helpful.
I forgot to mention that you may need to be careful with the locking. If I am not mistaken, "inflight" is protected with the arch.vgic.lock of vgic_get_target_vcpu();
Quoted 6 lines
Quoted 6 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 503
Quoted 6 lines
xen/arch/arm/vgic-v2.c +6
-0+ { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start));
Looking at this code again. You want to check whether the guest requested to clear the interrupt. Otherwise, we may get spurious warning.
Quoted 10 lines
Quoted 10 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 509
Quoted 6 lines
xen/arch/arm/vgic-v2.c +6
-0+ } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: vGICD: ICPENDR%d=0x%08x\n" , + v, gicd_reg -GICD_ICPENDR , irq_pending);This message is a bit confusing. I think it would be worth to print a message for every interrupt not cleared. Maybe something like:
Quoted 7 lines
Quoted 2 lines
"%pv trying to clear pending interrupt %u."
I was thinking that there may be too many interrupts there, to print each with one message line would be too superfluous.
But that worst case scenario should not be usual, and print a message for each interrupt would be much clearer.
In the worst case scenario, we would print 32 messages. We could possibly optimize to print all the interrupts on one line, but I don't think it is worth it. In most of the cases, you will have at most a couple of interrupts pending. If you have more, the XENLOG_G_ERR messages are ratelimited so there is no risk to flood the console.
Quoted 47 lines
Quoted 37 lines
xen/arch/arm/vgic-v3.c static int
Quoted 10 lines
xen/arch/arm/vgic-v2.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;xen/arch/arm/vgic-v3.c +0
-0@@ -816,11 +816,35 @@ static int__vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
Quoted 26 lines
xen/arch/arm/vgic-v3.c +18
-1return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { +struct pending_irq *iter; +unsigned int irq_start; +unsigned int irq_end; +uint32_t irq_pending =0 ; +if ( dabt.size !=DABT_WORD ) goto bad_width;printk (XENLOG_G_ERR "%pv: %s: unhandled word write %#" PRIregister" to ICPENDR%d\n" , v, name, r, reg -GICD_ICPENDR ); -return 0 ; + + irq_start = (reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + }Quoted 9 lines
xen/arch/arm/vgic-v3.c static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v, · line 845
Quoted 5 lines
xen/arch/arm/vgic-v3.c +5
-0+ +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: %s: ICPENDR%d=0x%08x\n" , + v, name, reg -GICD_ICPENDR , irq_pending);My remarks apply for GICv3 as well. Note that in the case of GICv3 v may not be current.
Quoted 1 line
I am a bit confused why v may not be current for GICv3?
Unlike on GICv2, the ICPENDR0 is not banked. Instead, they are part of the re-distributor. So vCPU A could write into vCPU B re-distributor.
Quoted 3 lines
Does that mean
that for SPI we should usevgic_get_target_vcpu()to get its correct vcpu on GICv3 and multi cores?
You should do that for both GICv2 and GICv3 when dealing with SPIs.
Quoted 14 lines
Quoted 14 lines
xen/arch/arm/vgic-v3.c static int vgic_v3_rdistr_sgi_mmio_write(struct
Quoted 1 line
xen/arch/arm/vgic-v3.c +0
-0@@ -978,19 +1002,17 @@ static int vgic_v3_rdistr_sgi_mmio_write(structvcpu *v,
mmio_info_t*info,Quoted 11 lines
xen/arch/arm/vgic-v3.c +4
-4case VREG32 (GICR_ICFGR1 ):case VRANGE32 (GICR_IPRIORITYR0 ,GICR_IPRIORITYR7 ):case VREG32 (GICR_ISPENDR0 ): -/* -* Above registers offset are common with GICD. -* So handle common with GICD handling -*/ +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/
Quoted 5 lines
Quoted 2 lines
This looks like a spurious change.
I moved this comment to the left by one space to apply format style to be coherent with others.
Ah yes, there is one more space. But all the * should be aligned like below:
/*
* Foo
* Bar
*/
Quoted 1 line
I will undo this modification and write another patch to fix it if needed.
I am usually OK with coding style change within a functional patch if they are around the code modified. This is not the case here, so please send it separately.
Cheers,
Signature · 1 line
Julien Grall
Hi,
Quoted 48 lines
-----Original Message-----
From: Julien Grall <[email protected]>
Sent: 2021年10月14日 17:30
To: Hongda Deng <[email protected]>; xen- [email protected]; [email protected]
Cc: Bertrand Marquis <[email protected]>; Wei Chen <[email protected]>
Subject: Re: [PATCH v2] xen/arm: vgic to ignore GICD ICPENRn registers accessQuoted 1 line · Hongda Deng
Hi,
Hi,
Quoted 4 lines
Quoted 4 lines
-----Original Message-----
From: Julien Grall <[email protected]>
Sent: 2021年10月13日 5:58
To: Hongda Deng <[email protected]>; xen-Quoted 4 lines
Quoted 4 lines
[email protected]
Cc: Bertrand Marquis <[email protected]>; Wei Chen <[email protected]>
Subject: Re: [PATCH v2] xen/arm: vgic to ignore GICD ICPENRn registersaccess
Quoted 5 lines
Quoted 5 lines
Hi,
Quoted 1 line · Hongda Deng
Currently, Xen will return IO unhandled when guests access GICD
ICPENRn
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
registers. This will raise a data abort inside guest. For Linux Guest, these virtual registers will not be accessed. But for Zephyr, in its GIC initialization code, these virtual registers will be accessed. And zephyr guest will get an IO data abort in initilization stage and enter fatal error. Emulating ICPENDR is not easy with the existing vGIC, so we currently ignore these virtual registers access and print a message about whether they are already pending instead of returning unhandled. More details can be found at [1].
Quoted 8 lines
Quoted 4 lines
The link you provide only states that I am happy with the warning. This doesn't seem relevant for a future reader. Did you intend to point to something different?
Yes, I would attach this link [1] then, which explains how zephyr accesses ICPENDR at its initialization. ( Though I still don't understand why zephyr would clear this register at initialization while linux wouldn't )
Quoted 8 lines
I am confused as well. From my understanding, clearing ICPENDR at initialization is pointless for level interrupts if you didn't quiesce the device beforehand.
The git history doesn't seem to give much details on the reason. But looking at the code, I am wondering if the intention was to clear the active bit rather than the pending bit.
I will try to find someone works on zephyr to see it if he/she knows that.
Quoted 49 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
[1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/
msg00744.htmlSigned-off-by Hongda Deng <[email protected]>--- xen/arch/arm/vgic-v2.c | 26 +++++++++++++++++++++++++- xen/arch/arm/vgic-v3.c | 40 +++++++++++++++++++++++++++++++---------
Quoted 7 lines
Quoted 7 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct
Quoted 7 lines
2 files changed, 56 insertions(+), 10 deletions(-)xen/arch/arm/vgic-v2.c +0
-0@@ -480,11 +480,35 @@ static int vgic_v2_distr_mmio_write(structvcpu *v,
Quoted 13 lines
Quoted 13 lines
mmio_info_t*info,Quoted 12 lines
xen/arch/arm/vgic-v2.c +6
-0return 1 ;case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { + struct pending_irq *iter; + unsigned int irq_start; + unsigned int irq_end; + uint32_t irq_pending = 0; + if ( dabt.size != DABT_WORD ) goto bad_width; printk(XENLOG_G_ERR "%pv: vGICD: unhandled word write %#"PRIregister" toQuoted 8 lines
Quoted 6 lines
ICPENDR%d\n",
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 492
Quoted 1 line
xen/arch/arm/vgic-v2.c +0
-0v, r, gicd_reg - GICD_ICPENDR);As I wrote in v1, we should avoid to print a message when we know there is no pending interrupts.
These are not the modifications made in this patch, and same codes also
exist
Quoted 1 line
for ICACTIVER. I didn't delete them for that I think they are used to give
some
Quoted 1 line
useful and coherent messages to user for reference. Should we delete it
for both
Quoted 1 line
or only for ICPENDR?
Looking at the implementation ICACTIVER, we simply ignore the write so it makes sense to print a message everytime.
Quoted 8 lines
This is quite different to the implementation of ICPENDR as we will partially emulate it. We technically emulated the register correctly when there is no pending interrupts, so I think it is wrong to print a message state this wasn't handled properly.
Therefore, I would like this message to only appear when we know the write wasn't handled properly.
Ack, I will fix it in next patch.
Quoted 29 lines
Quoted 29 lines
Quoted 10 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 497
Quoted 6 lines
xen/arch/arm/vgic-v2.c +5
-1-return 0 ; + + irq_start = (gicd_reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight)You need to hold
v->arch.vgic.lock(with interrupt disabled) to go through the list of inflight irqs. Otherwise, the list may be modified while you are walking it.Ack.
Quoted 15 lines
However, I am a little bit concerned with this approached (I noticed Stefano suggested). The list may in theory contains a few hundreds interrupts (a malicious OS May decide to never read IAR). So we are potentially doing more work than necessary (we need to think about the worse case scenario).
Instead, I think it would be better to go through the 32 interrupts and for each of them:
1) find thepending_irq()usingirq_to_pending()
2) check if the IRQ in the inflight list withlist_empty(&p->inflight)In addition to that, you want to check that the rank exists so we don't do any extra work if the guest is trying to clear an interrupts above the number of interrupts we support.
Quoted 6 lines
Quoted 1 line
Agreed, and that's quite helpful.
I forgot to mention that you may need to be careful with the locking. If I am not mistaken, "inflight" is protected with the arch.vgic.lock of
vgic_get_target_vcpu();
Yeah, I noticed that. Thanks ~
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
xen/arch/arm/vgic-v2.c static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info, · line 503
Quoted 6 lines
xen/arch/arm/vgic-v2.c +6
-0+ { +if ( iter->irq < irq_start || irq_end < iter->irq ) +continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start));Looking at this code again. You want to check whether the guest requested to clear the interrupt. Otherwise, we may get spurious warning.
Ack.
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
xen/arch/arm/vgic-v2.c +6
-0+ } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: vGICD: ICPENDR%d=0x%08x\n" , + v, gicd_reg -GICD_ICPENDR , irq_pending);Quoted 7 lines
Quoted 5 lines
This message is a bit confusing. I think it would be worth to print a message for every interrupt not cleared. Maybe something like:
"%pv trying to clear pending interrupt %u."
I was thinking that there may be too many interrupts there, to print each
with
Quoted 2 lines
one message line would be too superfluous.
But that worst case scenario should not be usual, and print a message for
Quoted 9 lines
each
Quoted 1 line
interrupt would be much clearer.
In the worst case scenario, we would print 32 messages. We could possibly optimize to print all the interrupts on one line, but I don't think it is worth it. In most of the cases, you will have at most a couple of interrupts pending. If you have more, the
XENLOG_G_ERRmessages are ratelimited so there is no risk to flood the console.
Ack.
Quoted 48 lines
Quoted 13 lines
Quoted 13 lines
xen/arch/arm/vgic-v3.c static int
Quoted 10 lines
xen/arch/arm/vgic-v2.c +2
-0+ goto write_ignore_32; + }case VRANGE32 (GICD_ISACTIVER ,GICD_ISACTIVERN ):if ( dabt.size !=DABT_WORD ) goto bad_width;xen/arch/arm/vgic-v3.c +0
-0@@ -816,11 +816,35 @@ static int__vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
Quoted 2 lines
xen/arch/arm/vgic-v3.c +0
-0return 1 ;Quoted 10 lines
Quoted 10 lines
xen/arch/arm/vgic-v3.c static int · line 827
Quoted 10 lines
xen/arch/arm/vgic-v3.c +6
-0case VRANGE32 (GICD_ICPENDR ,GICD_ICPENDRN ): + { + struct pending_irq *iter; + unsigned int irq_start; + unsigned int irq_end; + uint32_t irq_pending = 0; + if ( dabt.size != DABT_WORD ) goto bad_width; printk(XENLOG_G_ERR "%pv: %s: unhandled word write %#"PRIregister" toICPENDR%d\n",
Quoted 24 lines
Quoted 23 lines
Quoted 9 lines
xen/arch/arm/vgic-v3.c +7
-1v, name, r, reg - GICD_ICPENDR); -return 0 ; + + irq_start = (reg -GICD_ICPENDR ) *32 ; + irq_end = irq_start +31 ; +/* go through inflight_irqs and print specified pending irqs */ +list_for_each_entry (iter, &v->arch.vgic.inflight_irqs, inflight) + { +if ( iter->irq < irq_start || irq_end < iter->irq )xen/arch/arm/vgic-v3.c static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v, · line 845
Quoted 10 lines
xen/arch/arm/vgic-v3.c +10
-0+continue ; + +if (test_bit (GIC_IRQ_GUEST_QUEUED , &iter->status) ) + irq_pending = irq_pending | (1 << (iter->irq - irq_start)); + } + +if ( irq_pending !=0 ) +printk (XENLOG_G_ERR +"%pv: %s: ICPENDR%d=0x%08x\n" , + v, name, reg -GICD_ICPENDR , irq_pending);My remarks apply for GICv3 as well. Note that in the case of GICv3 v may not be current.
Quoted 5 lines
Quoted 1 line
I am a bit confused why v may not be current for GICv3?
Unlike on GICv2, the ICPENDR0 is not banked. Instead, they are part of the re-distributor. So vCPU A could write into vCPU B re-distributor.
Ok, I think this is what I need, and I will find it out.
Quoted 6 lines
Quoted 3 lines
Does that mean
that for SPI we should usevgic_get_target_vcpu()to get its correct vcpu on GICv3 and multi cores?You should do that for both GICv2 and GICv3 when dealing with SPIs.
Ack.
Quoted 21 lines
Quoted 1 line
Quoted 1 line
xen/arch/arm/vgic-v3.c static int
Quoted 1 line
xen/arch/arm/vgic-v3.c +0
-0@@ -978,19 +1002,17 @@ static intvgic_v3_rdistr_sgi_mmio_write(struct
Quoted 13 lines
Quoted 13 lines
vcpu *v,
mmio_info_t*info,Quoted 11 lines
xen/arch/arm/vgic-v3.c +4
-4case VREG32 (GICR_ICFGR1 ):case VRANGE32 (GICR_IPRIORITYR0 ,GICR_IPRIORITYR7 ):case VREG32 (GICR_ISPENDR0 ): -/* -* Above registers offset are common with GICD. -* So handle common with GICD handling -*/ +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/ Quoted 5 lines
Quoted 2 lines
This looks like a spurious change.
I moved this comment to the left by one space to apply format style to be coherent with others.
Quoted 7 lines
Ah yes, there is one more space. But all the * should be aligned like below:
/*
* Foo
* Bar
*/
Eh...yes, this shouldn't happen, sorry for that.
Quoted 6 lines
Quoted 2 lines
I will undo this modification and write another patch to fix it if needed.
I am usually OK with coding style change within a functional patch if they are around the code modified. This is not the case here, so please send it separately.
Ack.
I will send the new patch after the new version releasement.
- - -
Cheers,
Hongda