mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
KVM: add vm refcounting
the main purpose of adding this functions is the abilaty to release the spinlock that protect the kvm list while still be able to do operations on a specific kvm in a safe way. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
9c20456a32
commit
d39f13b0da
2 changed files with 20 additions and 1 deletions
|
@ -114,6 +114,7 @@ struct kvm {
|
|||
struct kvm_io_bus pio_bus;
|
||||
struct kvm_vm_stat stat;
|
||||
struct kvm_arch arch;
|
||||
atomic_t users_count;
|
||||
};
|
||||
|
||||
/* The guest did something we don't support. */
|
||||
|
@ -140,6 +141,9 @@ int kvm_init(void *opaque, unsigned int vcpu_size,
|
|||
struct module *module);
|
||||
void kvm_exit(void);
|
||||
|
||||
void kvm_get_kvm(struct kvm *kvm);
|
||||
void kvm_put_kvm(struct kvm *kvm);
|
||||
|
||||
#define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
|
||||
#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
|
||||
static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue