Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
kvm_host.h File Reference
#include <linux/types.h>
#include <linux/hardirq.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/bug.h>
#include <linux/mm.h>
#include <linux/mmu_notifier.h>
#include <linux/preempt.h>
#include <linux/msi.h>
#include <linux/slab.h>
#include <linux/rcupdate.h>
#include <linux/ratelimit.h>
#include <linux/err.h>
#include <asm/signal.h>
#include <linux/kvm.h>
#include <linux/kvm_para.h>
#include <linux/kvm_types.h>
#include <asm/kvm_host.h>

Go to the source code of this file.

Data Structures

struct  kvm_io_range
 
struct  kvm_io_bus
 
struct  kvm_mmio_fragment
 
struct  kvm_vcpu
 
struct  kvm_memory_slot
 
struct  kvm_kernel_irq_routing_entry
 
struct  kvm_irq_routing_table
 
struct  kvm_memslots
 
struct  kvm
 
struct  kvm_irq_ack_notifier
 
struct  kvm_assigned_dev_kernel
 
struct  kvm_irq_mask_notifier
 
struct  kvm_stats_debugfs_item
 

Macros

#define KVM_MMIO_SIZE   8
 
#define KVM_MEMSLOT_INVALID   (1UL << 16)
 
#define KVM_MAX_MMIO_FRAGMENTS   2
 
#define KVM_PFN_ERR_MASK   (0xfffULL << 52)
 
#define KVM_PFN_ERR_FAULT   (KVM_PFN_ERR_MASK)
 
#define KVM_PFN_ERR_HWPOISON   (KVM_PFN_ERR_MASK + 1)
 
#define KVM_PFN_ERR_BAD   (KVM_PFN_ERR_MASK + 2)
 
#define KVM_PFN_ERR_RO_FAULT   (KVM_PFN_ERR_MASK + 3)
 
#define KVM_HVA_ERR_BAD   (PAGE_OFFSET)
 
#define KVM_HVA_ERR_RO_BAD   (PAGE_OFFSET + PAGE_SIZE)
 
#define KVM_ERR_PTR_BAD_PAGE   (ERR_PTR(-ENOENT))
 
#define KVM_REQ_TLB_FLUSH   0
 
#define KVM_REQ_MIGRATE_TIMER   1
 
#define KVM_REQ_REPORT_TPR_ACCESS   2
 
#define KVM_REQ_MMU_RELOAD   3
 
#define KVM_REQ_TRIPLE_FAULT   4
 
#define KVM_REQ_PENDING_TIMER   5
 
#define KVM_REQ_UNHALT   6
 
#define KVM_REQ_MMU_SYNC   7
 
#define KVM_REQ_CLOCK_UPDATE   8
 
#define KVM_REQ_KICK   9
 
#define KVM_REQ_DEACTIVATE_FPU   10
 
#define KVM_REQ_EVENT   11
 
#define KVM_REQ_APF_HALT   12
 
#define KVM_REQ_STEAL_UPDATE   13
 
#define KVM_REQ_NMI   14
 
#define KVM_REQ_IMMEDIATE_EXIT   15
 
#define KVM_REQ_PMU   16
 
#define KVM_REQ_PMI   17
 
#define KVM_USERSPACE_IRQ_SOURCE_ID   0
 
#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID   1
 
#define NR_IOBUS_DEVS   1000
 
#define KVM_MEM_MAX_NR_PAGES   ((1UL << 31) - 1)
 
#define KVM_MEM_SLOTS_NUM   (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
 
#define kvm_err(fmt,...)   pr_err("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
 
#define kvm_info(fmt,...)   pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
 
#define kvm_debug(fmt,...)   pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
 
#define kvm_pr_unimpl(fmt,...)
 
#define vcpu_unimpl(vcpu, fmt,...)   kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__)
 
#define kvm_for_each_vcpu(idx, vcpup, kvm)
 
#define kvm_for_each_memslot(memslot, slots)
 
#define KVM_IOMMU_CACHE_COHERENCY   0x1
 

Enumerations

enum  kvm_bus { KVM_MMIO_BUS, KVM_PIO_BUS, KVM_NR_BUSES }
 
enum  { OUTSIDE_GUEST_MODE, IN_GUEST_MODE, EXITING_GUEST_MODE, READING_SHADOW_PAGE_TABLES }
 
enum  kvm_stat_kind { KVM_STAT_VM, KVM_STAT_VCPU }
 

Functions

int kvm_io_bus_write (struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, const void *val)
 
int kvm_io_bus_read (struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, void *val)
 
int kvm_io_bus_register_dev (struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, struct kvm_io_device *dev)
 
int kvm_io_bus_unregister_dev (struct kvm *kvm, enum kvm_bus bus_idx, struct kvm_io_device *dev)
 
int kvm_vcpu_init (struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
 
void kvm_vcpu_uninit (struct kvm_vcpu *vcpu)
 
int __must_check vcpu_load (struct kvm_vcpu *vcpu)
 
void vcpu_put (struct kvm_vcpu *vcpu)
 
int kvm_init (void *opaque, unsigned vcpu_size, unsigned vcpu_align, struct module *module)
 
void kvm_exit (void)
 
void kvm_get_kvm (struct kvm *kvm)
 
void kvm_put_kvm (struct kvm *kvm)
 
void update_memslots (struct kvm_memslots *slots, struct kvm_memory_slot *new)
 
int kvm_set_memory_region (struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc)
 
int __kvm_set_memory_region (struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc)
 
void kvm_arch_free_memslot (struct kvm_memory_slot *free, struct kvm_memory_slot *dont)
 
int kvm_arch_create_memslot (struct kvm_memory_slot *slot, unsigned long npages)
 
int kvm_arch_prepare_memory_region (struct kvm *kvm, struct kvm_memory_slot *memslot, struct kvm_memory_slot old, struct kvm_userspace_memory_region *mem, int user_alloc)
 
void kvm_arch_commit_memory_region (struct kvm *kvm, struct kvm_userspace_memory_region *mem, struct kvm_memory_slot old, int user_alloc)
 
bool kvm_largepages_enabled (void)
 
void kvm_disable_largepages (void)
 
void kvm_arch_flush_shadow_all (struct kvm *kvm)
 
void kvm_arch_flush_shadow_memslot (struct kvm *kvm, struct kvm_memory_slot *slot)
 
int gfn_to_page_many_atomic (struct kvm *kvm, gfn_t gfn, struct page **pages, int nr_pages)
 
struct pagegfn_to_page (struct kvm *kvm, gfn_t gfn)
 
unsigned long gfn_to_hva (struct kvm *kvm, gfn_t gfn)
 
unsigned long gfn_to_hva_memslot (struct kvm_memory_slot *slot, gfn_t gfn)
 
void kvm_release_page_clean (struct page *page)
 
void kvm_release_page_dirty (struct page *page)
 
void kvm_set_page_dirty (struct page *page)
 
void kvm_set_page_accessed (struct page *page)
 
pfn_t gfn_to_pfn_atomic (struct kvm *kvm, gfn_t gfn)
 
pfn_t gfn_to_pfn_async (struct kvm *kvm, gfn_t gfn, bool *async, bool write_fault, bool *writable)
 
pfn_t gfn_to_pfn (struct kvm *kvm, gfn_t gfn)
 
pfn_t gfn_to_pfn_prot (struct kvm *kvm, gfn_t gfn, bool write_fault, bool *writable)
 
pfn_t gfn_to_pfn_memslot (struct kvm_memory_slot *slot, gfn_t gfn)
 
pfn_t gfn_to_pfn_memslot_atomic (struct kvm_memory_slot *slot, gfn_t gfn)
 
void kvm_release_pfn_dirty (pfn_t pfn)
 
void kvm_release_pfn_clean (pfn_t pfn)
 
void kvm_set_pfn_dirty (pfn_t pfn)
 
void kvm_set_pfn_accessed (pfn_t pfn)
 
void kvm_get_pfn (pfn_t pfn)
 
int kvm_read_guest_page (struct kvm *kvm, gfn_t gfn, void *data, int offset, int len)
 
int kvm_read_guest_atomic (struct kvm *kvm, gpa_t gpa, void *data, unsigned long len)
 
int kvm_read_guest (struct kvm *kvm, gpa_t gpa, void *data, unsigned long len)
 
int kvm_read_guest_cached (struct kvm *kvm, struct gfn_to_hva_cache *ghc, void *data, unsigned long len)
 
int kvm_write_guest_page (struct kvm *kvm, gfn_t gfn, const void *data, int offset, int len)
 
int kvm_write_guest (struct kvm *kvm, gpa_t gpa, const void *data, unsigned long len)
 
int kvm_write_guest_cached (struct kvm *kvm, struct gfn_to_hva_cache *ghc, void *data, unsigned long len)
 
int kvm_gfn_to_hva_cache_init (struct kvm *kvm, struct gfn_to_hva_cache *ghc, gpa_t gpa)
 
int kvm_clear_guest_page (struct kvm *kvm, gfn_t gfn, int offset, int len)
 
int kvm_clear_guest (struct kvm *kvm, gpa_t gpa, unsigned long len)
 
struct kvm_memory_slotgfn_to_memslot (struct kvm *kvm, gfn_t gfn)
 
int kvm_is_visible_gfn (struct kvm *kvm, gfn_t gfn)
 
unsigned long kvm_host_page_size (struct kvm *kvm, gfn_t gfn)
 
void mark_page_dirty (struct kvm *kvm, gfn_t gfn)
 
void mark_page_dirty_in_slot (struct kvm *kvm, struct kvm_memory_slot *memslot, gfn_t gfn)
 
void kvm_vcpu_block (struct kvm_vcpu *vcpu)
 
void kvm_vcpu_kick (struct kvm_vcpu *vcpu)
 
bool kvm_vcpu_yield_to (struct kvm_vcpu *target)
 
void kvm_vcpu_on_spin (struct kvm_vcpu *vcpu)
 
void kvm_resched (struct kvm_vcpu *vcpu)
 
void kvm_load_guest_fpu (struct kvm_vcpu *vcpu)
 
void kvm_put_guest_fpu (struct kvm_vcpu *vcpu)
 
void kvm_flush_remote_tlbs (struct kvm *kvm)
 
void kvm_reload_remote_mmus (struct kvm *kvm)
 
long kvm_arch_dev_ioctl (struct file *filp, unsigned int ioctl, unsigned long arg)
 
long kvm_arch_vcpu_ioctl (struct file *filp, unsigned int ioctl, unsigned long arg)
 
int kvm_arch_vcpu_fault (struct kvm_vcpu *vcpu, struct vm_fault *vmf)
 
int kvm_dev_ioctl_check_extension (long ext)
 
int kvm_get_dirty_log (struct kvm *kvm, struct kvm_dirty_log *log, int *is_dirty)
 
int kvm_vm_ioctl_get_dirty_log (struct kvm *kvm, struct kvm_dirty_log *log)
 
int kvm_vm_ioctl_set_memory_region (struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc)
 
int kvm_vm_ioctl_irq_line (struct kvm *kvm, struct kvm_irq_level *irq_level)
 
long kvm_arch_vm_ioctl (struct file *filp, unsigned int ioctl, unsigned long arg)
 
int kvm_arch_vcpu_ioctl_get_fpu (struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
 
int kvm_arch_vcpu_ioctl_set_fpu (struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
 
int kvm_arch_vcpu_ioctl_translate (struct kvm_vcpu *vcpu, struct kvm_translation *tr)
 
int kvm_arch_vcpu_ioctl_get_regs (struct kvm_vcpu *vcpu, struct kvm_regs *regs)
 
int kvm_arch_vcpu_ioctl_set_regs (struct kvm_vcpu *vcpu, struct kvm_regs *regs)
 
int kvm_arch_vcpu_ioctl_get_sregs (struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
 
int kvm_arch_vcpu_ioctl_set_sregs (struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
 
int kvm_arch_vcpu_ioctl_get_mpstate (struct kvm_vcpu *vcpu, struct kvm_mp_state *mp_state)
 
int kvm_arch_vcpu_ioctl_set_mpstate (struct kvm_vcpu *vcpu, struct kvm_mp_state *mp_state)
 
int kvm_arch_vcpu_ioctl_set_guest_debug (struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
 
int kvm_arch_vcpu_ioctl_run (struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 
int kvm_arch_init (void *opaque)
 
void kvm_arch_exit (void)
 
int kvm_arch_vcpu_init (struct kvm_vcpu *vcpu)
 
void kvm_arch_vcpu_uninit (struct kvm_vcpu *vcpu)
 
void kvm_arch_vcpu_free (struct kvm_vcpu *vcpu)
 
void kvm_arch_vcpu_load (struct kvm_vcpu *vcpu, int cpu)
 
void kvm_arch_vcpu_put (struct kvm_vcpu *vcpu)
 
struct kvm_vcpukvm_arch_vcpu_create (struct kvm *kvm, unsigned int id)
 
int kvm_arch_vcpu_setup (struct kvm_vcpu *vcpu)
 
void kvm_arch_vcpu_destroy (struct kvm_vcpu *vcpu)
 
int kvm_arch_vcpu_reset (struct kvm_vcpu *vcpu)
 
int kvm_arch_hardware_enable (void *garbage)
 
void kvm_arch_hardware_disable (void *garbage)
 
int kvm_arch_hardware_setup (void)
 
void kvm_arch_hardware_unsetup (void)
 
void kvm_arch_check_processor_compat (void *rtn)
 
int kvm_arch_vcpu_runnable (struct kvm_vcpu *vcpu)
 
int kvm_arch_vcpu_should_kick (struct kvm_vcpu *vcpu)
 
void kvm_free_physmem (struct kvm *kvm)
 
voidkvm_kvzalloc (unsigned long size)
 
void kvm_kvfree (const void *addr)
 
int kvm_arch_init_vm (struct kvm *kvm, unsigned long type)
 
void kvm_arch_destroy_vm (struct kvm *kvm)
 
void kvm_free_all_assigned_devices (struct kvm *kvm)
 
void kvm_arch_sync_events (struct kvm *kvm)
 
int kvm_cpu_has_pending_timer (struct kvm_vcpu *vcpu)
 
bool kvm_is_mmio_pfn (pfn_t pfn)
 
void kvm_register_irq_mask_notifier (struct kvm *kvm, int irq, struct kvm_irq_mask_notifier *kimn)
 
void kvm_unregister_irq_mask_notifier (struct kvm *kvm, int irq, struct kvm_irq_mask_notifier *kimn)
 
void kvm_fire_mask_notifiers (struct kvm *kvm, unsigned irqchip, unsigned pin, bool mask)
 
int kvm_set_irq (struct kvm *kvm, int irq_source_id, u32 irq, int level)
 
int kvm_set_msi (struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, int irq_source_id, int level)
 
void kvm_notify_acked_irq (struct kvm *kvm, unsigned irqchip, unsigned pin)
 
void kvm_register_irq_ack_notifier (struct kvm *kvm, struct kvm_irq_ack_notifier *kian)
 
void kvm_unregister_irq_ack_notifier (struct kvm *kvm, struct kvm_irq_ack_notifier *kian)
 
int kvm_request_irq_source_id (struct kvm *kvm)
 
void kvm_free_irq_source_id (struct kvm *kvm, int irq_source_id)
 

Variables

struct kmem_cachekvm_vcpu_cache
 
struct kvm_stats_debugfs_item debugfs_entries []
 
struct dentrykvm_debugfs_dir
 

Macro Definition Documentation

#define kvm_debug (   fmt,
  ... 
)    pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)

Definition at line 373 of file kvm_host.h.

#define kvm_err (   fmt,
  ... 
)    pr_err("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)

Definition at line 369 of file kvm_host.h.

#define KVM_ERR_PTR_BAD_PAGE   (ERR_PTR(-ENOENT))

Definition at line 82 of file kvm_host.h.

#define kvm_for_each_memslot (   memslot,
  slots 
)
Value:
for (memslot = &slots->memslots[0]; \
memslot < slots->memslots + KVM_MEM_SLOTS_NUM && memslot->npages;\
memslot++)

Definition at line 395 of file kvm_host.h.

#define kvm_for_each_vcpu (   idx,
  vcpup,
  kvm 
)
Value:
for (idx = 0; \
(vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \
idx++)

Definition at line 389 of file kvm_host.h.

#define KVM_HVA_ERR_BAD   (PAGE_OFFSET)

Definition at line 74 of file kvm_host.h.

#define KVM_HVA_ERR_RO_BAD   (PAGE_OFFSET + PAGE_SIZE)

Definition at line 75 of file kvm_host.h.

#define kvm_info (   fmt,
  ... 
)    pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)

Definition at line 371 of file kvm_host.h.

#define KVM_IOMMU_CACHE_COHERENCY   0x1

Definition at line 680 of file kvm_host.h.

#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID   1

Definition at line 112 of file kvm_host.h.

#define KVM_MAX_MMIO_FRAGMENTS   2

Definition at line 46 of file kvm_host.h.

#define KVM_MEM_MAX_NR_PAGES   ((1UL << 31) - 1)

Definition at line 249 of file kvm_host.h.

#define KVM_MEM_SLOTS_NUM   (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)

Definition at line 302 of file kvm_host.h.

#define KVM_MEMSLOT_INVALID   (1UL << 16)

Definition at line 43 of file kvm_host.h.

#define KVM_MMIO_SIZE   8

Definition at line 35 of file kvm_host.h.

#define KVM_PFN_ERR_BAD   (KVM_PFN_ERR_MASK + 2)

Definition at line 56 of file kvm_host.h.

#define KVM_PFN_ERR_FAULT   (KVM_PFN_ERR_MASK)

Definition at line 54 of file kvm_host.h.

#define KVM_PFN_ERR_HWPOISON   (KVM_PFN_ERR_MASK + 1)

Definition at line 55 of file kvm_host.h.

#define KVM_PFN_ERR_MASK   (0xfffULL << 52)

Definition at line 52 of file kvm_host.h.

#define KVM_PFN_ERR_RO_FAULT   (KVM_PFN_ERR_MASK + 3)

Definition at line 57 of file kvm_host.h.

#define kvm_pr_unimpl (   fmt,
  ... 
)
Value:
pr_err_ratelimited("kvm [%i]: " fmt, \
task_tgid_nr(current), ## __VA_ARGS__)

Definition at line 375 of file kvm_host.h.

#define KVM_REQ_APF_HALT   12

Definition at line 104 of file kvm_host.h.

#define KVM_REQ_CLOCK_UPDATE   8

Definition at line 100 of file kvm_host.h.

#define KVM_REQ_DEACTIVATE_FPU   10

Definition at line 102 of file kvm_host.h.

#define KVM_REQ_EVENT   11

Definition at line 103 of file kvm_host.h.

#define KVM_REQ_IMMEDIATE_EXIT   15

Definition at line 107 of file kvm_host.h.

#define KVM_REQ_KICK   9

Definition at line 101 of file kvm_host.h.

#define KVM_REQ_MIGRATE_TIMER   1

Definition at line 93 of file kvm_host.h.

#define KVM_REQ_MMU_RELOAD   3

Definition at line 95 of file kvm_host.h.

#define KVM_REQ_MMU_SYNC   7

Definition at line 99 of file kvm_host.h.

#define KVM_REQ_NMI   14

Definition at line 106 of file kvm_host.h.

#define KVM_REQ_PENDING_TIMER   5

Definition at line 97 of file kvm_host.h.

#define KVM_REQ_PMI   17

Definition at line 109 of file kvm_host.h.

#define KVM_REQ_PMU   16

Definition at line 108 of file kvm_host.h.

#define KVM_REQ_REPORT_TPR_ACCESS   2

Definition at line 94 of file kvm_host.h.

#define KVM_REQ_STEAL_UPDATE   13

Definition at line 105 of file kvm_host.h.

#define KVM_REQ_TLB_FLUSH   0

Definition at line 92 of file kvm_host.h.

#define KVM_REQ_TRIPLE_FAULT   4

Definition at line 96 of file kvm_host.h.

#define KVM_REQ_UNHALT   6

Definition at line 98 of file kvm_host.h.

#define KVM_USERSPACE_IRQ_SOURCE_ID   0

Definition at line 111 of file kvm_host.h.

#define NR_IOBUS_DEVS   1000

Definition at line 124 of file kvm_host.h.

#define vcpu_unimpl (   vcpu,
  fmt,
  ... 
)    kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__)

