Deleted Added
full compact
vmcb.h (271559) vmcb.h (271939)
1/*-
2 * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h 271559 2014-09-13 23:48:43Z neel $
26 * $FreeBSD: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h 271939 2014-09-21 23:42:54Z neel $
27 */
28
29#ifndef _VMCB_H_
30#define _VMCB_H_
31
27 */
28
29#ifndef _VMCB_H_
30#define _VMCB_H_
31
32struct svm_softc;
33
32/*
33 * Secure Virtual Machine: AMD64 Programmer's Manual Vol2, Chapter 15
34 * Layout of VMCB: AMD64 Programmer's Manual Vol2, Appendix B
35 */
36
37/* vmcb_ctrl->intercept[] array indices */
38#define VMCB_CR_INTCPT 0
39#define VMCB_DR_INTCPT 1

--- 234 unchanged lines hidden (view full) ---

274
275struct vmcb {
276 struct vmcb_ctrl ctrl;
277 struct vmcb_state state;
278} __attribute__ ((__packed__));
279CTASSERT(sizeof(struct vmcb) == PAGE_SIZE);
280CTASSERT(offsetof(struct vmcb, state) == 0x400);
281
34/*
35 * Secure Virtual Machine: AMD64 Programmer's Manual Vol2, Chapter 15
36 * Layout of VMCB: AMD64 Programmer's Manual Vol2, Appendix B
37 */
38
39/* vmcb_ctrl->intercept[] array indices */
40#define VMCB_CR_INTCPT 0
41#define VMCB_DR_INTCPT 1

--- 234 unchanged lines hidden (view full) ---

276
277struct vmcb {
278 struct vmcb_ctrl ctrl;
279 struct vmcb_state state;
280} __attribute__ ((__packed__));
281CTASSERT(sizeof(struct vmcb) == PAGE_SIZE);
282CTASSERT(offsetof(struct vmcb, state) == 0x400);
283
282int vmcb_read(struct vmcb *vmcb, int ident, uint64_t *retval);
283int vmcb_write(struct vmcb *vmcb, int ident, uint64_t val);
284struct vmcb_segment *vmcb_seg(struct vmcb *vmcb, int type);
284int vmcb_read(struct svm_softc *sc, int vcpu, int ident, uint64_t *retval);
285int vmcb_write(struct svm_softc *sc, int vcpu, int ident, uint64_t val);
286int vmcb_setdesc(void *arg, int vcpu, int ident, struct seg_desc *desc);
287int vmcb_getdesc(void *arg, int vcpu, int ident, struct seg_desc *desc);
288int vmcb_seg(struct vmcb *vmcb, int ident, struct vmcb_segment *seg);
285
286#endif /* _VMCB_H_ */
289
290#endif /* _VMCB_H_ */