RE: [RFC PATCH v3 0/2] selftests/x86: sysret_rip update for FRED system

Li, Xin3 posted 2 patches 2 years, 7 months ago
Only 0 patches received!
There is a newer version of this series
RE: [RFC PATCH v3 0/2] selftests/x86: sysret_rip update for FRED system
Posted by Li, Xin3 2 years, 7 months ago
> >>
> >> Xin Li reported sysret_rip test fails at:
> >>
> >>         assert(ctx->uc_mcontext.gregs[REG_EFL] ==
> >>                ctx->uc_mcontext.gregs[REG_R11]);
> >
> >On FRED systems, flags is 0x200a93 and r11 is 0xfeedfacedeadbeef here.
> >
> >We need to remove or change this assertion, maybe:
> >  assert(ctx->uc_mcontext.gregs[REG_EFL] == ctx->uc_mcontext.gregs[REG_R11] ||
> >         r11_sentinel == ctx->uc_mcontext.gregs[REG_R11]);
> >
> >>
> >> in a FRED system. Let's handle the FRED system scenario too. The 'syscall'
> >> instruction in a FRED system doesn't set %r11=%rflags.
> >>
> 
> This should use check_regs_result() – which is exactly the reason I made that a
> separate function.

Exactly.