fclose(f);
}
+static void setfpregs(const int vcpu, struct kvm_fpu *fpregs) {
+ // KVM_[SG]ET_FPU isn't supported on PPC, we have to move individual regs...
+ unsigned i;
+ for (i = 0; i < 32; i++) {
+ struct kvm_one_reg r = {
+ .id = KVM_REG_PPC_FPR(i),
+ .addr = (uint64_t) &fpregs->fpr[i]
+ };
+
+ if (ioctl(vcpu, KVM_SET_ONE_REG, &r) != 0)
+ abort();
+ }
+}
+
+static void getfpregs(const int vcpu, struct kvm_fpu *fpregs) {
+ // KVM_[SG]ET_FPU isn't supported on PPC, we have to move individual regs...
+ unsigned i;
+ for (i = 0; i < 32; i++) {
+ struct kvm_one_reg r = {
+ .id = KVM_REG_PPC_FPR(i),
+ .addr = (uint64_t) &fpregs->fpr[i]
+ };
+
+ if (ioctl(vcpu, KVM_GET_ONE_REG, &r) != 0)
+ abort();
+ }
+}
+
int main(int argc, char **argv) {
const struct option longopts[] = {
if (ioctl(vcpu, KVM_SET_REGS, ®s) == -1)
abort();
- if (ioctl(vcpu, KVM_SET_FPU, &fpregs) == -1)
- abort();
+ setfpregs(vcpu, &fpregs);
const struct kvm_guest_debug dbg = {
.control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP