mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-02 21:46:58 +00:00
In some case, guest need to get more information under virtual environment, like guest capabilities. Basically this could be done by hypercalls, but hypercalls are designed for trusted VM/SOS VM, We need a machenism to report these information for normal VMs. In this patch, vCPUID leaf 0x40000001 will be used to satisfy this needs that report some extended information for guest by CPUID. Tracked-On: #3498 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
33 lines
653 B
C
33 lines
653 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef VCPUID_H_
|
|
#define VCPUID_H_
|
|
|
|
#define CPUID_CHECK_SUBLEAF (1U << 0U)
|
|
#define MAX_VM_VCPUID_ENTRIES 64U
|
|
|
|
/* Guest capability flags reported by CPUID */
|
|
#define GUEST_CAPS_PRIVILEGE_VM (1U << 0U)
|
|
|
|
struct vcpuid_entry {
|
|
uint32_t eax;
|
|
uint32_t ebx;
|
|
uint32_t ecx;
|
|
uint32_t edx;
|
|
uint32_t leaf;
|
|
uint32_t subleaf;
|
|
uint32_t flags;
|
|
uint32_t padding;
|
|
};
|
|
|
|
int32_t set_vcpuid_entries(struct acrn_vm *vm);
|
|
void guest_cpuid(struct acrn_vcpu *vcpu,
|
|
uint32_t *eax, uint32_t *ebx,
|
|
uint32_t *ecx, uint32_t *edx);
|
|
|
|
#endif /* VCPUID_H_ */
|