diff options
author | Alexander Graf <agraf@suse.de> | 2014-04-24 07:39:16 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-05-30 08:26:20 -0400 |
commit | 2743103f91e20d4c4d4f1a8d00821289c4c6ff62 (patch) | |
tree | db4ed5d2aa6e12e9f6ad4cb1c4772173b45515e3 | |
parent | b59d9d26becb8b32596f2eed6ce5a81d61f4f513 (diff) |
KVM: PPC: PR: Fill pvinfo hcall instructions in big endian
We expose a blob of hypercall instructions to user space that it gives to
the guest via device tree again. That blob should contain a stream of
instructions necessary to do a hypercall in big endian, as it just gets
passed into the guest and old guests use them straight away.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 3cf541a53e2a..a9bd0ff0e173 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -1015,10 +1015,10 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) | |||
1015 | u32 inst_nop = 0x60000000; | 1015 | u32 inst_nop = 0x60000000; |
1016 | #ifdef CONFIG_KVM_BOOKE_HV | 1016 | #ifdef CONFIG_KVM_BOOKE_HV |
1017 | u32 inst_sc1 = 0x44000022; | 1017 | u32 inst_sc1 = 0x44000022; |
1018 | pvinfo->hcall[0] = inst_sc1; | 1018 | pvinfo->hcall[0] = cpu_to_be32(inst_sc1); |
1019 | pvinfo->hcall[1] = inst_nop; | 1019 | pvinfo->hcall[1] = cpu_to_be32(inst_nop); |
1020 | pvinfo->hcall[2] = inst_nop; | 1020 | pvinfo->hcall[2] = cpu_to_be32(inst_nop); |
1021 | pvinfo->hcall[3] = inst_nop; | 1021 | pvinfo->hcall[3] = cpu_to_be32(inst_nop); |
1022 | #else | 1022 | #else |
1023 | u32 inst_lis = 0x3c000000; | 1023 | u32 inst_lis = 0x3c000000; |
1024 | u32 inst_ori = 0x60000000; | 1024 | u32 inst_ori = 0x60000000; |
@@ -1034,10 +1034,10 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) | |||
1034 | * sc | 1034 | * sc |
1035 | * nop | 1035 | * nop |
1036 | */ | 1036 | */ |
1037 | pvinfo->hcall[0] = inst_lis | ((KVM_SC_MAGIC_R0 >> 16) & inst_imm_mask); | 1037 | pvinfo->hcall[0] = cpu_to_be32(inst_lis | ((KVM_SC_MAGIC_R0 >> 16) & inst_imm_mask)); |
1038 | pvinfo->hcall[1] = inst_ori | (KVM_SC_MAGIC_R0 & inst_imm_mask); | 1038 | pvinfo->hcall[1] = cpu_to_be32(inst_ori | (KVM_SC_MAGIC_R0 & inst_imm_mask)); |
1039 | pvinfo->hcall[2] = inst_sc; | 1039 | pvinfo->hcall[2] = cpu_to_be32(inst_sc); |
1040 | pvinfo->hcall[3] = inst_nop; | 1040 | pvinfo->hcall[3] = cpu_to_be32(inst_nop); |
1041 | #endif | 1041 | #endif |
1042 | 1042 | ||
1043 | pvinfo->flags = KVM_PPC_PVINFO_FLAGS_EV_IDLE; | 1043 | pvinfo->flags = KVM_PPC_PVINFO_FLAGS_EV_IDLE; |