Definition at line 380 of file kvm_host.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
OUTSIDE_GUEST_MODE 
IN_GUEST_MODE 
EXITING_GUEST_MODE 
READING_SHADOW_PAGE_TABLES 

Definition at line 167 of file kvm_host.h.

enum kvm_bus
Enumerator:
KVM_MMIO_BUS 
KVM_PIO_BUS 
KVM_NR_BUSES 

Definition at line 131 of file kvm_host.h.

Enumerator:
KVM_STAT_VM 
KVM_STAT_VCPU 

Definition at line 818 of file kvm_host.h.

Function Documentation

int __kvm_set_memory_region ( struct kvm kvm,
struct kvm_userspace_memory_region mem,
int  user_alloc 
)

Definition at line 705 of file kvm_main.c.

unsigned long gfn_to_hva ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 1010 of file kvm_main.c.

unsigned long gfn_to_hva_memslot ( struct kvm_memory_slot slot,
gfn_t  gfn 
)

Definition at line 1003 of file kvm_main.c.

struct kvm_memory_slot* gfn_to_memslot ( struct kvm kvm,
gfn_t  gfn 
)
read

Definition at line 935 of file kvm_main.c.

struct page* gfn_to_page ( struct kvm kvm,
gfn_t  gfn 
)
read

Definition at line 1304 of file kvm_main.c.

