static int kvm_init_tss(kvm_context_t kvm) { int r; r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); if (r > 0) { /* * this address is 3 pages before the bios, and the bios should present * as unavaible memory */ r = kvm_set_tss_addr(kvm, 0xfeffd000); if (r < 0) { fprintf(stderr, "kvm_init_tss: unable to set tss addr\n"); return r; } } else { fprintf(stderr, "kvm does not support KVM_CAP_SET_TSS_ADDR\n"); } return 0; }
static int kvm_init_tss(kvm_context_t kvm) { #ifdef KVM_CAP_SET_TSS_ADDR int r; r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); if (r > 0) { /* * this address is 3 pages before the bios, and the bios should present * as unavaible memory */ r = kvm_set_tss_addr(kvm, 0xfffbd000); if (r < 0) { fprintf(stderr, "kvm_init_tss: unable to set tss addr\n"); return r; } } #endif return 0; }