xref: /illumos-gate/usr/src/uts/i86pc/ml/hma_asm.S (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
1/*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source.  A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12/*
13 * Copyright 2019 Joyent, Inc.
14 */
15
16
17#include <sys/asm_linkage.h>
18
19	ENTRY_NP(hma_vmx_vmxon)
20	push	%rbp
21	movq	%rsp, %rbp
22	pushq	%rdi
23
24	xorl	%eax, %eax
25	vmxon	-0x8(%rbp)
26	ja	1f	/* CF=0, ZF=0 (success) */
27	incl	%eax
281:
29
30	leave
31	ret
32	SET_SIZE(hma_vmx_vmxon)
33
34	ENTRY_NP(hma_vmx_do_invept)
35	push	%rbp
36	movq	%rsp, %rbp
37	pushq	%rdi
38	pushq	%rsi
39
40	/* build INVEPT descriptor on stack */
41	xorl	%eax, %eax
42	pushq	%rax;
43	pushq	%rsi
44
45	invept	(%rsp), %rdi
46	ja	1f	/* CF=0, ZF=0 (success) */
47	incl	%eax
481:
49
50	leave
51	ret
52	SET_SIZE(hma_vmx_do_invept)
53