/* SPDX-License-Identifier: GPL-2.0 */ /* * This file contains common definitions for working with Enlightened VMCS which * are used both by Hyper-V on KVM and KVM on Hyper-V.
*/ #ifndef __KVM_X86_VMX_HYPERV_EVMCS_H #define __KVM_X86_VMX_HYPERV_EVMCS_H
static __always_inline int evmcs_field_offset(unsignedlong field,
u16 *clean_field)
{ conststruct evmcs_field *evmcs_field; unsignedint index = ROL16(field, 6);
if (unlikely(index >= nr_evmcs_1_fields)) return -ENOENT;
evmcs_field = &vmcs_field_to_evmcs_1[index];
/* * Use offset=0 to detect holes in eVMCS. This offset belongs to * 'revision_id' but this field has no encoding and is supposed to * be accessed directly.
*/ if (unlikely(!evmcs_field->offset)) return -ENOENT;
if (clean_field)
*clean_field = evmcs_field->clean_field;
return evmcs_field->offset;
}
staticinline u64 evmcs_read_any(struct hv_enlightened_vmcs *evmcs, unsignedlong field, u16 offset)
{ /* * vmcs12_read_any() doesn't care whether the supplied structure * is 'struct vmcs12' or 'struct hv_enlightened_vmcs' as it takes * the exact offset of the required field, use it for convenience * here.
*/ return vmcs12_read_any((void *)evmcs, field, offset);
}
#endif/* __KVM_X86_VMX_HYPERV_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.