Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 17, 2012 at 04:39:57PM -0400, Christoffer Dall wrote:
> On Wed, Oct 17, 2012 at 4:38 PM, Alexander Graf <agraf@xxxxxxx> wrote:
> > On 10/14/2012 02:04 AM, Christoffer Dall wrote:
> >>
> >> *** warning: this RFC patch series is only compile-tested ***
> >>
> >> We need a way to specify the address at which we expect VMs to access
> >> the interrupt controller (both the emulated distributor and the hardware
> >> interface supporting virtualization).  User space should decide on this
> >> address as user space decides on an emulated board and loads a device
> >> tree describing these details directly to the guest.
> >>
> >> Instead of modifying the copying KVM_CREATE_IRQCHIP to an ARM specific
> >> ioctl with a a highly device specific set of parameters, we try
> >> something slightly more generic, that should fit well with how user
> >> space (read QEMU) first builds the individual devices and later sets up
> >> the emulated platform.
> >
> >
> > Have you talked to Ben about this one? He wanted to design a new, more
> > flexible irqchip API that would work for XICS & MPIC. Maybe there's some
> > room for cooperation here?
> >
> I have not - Ben, what do you have in mind?

I've taken over Ben's patches in this area and I'm currently working
on getting them ready for submission.  So far we only have XICS
emulation, and it is accessed through hypercalls, so there are no
addresses in the create-iochip ioctl argument yet.

What we have so far is a new ioctl:

#define KVM_CREATE_IRQCHIP_ARGS   _IOW(KVMIO,  0xac, struct kvm_irqchip_args)

where kvm_irqchip_args is defined in an arch header and currently
looks like this:

/* for KVM_CAP_SPAPR_XICS */
#define __KVM_HAVE_IRQCHIP_ARGS
struct kvm_irqchip_args {
#define KVM_IRQCHIP_TYPE_ICP	0	/* XICS: ICP (presentation controller) */
#define KVM_IRQCHIP_TYPE_ICS	1	/* XICS: ICS (source controller) */
	__u32 type;
	union {
		/* XICS ICP arguments. This needs to be called once before
		 * creating any VCPU to initialize the main kernel XICS data
		 * structures.
		 */
		struct {
#define KVM_ICP_FLAG_NOREALMODE		0x00000001 /* Disable real mode ICP */
			__u32 flags;
		} icp;

		/* XICS ICS arguments. You can call this for every BUID you
		 * want to make available.
		 *
		 * The BUID is 12 bits, the interrupt number within a BUID
		 * is up to 12 bits as well. The resulting interrupt numbers
		 * exposed to the guest are BUID || IRQ which is 24 bit
		 *
		 * BUID cannot be 0.
		 */
		struct {
			__u32 flags;
			__u16 buid;
			__u16 nr_irqs;
		} ics;
	};
};

With the XICS, there are two types of irqchip: a source controller and
a presentation controller.  There is one presentation controller per
vcpu and typically one source controller per PCI host bridge (a source
controller can manage multiple sources).  The "buid" above is
basically an identifier for a source controller.

So with the above, it would be quite easy to add new types and
arguments for them.

Thoughts?

Paul.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux