linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* KVM ARM interrupt virtualization
@ 2011-09-02  3:01 carson bill
  2011-09-07 15:35 ` Catalin Marinas
  0 siblings, 1 reply; 9+ messages in thread
From: carson bill @ 2011-09-02  3:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, all

I am trying to put interrupt virtualization support into KVM ARM
implementation by Christoffer.

The approach is like this:

   Distributor emulation stays in Qemu, whenever Guest OS touch
   Distributor iomem, this action is handled by Qemu as it is.

   Each time a device in Qemu call 'gic_update' to inject an
   interrupt, the emulated Distributor figure out the 'best_irq'.
   With the help of GIC virtulization, this "best_irq" can be routed
   to virtual cpu interface which Guest OS has directly access into.

   Of course, when Guest OS query which interrupt fired, it need not
   trapped out into Qemu anymore.



How to do this:
   For now, I didn't take SMP into consideration.

   a: create identical mapping from GPA->HPA to allow Guest OS access
      its own cpu interface register.

   b: tell hypovisor the 'best_irq'
      struct kvm_irq_level->level upper bits could be used to represent
      this 'best_irq', and goes into hypovisor through KVM_IRQ_LINE IOCTL

   once inside kernel, 'kvm_arch_vm_ioctl_irq_line' fetch the 'best_irq'
   and by updating list register, route this interrupt into Guest OS
   virtual cpu interface.


Problem:
    I did the experiment, and found the biggest obstoble on the way
    is creating the mapping.

    arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
    #define CT_CA9X4_MPIC       (0x1e000000)
    #define A9_MPCORE_SCU       (CT_CA9X4_MPIC + 0x0000)
    #define A9_MPCORE_GIC_CPU   (CT_CA9X4_MPIC + 0x0100)
    #define A9_MPCORE_GIT       (CT_CA9X4_MPIC + 0x0200)
    #define A9_MPCORE_TWD       (CT_CA9X4_MPIC + 0x0600)
    #define A9_MPCORE_GIC_DIST  (CT_CA9X4_MPIC + 0x1000)

    If I create an identical mapping at A9_MPCORE_GIC_CPU, all the iomem
    from CT_CA9X4_MPIC ~ CT_CA9X4_MPIC + 0x1000 could be access for
    Guest OS, which means access to SCU/GIT/TWD will not been trapped
    any more.


Any comments and suggestions would be truly welcome.



bill

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

end of thread, other threads:[~2011-09-13  9:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-02  3:01 KVM ARM interrupt virtualization carson bill
2011-09-07 15:35 ` Catalin Marinas
2011-09-08  1:44   ` carson bill
2011-09-08  8:54     ` Catalin Marinas
2011-09-08 10:32       ` bill4carson
2011-09-08 12:01         ` [Android-virt] " Peter Maydell
2011-09-13  5:24           ` bill4carson
2011-09-13  7:43             ` Peter Maydell
2011-09-13  9:50               ` bill4carson

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