kvm: external module: pci_get_bus_and_slot() compatibility
[kvm-userspace.git] / libkvm / kvm-x86.h
blobe988cb7bb0b081760df12eb673bdd46c4ff648d6
1 /*
2 * This header is for functions & variables that will ONLY be
3 * used inside libkvm for x86.
4 * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE
5 * WITHIN LIBKVM.
7 * derived from libkvm.c
9 * Copyright (C) 2006 Qumranet, Inc.
11 * Authors:
12 * Avi Kivity <avi@qumranet.com>
13 * Yaniv Kamay <yaniv@qumranet.com>
15 * This work is licensed under the GNU LGPL license, version 2.
18 #ifndef KVM_X86_H
19 #define KVM_X86_H
21 #include "kvm-common.h"
23 #define PAGE_SIZE 4096ul
24 #define PAGE_MASK (~(PAGE_SIZE - 1))
26 int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr);
28 #ifdef KVM_CAP_VAPIC
30 /*!
31 * \brief Enable kernel tpr access reporting
33 * When tpr access reporting is enabled, the kernel will call the
34 * ->tpr_access() callback every time the guest vcpu accesses the tpr.
36 * \param kvm Pointer to the current kvm_context
37 * \param vcpu vcpu to enable tpr access reporting on
39 int kvm_enable_tpr_access_reporting(kvm_context_t kvm, int vcpu);
41 /*!
42 * \brief Disable kernel tpr access reporting
44 * Undoes the effect of kvm_enable_tpr_access_reporting().
46 * \param kvm Pointer to the current kvm_context
47 * \param vcpu vcpu to disable tpr access reporting on
49 int kvm_disable_tpr_access_reporting(kvm_context_t kvm, int vcpu);
51 #endif
53 #define smp_wmb() asm volatile("" ::: "memory")
55 #endif