Akio Takebe wrote: > Hi, Xiantao and Anthony > >> +void getfpreg(unsigned long regnum, struct ia64_fpreg *fpval, >> + struct kvm_pt_regs *regs) >> +{ >> + /* Take floating register rotation into consideration*/ >> + if (regnum >= IA64_FIRST_ROTATING_FR) >> + regnum = IA64_FIRST_ROTATING_FR + fph_index(regs, >> regnum); >> +#define CASE_FIXED_FP(reg) \ >> + case (reg) : \ >> + ia64_stf_spill(fpval, reg); \ >> + break >> + >> + switch (regnum) { >> + CASE_FIXED_FP(0); >> + CASE_FIXED_FP(1); >> + CASE_FIXED_FP(2); >> + CASE_FIXED_FP(3); >> + CASE_FIXED_FP(4); >> + CASE_FIXED_FP(5); >> + >> + CASE_FIXED_FP(6); >> + CASE_FIXED_FP(7); >> + CASE_FIXED_FP(8); >> + CASE_FIXED_FP(9); >> + CASE_FIXED_FP(10); >> + CASE_FIXED_FP(11); >> + > Is this correct ? Though I don't know why xen do so. > In the case of Xen, the above parts are; > > #define CASE_SAVED_FP(reg) \ > case reg: \ > fpval->u.bits[0] = regs->f##reg.u.bits[0]; \ > fpval->u.bits[1] = regs->f##reg.u.bits[1]; \ > break > > CASE_SAVED_FP(6); > CASE_SAVED_FP(7); > CASE_SAVED_FP(8); > Hi, Akio Current should be correct, because for every host<-> guest switch, we switched FPU accordingly. So the fpu register file is dedicated for current vm, getting it from physical register should be right. But for xen's code, due to lazy fpu save/restore, current fpu register file maybe not belong to current vcpu, so need to load it from stack. Thanks Xiantao -- To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Sat Mar 29 13:21:04 2008
This archive was generated by hypermail 2.1.8 : 2008-03-29 13:21:19 EST