diff options
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/cpufunc.h | 11 | ||||
-rw-r--r-- | sys/amd64/include/md_var.h | 4 | ||||
-rw-r--r-- | sys/amd64/include/param.h | 11 | ||||
-rw-r--r-- | sys/amd64/include/vmm.h | 1 |
4 files changed, 25 insertions, 2 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index d180f5c76afb..9a4c82275a99 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -76,7 +76,7 @@ static __inline void clflushopt(u_long addr) { - __asm __volatile(".byte 0x66;clflush %0" : : "m" (*(char *)addr)); + __asm __volatile("clflushopt %0" : : "m" (*(char *)addr)); } static __inline void @@ -572,6 +572,15 @@ rss(void) return (sel); } +static __inline u_short +rcs(void) +{ + u_short sel; + + __asm __volatile("movw %%cs,%0" : "=rm" (sel)); + return (sel); +} + static __inline void load_ds(u_short sel) { diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index b6ddc6eaaebe..b6d8c469cdf6 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -99,6 +99,10 @@ void get_fpcontext(struct thread *td, struct __mcontext *mcp, int set_fpcontext(struct thread *td, struct __mcontext *mcp, char *xfpustate, size_t xfpustate_len); +void wrmsr_early_safe_start(void); +void wrmsr_early_safe_end(void); +int wrmsr_early_safe(u_int msr, uint64_t data); + #endif /* !_MACHINE_MD_VAR_H_ */ #endif /* __i386__ */ diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 5a9c3162e14c..0654bb9de790 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -150,6 +150,15 @@ (((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_high) || \ ((va) >= kva_layout.km_low && (va) < kva_layout.km_high)) -#define SC_TABLESIZE 1024 /* Must be power of 2. */ +/* + * Must be power of 2. + * + * Perhaps should be autosized on boot based on found ncpus. + */ +#if MAXCPU > 256 +#define SC_TABLESIZE 2048 +#else +#define SC_TABLESIZE 1024 +#endif #endif /* !_AMD64_INCLUDE_PARAM_H_ */ diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 0b3daed4f69e..e35119af8572 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -46,6 +46,7 @@ enum vm_suspend_how { VM_SUSPEND_POWEROFF, VM_SUSPEND_HALT, VM_SUSPEND_TRIPLEFAULT, + VM_SUSPEND_DESTROY, VM_SUSPEND_LAST }; |