On 2/15/21 3:13 PM, Paolo Bonzini wrote:
> On 15/02/21 15:05, Claudio Fontana wrote:
>> On 2/15/21 2:30 PM, Paolo Bonzini wrote:
>>> On 15/02/21 13:59, Claudio Fontana wrote:
>>>> Yes. The difference between before the patch and after the patch
>>>> is that before we were still going through all the code in
>>>> tcg_gen_callN, via the call to gen_helper_rsm macro, only to call
>>>> finally an empty function for CONFIG_USER_ONLY (helper_rsm()
>>>> {}),
>>>>
>>>> while now we do not generate anything, we do not call the
>>>> gen_helper_rsm macro at all, so we don't go through
>>>> tcg_gen_callN.
>>>>
>>>
>>> Can we even have an abort() for such cases?
>>>
>>> Paolo
>>>
>>
>> Hi Paolo,
>>
>> where are you suggesting to have an abort()?
>>
>> You mean that we should abort() QEMU as soon as we detect in
>> translate.c an RSM instruction in user-mode?
>
> Translating it is okay (it's just a guaranteed SIGILL), but I'm thinking
> of aborting if s->flags & HF_SMM_MASK is true. Likewise if we see
> CPU_INTERRUPT_SMI.
>
> Paolo
>
Ok, will rework as you suggest, thanks!
>>
>> case 0x1aa: /* rsm */
>> gen_svm_check_intercept(s, pc_start, SVM_EXIT_RSM);
>> if (!(s->flags & HF_SMM_MASK))
>> goto illegal_op;
>> gen_update_cc_op(s);
>> gen_jmp_im(s, s->pc - s->cs_base);
>> #ifndef CONFIG_USER_ONLY
>> gen_helper_rsm(cpu_env);
>> #endif /* CONFIG_USER_ONLY */
>> gen_eob(s);
>> break;
>
>