Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Preserve Xen SIR slots for VM_GUEST_XENPVH.



details:   https://anonhg.NetBSD.org/src/rev/b54140c6c618
branches:  trunk
changeset: 957127:b54140c6c618
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Nov 18 16:36:43 2020 +0000

description:
Preserve Xen SIR slots for VM_GUEST_XENPVH.

diffstat:

 sys/arch/x86/x86/intr.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 4617a69748c3 -r b54140c6c618 sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Wed Nov 18 16:13:34 2020 +0000
+++ b/sys/arch/x86/x86/intr.c   Wed Nov 18 16:36:43 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.152 2020/07/14 00:45:53 yamaguchi Exp $     */
+/*     $NetBSD: intr.c,v 1.153 2020/11/18 16:36:43 bouyer Exp $        */
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.152 2020/07/14 00:45:53 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.153 2020/11/18 16:36:43 bouyer Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -450,16 +450,20 @@
                slot = pin;
        } else {
                int start = 0;
+               int max = MAX_INTR_SOURCES;
                slot = -1;
 
                /* avoid reserved slots for legacy interrupts. */
                if (CPU_IS_PRIMARY(ci) && msipic_is_msi_pic(pic))
                        start = NUM_LEGACY_IRQS;
+               /* don't step over Xen's slots */
+               if (vm_guest == VM_GUEST_XENPVH)
+                       max = SIR_XENIPL_VM; 
                /*
                 * intr_allocate_slot has checked for an existing mapping.
                 * Now look for a free slot.
                 */
-               for (i = start; i < MAX_INTR_SOURCES ; i++) {
+               for (i = start; i < max ; i++) {
                        if (ci->ci_isources[i] == NULL) {
                                slot = i;
                                break;



Home | Main Index | Thread Index | Old Index