int gfn_to_page_many_atomic ( struct kvm kvm,
gfn_t  gfn,
struct page **  pages,
int  nr_pages 
)

Definition at line 1274 of file kvm_main.c.

pfn_t gfn_to_pfn ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 1250 of file kvm_main.c.

pfn_t gfn_to_pfn_async ( struct kvm kvm,
gfn_t  gfn,
bool async,
bool  write_fault,
bool writable 
)

Definition at line 1243 of file kvm_main.c.

pfn_t gfn_to_pfn_atomic ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 1237 of file kvm_main.c.

pfn_t gfn_to_pfn_memslot ( struct kvm_memory_slot slot,
gfn_t  gfn 
)

Definition at line 1263 of file kvm_main.c.

pfn_t gfn_to_pfn_memslot_atomic ( struct kvm_memory_slot slot,
gfn_t  gfn 
)

Definition at line 1268 of file kvm_main.c.

pfn_t gfn_to_pfn_prot ( struct kvm kvm,
gfn_t  gfn,
bool  write_fault,
bool writable 
)

Definition at line 1256 of file kvm_main.c.

void kvm_arch_check_processor_compat ( void rtn)

Definition at line 188 of file kvm-ia64.c.

void kvm_arch_commit_memory_region ( struct kvm kvm,
struct kvm_userspace_memory_region mem,
struct kvm_memory_slot  old,
int  user_alloc 
)

