qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v22 13/17] i386: split svm_helper into sysemu and stub-only u


From: Richard Henderson
Subject: Re: [PATCH v22 13/17] i386: split svm_helper into sysemu and stub-only user
Date: Wed, 24 Feb 2021 19:37:13 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 2/24/21 5:34 AM, Claudio Fontana wrote:
> For now we just copy over the previous user stubs, but really,
> 
> everything that requires s->cpl == 0 should be impossible
> to trigger from user-mode emulation.
> 
> Later on we should add a check that asserts this easily f.e.:
> 
> static bool check_cpl0(DisasContext *s)
> {
>      int cpl = s->cpl;
>  #ifdef CONFIG_USER_ONLY
>      assert(cpl == 3);
>  #endif
>      if (cpl != 0) {
>          gen_exception(s, EXCP0D_GPF, s->pc_start - s->cs_base);
>          return false;
>      }
>      return true;
> }

Hmm, more or less exactly what I was suggesting vs patch 11, with the
improvement to consolidate the generation of the exception.

Is it worth doing this now rather than later, so that we don't have to have the
stubs, and so don't have to add the new file?

If you were adding the stubs new, rather than moving them, I'd say add
g_assert_not_reached to them.  But the actual patch is fine.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]