On 1/12/20, 11:58 PM, "Jan Kiszka" <[email protected]> wrote: > On 09.01.20 16:55, Chase Conklin wrote: >> The GICv3 architecture does not guarantee that writes to the list >> registers are self-synchronizing. As a result, it is possible for a >> valid interrupt to be written into a list register but have the empty >> list register status register report that list register as not holding >> a valid interrupt. Since the empty list register status registers are >> used to indicate which list registers can be used to inject an >> interrupt to a cell, it is possible for a valid list register entry to >> be overwritten, dropping the corresponding interrupt. >> >> Fixes: 2ce9d14ca4e2 ("arm: GICv3 initialisation") >> Signed-off-by: Chase Conklin <[email protected]> >> --- >> hypervisor/arch/arm-common/gic-v3.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/hypervisor/arch/arm-common/gic-v3.c >> b/hypervisor/arch/arm-common/gic-v3.c >> index 906d9a8d..6a1d90f8 100644 >> --- a/hypervisor/arch/arm-common/gic-v3.c >> +++ b/hypervisor/arch/arm-common/gic-v3.c >> @@ -113,6 +113,12 @@ static void gicv3_write_lr(unsigned int reg, u64 val) >> __WRITE_LR8_15(7) >> #undef __WRITE_LR8_15 >> } >> + >> +/* >> + * Ensure the write to the LR is visible to the GIC (so that ICH_ELRSR >> + * is updated to indicate that the just-written LR is no longer empty) >> + */ >> +isb(); > > Ah, good to know. May we have such issues elsewhere as well? GICv2 is > not affected because it uses MMIO accesses, right?
It's possible that this sort of issue exists elsewhere; I haven't done a thorough check for all system register writes that affect EL2/Hyp context. I'm less familiar with GICv2 than GICv3, but I don't think an ISB would be required after list register writes because it uses MMIO. That said, a DSB may be necessary to ensure a store to a LR is completed prior to a subsequent ELSR load to ensure that it reflects the value stored to the LR. > Unfortunately, both your patches got mangled by your mail client. Can > you resent, maybe directly via git send-email? Yikes! I used git send-email. I'll look into why the patches got mangled and repost soon. Thanks, Chase > Thanks, > Jan > >> } >> >> static int gicv3_init(void) >> -- >> 2.22.0 >> >> IMPORTANT NOTICE: The contents of this email and any attachments are >> confidential and may also be privileged. If you are not the intended >> recipient, please notify the sender immediately and do not disclose the >> contents to any other person, use it for any purpose, or store or copy the >> information in any medium. Thank you. >> IMPORTANT NOTICE: The contents of this email and any attachments are >> confidential and may also be privileged. If you are not the intended >> recipient, please notify the sender immediately and do not disclose the >> contents to any other person, use it for any purpose, or store or copy the >> information in any medium. Thank you. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/C8CE26B4-1B4A-4115-8F21-F2C6723B8DF6%40arm.com.