Definition at line 1608 of file kvm-ia64.c.

int kvm_arch_create_memslot ( struct kvm_memory_slot slot,
unsigned long  npages 
)

Definition at line 1571 of file kvm-ia64.c.

void kvm_arch_destroy_vm ( struct kvm kvm)

Definition at line 1381 of file kvm-ia64.c.

long kvm_arch_dev_ioctl ( struct file filp,
unsigned int  ioctl,
unsigned long  arg 
)

Definition at line 1627 of file kvm-ia64.c.

void kvm_arch_exit ( void  )

Definition at line 1796 of file kvm-ia64.c.

void kvm_arch_flush_shadow_all ( struct kvm kvm)

Definition at line 1616 of file kvm-ia64.c.

void kvm_arch_flush_shadow_memslot ( struct kvm kvm,
struct kvm_memory_slot slot 
)

Definition at line 1621 of file kvm-ia64.c.

void kvm_arch_free_memslot ( struct kvm_memory_slot free,
struct kvm_memory_slot dont 
)

Definition at line 1566 of file kvm-ia64.c.

void kvm_arch_hardware_disable ( void garbage)

Definition at line 163 of file kvm-ia64.c.

int kvm_arch_hardware_enable ( void garbage)

Definition at line 128 of file kvm-ia64.c.

int kvm_arch_hardware_setup ( void  )

