Revision 45024f09 target-ppc/kvm.c

b/target-ppc/kvm.c
327 327
    return retval;
328 328
}
329 329

  
330
int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)
331
{
332
    uint32_t *hc = (uint32_t*)buf;
333

  
334
#ifdef KVM_CAP_PPC_GET_PVINFO
335
    struct kvm_ppc_pvinfo pvinfo;
336

  
337
    if (kvm_check_extension(env->kvm_state, KVM_CAP_PPC_GET_PVINFO) &&
338
        !kvm_vm_ioctl(env->kvm_state, KVM_PPC_GET_PVINFO, &pvinfo)) {
339
        memcpy(buf, pvinfo.hcall, buf_len);
340

  
341
        return 0;
342
    }
343
#endif
344

  
345
    /*
346
     * Fallback to always fail hypercalls:
347
     *
348
     *     li r3, -1
349
     *     nop
350
     *     nop
351
     *     nop
352
     */
353

  
354
    hc[0] = 0x3860ffff;
355
    hc[1] = 0x60000000;
356
    hc[2] = 0x60000000;
357
    hc[3] = 0x60000000;
358

  
359
    return 0;
360
}
361

  
330 362
bool kvm_arch_stop_on_emulation_error(CPUState *env)
331 363
{
332 364
    return true;

Also available in: Unified diff