]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Fix powerpc build errors caused by recent changes
authorMichael Ellerman <michael@ellerman.id.au>
Fri, 5 Oct 2012 01:15:17 +0000 (11:15 +1000)
committerPekka Enberg <penberg@kernel.org>
Fri, 5 Oct 2012 06:29:08 +0000 (09:29 +0300)
Several caused by commit 8074303 "remove global kvm object",
ioport__setup_arch(), term_getc_iov() & term_getc() in the
spapr_hvcons.c code, and kvm_cpu__reboot() in rtas_power_off().

Commit 221b584 "move active_console into struct kvm_config" added
checks in h_put_term_char() & h_get_term_char() of
kvm->cfg.active_console but needs to be vcpu->kvm->cfg.active_console.

That commit also missed updates to term_putc() & term_getc() in
spapr_rtas.c, and I'm guessing that we need similar checks of
active_console in rtas_put_term_char() & rtas_get_term_char().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/powerpc/ioport.c
tools/kvm/powerpc/spapr_hvcons.c
tools/kvm/powerpc/spapr_rtas.c

index a8e4dc319e8d9c73f791d9affe9b25e00090c4b4..264fb7e2d57dd18240227bb2f30cda74a0d59c41 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <stdlib.h>
 
-void ioport__setup_arch(void)
+void ioport__setup_arch(struct kvm *kvm)
 {
        /* PPC has no legacy ioports to set up */
 }
index 1fe4bdb135669395b99ebcb321ba4139cdf08f66..0bdf75ba36897a8cf2aeb554c99655a6d8fef0cf 100644 (file)
@@ -50,7 +50,7 @@ static unsigned long h_put_term_char(struct kvm_cpu *vcpu, unsigned long opcode,
        do {
                int ret;
 
-               if (kvm->cfg.active_console == CONSOLE_HV)
+               if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
                        ret = term_putc_iov(&iov, 1, 0);
                else
                        ret = 0;
@@ -74,14 +74,14 @@ static unsigned long h_get_term_char(struct kvm_cpu *vcpu, unsigned long opcode,
        union hv_chario data;
        struct iovec iov;
 
-       if (kvm->cfg.active_console != CONSOLE_HV)
+       if (vcpu->kvm->cfg.active_console != CONSOLE_HV)
                return H_SUCCESS;
 
        if (term_readable(0)) {
                iov.iov_base = data.buf;
                iov.iov_len = 16;
 
-               *len = term_getc_iov(&iov, 1, 0);
+               *len = term_getc_iov(vcpu->kvm, &iov, 1, 0);
                *char0_7 = be64_to_cpu(data.a.char0_7);
                *char8_15 = be64_to_cpu(data.a.char8_15);
        } else {
index 14a3462c5e032dd97df342ef055edc2a31a26ef7..c81d82b3857c39daa4803bd4401e736893b5b5b5 100644 (file)
@@ -41,7 +41,7 @@ static void rtas_display_character(struct kvm_cpu *vcpu,
                                    uint32_t nret, target_ulong rets)
 {
        char c = rtas_ld(vcpu->kvm, args, 0);
-       term_putc(CONSOLE_HV, &c, 1, 0);
+       term_putc(&c, 1, 0);
        rtas_st(vcpu->kvm, rets, 0, 0);
 }
 
@@ -52,7 +52,10 @@ static void rtas_put_term_char(struct kvm_cpu *vcpu,
                               uint32_t nret, target_ulong rets)
 {
        char c = rtas_ld(vcpu->kvm, args, 0);
-       term_putc(CONSOLE_HV, &c, 1, 0);
+
+       if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
+               term_putc(&c, 1, 0);
+
        rtas_st(vcpu->kvm, rets, 0, 0);
 }
 
@@ -62,8 +65,9 @@ static void rtas_get_term_char(struct kvm_cpu *vcpu,
                               uint32_t nret, target_ulong rets)
 {
        int c;
-       if (term_readable(CONSOLE_HV, 0) &&
-           (c = term_getc(CONSOLE_HV, 0)) >= 0) {
+
+       if (vcpu->kvm->cfg.active_console == CONSOLE_HV && term_readable(0) &&
+           (c = term_getc(vcpu->kvm, 0)) >= 0) {
                rtas_st(vcpu->kvm, rets, 0, 0);
                rtas_st(vcpu->kvm, rets, 1, c);
        } else {
@@ -115,7 +119,7 @@ static void rtas_power_off(struct kvm_cpu *vcpu,
                rtas_st(vcpu->kvm, rets, 0, -3);
                return;
        }
-       kvm_cpu__reboot();
+       kvm_cpu__reboot(vcpu->kvm);
 }
 
 static void rtas_query_cpu_stopped_state(struct kvm_cpu *vcpu,