diff mbox

PPC: KVM: Don't tell the user about missing SPR syncs

Message ID 1391464382-60634-1-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Feb. 3, 2014, 9:53 p.m. UTC
We sync a lot of SPRs automatically between KVM and QEMU now. Some
of these only matter on newer hardware, some only matter on HV KVM.

With the current code runnign on my reasonably recent PR KVM kernel
I get a lot of SPR synchronization warnings though:

  $ ./ppc64-softmmu/qemu-system-ppc64 -nographic -enable-kvm
  Warning: Unable to set SPR 17 to KVM: Invalid argument
  Warning: Unable to set SPR 29 to KVM: Invalid argument
  Warning: Unable to set SPR 157 to KVM: Invalid argument
  Warning: Unable to set SPR 308 to KVM: Invalid argument
  Warning: Unable to set SPR 309 to KVM: Invalid argument
  Warning: Unable to set SPR 318 to KVM: Invalid argument
  Warning: Unable to set SPR 770 to KVM: Invalid argument
  Warning: Unable to set SPR 945 to KVM: Invalid argument
  Warning: Unable to set SPR 946 to KVM: Invalid argument
  Warning: Unable to set SPR 1013 to KVM: Invalid argument
  Warning: Unable to set SPR 17 to KVM: Invalid argument
  Warning: Unable to set SPR 29 to KVM: Invalid argument
  Warning: Unable to set SPR 157 to KVM: Invalid argument
  Warning: Unable to set SPR 308 to KVM: Invalid argument
  Warning: Unable to set SPR 309 to KVM: Invalid argument
  Warning: Unable to set SPR 318 to KVM: Invalid argument
  Warning: Unable to set SPR 770 to KVM: Invalid argument
  Warning: Unable to set SPR 945 to KVM: Invalid argument
  Warning: Unable to set SPR 946 to KVM: Invalid argument
  Warning: Unable to set SPR 1013 to KVM: Invalid argument

Eventually we want to have something like a "verbose" flag that allows
us to get these warnings when we see something goes wrong. But until
then they do more harm than good exposed to casual users, so let's move
them to debug prints.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexey Kardashevskiy Feb. 4, 2014, 2:05 a.m. UTC | #1
On 02/04/2014 08:53 AM, Alexander Graf wrote:
> We sync a lot of SPRs automatically between KVM and QEMU now. Some
> of these only matter on newer hardware, some only matter on HV KVM.
> 
> With the current code runnign on my reasonably recent PR KVM kernel
> I get a lot of SPR synchronization warnings though:
> 
>   $ ./ppc64-softmmu/qemu-system-ppc64 -nographic -enable-kvm
>   Warning: Unable to set SPR 17 to KVM: Invalid argument
>   Warning: Unable to set SPR 29 to KVM: Invalid argument
>   Warning: Unable to set SPR 157 to KVM: Invalid argument
>   Warning: Unable to set SPR 308 to KVM: Invalid argument
>   Warning: Unable to set SPR 309 to KVM: Invalid argument
>   Warning: Unable to set SPR 318 to KVM: Invalid argument
>   Warning: Unable to set SPR 770 to KVM: Invalid argument
>   Warning: Unable to set SPR 945 to KVM: Invalid argument
>   Warning: Unable to set SPR 946 to KVM: Invalid argument
>   Warning: Unable to set SPR 1013 to KVM: Invalid argument
>   Warning: Unable to set SPR 17 to KVM: Invalid argument
>   Warning: Unable to set SPR 29 to KVM: Invalid argument
>   Warning: Unable to set SPR 157 to KVM: Invalid argument
>   Warning: Unable to set SPR 308 to KVM: Invalid argument
>   Warning: Unable to set SPR 309 to KVM: Invalid argument
>   Warning: Unable to set SPR 318 to KVM: Invalid argument
>   Warning: Unable to set SPR 770 to KVM: Invalid argument
>   Warning: Unable to set SPR 945 to KVM: Invalid argument
>   Warning: Unable to set SPR 946 to KVM: Invalid argument
>   Warning: Unable to set SPR 1013 to KVM: Invalid argument
> 
> Eventually we want to have something like a "verbose" flag that allows
> us to get these warnings when we see something goes wrong. But until
> then they do more harm than good exposed to casual users, so let's move
> them to debug prints.

Why are not these tracepoints? Then we would not need any "verbose" flag.


> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  target-ppc/kvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index 8f3f0bf..dce2156 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -480,7 +480,7 @@ static void kvm_get_one_spr(CPUState *cs, uint64_t id, int spr)
>  
>      ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
>      if (ret != 0) {
> -        fprintf(stderr, "Warning: Unable to retrieve SPR %d from KVM: %s\n",
> +        DPRINTF("Warning: Unable to retrieve SPR %d from KVM: %s\n",
>                  spr, strerror(errno));
>      } else {
>          switch (id & KVM_REG_SIZE_MASK) {
> @@ -529,7 +529,7 @@ static void kvm_put_one_spr(CPUState *cs, uint64_t id, int spr)
>  
>      ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
>      if (ret != 0) {
> -        fprintf(stderr, "Warning: Unable to set SPR %d to KVM: %s\n",
> +        DPRINTF("Warning: Unable to set SPR %d to KVM: %s\n",
>                  spr, strerror(errno));
>      }
>  }
>
Alexander Graf Feb. 4, 2014, 7:32 a.m. UTC | #2
On 04.02.2014, at 03:05, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> On 02/04/2014 08:53 AM, Alexander Graf wrote:
>> We sync a lot of SPRs automatically between KVM and QEMU now. Some
>> of these only matter on newer hardware, some only matter on HV KVM.
>> 
>> With the current code runnign on my reasonably recent PR KVM kernel
>> I get a lot of SPR synchronization warnings though:
>> 
>>  $ ./ppc64-softmmu/qemu-system-ppc64 -nographic -enable-kvm
>>  Warning: Unable to set SPR 17 to KVM: Invalid argument
>>  Warning: Unable to set SPR 29 to KVM: Invalid argument
>>  Warning: Unable to set SPR 157 to KVM: Invalid argument
>>  Warning: Unable to set SPR 308 to KVM: Invalid argument
>>  Warning: Unable to set SPR 309 to KVM: Invalid argument
>>  Warning: Unable to set SPR 318 to KVM: Invalid argument
>>  Warning: Unable to set SPR 770 to KVM: Invalid argument
>>  Warning: Unable to set SPR 945 to KVM: Invalid argument
>>  Warning: Unable to set SPR 946 to KVM: Invalid argument
>>  Warning: Unable to set SPR 1013 to KVM: Invalid argument
>>  Warning: Unable to set SPR 17 to KVM: Invalid argument
>>  Warning: Unable to set SPR 29 to KVM: Invalid argument
>>  Warning: Unable to set SPR 157 to KVM: Invalid argument
>>  Warning: Unable to set SPR 308 to KVM: Invalid argument
>>  Warning: Unable to set SPR 309 to KVM: Invalid argument
>>  Warning: Unable to set SPR 318 to KVM: Invalid argument
>>  Warning: Unable to set SPR 770 to KVM: Invalid argument
>>  Warning: Unable to set SPR 945 to KVM: Invalid argument
>>  Warning: Unable to set SPR 946 to KVM: Invalid argument
>>  Warning: Unable to set SPR 1013 to KVM: Invalid argument
>> 
>> Eventually we want to have something like a "verbose" flag that allows
>> us to get these warnings when we see something goes wrong. But until
>> then they do more harm than good exposed to casual users, so let's move
>> them to debug prints.
> 
> Why are not these tracepoints? Then we would not need any "verbose" flag.

True, we should convert all of the debug prints to trace points. But that's for later :).


Alex
diff mbox

Patch

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 8f3f0bf..dce2156 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -480,7 +480,7 @@  static void kvm_get_one_spr(CPUState *cs, uint64_t id, int spr)
 
     ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (ret != 0) {
-        fprintf(stderr, "Warning: Unable to retrieve SPR %d from KVM: %s\n",
+        DPRINTF("Warning: Unable to retrieve SPR %d from KVM: %s\n",
                 spr, strerror(errno));
     } else {
         switch (id & KVM_REG_SIZE_MASK) {
@@ -529,7 +529,7 @@  static void kvm_put_one_spr(CPUState *cs, uint64_t id, int spr)
 
     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
     if (ret != 0) {
-        fprintf(stderr, "Warning: Unable to set SPR %d to KVM: %s\n",
+        DPRINTF("Warning: Unable to set SPR %d to KVM: %s\n",
                 spr, strerror(errno));
     }
 }