Module Name: src Committed By: bouyer Date: Thu Apr 16 17:44:54 UTC 2020
Modified Files: src/sys/arch/amd64/include [bouyer-xenpvh]: intrdefs.h src/sys/arch/i386/include [bouyer-xenpvh]: intrdefs.h src/sys/arch/x86/include [bouyer-xenpvh]: cpu.h Log Message: Avoid overflow of ci_ipi_events[] in the PVHVM case (it's size is XEN_NIPIS but we use x86 IPIs): size XEN_NIPIS only for PV, and CTASSERT that XEN_NIPIS <= X86_NIPI if we ever use Xen IPIs for PVHVM. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.64.1 src/sys/arch/amd64/include/intrdefs.h cvs rdiff -u -r1.4 -r1.4.64.1 src/sys/arch/i386/include/intrdefs.h cvs rdiff -u -r1.117.4.4 -r1.117.4.5 src/sys/arch/x86/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/include/intrdefs.h diff -u src/sys/arch/amd64/include/intrdefs.h:1.2 src/sys/arch/amd64/include/intrdefs.h:1.2.64.1 --- src/sys/arch/amd64/include/intrdefs.h:1.2 Wed Aug 10 06:30:59 2011 +++ src/sys/arch/amd64/include/intrdefs.h Thu Apr 16 17:44:54 2020 @@ -1,6 +1,4 @@ -/* $NetBSD: intrdefs.h,v 1.2 2011/08/10 06:30:59 cherry Exp $ */ +/* $NetBSD: intrdefs.h,v 1.2.64.1 2020/04/16 17:44:54 bouyer Exp $ */ #include <x86/intrdefs.h> -#ifdef XEN #include <xen/intrdefs.h> -#endif /* XEN */ Index: src/sys/arch/i386/include/intrdefs.h diff -u src/sys/arch/i386/include/intrdefs.h:1.4 src/sys/arch/i386/include/intrdefs.h:1.4.64.1 --- src/sys/arch/i386/include/intrdefs.h:1.4 Wed Aug 10 06:30:59 2011 +++ src/sys/arch/i386/include/intrdefs.h Thu Apr 16 17:44:54 2020 @@ -1,6 +1,4 @@ -/* $NetBSD: intrdefs.h,v 1.4 2011/08/10 06:30:59 cherry Exp $ */ +/* $NetBSD: intrdefs.h,v 1.4.64.1 2020/04/16 17:44:54 bouyer Exp $ */ #include <x86/intrdefs.h> -#ifdef XEN #include <xen/intrdefs.h> -#endif /* XEN */ Index: src/sys/arch/x86/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.117.4.4 src/sys/arch/x86/include/cpu.h:1.117.4.5 --- src/sys/arch/x86/include/cpu.h:1.117.4.4 Sun Apr 12 17:25:52 2020 +++ src/sys/arch/x86/include/cpu.h Thu Apr 16 17:44:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.117.4.4 2020/04/12 17:25:52 bouyer Exp $ */ +/* $NetBSD: cpu.h,v 1.117.4.5 2020/04/16 17:44:54 bouyer Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -262,9 +262,13 @@ struct cpu_info { vaddr_t ci_svs_utls; #endif +#ifndef XENPV + struct evcnt ci_ipi_events[X86_NIPI]; +#else + struct evcnt ci_ipi_events[XEN_NIPIS]; +#endif #ifdef XEN u_long ci_evtmask[NR_EVENT_CHANNELS]; /* events allowed on this CPU */ - struct evcnt ci_ipi_events[XEN_NIPIS]; evtchn_port_t ci_ipi_evtchn; #if defined(XENPV) #if defined(PAE) || defined(__x86_64__) @@ -299,9 +303,6 @@ struct cpu_info { */ uint64_t ci_xen_systime_ns_skew; - /* Xen periodic timer interrupt handle. */ - struct intrhand *ci_xen_timer_intrhand; - /* * Clockframe for timer interrupt handler. * Saved at entry via event callback. @@ -316,11 +317,11 @@ struct cpu_info { struct evcnt ci_xen_raw_systime_backwards_evcnt; struct evcnt ci_xen_systime_backwards_hardclock_evcnt; struct evcnt ci_xen_missed_hardclock_evcnt; -#else /* XEN */ - struct evcnt ci_ipi_events[X86_NIPI]; #endif /* XEN */ - }; +#ifndef XENPV + __CTASSERT(XEN_NIPIS <= X86_NIPI); +#endif /* * Macros to handle (some) trapframe registers for common x86 code.