Definition at line 1859 of file kvm-ia64.c.

void kvm_arch_hardware_unsetup ( void  )

Definition at line 1864 of file kvm-ia64.c.

int kvm_arch_init ( void opaque)

Definition at line 1757 of file kvm-ia64.c.

int kvm_arch_init_vm ( struct kvm kvm,
unsigned long  type 
)

Definition at line 812 of file kvm-ia64.c.

int kvm_arch_prepare_memory_region ( struct kvm kvm,
struct kvm_memory_slot memslot,
struct kvm_memory_slot  old,
struct kvm_userspace_memory_region mem,
int  user_alloc 
)

Definition at line 1576 of file kvm-ia64.c.

void kvm_arch_sync_events ( struct kvm kvm)

Definition at line 1377 of file kvm-ia64.c.

struct kvm_vcpu* kvm_arch_vcpu_create ( struct kvm kvm,
unsigned int  id 
)
read

Definition at line 1288 of file kvm-ia64.c.

void kvm_arch_vcpu_destroy ( struct kvm_vcpu vcpu)

Definition at line 1633 of file kvm-ia64.c.

int kvm_arch_vcpu_fault ( struct kvm_vcpu vcpu,
struct vm_fault *  vmf 
)

Definition at line 1561 of file kvm-ia64.c.

void kvm_arch_vcpu_free ( struct kvm_vcpu vcpu)

Definition at line 357 of file powerpc.c.

int kvm_arch_vcpu_init ( struct kvm_vcpu vcpu)

Definition at line 1167 of file kvm-ia64.c.

long kvm_arch_vcpu_ioctl ( struct file filp,
unsigned int  ioctl,
unsigned long  arg 
)

Definition at line 1484 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_get_fpu ( struct kvm_vcpu vcpu,
struct kvm_fpu fpu 
)

Definition at line 1333 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_get_mpstate ( struct kvm_vcpu vcpu,
struct kvm_mp_state mp_state 
)

Definition at line 1942 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_get_regs ( struct kvm_vcpu vcpu,
struct kvm_regs regs 
)

Definition at line 1406 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_get_sregs ( struct kvm_vcpu vcpu,
struct kvm_sregs sregs 
)

Definition at line 1024 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_run ( struct kvm_vcpu vcpu,
struct kvm_run kvm_run 
)

Definition at line 726 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_set_fpu ( struct kvm_vcpu vcpu,
struct kvm_fpu fpu 
)

Definition at line 1338 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_set_guest_debug ( struct kvm_vcpu vcpu,
struct kvm_guest_debug dbg 
)

Definition at line 1343 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_set_mpstate ( struct kvm_vcpu vcpu,
struct kvm_mp_state mp_state 
)

Definition at line 1971 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_set_regs ( struct kvm_vcpu vcpu,
struct kvm_regs regs 
)

Definition at line 873 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_set_sregs ( struct kvm_vcpu vcpu,
struct kvm_sregs sregs 
)

Definition at line 1018 of file kvm-ia64.c.

int kvm_arch_vcpu_ioctl_translate ( struct kvm_vcpu vcpu,
struct kvm_translation tr 
)

Definition at line 1030 of file kvm-ia64.c.

void kvm_arch_vcpu_load ( struct kvm_vcpu vcpu,
int  cpu 
)

Definition at line 1395 of file kvm-ia64.c.

void kvm_arch_vcpu_put ( struct kvm_vcpu vcpu)

Definition at line 1391 of file kvm-ia64.c.

int kvm_arch_vcpu_reset ( struct kvm_vcpu vcpu)

Definition at line 6072 of file x86.c.

int kvm_arch_vcpu_runnable ( struct kvm_vcpu vcpu)

Definition at line 1931 of file kvm-ia64.c.

int kvm_arch_vcpu_setup ( struct kvm_vcpu vcpu)

Definition at line 1328 of file kvm-ia64.c.

int kvm_arch_vcpu_should_kick ( struct kvm_vcpu vcpu)

Definition at line 1937 of file kvm-ia64.c.

void kvm_arch_vcpu_uninit ( struct kvm_vcpu vcpu)

Definition at line 1476 of file kvm-ia64.c.

long kvm_arch_vm_ioctl ( struct file filp,
unsigned int  ioctl,
unsigned long  arg 
)

Definition at line 937 of file kvm-ia64.c.

int kvm_clear_guest ( struct kvm kvm,
gpa_t  gpa,
unsigned long  len 
)

Definition at line 1544 of file kvm_main.c.

int kvm_clear_guest_page ( struct kvm kvm,
gfn_t  gfn,
int  offset,
int  len 
)

Definition at line 1537 of file kvm_main.c.

int kvm_cpu_has_pending_timer ( struct kvm_vcpu vcpu)

Definition at line 1926 of file kvm-ia64.c.

int kvm_dev_ioctl_check_extension ( long  ext)

Definition at line 193 of file kvm-ia64.c.

void kvm_disable_largepages ( void  )

Definition at line 929 of file kvm_main.c.

void kvm_exit ( void  )

Definition at line 2961 of file kvm_main.c.

void kvm_fire_mask_notifiers ( struct kvm kvm,
unsigned  irqchip,
unsigned  pin,
bool  mask 
)

Definition at line 284 of file irq_comm.c.

void kvm_flush_remote_tlbs ( struct kvm kvm)

Definition at line 200 of file kvm_main.c.

void kvm_free_all_assigned_devices ( struct kvm kvm)

Definition at line 288 of file assigned-dev.c.

void kvm_free_irq_source_id ( struct kvm kvm,
int  irq_source_id 
)

Definition at line 241 of file irq_comm.c.

void kvm_free_physmem ( struct kvm kvm)

Definition at line 560 of file kvm_main.c.

int kvm_get_dirty_log ( struct kvm kvm,
struct kvm_dirty_log log,
int is_dirty 
)

Definition at line 890 of file kvm_main.c.

void kvm_get_kvm ( struct kvm kvm)

Definition at line 597 of file kvm_main.c.

void kvm_get_pfn ( pfn_t  pfn)

Definition at line 1368 of file kvm_main.c.

int kvm_gfn_to_hva_cache_init ( struct kvm kvm,
struct gfn_to_hva_cache ghc,
gpa_t  gpa 
)

Definition at line 1476 of file kvm_main.c.

unsigned long kvm_host_page_size ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 953 of file kvm_main.c.

int kvm_init ( void opaque,
unsigned  vcpu_size,
unsigned  vcpu_align,
struct module module 
)

Definition at line 2871 of file kvm_main.c.

int kvm_io_bus_read ( struct kvm kvm,
enum kvm_bus  bus_idx,
gpa_t  addr,
int  len,
void val 
)

Definition at line 2668 of file kvm_main.c.

int kvm_io_bus_register_dev ( struct kvm kvm,
enum kvm_bus  bus_idx,
gpa_t  addr,
int  len,
struct kvm_io_device dev 
)

Definition at line 2696 of file kvm_main.c.

int kvm_io_bus_unregister_dev ( struct kvm kvm,
enum kvm_bus  bus_idx,
struct kvm_io_device dev 
)

Definition at line 2720 of file kvm_main.c.

int kvm_io_bus_write ( struct kvm kvm,
enum kvm_bus  bus_idx,
gpa_t  addr,
int  len,
const void val 
)

Definition at line 2640 of file kvm_main.c.

bool kvm_is_mmio_pfn ( pfn_t  pfn)

Definition at line 103 of file kvm_main.c.

int kvm_is_visible_gfn ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 941 of file kvm_main.c.

void kvm_kvfree ( const void addr)

Definition at line 529 of file kvm_main.c.

void* kvm_kvzalloc ( unsigned long  size)

Definition at line 521 of file kvm_main.c.

bool kvm_largepages_enabled ( void  )

Definition at line 924 of file kvm_main.c.

void kvm_load_guest_fpu ( struct kvm_vcpu vcpu)

Definition at line 5991 of file x86.c.

void kvm_notify_acked_irq ( struct kvm kvm,
unsigned  irqchip,
unsigned  pin 
)

Definition at line 181 of file irq_comm.c.

void kvm_put_guest_fpu ( struct kvm_vcpu vcpu)

Definition at line 6008 of file x86.c.

void kvm_put_kvm ( struct kvm kvm)

Definition at line 603 of file kvm_main.c.

int kvm_read_guest ( struct kvm kvm,
gpa_t  gpa,
void data,
unsigned long  len 
)

Definition at line 1399 of file kvm_main.c.

int kvm_read_guest_atomic ( struct kvm kvm,
gpa_t  gpa,
void data,
unsigned long  len 
)

Definition at line 1419 of file kvm_main.c.

int kvm_read_guest_cached ( struct kvm kvm,
struct gfn_to_hva_cache ghc,
void data,
unsigned long  len 
)

Definition at line 1517 of file kvm_main.c.

int kvm_read_guest_page ( struct kvm kvm,
gfn_t  gfn,
void data,
int  offset,
int  len 
)

Definition at line 1383 of file kvm_main.c.

void kvm_register_irq_ack_notifier ( struct kvm kvm,
struct kvm_irq_ack_notifier kian 
)

Definition at line 199 of file irq_comm.c.

void kvm_register_irq_mask_notifier ( struct kvm kvm,
int  irq,
struct kvm_irq_mask_notifier kimn 
)

Definition at line 266 of file irq_comm.c.

void kvm_release_page_clean ( struct page page)

Definition at line 1315 of file kvm_main.c.

void kvm_release_page_dirty ( struct page page)

Definition at line 1330 of file kvm_main.c.

void kvm_release_pfn_clean ( pfn_t  pfn)

Definition at line 1323 of file kvm_main.c.

void kvm_release_pfn_dirty ( pfn_t  pfn)

Definition at line 1338 of file kvm_main.c.

void kvm_reload_remote_mmus ( struct kvm kvm)

Definition at line 210 of file kvm_main.c.

