KVM: PPC: Rename MMIO register identifiers
authorAlexander Graf <agraf@suse.de>
Sat, 7 Jan 2012 01:07:38 +0000 (02:07 +0100)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:41 +0000 (14:52 +0200)
We need the KVM_REG namespace for generic register settings now, so
let's rename the existing users to something different, enabling
us to reuse the namespace for more visible interfaces.

While at it, also move these private constants to a private header.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm.h
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_paired_singles.c
arch/powerpc/kvm/powerpc.c

index f41adcda1468dc6f3ad90644681877c5c2ea973d..b921c3f48928868a74bce5142af1a346c9a79c7f 100644 (file)
@@ -269,13 +269,6 @@ struct kvm_guest_debug_arch {
 struct kvm_sync_regs {
 };
 
-#define KVM_REG_MASK           0x001f
-#define KVM_REG_EXT_MASK       0xffe0
-#define KVM_REG_GPR            0x0000
-#define KVM_REG_FPR            0x0020
-#define KVM_REG_QPR            0x0040
-#define KVM_REG_FQPR           0x0060
-
 #define KVM_INTERRUPT_SET      -1U
 #define KVM_INTERRUPT_UNSET    -2U
 #define KVM_INTERRUPT_SET_LEVEL        -3U
index 1cb6e522485bf20e3997e4c3a3995ac9d789b277..af438b1e8a3cbc53eb2e02ce02c4323d71fceb37 100644 (file)
@@ -485,4 +485,12 @@ struct kvm_vcpu_arch {
 #define KVMPPC_VCPU_BUSY_IN_HOST       1
 #define KVMPPC_VCPU_RUNNABLE           2
 
+/* Values for vcpu->arch.io_gpr */
+#define KVM_MMIO_REG_MASK      0x001f
+#define KVM_MMIO_REG_EXT_MASK  0xffe0
+#define KVM_MMIO_REG_GPR       0x0000
+#define KVM_MMIO_REG_FPR       0x0020
+#define KVM_MMIO_REG_QPR       0x0040
+#define KVM_MMIO_REG_FQPR      0x0060
+
 #endif /* __POWERPC_KVM_HOST_H__ */
index 7b0ee96c1bedec56a280e90ab47f7cceeba1d692..e70ef2d86431bd7eef8c93adf219a88009ea6828 100644 (file)
@@ -196,7 +196,8 @@ static int kvmppc_emulate_fpr_load(struct kvm_run *run, struct kvm_vcpu *vcpu,
                kvmppc_inject_pf(vcpu, addr, false);
                goto done_load;
        } else if (r == EMULATE_DO_MMIO) {
-               emulated = kvmppc_handle_load(run, vcpu, KVM_REG_FPR | rs, len, 1);
+               emulated = kvmppc_handle_load(run, vcpu, KVM_MMIO_REG_FPR | rs,
+                                             len, 1);
                goto done_load;
        }
 
@@ -286,11 +287,13 @@ static int kvmppc_emulate_psq_load(struct kvm_run *run, struct kvm_vcpu *vcpu,
                kvmppc_inject_pf(vcpu, addr, false);
                goto done_load;
        } else if ((r == EMULATE_DO_MMIO) && w) {
-               emulated = kvmppc_handle_load(run, vcpu, KVM_REG_FPR | rs, 4, 1);
+               emulated = kvmppc_handle_load(run, vcpu, KVM_MMIO_REG_FPR | rs,
+                                             4, 1);
                vcpu->arch.qpr[rs] = tmp[1];
                goto done_load;
        } else if (r == EMULATE_DO_MMIO) {
-               emulated = kvmppc_handle_load(run, vcpu, KVM_REG_FQPR | rs, 8, 1);
+               emulated = kvmppc_handle_load(run, vcpu, KVM_MMIO_REG_FQPR | rs,
+                                             8, 1);
                goto done_load;
        }
 
index e23270779ff5d126287be071ff42c24cdfbb3a65..0e21d155eea7fd42db74505d208e24be47fcb973 100644 (file)
@@ -448,20 +448,20 @@ static void kvmppc_complete_mmio_load(struct kvm_vcpu *vcpu,
 
        kvmppc_set_gpr(vcpu, vcpu->arch.io_gpr, gpr);
 
-       switch (vcpu->arch.io_gpr & KVM_REG_EXT_MASK) {
-       case KVM_REG_GPR:
+       switch (vcpu->arch.io_gpr & KVM_MMIO_REG_EXT_MASK) {
+       case KVM_MMIO_REG_GPR:
                kvmppc_set_gpr(vcpu, vcpu->arch.io_gpr, gpr);
                break;
-       case KVM_REG_FPR:
-               vcpu->arch.fpr[vcpu->arch.io_gpr & KVM_REG_MASK] = gpr;
+       case KVM_MMIO_REG_FPR:
+               vcpu->arch.fpr[vcpu->arch.io_gpr & KVM_MMIO_REG_MASK] = gpr;
                break;
 #ifdef CONFIG_PPC_BOOK3S
-       case KVM_REG_QPR:
-               vcpu->arch.qpr[vcpu->arch.io_gpr & KVM_REG_MASK] = gpr;
+       case KVM_MMIO_REG_QPR:
+               vcpu->arch.qpr[vcpu->arch.io_gpr & KVM_MMIO_REG_MASK] = gpr;
                break;
-       case KVM_REG_FQPR:
-               vcpu->arch.fpr[vcpu->arch.io_gpr & KVM_REG_MASK] = gpr;
-               vcpu->arch.qpr[vcpu->arch.io_gpr & KVM_REG_MASK] = gpr;
+       case KVM_MMIO_REG_FQPR:
+               vcpu->arch.fpr[vcpu->arch.io_gpr & KVM_MMIO_REG_MASK] = gpr;
+               vcpu->arch.qpr[vcpu->arch.io_gpr & KVM_MMIO_REG_MASK] = gpr;
                break;
 #endif
        default: