summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/sys
diff options
context:
space:
mode:
authornn35248 <none@none>2006-09-11 22:51:59 -0700
committernn35248 <none@none>2006-09-11 22:51:59 -0700
commit9acbbeaf2a1ffe5c14b244867d427714fab43c5c (patch)
treed1ecd54896325c19a463220e9cbc50864874fc82 /usr/src/uts/intel/sys
parentda51466dc253d7c98dda4956059042bd0c476328 (diff)
downloadillumos-joyent-9acbbeaf2a1ffe5c14b244867d427714fab43c5c.tar.gz
PSARC/2005/471 BrandZ: Support for non-native zones
6374606 ::nm -D without an object may not work on processes in zones 6409350 BrandZ project integration into Solaris 6455289 pthread_setschedparam() should return EPERM rather than panic libc 6455591 setpriority(3C) gets errno wrong for deficient privileges failure 6458178 fifofs doesn't support lofs mounts of fifos 6460380 Attempted open() of a symlink with the O_NOFOLLOW flag set returns EINVAL, not ELOOP 6463857 renice(1) errors erroneously --HG-- rename : usr/src/lib/libzonecfg/zones/SUNWblank.xml => usr/src/lib/brand/native/zone/SUNWblank.xml rename : usr/src/lib/libzonecfg/zones/SUNWdefault.xml => usr/src/lib/brand/native/zone/SUNWdefault.xml
Diffstat (limited to 'usr/src/uts/intel/sys')
-rw-r--r--usr/src/uts/intel/sys/archsystm.h11
-rw-r--r--usr/src/uts/intel/sys/fasttrap_isa.h20
-rw-r--r--usr/src/uts/intel/sys/machbrand.h60
-rw-r--r--usr/src/uts/intel/sys/segments.h10
-rw-r--r--usr/src/uts/intel/sys/sysi86.h8
5 files changed, 100 insertions, 9 deletions
diff --git a/usr/src/uts/intel/sys/archsystm.h b/usr/src/uts/intel/sys/archsystm.h
index 5ed70f0cb2..07adccd582 100644
--- a/usr/src/uts/intel/sys/archsystm.h
+++ b/usr/src/uts/intel/sys/archsystm.h
@@ -69,11 +69,17 @@ extern void sys_syscall();
extern void sys_syscall32();
extern void sys_lcall32();
extern void sys_syscall_int();
+extern void brand_sys_syscall();
+extern void brand_sys_syscall32();
+extern void brand_sys_syscall_int();
#elif defined(__i386)
extern void sys_call();
+extern void brand_sys_call();
#endif
extern void sys_sysenter();
extern void _sys_sysenter_post_swapgs();
+extern void brand_sys_sysenter();
+extern void _brand_sys_sysenter_post_swapgs();
extern void dosyscall(void);
@@ -112,6 +118,9 @@ extern int fpu_pentium_fdivbug;
extern void sep_save(void *);
extern void sep_restore(void *);
+extern void brand_interpositioning_enable(void);
+extern void brand_interpositioning_disable(void);
+
struct regs;
extern int instr_size(struct regs *, caddr_t *, enum seg_rw);
@@ -136,6 +145,8 @@ extern void setup_mca(void);
extern void setup_mtrr(void);
extern void patch_tsc(void);
+extern user_desc_t *cpu_get_gdt(void);
+
/*
* Warning: these routines do -not- use normal calling conventions!
*/
diff --git a/usr/src/uts/intel/sys/fasttrap_isa.h b/usr/src/uts/intel/sys/fasttrap_isa.h
index 89e2cf30ed..2406791710 100644
--- a/usr/src/uts/intel/sys/fasttrap_isa.h
+++ b/usr/src/uts/intel/sys/fasttrap_isa.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -55,6 +54,7 @@ typedef struct fasttrap_machtp {
uint8_t ftmt_base; /* branch base */
uint8_t ftmt_index; /* branch index */
uint8_t ftmt_scale; /* branch scale */
+ uint8_t ftmt_segment; /* segment for memory accesses */
uintptr_t ftmt_dest; /* destination of control flow */
} fasttrap_machtp_t;
@@ -69,6 +69,7 @@ typedef struct fasttrap_machtp {
#define ftt_base ftt_mtp.ftmt_base
#define ftt_index ftt_mtp.ftmt_index
#define ftt_scale ftt_mtp.ftmt_scale
+#define ftt_segment ftt_mtp.ftmt_segment
#define ftt_dest ftt_mtp.ftmt_dest
#define FASTTRAP_T_COMMON 0x00 /* common case -- no emulation */
@@ -89,6 +90,17 @@ typedef struct fasttrap_machtp {
#define FASTTRAP_RIP_2 0x2
#define FASTTRAP_RIP_X 0x4
+/*
+ * Segment values.
+ */
+#define FASTTRAP_SEG_NONE 0
+#define FASTTRAP_SEG_CS 1
+#define FASTTRAP_SEG_DS 2
+#define FASTTRAP_SEG_ES 3
+#define FASTTRAP_SEG_FS 4
+#define FASTTRAP_SEG_GS 5
+#define FASTTRAP_SEG_SS 6
+
#define FASTTRAP_AFRAMES 3
#define FASTTRAP_RETURN_AFRAMES 4
#define FASTTRAP_ENTRY_AFRAMES 3
diff --git a/usr/src/uts/intel/sys/machbrand.h b/usr/src/uts/intel/sys/machbrand.h
new file mode 100644
index 0000000000..e4b90473a6
--- /dev/null
+++ b/usr/src/uts/intel/sys/machbrand.h
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_MACHBRAND_H
+#define _SYS_MACHBRAND_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ASM
+
+#include <sys/model.h>
+
+struct brand_mach_ops {
+ void (*b_sysenter)(void);
+ void (*b_int80)(void);
+ void (*b_int91)(void);
+ void (*b_syscall)(void);
+ void (*b_syscall32)(void);
+ greg_t (*b_fixsegreg)(greg_t, model_t);
+};
+
+#endif /* _ASM */
+
+#define BRAND_CB_SYSENTER 0
+#define BRAND_CB_INT80 1
+#define BRAND_CB_INT91 2
+#define BRAND_CB_SYSCALL 3
+#define BRAND_CB_SYSCALL32 4
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_MACHBRAND_H */
diff --git a/usr/src/uts/intel/sys/segments.h b/usr/src/uts/intel/sys/segments.h
index b17b300cd6..fe65db8575 100644
--- a/usr/src/uts/intel/sys/segments.h
+++ b/usr/src/uts/intel/sys/segments.h
@@ -453,7 +453,9 @@ void set_syssegd(system_desc_t *, void *, size_t, uint_t, uint_t);
#define GDT_GS GDT_NULL /* kernel %gs segment selector */
#define GDT_LWPFS 55 /* lwp private %fs segment selector */
#define GDT_LWPGS 56 /* lwp private %gs segment selector */
-#define NGDT 58 /* number of entries in GDT */
+#define GDT_BRANDMIN 57 /* first entry in GDT for brand usage */
+#define GDT_BRANDMAX 61 /* last entry in GDT for brand usage */
+#define NGDT 62 /* number of entries in GDT */
/*
* This selector is only used in the temporary GDT used to bring additional
@@ -479,6 +481,8 @@ void set_syssegd(system_desc_t *, void *, size_t, uint_t, uint_t);
#define GDT_GS 54 /* kernel %gs segment selector */
#define GDT_LWPFS 55 /* lwp private %fs segment selector */
#define GDT_LWPGS 56 /* lwp private %gs segment selector */
+#define GDT_BRANDMIN 57 /* first entry in GDT for brand usage */
+#define GDT_BRANDMAX 61 /* last entry in GDT for brand usage */
#define NGDT 90 /* number of entries in GDT */
#endif /* __i386 */
@@ -501,6 +505,8 @@ void set_syssegd(system_desc_t *, void *, size_t, uint_t, uint_t);
#define KGS_SEL SEL_GDT(GDT_GS, SEL_KPL)
#define LWPFS_SEL SEL_GDT(GDT_LWPFS, SEL_UPL)
#define LWPGS_SEL SEL_GDT(GDT_LWPGS, SEL_UPL)
+#define BRANDMIN_SEL SEL_GDT(GDT_BRANDMIN, SEL_UPL)
+#define BRANDMAX_SEL SEL_GDT(GDT_BRANDMAX, SEL_UPL)
#if defined(__amd64)
#define B64CODE_SEL SEL_GDT(GDT_B64CODE, SEL_KPL)
#else
@@ -551,6 +557,8 @@ extern void _start(), cmnint();
extern void achktrap(), mcetrap();
extern void xmtrap();
extern void fasttrap();
+extern void sys_int80();
+extern void brand_sys_int80();
extern void dtrace_ret();
#if !defined(__amd64)
diff --git a/usr/src/uts/intel/sys/sysi86.h b/usr/src/uts/intel/sys/sysi86.h
index 4c3c4182ff..54e9f905a0 100644
--- a/usr/src/uts/intel/sys/sysi86.h
+++ b/usr/src/uts/intel/sys/sysi86.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -144,6 +143,7 @@ struct ssd {
#ifdef _KERNEL
extern void usd_to_ssd(user_desc_t *, struct ssd *, selector_t);
+extern int setdscr(struct ssd *);
#endif /* _KERNEL */
/*