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 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to