[Differential] [Request, 10 lines] D5291: hyperv/vmbus: Select an IDT vector has lower priority than LAPIC timer and IPIs vectors

sepherosa_gmail.com (Sepherosa Ziehau) phabric-noreply at FreeBSD.org
Tue Feb 16 06:57:30 UTC 2016


sepherosa_gmail.com created this revision.
sepherosa_gmail.com added reviewers: adrian, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com.
sepherosa_gmail.com added a subscriber: freebsd-virtualization-list.

REVISION SUMMARY
  Better and simple solution is to do the same things as XEN'a EVTCHN, but that will require us to have a hyperv specific file always reside in kernel.
  
  Inspired by a discussion w/ Dexuan

REVISION DETAIL
  https://reviews.freebsd.org/D5291

AFFECTED FILES
  sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c

CHANGE DETAILS
  diff --git a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  --- a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  +++ b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  @@ -382,8 +382,12 @@
   #ifdef HYPERV
   extern inthand_t IDTVEC(rsvd), IDTVEC(hv_vmbus_callback);
   
  +#define VMBUS_IDT_START	IDT_DTRACE_RET 
  +#define VMBUS_IDT_END	APIC_TIMER_INT
  +
   /**
    * @brief Find a free IDT slot and setup the interrupt handler.
  + * range: (VMBUS_IDT_START, VMBUS_IDT_END)
    */
   static int
   vmbus_vector_alloc(void)
  @@ -397,8 +401,8 @@
   	 * as vmbus channel callback vector. We install 'hv_vmbus_callback'
   	 * handler at that vector and use it to interrupt vcpus.
   	 */
  -	vector = APIC_SPURIOUS_INT;
  -	while (--vector >= APIC_IPI_INTS) {
  +	vector = VMBUS_IDT_END;
  +	while (--vector > VMBUS_IDT_START) {
   		ip = &idt[vector];
   		func = ((long)ip->gd_hioffset << 16 | ip->gd_looffset);
   		if (func == (uintptr_t)&IDTVEC(rsvd)) {
  @@ -428,7 +432,7 @@
   	if (vector == 0)
   		return;
   
  -        KASSERT(vector >= APIC_IPI_INTS && vector < APIC_SPURIOUS_INT,
  +        KASSERT(vector > VMBUS_IDT_START && vector < VMBUS_IDT_END,
               ("invalid vector %d", vector));
   
           ip = &idt[vector];

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: sepherosa_gmail.com, adrian, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5291.13341.patch
Type: text/x-patch
Size: 1219 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20160216/a76face6/attachment.bin>


More information about the freebsd-virtualization mailing list