linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Report an error on GICv4.1 vcpu de-schedule
@ 2022-03-17  7:27 Jingyi Wang
  2022-03-17 10:17 ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Jingyi Wang @ 2022-03-17  7:27 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, kvm, maz
  Cc: wanghaibin.wang@huawei.com, yuzenghui@huawei.com, Martin.Weidmann,
	tangnianyao, chengjian8, Jingyi Wang

Hi Marc,

The patch "KVM: arm64: Delay the polling of the GICR_VPENDBASER.Dirty
bit"(57e3cebd022fbc035dcf190ac789fd2ffc747f5b) remove the polling of
GICR_VPENDBASER.Dirty bit in vcpu_load() , while check the VPT parsing
ready in kvm_vgic_flush_hwstate() for better performance.

Most time it works, but we have met an error on our hardware recently.
In preemptable kernel, the vcpu can be preempted between vcpu_load and
kvm_vgic_flush_hwstate. As a result, it get de-scheduled and
its_clear_vpend_valid() is called

	val = gicr_read_vpendbaser(vlpi_base + GICR_VPENDBASER);
	val &= ~GICR_VPENDBASER_Valid;
	val &= ~clr;
	val |= set;
	gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);


The function clears Valid bit meanwhile GICR_VPENDBASER_Dirty
maybe still 1, which cause the subsequent GICR_VPENDBASER_Dirty polling
fail and report ""ITS virtual pending table not cleaning".

We have communicated with Martin from ARM and get the conclusion
that we should not change valid bit while the dirty bit not clear——
"The dirty bit reports whether the last schedule /de-schedule
operation has completed.The restriction on not changing Valid when Dirty
is 1, is so that hardware can always complete the last operation for
starting the next".

I think maybe we can check dirty bit clear before clearing the valid bit
in its_clear_vpend_valid() code. Hope to know your opinion about this
issue.

Thanks,
Jingyi








_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-21  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-17  7:27 Report an error on GICv4.1 vcpu de-schedule Jingyi Wang
2022-03-17 10:17 ` Marc Zyngier
2022-03-18  6:14   ` Jingyi Wang
2022-03-21  1:33   ` Jingyi Wang

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).