* [PATCH 0/7] KVM minor fixups
@ 2013-04-04 23:33 Geoff Levand
2013-04-04 23:33 ` [PATCH 1/7] kvm: Make local routines static Geoff Levand
` (8 more replies)
0 siblings, 9 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Geoff Levand, kvm, kvmarm, Christoffer Dall, Marc Zyngier
Hi Marcelo,
These are a few fixups I found when running sparse and building Marc's 64 bit
ARM tree. Please consider for 3.10.
-Geoff
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 5d9e775fd2d7c9ab03d70175610a5d8cedcc3799:
kvm/arm: Remove unused kvm_arch_set_memory_region (2013-04-04 16:08:28 -0700)
----------------------------------------------------------------
Geoff Levand (7):
kvm: Make local routines static
kvm: Move vm_list, kvm_lock dec's out of x86
kvm: Move kvm_spurious_fault dec out of x86
kvm: Move kvm_rebooting dec out of x86
kvm/arm: Fix missing include build error
kvm/arm: Make force_vm_exit static
kvm/arm: Remove unused kvm_arch_set_memory_region
arch/arm/include/asm/kvm_host.h | 1 -
arch/arm/kvm/arm.c | 11 ++---------
arch/x86/include/asm/kvm_host.h | 11 -----------
include/linux/kvm_host.h | 11 +++++++++++
virt/kvm/kvm_main.c | 8 ++++----
5 files changed, 17 insertions(+), 25 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/7] kvm: Make local routines static
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:33 ` [PATCH 2/7] kvm: Move vm_list, kvm_lock dec's out of x86 Geoff Levand
` (7 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: 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] 20+ messages in thread
* [PATCH 4/7] kvm: Move kvm_rebooting dec out of x86
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (2 preceding siblings ...)
2013-04-04 23:33 ` [PATCH 5/7] kvm/arm: Fix missing include build error Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:33 ` [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region Geoff Levand
` (4 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, kvmarm
The variable kvm_rebooting is a common kvm variable, so move
its declaration from arch/x86/include/asm/kvm_host.h to
arch/arm/include/asm/kvm_host.h.
Fixes 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 | 2 --
include/linux/kvm_host.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index da7c126..225139a 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -964,8 +964,6 @@ enum {
#define HF_IRET_MASK (1 << 4)
#define HF_GUEST_MASK (1 << 5) /* VCPU is in guest-mode */
-extern bool kvm_rebooting;
-
#define ____kvm_handle_fault_on_reboot(insn, cleanup_insn) \
"666: " insn "\n\t" \
"668: \n\t" \
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 4bfb062..7165bd8 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1037,6 +1037,7 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
* Trap the fault and ignore the instruction if that happens.
*/
asmlinkage void kvm_spurious_fault(void);
+extern bool kvm_rebooting;
#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
--
1.7.9.5
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (3 preceding siblings ...)
2013-04-04 23:33 ` [PATCH 4/7] kvm: Move kvm_rebooting dec out of x86 Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:58 ` Christoffer Dall
2013-04-04 23:33 ` [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86 Geoff Levand
` (3 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, kvmarm, Christoffer Dall, Marc Zyngier
Remove the unused and empty routine kvm_arch_set_memory_region().
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
arch/arm/kvm/arm.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 86becdc..a67b798 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -221,14 +221,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
return -EINVAL;
}
-int kvm_arch_set_memory_region(struct kvm *kvm,
- struct kvm_userspace_memory_region *mem,
- struct kvm_memory_slot old,
- int user_alloc)
-{
- return 0;
-}
-
int kvm_arch_prepare_memory_region(struct kvm *kvm,
struct kvm_memory_slot *memslot,
struct kvm_memory_slot old,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 2/7] kvm: Move vm_list, kvm_lock dec's out of x86
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
2013-04-04 23:33 ` [PATCH 1/7] kvm: Make local routines static Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:33 ` [PATCH 5/7] kvm/arm: Fix missing include build error Geoff Levand
` (6 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: 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 4979778..40fc39f 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 cad77fe..8ef2212 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] 20+ messages in thread
* [PATCH 5/7] kvm/arm: Fix missing include build error
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
2013-04-04 23:33 ` [PATCH 1/7] kvm: Make local routines static Geoff Levand
2013-04-04 23:33 ` [PATCH 2/7] kvm: Move vm_list, kvm_lock dec's out of x86 Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:51 ` Christoffer Dall
2013-04-04 23:33 ` [PATCH 4/7] kvm: Move kvm_rebooting dec out of x86 Geoff Levand
` (5 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, kvmarm, Christoffer Dall, Marc Zyngier
Include linux/cpu.h in kvm/arm.c. Fixes build errors like
these with ARCH=arm64:
arch/arm/kvm/arm.c: error: ‘CPU_STARTING_FROZEN’ undeclared
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
arch/arm/kvm/arm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 5a93698..49b4bc6 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -24,6 +24,7 @@
#include <linux/fs.h>
#include <linux/mman.h>
#include <linux/sched.h>
+#include <linux/cpu.h>
#include <linux/kvm.h>
#include <trace/events/kvm.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (4 preceding siblings ...)
2013-04-04 23:33 ` [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-05 7:48 ` Paolo Bonzini
2013-04-05 7:56 ` Paolo Bonzini
2013-04-04 23:33 ` [PATCH 6/7] kvm/arm: Make force_vm_exit static Geoff Levand
` (2 subsequent siblings)
8 siblings, 2 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, kvmarm
The routine kvm_spurious_fault() is a common kvm routine, so
move its declaration from arch/x86/include/asm/kvm_host.h to
arch/arm/include/asm/kvm_host.h.
Fixes 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/include/asm/kvm_host.h | 6 ------
include/linux/kvm_host.h | 7 +++++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 40fc39f..da7c126 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -964,12 +964,6 @@ enum {
#define HF_IRET_MASK (1 << 4)
#define HF_GUEST_MASK (1 << 5) /* VCPU is in guest-mode */
-/*
- * Hardware virtualization extension instructions may fault if a
- * reboot turns off virtualization while processes are running.
- * 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) \
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 8ef2212..4bfb062 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1031,6 +1031,13 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
}
}
+/*
+ * Hardware virtualization extension instructions may fault if a
+ * reboot turns off virtualization while processes are running.
+ * Trap the fault and ignore the instruction if that happens.
+ */
+asmlinkage void kvm_spurious_fault(void);
+
#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] 20+ messages in thread
* [PATCH 6/7] kvm/arm: Make force_vm_exit static
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (5 preceding siblings ...)
2013-04-04 23:33 ` [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86 Geoff Levand
@ 2013-04-04 23:33 ` Geoff Levand
2013-04-04 23:57 ` Christoffer Dall
2013-04-04 23:53 ` [PATCH 0/7] KVM minor fixups Christoffer Dall
2013-04-05 7:56 ` Paolo Bonzini
8 siblings, 1 reply; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:33 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, kvmarm, Christoffer Dall, Marc Zyngier
The routine force_vm_exit() is not referenced outside kvm/arm.c,
so make it have static linkage.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
arch/arm/include/asm/kvm_host.h | 1 -
arch/arm/kvm/arm.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index d1736a5..1e93cef 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -149,7 +149,6 @@ struct kvm_one_reg;
int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
u64 kvm_call_hyp(void *hypfn, ...);
-void force_vm_exit(const cpumask_t *mask);
#define KVM_ARCH_WANT_MMU_NOTIFIER
struct kvm;
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 49b4bc6..86becdc 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -400,7 +400,7 @@ static void exit_vm_noop(void *info)
{
}
-void force_vm_exit(const cpumask_t *mask)
+static void force_vm_exit(const cpumask_t *mask)
{
smp_call_function_many(mask, exit_vm_noop, NULL, true);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 5/7] kvm/arm: Fix missing include build error
2013-04-04 23:33 ` [PATCH 5/7] kvm/arm: Fix missing include build error Geoff Levand
@ 2013-04-04 23:51 ` Christoffer Dall
2013-04-05 0:04 ` Geoff Levand
0 siblings, 1 reply; 20+ messages in thread
From: Christoffer Dall @ 2013-04-04 23:51 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> Include linux/cpu.h in kvm/arm.c. Fixes build errors like
> these with ARCH=arm64:
>
> arch/arm/kvm/arm.c: error: ‘CPU_STARTING_FROZEN’ undeclared
>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> arch/arm/kvm/arm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 5a93698..49b4bc6 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -24,6 +24,7 @@
> #include <linux/fs.h>
> #include <linux/mman.h>
> #include <linux/sched.h>
> +#include <linux/cpu.h>
> #include <linux/kvm.h>
> #include <trace/events/kvm.h>
>
> --
>
I'm confused, I don't see this symbol in arm.c - against which tree do
these patches apply exactly? If this is something introduced by arm64,
then it's premature, and should be added to that series.
-Christoffer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] KVM minor fixups
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (6 preceding siblings ...)
2013-04-04 23:33 ` [PATCH 6/7] kvm/arm: Make force_vm_exit static Geoff Levand
@ 2013-04-04 23:53 ` Christoffer Dall
2013-04-04 23:57 ` Geoff Levand
2013-04-05 7:56 ` Paolo Bonzini
8 siblings, 1 reply; 20+ messages in thread
From: Christoffer Dall @ 2013-04-04 23:53 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> Hi Marcelo,
>
> These are a few fixups I found when running sparse and building Marc's 64 bit
> ARM tree. Please consider for 3.10.
"running sparse" - what does this mean?
-Christoffer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/7] kvm/arm: Make force_vm_exit static
2013-04-04 23:33 ` [PATCH 6/7] kvm/arm: Make force_vm_exit static Geoff Levand
@ 2013-04-04 23:57 ` Christoffer Dall
0 siblings, 0 replies; 20+ messages in thread
From: Christoffer Dall @ 2013-04-04 23:57 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> The routine force_vm_exit() is not referenced outside kvm/arm.c,
> so make it have static linkage.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> arch/arm/include/asm/kvm_host.h | 1 -
> arch/arm/kvm/arm.c | 2 +-
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index d1736a5..1e93cef 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -149,7 +149,6 @@ struct kvm_one_reg;
> int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
> int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
> u64 kvm_call_hyp(void *hypfn, ...);
> -void force_vm_exit(const cpumask_t *mask);
>
> #define KVM_ARCH_WANT_MMU_NOTIFIER
> struct kvm;
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 49b4bc6..86becdc 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -400,7 +400,7 @@ static void exit_vm_noop(void *info)
> {
> }
>
> -void force_vm_exit(const cpumask_t *mask)
> +static void force_vm_exit(const cpumask_t *mask)
> {
> smp_call_function_many(mask, exit_vm_noop, NULL, true);
> }
> --
> 1.7.9.5
>
>
I can take this one.
-Christoffer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] KVM minor fixups
2013-04-04 23:53 ` [PATCH 0/7] KVM minor fixups Christoffer Dall
@ 2013-04-04 23:57 ` Geoff Levand
2013-04-05 0:01 ` Christoffer Dall
0 siblings, 1 reply; 20+ messages in thread
From: Geoff Levand @ 2013-04-04 23:57 UTC (permalink / raw)
To: Christoffer Dall; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
Hi Christoffer,
On Thu, 2013-04-04 at 16:53 -0700, Christoffer Dall wrote:
> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> > Hi Marcelo,
> >
> > These are a few fixups I found when running sparse and building Marc's 64 bit
> > ARM tree. Please consider for 3.10.
>
> "running sparse" - what does this mean?
make C=1. It runs the checker, by default, sparse.
http://en.wikipedia.org/wiki/Sparse
-Geoff
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region
2013-04-04 23:33 ` [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region Geoff Levand
@ 2013-04-04 23:58 ` Christoffer Dall
0 siblings, 0 replies; 20+ messages in thread
From: Christoffer Dall @ 2013-04-04 23:58 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> Remove the unused and empty routine kvm_arch_set_memory_region().
>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> arch/arm/kvm/arm.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 86becdc..a67b798 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -221,14 +221,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
> return -EINVAL;
> }
>
> -int kvm_arch_set_memory_region(struct kvm *kvm,
> - struct kvm_userspace_memory_region *mem,
> - struct kvm_memory_slot old,
> - int user_alloc)
> -{
> - return 0;
> -}
> -
> int kvm_arch_prepare_memory_region(struct kvm *kvm,
> struct kvm_memory_slot *memslot,
> struct kvm_memory_slot old,
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
and I can take this one too.
-Christoffer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] KVM minor fixups
2013-04-04 23:57 ` Geoff Levand
@ 2013-04-05 0:01 ` Christoffer Dall
0 siblings, 0 replies; 20+ messages in thread
From: Christoffer Dall @ 2013-04-05 0:01 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 4:57 PM, Geoff Levand <geoff@infradead.org> wrote:
> Hi Christoffer,
>
> On Thu, 2013-04-04 at 16:53 -0700, Christoffer Dall wrote:
>> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
>> > Hi Marcelo,
>> >
>> > These are a few fixups I found when running sparse and building Marc's 64 bit
>> > ARM tree. Please consider for 3.10.
>>
>> "running sparse" - what does this mean?
>
> make C=1. It runs the checker, by default, sparse.
>
> http://en.wikipedia.org/wiki/Sparse
>
got it, thanks.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/7] kvm/arm: Fix missing include build error
2013-04-04 23:51 ` Christoffer Dall
@ 2013-04-05 0:04 ` Geoff Levand
2013-04-05 0:15 ` Christoffer Dall
0 siblings, 1 reply; 20+ messages in thread
From: Geoff Levand @ 2013-04-05 0:04 UTC (permalink / raw)
To: Christoffer Dall; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
Hi Christoffer,
On Thu, 2013-04-04 at 16:51 -0700, Christoffer Dall wrote:
> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
> > Include linux/cpu.h in kvm/arm.c. Fixes build errors like
> > these with ARCH=arm64:
> >
> > arch/arm/kvm/arm.c: error: ‘CPU_STARTING_FROZEN’ undeclared
> >
> > Signed-off-by: Geoff Levand <geoff@infradead.org>
> > ---
> > arch/arm/kvm/arm.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> > index 5a93698..49b4bc6 100644
> > --- a/arch/arm/kvm/arm.c
> > +++ b/arch/arm/kvm/arm.c
> > @@ -24,6 +24,7 @@
> > #include <linux/fs.h>
> > #include <linux/mman.h>
> > #include <linux/sched.h>
> > +#include <linux/cpu.h>
> > #include <linux/kvm.h>
> > #include <trace/events/kvm.h>
> >
> > --
> >
>
> I'm confused, I don't see this symbol in arm.c - against which tree do
> these patches apply exactly? If this is something introduced by arm64,
> then it's premature, and should be added to that series.
Sorry, this one is from Marc's kvm-for-next branch. I'll send it
to him to include, unless you just want to take it in preparation.
-Geoff
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/7] kvm/arm: Fix missing include build error
2013-04-05 0:04 ` Geoff Levand
@ 2013-04-05 0:15 ` Christoffer Dall
2013-04-05 0:24 ` Geoff Levand
0 siblings, 1 reply; 20+ messages in thread
From: Christoffer Dall @ 2013-04-05 0:15 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
On Thu, Apr 4, 2013 at 5:04 PM, Geoff Levand <geoff@infradead.org> wrote:
> Hi Christoffer,
>
> On Thu, 2013-04-04 at 16:51 -0700, Christoffer Dall wrote:
>> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand <geoff@infradead.org> wrote:
>> > Include linux/cpu.h in kvm/arm.c. Fixes build errors like
>> > these with ARCH=arm64:
>> >
>> > arch/arm/kvm/arm.c: error: ‘CPU_STARTING_FROZEN’ undeclared
>> >
>> > Signed-off-by: Geoff Levand <geoff@infradead.org>
>> > ---
>> > arch/arm/kvm/arm.c | 1 +
>> > 1 file changed, 1 insertion(+)
>> >
>> > diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>> > index 5a93698..49b4bc6 100644
>> > --- a/arch/arm/kvm/arm.c
>> > +++ b/arch/arm/kvm/arm.c
>> > @@ -24,6 +24,7 @@
>> > #include <linux/fs.h>
>> > #include <linux/mman.h>
>> > #include <linux/sched.h>
>> > +#include <linux/cpu.h>
>> > #include <linux/kvm.h>
>> > #include <trace/events/kvm.h>
>> >
>> > --
>> >
>>
>> I'm confused, I don't see this symbol in arm.c - against which tree do
>> these patches apply exactly? If this is something introduced by arm64,
>> then it's premature, and should be added to that series.
>
> Sorry, this one is from Marc's kvm-for-next branch. I'll send it
> to him to include, unless you just want to take it in preparation.
>
Hmm, not sure what the status of his branch is exactly. Does it
contain the arm64 stuff?
I don't really want to merge this before it's needed.
-Christoffer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/7] kvm/arm: Fix missing include build error
2013-04-05 0:15 ` Christoffer Dall
@ 2013-04-05 0:24 ` Geoff Levand
0 siblings, 0 replies; 20+ messages in thread
From: Geoff Levand @ 2013-04-05 0:24 UTC (permalink / raw)
To: Christoffer Dall; +Cc: Marcelo Tosatti, kvm, kvmarm, Marc Zyngier
Hi,
On Thu, 2013-04-04 at 17:15 -0700, Christoffer Dall wrote:
> On Thu, Apr 4, 2013 at 5:04 PM, Geoff Levand <geoff@infradead.org> wrote:
>
> > Sorry, this one is from Marc's kvm-for-next branch. I'll send it
> > to him to include, unless you just want to take it in preparation.
> >
> Hmm, not sure what the status of his branch is exactly. Does it
> contain the arm64 stuff?
Yes, it is pretty much his most recent.
> I don't really want to merge this before it's needed.
OK, that's fine. I'll just add it to a few other 64 bit specific
fixups I'll be sending to Marc.
-Geoff
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86
2013-04-04 23:33 ` [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86 Geoff Levand
@ 2013-04-05 7:48 ` Paolo Bonzini
2013-04-05 7:56 ` Paolo Bonzini
1 sibling, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-04-05 7:48 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm
Il 05/04/2013 01:33, Geoff Levand ha scritto:
> The routine kvm_spurious_fault() is a common kvm routine, so
> move its declaration from arch/x86/include/asm/kvm_host.h to
> arch/arm/include/asm/kvm_host.h.
Typo in the commit message.
Paolo
> Fixes 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/include/asm/kvm_host.h | 6 ------
> include/linux/kvm_host.h | 7 +++++++
> 2 files changed, 7 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86
2013-04-04 23:33 ` [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86 Geoff Levand
2013-04-05 7:48 ` Paolo Bonzini
@ 2013-04-05 7:56 ` Paolo Bonzini
1 sibling, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-04-05 7:56 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm
Il 05/04/2013 01:33, Geoff Levand ha scritto:
> The routine kvm_spurious_fault() is a common kvm routine, so
> move its declaration from arch/x86/include/asm/kvm_host.h to
> arch/arm/include/asm/kvm_host.h.
>
> Fixes sparse warning when building on arm64:
>
> virt/kvm/kvm_main.c:warning: symbol 'kvm_spurious_fault' was not declared. Should it be static?
Please move it to arch/x86/kvm/x86.c instead.
Thanks!
Paolo
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> arch/x86/include/asm/kvm_host.h | 6 ------
> include/linux/kvm_host.h | 7 +++++++
> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 40fc39f..da7c126 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -964,12 +964,6 @@ enum {
> #define HF_IRET_MASK (1 << 4)
> #define HF_GUEST_MASK (1 << 5) /* VCPU is in guest-mode */
>
> -/*
> - * Hardware virtualization extension instructions may fault if a
> - * reboot turns off virtualization while processes are running.
> - * 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) \
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 8ef2212..4bfb062 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -1031,6 +1031,13 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
> }
> }
>
> +/*
> + * Hardware virtualization extension instructions may fault if a
> + * reboot turns off virtualization while processes are running.
> + * Trap the fault and ignore the instruction if that happens.
> + */
> +asmlinkage void kvm_spurious_fault(void);
> +
> #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
>
> static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] KVM minor fixups
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
` (7 preceding siblings ...)
2013-04-04 23:53 ` [PATCH 0/7] KVM minor fixups Christoffer Dall
@ 2013-04-05 7:56 ` Paolo Bonzini
8 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-04-05 7:56 UTC (permalink / raw)
To: Geoff Levand; +Cc: Marcelo Tosatti, kvm, kvmarm, Christoffer Dall, Marc Zyngier
Il 05/04/2013 01:33, Geoff Levand ha scritto:
> Hi Marcelo,
>
> These are a few fixups I found when running sparse and building Marc's 64 bit
> ARM tree. Please consider for 3.10.
Thanks, nice cleanups.
Please resubmit patches 1-4 with the small fixes I suggested and, since
you're at it, please write "declaration" in full instead of just "dec".
Paolo
> -Geoff
>
> 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 5d9e775fd2d7c9ab03d70175610a5d8cedcc3799:
>
> kvm/arm: Remove unused kvm_arch_set_memory_region (2013-04-04 16:08:28 -0700)
>
> ----------------------------------------------------------------
> Geoff Levand (7):
> kvm: Make local routines static
> kvm: Move vm_list, kvm_lock dec's out of x86
> kvm: Move kvm_spurious_fault dec out of x86
> kvm: Move kvm_rebooting dec out of x86
> kvm/arm: Fix missing include build error
> kvm/arm: Make force_vm_exit static
> kvm/arm: Remove unused kvm_arch_set_memory_region
>
> arch/arm/include/asm/kvm_host.h | 1 -
> arch/arm/kvm/arm.c | 11 ++---------
> arch/x86/include/asm/kvm_host.h | 11 -----------
> include/linux/kvm_host.h | 11 +++++++++++
> virt/kvm/kvm_main.c | 8 ++++----
> 5 files changed, 17 insertions(+), 25 deletions(-)
>
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2013-04-05 7:56 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04 23:33 [PATCH 0/7] KVM minor fixups Geoff Levand
2013-04-04 23:33 ` [PATCH 1/7] kvm: Make local routines static Geoff Levand
2013-04-04 23:33 ` [PATCH 2/7] kvm: Move vm_list, kvm_lock dec's out of x86 Geoff Levand
2013-04-04 23:33 ` [PATCH 5/7] kvm/arm: Fix missing include build error Geoff Levand
2013-04-04 23:51 ` Christoffer Dall
2013-04-05 0:04 ` Geoff Levand
2013-04-05 0:15 ` Christoffer Dall
2013-04-05 0:24 ` Geoff Levand
2013-04-04 23:33 ` [PATCH 4/7] kvm: Move kvm_rebooting dec out of x86 Geoff Levand
2013-04-04 23:33 ` [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region Geoff Levand
2013-04-04 23:58 ` Christoffer Dall
2013-04-04 23:33 ` [PATCH 3/7] kvm: Move kvm_spurious_fault dec out of x86 Geoff Levand
2013-04-05 7:48 ` Paolo Bonzini
2013-04-05 7:56 ` Paolo Bonzini
2013-04-04 23:33 ` [PATCH 6/7] kvm/arm: Make force_vm_exit static Geoff Levand
2013-04-04 23:57 ` Christoffer Dall
2013-04-04 23:53 ` [PATCH 0/7] KVM minor fixups Christoffer Dall
2013-04-04 23:57 ` Geoff Levand
2013-04-05 0:01 ` Christoffer Dall
2013-04-05 7:56 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.