Linux Kernel
3.7.1
|
#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 |
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 } |
Variables | |
struct kmem_cache * | kvm_vcpu_cache |
struct kvm_stats_debugfs_item | debugfs_entries [] |
struct dentry * | kvm_debugfs_dir |
Definition at line 373 of file kvm_host.h.
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 | |||
) |
Definition at line 395 of file kvm_host.h.
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.
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, | |
... | |||
) |
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.
anonymous enum |
Definition at line 167 of file kvm_host.h.
enum kvm_bus |
Definition at line 131 of file kvm_host.h.
enum kvm_stat_kind |
Definition at line 818 of file kvm_host.h.
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.
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.
|
read |
Definition at line 935 of file kvm_main.c.
Definition at line 1304 of file kvm_main.c.
Definition at line 1274 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_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.
Definition at line 1256 of file kvm_main.c.
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.
Definition at line 1381 of file kvm-ia64.c.
Definition at line 1627 of file kvm-ia64.c.
Definition at line 1796 of file kvm-ia64.c.
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.
Definition at line 163 of file kvm-ia64.c.
Definition at line 128 of file kvm-ia64.c.
Definition at line 1859 of file kvm-ia64.c.
Definition at line 1864 of file kvm-ia64.c.
Definition at line 1757 of file kvm-ia64.c.
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.
Definition at line 1377 of file kvm-ia64.c.
Definition at line 1288 of file kvm-ia64.c.
Definition at line 1633 of file kvm-ia64.c.
Definition at line 1561 of file kvm-ia64.c.
Definition at line 1167 of file kvm-ia64.c.
Definition at line 1484 of file kvm-ia64.c.
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.
Definition at line 1406 of file kvm-ia64.c.
Definition at line 1024 of file kvm-ia64.c.
Definition at line 726 of file kvm-ia64.c.
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.
Definition at line 873 of file kvm-ia64.c.
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.
Definition at line 1395 of file kvm-ia64.c.
Definition at line 1391 of file kvm-ia64.c.
Definition at line 1931 of file kvm-ia64.c.
Definition at line 1328 of file kvm-ia64.c.
Definition at line 1937 of file kvm-ia64.c.
Definition at line 1476 of file kvm-ia64.c.
Definition at line 937 of file kvm-ia64.c.
Definition at line 1544 of file kvm_main.c.
Definition at line 1537 of file kvm_main.c.
Definition at line 1926 of file kvm-ia64.c.
Definition at line 193 of file kvm-ia64.c.
Definition at line 929 of file kvm_main.c.
Definition at line 2961 of file kvm_main.c.
Definition at line 284 of file irq_comm.c.
Definition at line 200 of file kvm_main.c.
Definition at line 288 of file assigned-dev.c.
Definition at line 241 of file irq_comm.c.
Definition at line 560 of file kvm_main.c.
Definition at line 890 of file kvm_main.c.
Definition at line 597 of file kvm_main.c.
Definition at line 1368 of file kvm_main.c.
Definition at line 1476 of file kvm_main.c.
Definition at line 953 of file kvm_main.c.
Definition at line 2871 of file kvm_main.c.
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.
Definition at line 103 of file kvm_main.c.
Definition at line 529 of file kvm_main.c.
Definition at line 521 of file kvm_main.c.
Definition at line 924 of file kvm_main.c.
Definition at line 181 of file irq_comm.c.
Definition at line 603 of file kvm_main.c.
Definition at line 1399 of file kvm_main.c.
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.
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.
Definition at line 1315 of file kvm_main.c.
Definition at line 1330 of file kvm_main.c.
Definition at line 1323 of file kvm_main.c.
Definition at line 1338 of file kvm_main.c.
Definition at line 210 of file kvm_main.c.
Definition at line 216 of file irq_comm.c.
Definition at line 1630 of file kvm_main.c.
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.
Definition at line 1345 of file kvm_main.c.
Definition at line 1361 of file kvm_main.c.
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.
Definition at line 1584 of file kvm_main.c.
Definition at line 215 of file kvm_main.c.
Definition at line 1610 of file kvm_main.c.
Definition at line 1700 of file kvm_main.c.
Definition at line 250 of file kvm_main.c.
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:
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.
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.
Definition at line 1439 of file kvm_main.c.
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.
Definition at line 155 of file kvm_main.c.
struct kvm_stats_debugfs_item debugfs_entries[] |
Definition at line 68 of file kvm-ia64.c.
Definition at line 85 of file kvm_main.c.
struct kmem_cache* kvm_vcpu_cache |
Definition at line 80 of file kvm_main.c.