drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / x86 / kvm / vmx / sgx.h
bloba400888b376d31527d8d2ffb0747e8eada015835
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __KVM_X86_SGX_H
3 #define __KVM_X86_SGX_H
5 #include <linux/kvm_host.h>
7 #include "capabilities.h"
8 #include "vmx_ops.h"
10 #ifdef CONFIG_X86_SGX_KVM
11 extern bool __read_mostly enable_sgx;
13 int handle_encls(struct kvm_vcpu *vcpu);
15 void setup_default_sgx_lepubkeyhash(void);
16 void vcpu_setup_sgx_lepubkeyhash(struct kvm_vcpu *vcpu);
18 void vmx_write_encls_bitmap(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12);
19 #else
20 #define enable_sgx 0
22 static inline void setup_default_sgx_lepubkeyhash(void) { }
23 static inline void vcpu_setup_sgx_lepubkeyhash(struct kvm_vcpu *vcpu) { }
25 static inline void vmx_write_encls_bitmap(struct kvm_vcpu *vcpu,
26 struct vmcs12 *vmcs12)
28 /* Nothing to do if hardware doesn't support SGX */
29 if (cpu_has_vmx_encls_vmexit())
30 vmcs_write64(ENCLS_EXITING_BITMAP, -1ull);
32 #endif
34 #endif /* __KVM_X86_SGX_H */