public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] KVM: Move kvm_rebooting declaration out of x86
  2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
  2013-04-05 19:20 ` [PATCH 1/4] KVM: Make local routines static Geoff Levand
  2013-04-05 19:20 ` [PATCH 4/4] KVM: Move vm_list kvm_lock declarations out of x86 Geoff Levand
@ 2013-04-05 19:20 ` Geoff Levand
  2013-04-05 19:20 ` [PATCH 2/4] KVM: Move kvm_spurious_fault to x86.c Geoff Levand
  2013-04-08 10:03 ` [PATCH v2 0/4] KVM minor fixups Gleb Natapov
  4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2013-04-05 19:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm, kvmarm

The 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?

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/x86/include/asm/kvm_host.h |    1 -
 include/linux/kvm_host.h        |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 4979778..8578da4 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -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" \
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index cad77fe..19855c2 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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)
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/4] KVM: Make local routines static
  2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
@ 2013-04-05 19:20 ` Geoff Levand
  2013-04-05 19:20 ` [PATCH 4/4] KVM: Move vm_list kvm_lock declarations out of x86 Geoff Levand
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2013-04-05 19:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm, kvmarm

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?

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 virt/kvm/kvm_main.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index adc68fe..82ca8e2 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -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;
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] KVM: Move vm_list kvm_lock declarations out of x86
  2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
  2013-04-05 19:20 ` [PATCH 1/4] KVM: Make local routines static Geoff Levand
@ 2013-04-05 19:20 ` Geoff Levand
  2013-04-05 19:20 ` [PATCH 3/4] KVM: Move kvm_rebooting declaration " Geoff Levand
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2013-04-05 19:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm, kvmarm

The 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?

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/x86/include/asm/kvm_host.h |    3 ---
 include/linux/kvm_host.h        |    3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 8578da4..e91b5ef 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -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;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 19855c2..9dd3e31 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 0/4] KVM minor fixups
@ 2013-04-05 19:20 Geoff Levand
  2013-04-05 19:20 ` [PATCH 1/4] KVM: Make local routines static Geoff Levand
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Geoff Levand @ 2013-04-05 19:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm, kvmarm

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(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] KVM: Move kvm_spurious_fault to x86.c
  2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
                   ` (2 preceding siblings ...)
  2013-04-05 19:20 ` [PATCH 3/4] KVM: Move kvm_rebooting declaration " Geoff Levand
@ 2013-04-05 19:20 ` Geoff Levand
  2013-04-08 10:03 ` [PATCH v2 0/4] KVM minor fixups Gleb Natapov
  4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2013-04-05 19:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm, kvmarm

The 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?

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/x86/kvm/x86.c  |    7 +++++++
 virt/kvm/kvm_main.c |    8 --------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f19ac0a..87a8536 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 82ca8e2..4000427 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -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)
 {
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] KVM minor fixups
  2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
                   ` (3 preceding siblings ...)
  2013-04-05 19:20 ` [PATCH 2/4] KVM: Move kvm_spurious_fault to x86.c Geoff Levand
@ 2013-04-08 10:03 ` Gleb Natapov
  4 siblings, 0 replies; 6+ messages in thread
From: Gleb Natapov @ 2013-04-08 10:03 UTC (permalink / raw)
  To: Geoff Levand; +Cc: Paolo Bonzini, Marcelo Tosatti, kvm, kvmarm

On Fri, Apr 05, 2013 at 07:20:30PM +0000, Geoff Levand wrote:
> 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(-)
> 
Applied all, thanks.

--
			Gleb.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-08 10:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05 19:20 [PATCH v2 0/4] KVM minor fixups Geoff Levand
2013-04-05 19:20 ` [PATCH 1/4] KVM: Make local routines static Geoff Levand
2013-04-05 19:20 ` [PATCH 4/4] KVM: Move vm_list kvm_lock declarations out of x86 Geoff Levand
2013-04-05 19:20 ` [PATCH 3/4] KVM: Move kvm_rebooting declaration " Geoff Levand
2013-04-05 19:20 ` [PATCH 2/4] KVM: Move kvm_spurious_fault to x86.c Geoff Levand
2013-04-08 10:03 ` [PATCH v2 0/4] KVM minor fixups Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox