Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011. Freescale Inc. All rights reserved. |
| 3 | * |
| 4 | * Authors: |
| 5 | * Alexander Graf <agraf@suse.de> |
| 6 | * Paul Mackerras <paulus@samba.org> |
| 7 | * |
| 8 | * Description: |
| 9 | * |
| 10 | * Hypercall handling for running PAPR guests in PR KVM on Book 3S |
| 11 | * processors. |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License, version 2, as |
| 15 | * published by the Free Software Foundation. |
| 16 | */ |
| 17 | |
Benjamin Herrenschmidt | f31e65e | 2012-03-15 21:58:34 +0000 | [diff] [blame] | 18 | #include <linux/anon_inodes.h> |
| 19 | |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 20 | #include <asm/uaccess.h> |
| 21 | #include <asm/kvm_ppc.h> |
| 22 | #include <asm/kvm_book3s.h> |
| 23 | |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 24 | #define HPTE_SIZE 16 /* bytes per HPT entry */ |
| 25 | |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 26 | static unsigned long get_pteg_addr(struct kvm_vcpu *vcpu, long pte_index) |
| 27 | { |
| 28 | struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu); |
| 29 | unsigned long pteg_addr; |
| 30 | |
| 31 | pte_index <<= 4; |
| 32 | pte_index &= ((1 << ((vcpu_book3s->sdr1 & 0x1f) + 11)) - 1) << 7 | 0x70; |
| 33 | pteg_addr = vcpu_book3s->sdr1 & 0xfffffffffffc0000ULL; |
| 34 | pteg_addr |= pte_index; |
| 35 | |
| 36 | return pteg_addr; |
| 37 | } |
| 38 | |
| 39 | static int kvmppc_h_pr_enter(struct kvm_vcpu *vcpu) |
| 40 | { |
| 41 | long flags = kvmppc_get_gpr(vcpu, 4); |
| 42 | long pte_index = kvmppc_get_gpr(vcpu, 5); |
| 43 | unsigned long pteg[2 * 8]; |
| 44 | unsigned long pteg_addr, i, *hpte; |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 45 | long int ret; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 46 | |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 47 | i = pte_index & 7; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 48 | pte_index &= ~7UL; |
| 49 | pteg_addr = get_pteg_addr(vcpu, pte_index); |
| 50 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 51 | mutex_lock(&vcpu->kvm->arch.hpt_mutex); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 52 | copy_from_user(pteg, (void __user *)pteg_addr, sizeof(pteg)); |
| 53 | hpte = pteg; |
| 54 | |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 55 | ret = H_PTEG_FULL; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 56 | if (likely((flags & H_EXACT) == 0)) { |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 57 | for (i = 0; ; ++i) { |
| 58 | if (i == 8) |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 59 | goto done; |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 60 | if ((be64_to_cpu(*hpte) & HPTE_V_VALID) == 0) |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 61 | break; |
| 62 | hpte += 2; |
| 63 | } |
| 64 | } else { |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 65 | hpte += i * 2; |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 66 | if (*hpte & HPTE_V_VALID) |
| 67 | goto done; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 68 | } |
| 69 | |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 70 | hpte[0] = cpu_to_be64(kvmppc_get_gpr(vcpu, 6)); |
| 71 | hpte[1] = cpu_to_be64(kvmppc_get_gpr(vcpu, 7)); |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 72 | pteg_addr += i * HPTE_SIZE; |
| 73 | copy_to_user((void __user *)pteg_addr, hpte, HPTE_SIZE); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 74 | kvmppc_set_gpr(vcpu, 4, pte_index | i); |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 75 | ret = H_SUCCESS; |
| 76 | |
| 77 | done: |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 78 | mutex_unlock(&vcpu->kvm->arch.hpt_mutex); |
Paul Mackerras | 5cd92a9 | 2013-09-20 14:52:47 +1000 | [diff] [blame] | 79 | kvmppc_set_gpr(vcpu, 3, ret); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 80 | |
| 81 | return EMULATE_DONE; |
| 82 | } |
| 83 | |
| 84 | static int kvmppc_h_pr_remove(struct kvm_vcpu *vcpu) |
| 85 | { |
| 86 | unsigned long flags= kvmppc_get_gpr(vcpu, 4); |
| 87 | unsigned long pte_index = kvmppc_get_gpr(vcpu, 5); |
| 88 | unsigned long avpn = kvmppc_get_gpr(vcpu, 6); |
| 89 | unsigned long v = 0, pteg, rb; |
| 90 | unsigned long pte[2]; |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 91 | long int ret; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 92 | |
| 93 | pteg = get_pteg_addr(vcpu, pte_index); |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 94 | mutex_lock(&vcpu->kvm->arch.hpt_mutex); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 95 | copy_from_user(pte, (void __user *)pteg, sizeof(pte)); |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 96 | pte[0] = be64_to_cpu(pte[0]); |
| 97 | pte[1] = be64_to_cpu(pte[1]); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 98 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 99 | ret = H_NOT_FOUND; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 100 | if ((pte[0] & HPTE_V_VALID) == 0 || |
| 101 | ((flags & H_AVPN) && (pte[0] & ~0x7fUL) != avpn) || |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 102 | ((flags & H_ANDCOND) && (pte[0] & avpn) != 0)) |
| 103 | goto done; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 104 | |
| 105 | copy_to_user((void __user *)pteg, &v, sizeof(v)); |
| 106 | |
| 107 | rb = compute_tlbie_rb(pte[0], pte[1], pte_index); |
| 108 | vcpu->arch.mmu.tlbie(vcpu, rb, rb & 1 ? true : false); |
| 109 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 110 | ret = H_SUCCESS; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 111 | kvmppc_set_gpr(vcpu, 4, pte[0]); |
| 112 | kvmppc_set_gpr(vcpu, 5, pte[1]); |
| 113 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 114 | done: |
| 115 | mutex_unlock(&vcpu->kvm->arch.hpt_mutex); |
| 116 | kvmppc_set_gpr(vcpu, 3, ret); |
| 117 | |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 118 | return EMULATE_DONE; |
| 119 | } |
| 120 | |
Matt Evans | 3aaefef | 2012-01-30 20:25:31 +0000 | [diff] [blame] | 121 | /* Request defs for kvmppc_h_pr_bulk_remove() */ |
| 122 | #define H_BULK_REMOVE_TYPE 0xc000000000000000ULL |
| 123 | #define H_BULK_REMOVE_REQUEST 0x4000000000000000ULL |
| 124 | #define H_BULK_REMOVE_RESPONSE 0x8000000000000000ULL |
| 125 | #define H_BULK_REMOVE_END 0xc000000000000000ULL |
| 126 | #define H_BULK_REMOVE_CODE 0x3000000000000000ULL |
| 127 | #define H_BULK_REMOVE_SUCCESS 0x0000000000000000ULL |
| 128 | #define H_BULK_REMOVE_NOT_FOUND 0x1000000000000000ULL |
| 129 | #define H_BULK_REMOVE_PARM 0x2000000000000000ULL |
| 130 | #define H_BULK_REMOVE_HW 0x3000000000000000ULL |
| 131 | #define H_BULK_REMOVE_RC 0x0c00000000000000ULL |
| 132 | #define H_BULK_REMOVE_FLAGS 0x0300000000000000ULL |
| 133 | #define H_BULK_REMOVE_ABSOLUTE 0x0000000000000000ULL |
| 134 | #define H_BULK_REMOVE_ANDCOND 0x0100000000000000ULL |
| 135 | #define H_BULK_REMOVE_AVPN 0x0200000000000000ULL |
| 136 | #define H_BULK_REMOVE_PTEX 0x00ffffffffffffffULL |
| 137 | #define H_BULK_REMOVE_MAX_BATCH 4 |
| 138 | |
| 139 | static int kvmppc_h_pr_bulk_remove(struct kvm_vcpu *vcpu) |
| 140 | { |
| 141 | int i; |
| 142 | int paramnr = 4; |
| 143 | int ret = H_SUCCESS; |
| 144 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 145 | mutex_lock(&vcpu->kvm->arch.hpt_mutex); |
Matt Evans | 3aaefef | 2012-01-30 20:25:31 +0000 | [diff] [blame] | 146 | for (i = 0; i < H_BULK_REMOVE_MAX_BATCH; i++) { |
| 147 | unsigned long tsh = kvmppc_get_gpr(vcpu, paramnr+(2*i)); |
| 148 | unsigned long tsl = kvmppc_get_gpr(vcpu, paramnr+(2*i)+1); |
| 149 | unsigned long pteg, rb, flags; |
| 150 | unsigned long pte[2]; |
| 151 | unsigned long v = 0; |
| 152 | |
| 153 | if ((tsh & H_BULK_REMOVE_TYPE) == H_BULK_REMOVE_END) { |
| 154 | break; /* Exit success */ |
| 155 | } else if ((tsh & H_BULK_REMOVE_TYPE) != |
| 156 | H_BULK_REMOVE_REQUEST) { |
| 157 | ret = H_PARAMETER; |
| 158 | break; /* Exit fail */ |
| 159 | } |
| 160 | |
| 161 | tsh &= H_BULK_REMOVE_PTEX | H_BULK_REMOVE_FLAGS; |
| 162 | tsh |= H_BULK_REMOVE_RESPONSE; |
| 163 | |
| 164 | if ((tsh & H_BULK_REMOVE_ANDCOND) && |
| 165 | (tsh & H_BULK_REMOVE_AVPN)) { |
| 166 | tsh |= H_BULK_REMOVE_PARM; |
| 167 | kvmppc_set_gpr(vcpu, paramnr+(2*i), tsh); |
| 168 | ret = H_PARAMETER; |
| 169 | break; /* Exit fail */ |
| 170 | } |
| 171 | |
| 172 | pteg = get_pteg_addr(vcpu, tsh & H_BULK_REMOVE_PTEX); |
| 173 | copy_from_user(pte, (void __user *)pteg, sizeof(pte)); |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 174 | pte[0] = be64_to_cpu(pte[0]); |
| 175 | pte[1] = be64_to_cpu(pte[1]); |
Matt Evans | 3aaefef | 2012-01-30 20:25:31 +0000 | [diff] [blame] | 176 | |
| 177 | /* tsl = AVPN */ |
| 178 | flags = (tsh & H_BULK_REMOVE_FLAGS) >> 26; |
| 179 | |
| 180 | if ((pte[0] & HPTE_V_VALID) == 0 || |
| 181 | ((flags & H_AVPN) && (pte[0] & ~0x7fUL) != tsl) || |
| 182 | ((flags & H_ANDCOND) && (pte[0] & tsl) != 0)) { |
| 183 | tsh |= H_BULK_REMOVE_NOT_FOUND; |
| 184 | } else { |
| 185 | /* Splat the pteg in (userland) hpt */ |
| 186 | copy_to_user((void __user *)pteg, &v, sizeof(v)); |
| 187 | |
| 188 | rb = compute_tlbie_rb(pte[0], pte[1], |
| 189 | tsh & H_BULK_REMOVE_PTEX); |
| 190 | vcpu->arch.mmu.tlbie(vcpu, rb, rb & 1 ? true : false); |
| 191 | tsh |= H_BULK_REMOVE_SUCCESS; |
| 192 | tsh |= (pte[1] & (HPTE_R_C | HPTE_R_R)) << 43; |
| 193 | } |
| 194 | kvmppc_set_gpr(vcpu, paramnr+(2*i), tsh); |
| 195 | } |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 196 | mutex_unlock(&vcpu->kvm->arch.hpt_mutex); |
Matt Evans | 3aaefef | 2012-01-30 20:25:31 +0000 | [diff] [blame] | 197 | kvmppc_set_gpr(vcpu, 3, ret); |
| 198 | |
| 199 | return EMULATE_DONE; |
| 200 | } |
| 201 | |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 202 | static int kvmppc_h_pr_protect(struct kvm_vcpu *vcpu) |
| 203 | { |
| 204 | unsigned long flags = kvmppc_get_gpr(vcpu, 4); |
| 205 | unsigned long pte_index = kvmppc_get_gpr(vcpu, 5); |
| 206 | unsigned long avpn = kvmppc_get_gpr(vcpu, 6); |
| 207 | unsigned long rb, pteg, r, v; |
| 208 | unsigned long pte[2]; |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 209 | long int ret; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 210 | |
| 211 | pteg = get_pteg_addr(vcpu, pte_index); |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 212 | mutex_lock(&vcpu->kvm->arch.hpt_mutex); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 213 | copy_from_user(pte, (void __user *)pteg, sizeof(pte)); |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 214 | pte[0] = be64_to_cpu(pte[0]); |
| 215 | pte[1] = be64_to_cpu(pte[1]); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 216 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 217 | ret = H_NOT_FOUND; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 218 | if ((pte[0] & HPTE_V_VALID) == 0 || |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 219 | ((flags & H_AVPN) && (pte[0] & ~0x7fUL) != avpn)) |
| 220 | goto done; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 221 | |
| 222 | v = pte[0]; |
| 223 | r = pte[1]; |
| 224 | r &= ~(HPTE_R_PP0 | HPTE_R_PP | HPTE_R_N | HPTE_R_KEY_HI | |
| 225 | HPTE_R_KEY_LO); |
| 226 | r |= (flags << 55) & HPTE_R_PP0; |
| 227 | r |= (flags << 48) & HPTE_R_KEY_HI; |
| 228 | r |= flags & (HPTE_R_PP | HPTE_R_N | HPTE_R_KEY_LO); |
| 229 | |
| 230 | pte[1] = r; |
| 231 | |
| 232 | rb = compute_tlbie_rb(v, r, pte_index); |
| 233 | vcpu->arch.mmu.tlbie(vcpu, rb, rb & 1 ? true : false); |
Alexander Graf | 1692aa3 | 2014-04-24 13:09:15 +0200 | [diff] [blame] | 234 | pte[0] = cpu_to_be64(pte[0]); |
| 235 | pte[1] = cpu_to_be64(pte[1]); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 236 | copy_to_user((void __user *)pteg, pte, sizeof(pte)); |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 237 | ret = H_SUCCESS; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 238 | |
Paul Mackerras | 9308ab8 | 2013-09-20 14:52:48 +1000 | [diff] [blame] | 239 | done: |
| 240 | mutex_unlock(&vcpu->kvm->arch.hpt_mutex); |
| 241 | kvmppc_set_gpr(vcpu, 3, ret); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 242 | |
| 243 | return EMULATE_DONE; |
| 244 | } |
| 245 | |
Benjamin Herrenschmidt | f31e65e | 2012-03-15 21:58:34 +0000 | [diff] [blame] | 246 | static int kvmppc_h_pr_put_tce(struct kvm_vcpu *vcpu) |
| 247 | { |
| 248 | unsigned long liobn = kvmppc_get_gpr(vcpu, 4); |
| 249 | unsigned long ioba = kvmppc_get_gpr(vcpu, 5); |
| 250 | unsigned long tce = kvmppc_get_gpr(vcpu, 6); |
| 251 | long rc; |
| 252 | |
| 253 | rc = kvmppc_h_put_tce(vcpu, liobn, ioba, tce); |
| 254 | if (rc == H_TOO_HARD) |
| 255 | return EMULATE_FAIL; |
| 256 | kvmppc_set_gpr(vcpu, 3, rc); |
| 257 | return EMULATE_DONE; |
| 258 | } |
| 259 | |
Benjamin Herrenschmidt | bc5ad3f | 2013-04-17 20:30:26 +0000 | [diff] [blame] | 260 | static int kvmppc_h_pr_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd) |
| 261 | { |
| 262 | long rc = kvmppc_xics_hcall(vcpu, cmd); |
| 263 | kvmppc_set_gpr(vcpu, 3, rc); |
| 264 | return EMULATE_DONE; |
| 265 | } |
| 266 | |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 267 | int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd) |
| 268 | { |
| 269 | switch (cmd) { |
| 270 | case H_ENTER: |
| 271 | return kvmppc_h_pr_enter(vcpu); |
| 272 | case H_REMOVE: |
| 273 | return kvmppc_h_pr_remove(vcpu); |
| 274 | case H_PROTECT: |
| 275 | return kvmppc_h_pr_protect(vcpu); |
| 276 | case H_BULK_REMOVE: |
Matt Evans | 3aaefef | 2012-01-30 20:25:31 +0000 | [diff] [blame] | 277 | return kvmppc_h_pr_bulk_remove(vcpu); |
Benjamin Herrenschmidt | f31e65e | 2012-03-15 21:58:34 +0000 | [diff] [blame] | 278 | case H_PUT_TCE: |
| 279 | return kvmppc_h_pr_put_tce(vcpu); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 280 | case H_CEDE: |
Alexander Graf | 5deb8e7 | 2014-04-24 13:46:24 +0200 | [diff] [blame] | 281 | kvmppc_set_msr_fast(vcpu, kvmppc_get_msr(vcpu) | MSR_EE); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 282 | kvm_vcpu_block(vcpu); |
Alexander Graf | 966cd0f | 2012-03-14 16:55:08 +0100 | [diff] [blame] | 283 | clear_bit(KVM_REQ_UNHALT, &vcpu->requests); |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 284 | vcpu->stat.halt_wakeup++; |
| 285 | return EMULATE_DONE; |
Benjamin Herrenschmidt | bc5ad3f | 2013-04-17 20:30:26 +0000 | [diff] [blame] | 286 | case H_XIRR: |
| 287 | case H_CPPR: |
| 288 | case H_EOI: |
| 289 | case H_IPI: |
Paul Mackerras | 8e44ddc | 2013-05-23 15:42:21 +0000 | [diff] [blame] | 290 | case H_IPOLL: |
| 291 | case H_XIRR_X: |
Benjamin Herrenschmidt | bc5ad3f | 2013-04-17 20:30:26 +0000 | [diff] [blame] | 292 | if (kvmppc_xics_enabled(vcpu)) |
| 293 | return kvmppc_h_pr_xics_hcall(vcpu, cmd); |
| 294 | break; |
Michael Ellerman | 8e591cb | 2013-04-17 20:30:00 +0000 | [diff] [blame] | 295 | case H_RTAS: |
| 296 | if (list_empty(&vcpu->kvm->arch.rtas_tokens)) |
| 297 | return RESUME_HOST; |
| 298 | if (kvmppc_rtas_hcall(vcpu)) |
| 299 | break; |
| 300 | kvmppc_set_gpr(vcpu, 3, 0); |
| 301 | return EMULATE_DONE; |
Alexander Graf | 0254f074 | 2011-08-08 17:21:15 +0200 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | return EMULATE_FAIL; |
| 305 | } |