All of lore.kernel.org
 help / color / mirror / Atom feed
* [question] Shall we flush ITS tables into guest RAM when shutdown the VM?
@ 2021-06-29  9:33 Kunkun Jiang
  2021-06-29 20:14 ` Eric Auger
  0 siblings, 1 reply; 12+ messages in thread
From: Kunkun Jiang @ 2021-06-29  9:33 UTC (permalink / raw)
  To: Peter Maydell, Eric Auger, open list:ARM cores,
	open list:All patches CC here
  Cc: wanghaibin.wang

Hi all,

Accroding to the patch cddafd8f353d2d251b1a5c6c948a577a85838582,
our original intention is to flush the ITS tables into guest RAM at the 
point
RUN_STATE_FINISH_MIGRATE, but sometimes the VM gets stopped before
migration launch so let's simply flush the tables each time the VM gets
stopped.

But I encountered an error when I shut down the virtual machine.

> qemu-system-aarch64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 
> 0x0000000000000001: Permission denied

Shall we need to flush ITS tables into guest RAM when 'shutdown' the VM?
Or do you think this error is normal?

This error occurs in the following scenario:
Kunpeng 920 、enable GICv4、passthrough a accelerator Hisilicon SEC to the 
VM.

The flow is as follows:

QEMU:
vm_shutdown
     do_vm_stop(RUN_STATE_SHUTDOWN)
         vm_state_notify
             ...
             vm_change_state_handler (hw/intc/arm_gicv3_its_kvm.c)
                 kvm_device_access

Kernel:
     vgic_its_save_tables_v0
         vgic_its_save_device_tables
             vgic_its_save_itt

There is such a code in vgic_its_save_itt():
> /*
>  * If an LPI carries the HW bit, this means that this
>  * interrupt is controlled by GICv4, and we do not
>  * have direct access to that state without GICv4.1.
>  * Let's simply fail the save operation...
>  */
> if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1)
>           return -EACCES;

Looking forward to your reply.

Thanks,
Kunkun Jiang








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

end of thread, other threads:[~2021-07-26 13:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  9:33 [question] Shall we flush ITS tables into guest RAM when shutdown the VM? Kunkun Jiang
2021-06-29 20:14 ` Eric Auger
2021-06-30  1:38   ` Kunkun Jiang
2021-06-30  9:16     ` Eric Auger
2021-07-06  8:18       ` Kunkun Jiang
2021-07-06 13:52         ` Eric Auger
2021-07-06 14:19           ` Dr. David Alan Gilbert
2021-07-06 14:27             ` Eric Auger
2021-07-22 13:19               ` Juan Quintela
2021-07-22 13:27                 ` Peter Maydell
2021-07-26 13:19               ` Kunkun Jiang
2021-07-26 13:19           ` Kunkun Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.