* [PATCH 0/2] KVM: MIPS: Bug fix and cleanup
@ 2020-02-03 18:41 Sean Christopherson
2020-02-03 18:41 ` [PATCH 1/2] KVM: MIPS: Fix a build error due to referencing not-yet-defined function Sean Christopherson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sean Christopherson @ 2020-02-03 18:41 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-mips, kvm, linux-kernel, Davidlohr Bueso
Fix for a compilation error introduced by the vCPU create refactoring, and
a patch on top to cleanup some ugliness in the relocated code.
Untested, really need to setup a cross-compiling environment...
Sean Christopherson (2):
KVM: MIPS: Fix a build error due to referencing not-yet-defined
function
KVM: MIPS: Fold comparecount_func() into comparecount_wakeup()
arch/mips/kvm/mips.c | 37 ++++++++++++++++---------------------
1 file changed, 16 insertions(+), 21 deletions(-)
--
2.24.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] KVM: MIPS: Fix a build error due to referencing not-yet-defined function
2020-02-03 18:41 [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Sean Christopherson
@ 2020-02-03 18:41 ` Sean Christopherson
2020-02-03 18:42 ` [PATCH 2/2] KVM: MIPS: Fold comparecount_func() into comparecount_wakeup() Sean Christopherson
2020-02-05 14:30 ` [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2020-02-03 18:41 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-mips, kvm, linux-kernel, Davidlohr Bueso
Hoist kvm_mips_comparecount_wakeup() above its only user,
kvm_arch_vcpu_create() to fix a compilation error due to referencing an
undefined function.
Fixes: d11dfed5d700 ("KVM: MIPS: Move all vcpu init code into kvm_arch_vcpu_create()")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
arch/mips/kvm/mips.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
index 2606f3f02b54..92509041b954 100644
--- a/arch/mips/kvm/mips.c
+++ b/arch/mips/kvm/mips.c
@@ -280,6 +280,27 @@ static inline void dump_handler(const char *symbol, void *start, void *end)
pr_debug("\tEND(%s)\n", symbol);
}
+static void kvm_mips_comparecount_func(unsigned long data)
+{
+ struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
+
+ kvm_mips_callbacks->queue_timer_int(vcpu);
+
+ vcpu->arch.wait = 0;
+ if (swq_has_sleeper(&vcpu->wq))
+ swake_up_one(&vcpu->wq);
+}
+
+/* low level hrtimer wake routine */
+static enum hrtimer_restart kvm_mips_comparecount_wakeup(struct hrtimer *timer)
+{
+ struct kvm_vcpu *vcpu;
+
+ vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer);
+ kvm_mips_comparecount_func((unsigned long) vcpu);
+ return kvm_mips_count_timeout(vcpu);
+}
+
int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id)
{
return 0;
@@ -1209,27 +1230,6 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
return 0;
}
-static void kvm_mips_comparecount_func(unsigned long data)
-{
- struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
-
- kvm_mips_callbacks->queue_timer_int(vcpu);
-
- vcpu->arch.wait = 0;
- if (swq_has_sleeper(&vcpu->wq))
- swake_up_one(&vcpu->wq);
-}
-
-/* low level hrtimer wake routine */
-static enum hrtimer_restart kvm_mips_comparecount_wakeup(struct hrtimer *timer)
-{
- struct kvm_vcpu *vcpu;
-
- vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer);
- kvm_mips_comparecount_func((unsigned long) vcpu);
- return kvm_mips_count_timeout(vcpu);
-}
-
int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
struct kvm_translation *tr)
{
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] KVM: MIPS: Fold comparecount_func() into comparecount_wakeup()
2020-02-03 18:41 [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Sean Christopherson
2020-02-03 18:41 ` [PATCH 1/2] KVM: MIPS: Fix a build error due to referencing not-yet-defined function Sean Christopherson
@ 2020-02-03 18:42 ` Sean Christopherson
2020-02-05 14:30 ` [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2020-02-03 18:42 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-mips, kvm, linux-kernel, Davidlohr Bueso
Fold kvm_mips_comparecount_func() into kvm_mips_comparecount_wakeup() to
eliminate the nondescript function name as well as its unnecessary cast
of a vcpu to "unsigned long" and back to a vcpu. Presumably func() was
used as a callback at some point during pre-upstream development, as
wakeup() is the only user of func() and has been the only user since
both with introduced by commit 669e846e6c4e ("KVM/MIPS32: MIPS arch
specific APIs for KVM").
Cc: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
arch/mips/kvm/mips.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
index 92509041b954..71244bf87c3a 100644
--- a/arch/mips/kvm/mips.c
+++ b/arch/mips/kvm/mips.c
@@ -280,24 +280,19 @@ static inline void dump_handler(const char *symbol, void *start, void *end)
pr_debug("\tEND(%s)\n", symbol);
}
-static void kvm_mips_comparecount_func(unsigned long data)
+/* low level hrtimer wake routine */
+static enum hrtimer_restart kvm_mips_comparecount_wakeup(struct hrtimer *timer)
{
- struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
+ struct kvm_vcpu *vcpu;
+
+ vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer);
kvm_mips_callbacks->queue_timer_int(vcpu);
vcpu->arch.wait = 0;
if (swq_has_sleeper(&vcpu->wq))
swake_up_one(&vcpu->wq);
-}
-/* low level hrtimer wake routine */
-static enum hrtimer_restart kvm_mips_comparecount_wakeup(struct hrtimer *timer)
-{
- struct kvm_vcpu *vcpu;
-
- vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer);
- kvm_mips_comparecount_func((unsigned long) vcpu);
return kvm_mips_count_timeout(vcpu);
}
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] KVM: MIPS: Bug fix and cleanup
2020-02-03 18:41 [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Sean Christopherson
2020-02-03 18:41 ` [PATCH 1/2] KVM: MIPS: Fix a build error due to referencing not-yet-defined function Sean Christopherson
2020-02-03 18:42 ` [PATCH 2/2] KVM: MIPS: Fold comparecount_func() into comparecount_wakeup() Sean Christopherson
@ 2020-02-05 14:30 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-02-05 14:30 UTC (permalink / raw)
To: Sean Christopherson; +Cc: linux-mips, kvm, linux-kernel, Davidlohr Bueso
On 03/02/20 19:41, Sean Christopherson wrote:
> Fix for a compilation error introduced by the vCPU create refactoring, and
> a patch on top to cleanup some ugliness in the relocated code.
>
> Untested, really need to setup a cross-compiling environment...
>
> Sean Christopherson (2):
> KVM: MIPS: Fix a build error due to referencing not-yet-defined
> function
> KVM: MIPS: Fold comparecount_func() into comparecount_wakeup()
>
> arch/mips/kvm/mips.c | 37 ++++++++++++++++---------------------
> 1 file changed, 16 insertions(+), 21 deletions(-)
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-05 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03 18:41 [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Sean Christopherson
2020-02-03 18:41 ` [PATCH 1/2] KVM: MIPS: Fix a build error due to referencing not-yet-defined function Sean Christopherson
2020-02-03 18:42 ` [PATCH 2/2] KVM: MIPS: Fold comparecount_func() into comparecount_wakeup() Sean Christopherson
2020-02-05 14:30 ` [PATCH 0/2] KVM: MIPS: Bug fix and cleanup Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).