Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch We reorganise definitions for XEN source support as...
details: https://anonhg.NetBSD.org/src/rev/f6782709d7d5
branches: trunk
changeset: 448851:f6782709d7d5
user: cherry <cherry%NetBSD.org@localhost>
date: Mon Feb 11 14:59:32 2019 +0000
description:
We reorganise definitions for XEN source support as follows:
XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.
diffstat:
sys/arch/amd64/amd64/amd64_trap.S | 12 +-
sys/arch/amd64/amd64/cpufunc.S | 14 +-
sys/arch/amd64/amd64/db_interface.c | 20 ++--
sys/arch/amd64/amd64/gdt.c | 26 +++---
sys/arch/amd64/amd64/genassym.cf | 6 +-
sys/arch/amd64/amd64/lock_stubs.S | 6 +-
sys/arch/amd64/amd64/locore.S | 32 ++++---
sys/arch/amd64/amd64/machdep.c | 80 ++++++++++----------
sys/arch/amd64/amd64/process_machdep.c | 6 +-
sys/arch/amd64/amd64/spl.S | 6 +-
sys/arch/amd64/amd64/trap.c | 10 +-
sys/arch/amd64/amd64/vector.S | 10 +-
sys/arch/amd64/conf/XEN3_DOM0 | 5 +-
sys/arch/amd64/conf/XEN3_DOMU | 5 +-
sys/arch/amd64/include/cpu.h | 8 +-
sys/arch/amd64/include/frame.h | 4 +-
sys/arch/amd64/include/frameasm.h | 6 +-
sys/arch/amd64/include/param.h | 4 +-
sys/arch/amd64/include/pmap.h | 10 +-
sys/arch/amd64/include/profile.h | 8 +-
sys/arch/amd64/include/segments.h | 12 +-
sys/arch/amd64/include/types.h | 4 +-
sys/arch/amd64/include/vmparam.h | 4 +-
sys/arch/i386/conf/XEN3PAE_DOM0 | 3 +-
sys/arch/i386/conf/XEN3PAE_DOMU | 3 +-
sys/arch/i386/i386/cpufunc.S | 12 +-
sys/arch/i386/i386/db_interface.c | 20 ++--
sys/arch/i386/i386/gdt.c | 16 ++--
sys/arch/i386/i386/genassym.cf | 4 +-
sys/arch/i386/i386/i386_trap.S | 10 +-
sys/arch/i386/i386/lock_stubs.S | 10 +-
sys/arch/i386/i386/locore.S | 42 +++++-----
sys/arch/i386/i386/machdep.c | 92 ++++++++++++------------
sys/arch/i386/i386/spl.S | 26 +++---
sys/arch/i386/i386/trap.c | 12 +-
sys/arch/i386/i386/vector.S | 8 +-
sys/arch/i386/include/cpu.h | 8 +-
sys/arch/i386/include/frame.h | 4 +-
sys/arch/i386/include/frameasm.h | 4 +-
sys/arch/i386/include/pmap.h | 16 ++--
sys/arch/i386/include/segments.h | 14 +-
sys/arch/i386/include/vmparam.h | 6 +-
sys/arch/x86/acpi/acpi_machdep.c | 12 +-
sys/arch/x86/include/cpu.h | 24 +++--
sys/arch/x86/include/cpuvar.h | 10 +-
sys/arch/x86/include/intr.h | 8 +-
sys/arch/x86/include/intrdefs.h | 6 +-
sys/arch/x86/include/pmap.h | 6 +-
sys/arch/x86/include/specialreg.h | 6 +-
sys/arch/x86/isa/isa_machdep.c | 8 +-
sys/arch/x86/pci/pci_intr_machdep.c | 8 +-
sys/arch/x86/pci/pci_machdep.c | 8 +-
sys/arch/x86/pci/pcib.c | 6 +-
sys/arch/x86/x86/bios32.c | 10 +-
sys/arch/x86/x86/bus_space.c | 16 ++--
sys/arch/x86/x86/cpu_ucode.c | 6 +-
sys/arch/x86/x86/fpu.c | 10 +-
sys/arch/x86/x86/i8259.c | 8 +-
sys/arch/x86/x86/identcpu.c | 14 +-
sys/arch/x86/x86/idt.c | 10 +-
sys/arch/x86/x86/pmap.c | 126 ++++++++++++++++----------------
sys/arch/x86/x86/sys_machdep.c | 16 ++--
sys/arch/x86/x86/vm_machdep.c | 6 +-
sys/arch/x86/x86/x86_machdep.c | 26 +++---
sys/arch/x86/x86/x86_tlb.c | 14 +-
65 files changed, 493 insertions(+), 479 deletions(-)
diffs (truncated from 4095 to 300 lines):
diff -r c1f1aa03579a -r f6782709d7d5 sys/arch/amd64/amd64/amd64_trap.S
--- a/sys/arch/amd64/amd64/amd64_trap.S Mon Feb 11 11:12:58 2019 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S Mon Feb 11 14:59:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amd64_trap.S,v 1.45 2018/08/12 06:11:47 maxv Exp $ */
+/* $NetBSD: amd64_trap.S,v 1.46 2019/02/11 14:59:32 cherry Exp $ */
/*
* Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
* handler.
*/
-#ifdef XEN
+#ifdef XENPV
#define PRE_TRAP movq (%rsp),%rcx ; movq 8(%rsp),%r11 ; addq $0x10,%rsp
#else
#define PRE_TRAP
@@ -179,7 +179,7 @@
* to contain secrets.
*/
IDTVEC(trap01)
-#ifndef XEN
+#ifndef XENPV
subq $(TF_REGSIZE+16),%rsp
/* We clobber only RDX, RCX and RAX. */
@@ -247,7 +247,7 @@
* running in kernel mode with a userland %gs.
*/
IDTVEC(trap02)
-#if defined(XEN)
+#if defined(XENPV)
ZTRAP(T_NMI)
#else
ZTRAP_NJ(T_NMI)
@@ -346,7 +346,7 @@
* of it. So don't enable interrupts.
*/
IDTVEC(trap08)
-#if defined(XEN)
+#if defined(XENPV)
TRAP(T_DOUBLEFLT)
#else
TRAP_NJ(T_DOUBLEFLT)
@@ -390,7 +390,7 @@
TRAP(T_TSSFLT)
IDTVEC_END(trap10)
-#ifdef XEN
+#ifdef XENPV
/*
* I don't believe XEN generates in-kernel traps for the
* equivalent of iret, if it does this code would be needed
diff -r c1f1aa03579a -r f6782709d7d5 sys/arch/amd64/amd64/cpufunc.S
--- a/sys/arch/amd64/amd64/cpufunc.S Mon Feb 11 11:12:58 2019 +0000
+++ b/sys/arch/amd64/amd64/cpufunc.S Mon Feb 11 14:59:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.S,v 1.35 2019/01/06 14:35:31 cherry Exp $ */
+/* $NetBSD: cpufunc.S,v 1.36 2019/02/11 14:59:32 cherry Exp $ */
/*
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
ret
END(x86_mfence)
-#ifndef XEN
+#ifndef XENPV
ENTRY(invlpg)
invlpg (%rdi)
ret
@@ -158,7 +158,7 @@
*
* If PGE is not in use, we reload CR3.
*/
-#ifndef XEN
+#ifndef XENPV
ENTRY(tlbflushg)
movq %cr4, %rax
testq $CR4_PGE, %rax
@@ -262,7 +262,7 @@
END(x86_write_flags)
STRONG_ALIAS(x86_write_psl,x86_write_flags)
-#endif /* XEN */
+#endif /* XENPV */
ENTRY(rdmsr)
movq %rdi, %rcx
@@ -352,7 +352,7 @@
ret
END(msr_onfault)
-#ifndef XEN
+#ifndef XENPV
ENTRY(wbinvd)
wbinvd
ret
@@ -434,7 +434,7 @@
* is necessary, since the actual descriptor data is not changed except by
* process creation and exit, both of which clean up via task switches.
*/
-#ifndef XEN
+#ifndef XENPV
ENTRY(lgdt)
/* Reload the descriptor table. */
movq %rdi,%rax
@@ -754,7 +754,7 @@
ret
END(setfs)
-#ifndef XEN
+#ifndef XENPV
ENTRY(setusergs)
CLI(ax)
swapgs
diff -r c1f1aa03579a -r f6782709d7d5 sys/arch/amd64/amd64/db_interface.c
--- a/sys/arch/amd64/amd64/db_interface.c Mon Feb 11 11:12:58 2019 +0000
+++ b/sys/arch/amd64/amd64/db_interface.c Mon Feb 11 14:59:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.34 2018/09/23 00:59:59 cherry Exp $ */
+/* $NetBSD: db_interface.c,v 1.35 2019/02/11 14:59:32 cherry Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.34 2018/09/23 00:59:59 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.35 2019/02/11 14:59:32 cherry Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -88,9 +88,9 @@
#ifdef MULTIPROCESSOR
extern void ddb_ipi(struct trapframe);
static void ddb_suspend(struct trapframe *);
-#ifndef XEN
+#ifndef XENPV
int ddb_vec;
-#endif /* XEN */
+#endif /* XENPV */
static bool ddb_mp_online;
#endif
@@ -106,7 +106,7 @@
{
#ifdef MULTIPROCESSOR
-#ifndef XEN
+#ifndef XENPV
vector *handler = &Xintr_ddbipi;
#if NLAPIC > 0
if (lapic_is_x2apic())
@@ -117,7 +117,7 @@
GSEL(GCODE_SEL, SEL_KPL));
#else
/* Initialised as part of xen_ipi_init() */
-#endif /* XEN */
+#endif /* XENPV */
#endif
}
@@ -131,10 +131,10 @@
int cpu_me = cpu_number();
int win;
-#ifndef XEN
+#ifndef XENPV
if (ddb_vec == 0)
return 1;
-#endif /* XEN */
+#endif /* XENPV */
__cpu_simple_lock(&db_lock);
if (ddb_cpu == NOCPU)
@@ -142,11 +142,11 @@
win = (ddb_cpu == cpu_me);
__cpu_simple_unlock(&db_lock);
if (win) {
-#ifdef XEN
+#ifdef XENPV
xen_broadcast_ipi(XEN_IPI_DDB);
#else
x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
-#endif /* XEN */
+#endif /* XENPV */
}
ddb_mp_online = x86_mp_online;
x86_mp_online = false;
diff -r c1f1aa03579a -r f6782709d7d5 sys/arch/amd64/amd64/gdt.c
--- a/sys/arch/amd64/amd64/gdt.c Mon Feb 11 11:12:58 2019 +0000
+++ b/sys/arch/amd64/amd64/gdt.c Mon Feb 11 14:59:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.45 2018/01/05 08:04:20 maxv Exp $ */
+/* $NetBSD: gdt.c,v 1.46 2019/02/11 14:59:32 cherry Exp $ */
/*
* Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.45 2018/01/05 08:04:20 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.46 2019/02/11 14:59:32 cherry Exp $");
#include "opt_multiprocessor.h"
#include "opt_xen.h"
@@ -53,7 +53,7 @@
#include <machine/gdt.h>
-#ifdef XEN
+#ifdef XENPV
#include <xen/hypervisor.h>
#endif
@@ -67,7 +67,7 @@
} gdt_bitmap_t;
/* size of GDT in bytes */
-#ifdef XEN
+#ifdef XENPV
const size_t gdt_size = FIRST_RESERVED_GDT_BYTE;
#else
const size_t gdt_size = MAXGDTSIZ;
@@ -76,7 +76,7 @@
/* bitmap of busy slots */
static gdt_bitmap_t gdt_bitmap;
-#if defined(USER_LDT) || !defined(XEN)
+#if defined(USER_LDT) || !defined(XENPV)
static void set_sys_gdt(int, void *, size_t, int, int, int);
#endif
@@ -88,7 +88,7 @@
table = tp;
entry = ep;
-#ifndef XEN
+#ifndef XENPV
*table = *entry;
#else
paddr_t pa;
@@ -99,7 +99,7 @@
#endif
}
-#if defined(USER_LDT) || !defined(XEN)
+#if defined(USER_LDT) || !defined(XENPV)
/*
* Called on a newly-allocated GDT slot, so no race between CPUs.
*/
@@ -122,7 +122,7 @@
update_descriptor(&ci->ci_gdt[idx + 1], &d.bits[1]);
}
}
-#endif /* USER_LDT || !XEN */
+#endif /* USER_LDT || !XENPV */
/*
* Initialize the GDT. We already have a gdtstore, which was temporarily used
@@ -165,7 +165,7 @@
/* Copy the initial bootstrap GDT into the new area. */
memcpy(gdtstore, old_gdt, DYNSEL_START);
ci->ci_gdt = (void *)gdtstore;
-#ifndef XEN
+#ifndef XENPV
set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore,
LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0);
#endif
@@ -218,7 +218,7 @@
lgdt(®ion);
}
-#if !defined(XEN) || defined(USER_LDT)
+#if !defined(XENPV) || defined(USER_LDT)
static int
gdt_get_slot(void)
{
@@ -250,7 +250,7 @@
int
tss_alloc(struct x86_64_tss *tss)
{
-#ifndef XEN
+#ifndef XENPV
int slot;
mutex_enter(&cpu_lock);
@@ -271,7 +271,7 @@
void
tss_free(int sel)
{
-#ifndef XEN
+#ifndef XENPV
mutex_enter(&cpu_lock);
gdt_put_slot(IDXDYNSEL(sel));
mutex_exit(&cpu_lock);
Home |
Main Index |
Thread Index |
Old Index