KVM minor fixups
v2 cover KVM minor fixups
Hi Paolo,
I fixed up the series as requested.
-Geoff
V2:
o Removed arm patches.
o Moved kvm_spurious_fault to arch/x86/kvm/x86.c.
o Fixed commit comments.
The following changes since commit 07961ac7c0ee8b546658717034fe692fd12eefa9:
Linux 3.9-rc5 (2013-03-31 15:12:43 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/geoff/kvm.git for-kvm
for you to fetch changes up to 753c819ec3c3c55d6ca0eeddb4c6c2a32be7219b:
KVM: Move vm_list kvm_lock declarations out of x86 (2013-04-05 11:43:22 -0700)
Geoff Levand (4):
KVM: Make local routines static
KVM: Move kvm_spurious_fault to x86.c
KVM: Move kvm_rebooting declaration out of x86
KVM: Move vm_list kvm_lock declarations out of x86
arch/x86/include/asm/kvm_host.h | 4 ---- arch/x86/kvm/x86.c | 7 +++++++ include/linux/kvm_host.h | 5 +++++ virt/kvm/kvm_main.c | 16 ++++------------ 4 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/4 KVM: Make local routines static
The routines get_user_page_nowait(), kvm_io_bus_sort_cmp(), kvm_io_bus_insert_dev() and kvm_io_bus_get_first_dev() are only referenced within kvm_main.c, so give them static linkage.
Fixes sparse warnings like these:
virt/kvm/kvm_main.c: warning: symbol 'get_user_page_nowait' was not declared. Should it be static?
--- virt/kvm/kvm_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
virt/kvm/kvm_main.c +4 -4
@@ -1099,7 +1099,7 @@ static int kvm_read_hva_atomic(void *data, void __user *hva, int len)return __copy_from_user_inatomic (data, hva, len); } -int get_user_page_nowait (struct task_struct *tsk,struct mm_struct *mm, +static int get_user_page_nowait (struct task_struct *tsk,struct mm_struct *mm,unsigned long start,int write,struct page **page) {int flags =FOLL_TOUCH |FOLL_NOWAIT |FOLL_HWPOISON |FOLL_GET ;
@@ -2631,7 +2631,7 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus)kfree (bus); } -int kvm_io_bus_sort_cmp (const void *p1,const void *p2) +static int kvm_io_bus_sort_cmp (const void *p1,const void *p2) {const struct kvm_io_range *r1 = p1;const struct kvm_io_range *r2 = p2;
@@ -2643,7 +2643,7 @@ int kvm_io_bus_sort_cmp(const void *p1, const void *p2)return 0 ; } -int kvm_io_bus_insert_dev (struct kvm_io_bus *bus,struct kvm_io_device *dev, +static int kvm_io_bus_insert_dev (struct kvm_io_bus *bus,struct kvm_io_device *dev,gpa_t addr,int len) { bus->range[bus->dev_count++] = (struct kvm_io_range ) {
@@ -2658,7 +2658,7 @@ int kvm_io_bus_insert_dev(struct kvm_io_bus *bus, struct kvm_io_device *dev,return 0 ; } -int kvm_io_bus_get_first_dev (struct kvm_io_bus *bus, +static int kvm_io_bus_get_first_dev (struct kvm_io_bus *bus,gpa_t addr,int len) {struct kvm_io_range *range, key;
Signature · 1 line
1.7.9.5
PATCH v2 2/4 KVM: Move kvm_spurious_fault to x86.c
In reply to Geoff LevandThe routine kvm_spurious_fault() is an x86 specific routine, so move it from virt/kvm/kvm_main.c to arch/x86/kvm/x86.c.
Fixes this sparse warning when building on arm64:
virt/kvm/kvm_main.c:warning: symbol 'kvm_spurious_fault' was not declared. Should it be static?
--- arch/x86/kvm/x86.c | 7 +++++++ virt/kvm/kvm_main.c | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-)
arch/x86/kvm/x86.c +7 -0
@@ -263,6 +263,13 @@ void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data) }EXPORT_SYMBOL_GPL (kvm_set_apic_base); +asmlinkage void kvm_spurious_fault(void) +{ +/* Fault while not rebooting. We want the trace. */ +BUG (); +} +EXPORT_SYMBOL_GPL (kvm_spurious_fault); +#define EXCPT_BENIGN 0#define EXCPT_CONTRIBUTORY 1#define EXCPT_PF 2
virt/kvm/kvm_main.c +0 -8
@@ -2591,14 +2591,6 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,return NOTIFY_OK ; } - -asmlinkage void kvm_spurious_fault(void) -{ -/* Fault while not rebooting. We want the trace. */ -BUG (); -} -EXPORT_SYMBOL_GPL (kvm_spurious_fault); -static int kvm_reboot (struct notifier_block *notifier,unsigned long val,void *v) {
Signature · 1 line
1.7.9.5
PATCH v2 3/4 KVM: Move kvm_rebooting declaration out of x86
In reply to Geoff LevandThe variable kvm_rebooting is a common kvm variable, so move its declaration from arch/x86/include/asm/kvm_host.h to include/asm/kvm_host.h.
Fixes this sparse warning when building on arm64:
virt/kvm/kvm_main.c:warning: symbol 'kvm_rebooting' was not declared. Should it be static?
--- arch/x86/include/asm/kvm_host.h | 1 - include/linux/kvm_host.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
arch/x86/include/asm/kvm_host.h +0 -1
@@ -973,7 +973,6 @@ enum {* Trap the fault and ignore the instruction if that happens. */ asmlinkage void kvm_spurious_fault(void); -extern bool kvm_rebooting;#define ____kvm_handle_fault_on_reboot (insn, cleanup_insn) \ "666: " insn "\n\t" \
include/linux/kvm_host.h +2 -0
@@ -1028,6 +1028,8 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) } } +extern bool kvm_rebooting; +#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT static inline void kvm_vcpu_set_in_spin_loop (struct kvm_vcpu *vcpu,bool val)
Signature · 1 line
1.7.9.5
PATCH v2 4/4 KVM: Move vm_list kvm_lock declarations out of x86
In reply to Geoff LevandThe variables vm_list and kvm_lock are common to all architectures, so move the declarations from arch/x86/include/asm/kvm_host.h to include/linux/kvm_host.h.
Fixes sparse warnings like these when building for arm64:
virt/kvm/kvm_main.c: warning: symbol 'kvm_lock' was not declared. Should it be static? virt/kvm/kvm_main.c: warning: symbol 'vm_list' was not declared. Should it be static?
--- arch/x86/include/asm/kvm_host.h | 3 --- include/linux/kvm_host.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/include/asm/kvm_host.h +0 -3
@@ -94,9 +94,6 @@#define ASYNC_PF_PER_VCPU 64 -extern raw_spinlock_t kvm_lock; -extern struct list_head vm_list; -struct kvm_vcpu ;struct kvm ;struct kvm_async_pf ;
include/linux/kvm_host.h +3 -0
@@ -133,6 +133,9 @@ struct kvm;struct kvm_vcpu ;extern struct kmem_cache *kvm_vcpu_cache; +extern raw_spinlock_t kvm_lock; +extern struct list_head vm_list; +struct kvm_io_range {gpa_t addr;int len;
Signature · 1 line
1.7.9.5
Gleb Natapov
AppliedQuoted 30 lines · Geoff Levand
Hi Paolo,
I fixed up the series as requested.
-Geoff
V2:
o Removed arm patches.
o Movedkvm_spurious_faulttoarch/x86/kvm/x86.c.
o Fixed commit comments.The following changes since commit
07961ac7c0ee8b546658717034fe692fd12eefa9:Linux 3.9-rc5 (2013-03-31 15:12:43 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/geoff/kvm.gitfor-kvmfor you to fetch changes up to
753c819ec3c3c55d6ca0eeddb4c6c2a32be7219b:KVM: Move
vm_listkvm_lockdeclarations out of x86 (2013-04-05 11:43:22 -0700)Geoff Levand (4):
KVM: Make local routines static
KVM: Movekvm_spurious_faulttox86.c
KVM: Movekvm_rebootingdeclaration out of x86
KVM: Movevm_listkvm_lockdeclarations out of x86
Quoted 6 lines
arch/x86/include/asm/kvm_host.h | 4 ---- arch/x86/kvm/x86.c | 7 +++++++ include/linux/kvm_host.h | 5 +++++ virt/kvm/kvm_main.c | 16 ++++------------ 4 files changed, 16 insertions(+), 16 deletions(-)
Applied all, thanks.
--
Gleb.