~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to arch/x86/include/asm/kvm_host.h

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-57i0gl3v99b3lkfg
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#define KVM_MEMORY_SLOTS 32
31
31
/* memory slots that does not exposed to userspace */
32
32
#define KVM_PRIVATE_MEM_SLOTS 4
 
33
#define KVM_MMIO_SIZE 16
33
34
 
34
35
#define KVM_PIO_PAGE_OFFSET 1
35
36
#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
36
37
 
 
38
#define CR0_RESERVED_BITS                                               \
 
39
        (~(unsigned long)(X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS \
 
40
                          | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \
 
41
                          | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
 
42
 
37
43
#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1)
38
44
#define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
39
45
#define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS |    \
40
46
                                  0xFFFFFF0000000000ULL)
 
47
#define CR4_RESERVED_BITS                                               \
 
48
        (~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
 
49
                          | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE     \
 
50
                          | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR  \
 
51
                          | X86_CR4_OSXSAVE | X86_CR4_SMEP              \
 
52
                          | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE))
 
53
 
 
54
#define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR)
 
55
 
 
56
 
41
57
 
42
58
#define INVALID_PAGE (~(hpa_t)0)
43
59
#define VALID_PAGE(x) ((x) != INVALID_PAGE)
118
134
enum kvm_reg_ex {
119
135
        VCPU_EXREG_PDPTR = NR_VCPU_REGS,
120
136
        VCPU_EXREG_CR3,
 
137
        VCPU_EXREG_RFLAGS,
 
138
        VCPU_EXREG_CPL,
 
139
        VCPU_EXREG_SEGMENTS,
121
140
};
122
141
 
123
142
enum {
256
275
                         struct kvm_mmu_page *sp);
257
276
        void (*invlpg)(struct kvm_vcpu *vcpu, gva_t gva);
258
277
        void (*update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
259
 
                        u64 *spte, const void *pte, unsigned long mmu_seq);
 
278
                           u64 *spte, const void *pte);
260
279
        hpa_t root_hpa;
261
280
        int root_level;
262
281
        int shadow_root_level;
340
359
        struct fpu guest_fpu;
341
360
        u64 xcr0;
342
361
 
343
 
        gva_t mmio_fault_cr2;
344
362
        struct kvm_pio_request pio;
345
363
        void *pio_data;
346
364
 
367
385
        /* emulate context */
368
386
 
369
387
        struct x86_emulate_ctxt emulate_ctxt;
 
388
        bool emulate_regs_need_sync_to_vcpu;
 
389
        bool emulate_regs_need_sync_from_vcpu;
370
390
 
371
391
        gpa_t time;
372
392
        struct pvclock_vcpu_time_info hv_clock;
373
393
        unsigned int hw_tsc_khz;
374
394
        unsigned int time_offset;
375
395
        struct page *time_page;
376
 
        u64 last_host_tsc;
377
396
        u64 last_guest_tsc;
378
397
        u64 last_kernel_ns;
379
398
        u64 last_tsc_nsec;
380
399
        u64 last_tsc_write;
 
400
        u32 virtual_tsc_khz;
381
401
        bool tsc_catchup;
 
402
        u32  tsc_catchup_mult;
 
403
        s8   tsc_catchup_shift;
382
404
 
383
405
        bool nmi_pending;
384
406
        bool nmi_injected;
448
470
        u64 last_tsc_nsec;
449
471
        u64 last_tsc_offset;
450
472
        u64 last_tsc_write;
451
 
        u32 virtual_tsc_khz;
452
 
        u32 virtual_tsc_mult;
453
 
        s8 virtual_tsc_shift;
454
473
 
455
474
        struct kvm_xen_hvm_config xen_hvm_config;
456
475
 
502
521
        u32 nmi_injections;
503
522
};
504
523
 
 
524
struct x86_instruction_info;
 
525
 
505
526
struct kvm_x86_ops {
506
527
        int (*cpu_has_kvm_support)(void);          /* __init */
507
528
        int (*disabled_by_bios)(void);             /* __init */
586
607
 
587
608
        bool (*has_wbinvd_exit)(void);
588
609
 
 
610
        void (*set_tsc_khz)(struct kvm_vcpu *vcpu, u32 user_tsc_khz);
589
611
        void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset);
590
612
 
 
613
        u64 (*compute_tsc_offset)(struct kvm_vcpu *vcpu, u64 target_tsc);
 
614
 
591
615
        void (*get_exit_info)(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2);
 
616
 
 
617
        int (*check_intercept)(struct kvm_vcpu *vcpu,
 
618
                               struct x86_instruction_info *info,
 
619
                               enum x86_intercept_stage stage);
 
620
 
592
621
        const struct trace_print_flags *exit_reasons_str;
593
622
};
594
623
 
627
656
 
628
657
extern bool tdp_enabled;
629
658
 
 
659
/* control of guest tsc rate supported? */
 
660
extern bool kvm_has_tsc_control;
 
661
/* minimum supported tsc_khz for guests */
 
662
extern u32  kvm_min_guest_tsc_khz;
 
663
/* maximum supported tsc_khz for guests */
 
664
extern u32  kvm_max_guest_tsc_khz;
 
665
 
630
666
enum emulation_result {
631
667
        EMULATE_DONE,       /* no further processing */
632
668
        EMULATE_DO_MMIO,      /* kvm_run filled with mmio request */
645
681
        return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
646
682
}
647
683
 
648
 
void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
649
 
void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
650
 
 
651
684
void kvm_enable_efer_bits(u64);
652
685
int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data);
653
686
int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
657
690
int kvm_fast_pio_out(struct kvm_vcpu *vcpu, int size, unsigned short port);
658
691
void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
659
692
int kvm_emulate_halt(struct kvm_vcpu *vcpu);
660
 
int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address);
661
 
int emulate_clts(struct kvm_vcpu *vcpu);
662
693
int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu);
663
694
 
664
695
void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
721
752
 
722
753
int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
723
754
 
724
 
int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
725
 
 
726
755
int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code,
727
756
                       void *insn, int insn_len);
728
757
void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva);