10
10
#include <linux/compiler.h>
11
11
#include <linux/version.h>
12
12
#include <linux/string.h>
13
#include "include/linux/kvm.h"
14
#include "include/linux/kvm_para.h"
13
#include <linux/kvm.h>
14
#include <linux/kvm_para.h>
15
15
#include <linux/cpu.h>
16
16
#include <asm/processor.h>
17
17
#include <linux/hrtimer.h>
350
350
#ifndef CONFIG_PREEMPT_NOTIFIERS
352
* Include sched|preempt.h before defining CONFIG_PREEMPT_NOTIFIERS to avoid
355
#include <linux/sched.h>
356
#include <linux/preempt.h>
357
#define CONFIG_PREEMPT_NOTIFIERS
358
#define CONFIG_PREEMPT_NOTIFIERS_COMPAT
352
360
struct preempt_notifier;
556
564
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
558
566
#define mmdrop(x) do { (void)(x); } while (0)
567
#define mmget(x) do { (void)(x); } while (0)
571
#define mmget(x) do { atomic_inc(x); } while (0)
580
593
#define EFER_LMA (1<<_EFER_LMA)
596
/* pagefault_enable(), page_fault_disable() - 2.6.20 */
597
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
599
#define pagefault_enable() do {} while (0)
600
#define pagefault_disable() do {} while (0)
583
604
/* vm ops ->fault() was introduced in 2.6.23. */
584
605
#include <linux/mm.h>
663
/* simple vfs attribute getter signature has changed to add a return code */
665
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
667
#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x) \
668
static u64 x(void *v) \
678
#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x) \
679
static int x(void *v, u64 *val) \
681
return __##x(v, val); \
686
/* set_kset_name() is gone in 2.6.25 */
688
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
690
#define set_kset_name(x) .name = x
694
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
696
#define FASTCALL(x) x
701
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
703
#define kvm_tsc_khz 2000000
707
#define kvm_tsc_khz tsc_khz
711
struct kvm_desc_struct {
713
struct { unsigned int a, b; };
717
unsigned base1: 8, type: 4, s: 1, dpl: 2, p: 1;
718
unsigned limit: 4, avl: 1, l: 1, d: 1, g: 1, base2: 8;
722
} __attribute__((packed));
724
struct kvm_ldttss_desc64 {
727
unsigned base1 : 8, type : 5, dpl : 2, p : 1;
728
unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
731
} __attribute__((packed));