Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2014 09:19:56 +0000
From:      Wei Hu <weh@microsoft.com>
To:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>, "freebsd-xen@freebsd.org" <freebsd-xen@freebsd.org>
Cc:        "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Directly reserve an interrupt IDT entry for Hyper-V
Message-ID:  <3defccd56bc0407c88bdda139b2462ac@BY1PR0301MB0902.namprd03.prod.outlook.com>

next in thread | raw e-mail | index | archive | help
Hello,

Sending to Xen, drivers and virtualization mailing lists since this might b=
e of interest to the folks on these aliases.

I am working for Microsoft to improve the performance of FreeBSD running on=
 Hyper-V. Right now I am adding a feature in the vmbus driver which could h=
andle the host-guest channel communications on all vCPUs simultaneously. In=
 order to achieve this, the hypervisor will send same interrupt concurrentl=
y on all the vCPUs. The traditional way on FreeBSD to set up interrupt hand=
ling for devicse, such as calling bus_alloc_resource() to reserve an IRQ li=
ne, and then calling bus_setup_intr() to create a vector, doesn't seem to w=
ork in this case. It seems if the interrupt is routed via legacy IRQ, it ca=
n only be active on one vCPU at a time. In order to allow the same interrup=
t to be handled on all vCPUs concurrently, all I need is an IDT entry, not =
an IRQ line.

I checked current FreeBSD code. It looks to me Xen directly uses the vector=
 number IDT_EVTCHN (0x93) to achieve the same purpose. I am proposing both =
Xen and Hyper-V share this same vector. Following is a little bit detail of=
 my proposal for the changes in the current kernel.


1.       In machdep.c:

 #ifdef XENHVM

        setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYSIGT, SEL_UPL, 0=
);

#else

        setidt(IDT_EVTCHN, &IDTVEC(hv_vmbus_intr), SDT_SYSIGT, SEL_UPL, 0);

#endif

2.       Apic_vector.S

Add IDTVEC(hv_vmbus_intr) to call Hyper-V vmbus interrupt service routine.

Any  thoughts, objections and feedbacks are all welcome.

Thanks,
Wei Hu

Open Source Technology Center
Microsoft China



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3defccd56bc0407c88bdda139b2462ac>