int kvm_request_irq_source_id ( struct kvm kvm)

Definition at line 216 of file irq_comm.c.

void kvm_resched ( struct kvm_vcpu vcpu)

Definition at line 1630 of file kvm_main.c.

int kvm_set_irq ( struct kvm kvm,
int  irq_source_id,
u32  irq,
int  level 
)

Definition at line 149 of file irq_comm.c.

int kvm_set_memory_region ( struct kvm kvm,
struct kvm_userspace_memory_region mem,
int  user_alloc 
)

Definition at line 867 of file kvm_main.c.

int kvm_set_msi ( struct kvm_kernel_irq_routing_entry irq_entry,
struct kvm kvm,
int  irq_source_id,
int  level 
)

Definition at line 105 of file irq_comm.c.

void kvm_set_page_accessed ( struct page page)
void kvm_set_page_dirty ( struct page page)

Definition at line 1345 of file kvm_main.c.

void kvm_set_pfn_accessed ( pfn_t  pfn)

Definition at line 1361 of file kvm_main.c.

void kvm_set_pfn_dirty ( pfn_t  pfn)

Definition at line 1351 of file kvm_main.c.

void kvm_unregister_irq_ack_notifier ( struct kvm kvm,
struct kvm_irq_ack_notifier kian 
)

Definition at line 207 of file irq_comm.c.

void kvm_unregister_irq_mask_notifier ( struct kvm kvm,
int  irq,
struct kvm_irq_mask_notifier kimn 
)

Definition at line 275 of file irq_comm.c.

void kvm_vcpu_block ( struct kvm_vcpu vcpu)

Definition at line 1584 of file kvm_main.c.

int kvm_vcpu_init ( struct kvm_vcpu vcpu,
struct kvm kvm,
unsigned  id 
)

Definition at line 215 of file kvm_main.c.

void kvm_vcpu_kick ( struct kvm_vcpu vcpu)

Definition at line 1610 of file kvm_main.c.

void kvm_vcpu_on_spin ( struct kvm_vcpu vcpu)

Definition at line 1700 of file kvm_main.c.

void kvm_vcpu_uninit ( struct kvm_vcpu vcpu)

Definition at line 250 of file kvm_main.c.

bool kvm_vcpu_yield_to ( struct kvm_vcpu target)

Definition at line 1638 of file kvm_main.c.

int kvm_vm_ioctl_get_dirty_log ( struct kvm kvm,
struct kvm_dirty_log log 
)

kvm_vm_ioctl_get_dirty_log - get and clear the log of dirty pages in a slot : kvm instance : slot id and address to which we copy the log

We need to keep it in mind that VCPU threads can write to the bitmap concurrently. So, to avoid losing data, we keep the following order for each bit:

  1. Take a snapshot of the bit and clear it if needed.
  2. Write protect the corresponding page.
  3. Flush TLB's if needed.
  4. Copy the snapshot to the userspace.

Between 2 and 3, the guest may write to the page using the remaining TLB entry. This is not a problem because the page will be reported dirty at step 4 using the snapshot taken before and step 3 ensures that successive writes will be logged for the next call.

Definition at line 1823 of file kvm-ia64.c.

int kvm_vm_ioctl_irq_line ( struct kvm kvm,
struct kvm_irq_level irq_level 
)

Definition at line 927 of file kvm-ia64.c.

int kvm_vm_ioctl_set_memory_region ( struct kvm kvm,
struct kvm_userspace_memory_region mem,
int  user_alloc 
)

Definition at line 880 of file kvm_main.c.

int kvm_write_guest ( struct kvm kvm,
gpa_t  gpa,
const void data,
unsigned long  len 
)

Definition at line 1456 of file kvm_main.c.

int kvm_write_guest_cached ( struct kvm kvm,
struct gfn_to_hva_cache ghc,
void data,
unsigned long  len 
)

Definition at line 1496 of file kvm_main.c.

int kvm_write_guest_page ( struct kvm kvm,
gfn_t  gfn,
const void data,
int  offset,
int  len 
)

Definition at line 1439 of file kvm_main.c.

void mark_page_dirty ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 1573 of file kvm_main.c.

void mark_page_dirty_in_slot ( struct kvm kvm,
struct kvm_memory_slot memslot,
gfn_t  gfn 
)

Definition at line 1563 of file kvm_main.c.

void update_memslots ( struct kvm_memslots slots,
struct kvm_memory_slot new 
)

Definition at line 668 of file kvm_main.c.

int __must_check vcpu_load ( struct kvm_vcpu vcpu)

Definition at line 134 of file kvm_main.c.

void vcpu_put ( struct kvm_vcpu vcpu)

Definition at line 155 of file kvm_main.c.

Variable Documentation

struct kvm_stats_debugfs_item debugfs_entries[]

Definition at line 68 of file kvm-ia64.c.

struct dentry* kvm_debugfs_dir

Definition at line 85 of file kvm_main.c.

struct kmem_cache* kvm_vcpu_cache

Definition at line 80 of file kvm_main.c.