diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2015-11-09 01:08:57 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2015-11-09 01:08:57 +0000 |
commit | 5b5ef58c30e0cd58c8d01f280d0fe853d50b1f14 (patch) | |
tree | bc0fbbe1846b5b7af49385a7d45baa6d696db1f0 | |
parent | 81b5901106075a9161b29352b9af69ca6084cfe0 (diff) |
Cache the result of cpuid leaf function $0x1 from the host's boot CPU
during locore, information based on this will be returned to guest VMs
issuing cpuid instructions later, under certain circumstances.
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 46f20f7d6e3..618c6e7f5ad 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.72 2015/07/17 15:37:58 guenther Exp $ */ +/* $OpenBSD: locore.S,v 1.73 2015/11/09 01:08:56 mlarkin Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -169,6 +169,7 @@ _C_LABEL(lapic_isr): .globl _C_LABEL(cpu_id),_C_LABEL(cpu_vendor) .globl _C_LABEL(cpuid_level),_C_LABEL(cpu_feature) + .globl _C_LABEL(cpu_ebxfeature) .globl _C_LABEL(cpu_ecxfeature),_C_LABEL(ecpu_ecxfeature) .globl _C_LABEL(cpu_perf_eax) .globl _C_LABEL(cpu_perf_ebx) @@ -183,7 +184,8 @@ _C_LABEL(lapic_isr): _C_LABEL(cpu_id): .long 0 # saved from `cpuid' instruction _C_LABEL(cpu_feature): .long 0 # feature flags from 'cpuid' # instruction -_C_LABEL(cpu_ecxfeature):.long 0 # extended feature flags from 'cpuid' +_C_LABEL(cpu_ebxfeature):.long 0 # ext. ebx feature flags from 'cpuid' +_C_LABEL(cpu_ecxfeature):.long 0 # ext. ecx feature flags from 'cpuid' _C_LABEL(ecpu_ecxfeature):.long 0 # extended ecx feature flags _C_LABEL(cpu_perf_eax): .long 0 # arch. perf. mon. flags from 'cpuid' _C_LABEL(cpu_perf_ebx): .long 0 # arch. perf. mon. flags from 'cpuid' @@ -319,6 +321,7 @@ bi_size_ok: movl $1,%eax cpuid movl %eax,RELOC(cpu_id) + movl %ebx,RELOC(cpu_ebxfeature) movl %ecx,RELOC(cpu_ecxfeature) movl %edx,RELOC(cpu_feature) |