[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~
- [PATCH v22 06/17] meson: add target_user_arch, (continued)
- [PATCH v22 09/17] i386: split tcg excp_helper into sysemu and user parts, Claudio Fontana, 2021/02/24
- [PATCH v22 10/17] i386: move TCG btp_helper into sysemu/, Claudio Fontana, 2021/02/24
- [PATCH v22 13/17] i386: split svm_helper into sysemu and stub-only user, Claudio Fontana, 2021/02/24
- Re: [PATCH v22 13/17] i386: split svm_helper into sysemu and stub-only user,
Richard Henderson <=
- [PATCH v22 12/17] i386: separate fpu_helper into user and sysemu parts, Claudio Fontana, 2021/02/24
- [PATCH v22 14/17] i386: split seg_helper into user-only and sysemu parts, Claudio Fontana, 2021/02/24
- [PATCH v22 11/17] i386: split misc helper into user and sysemu parts, Claudio Fontana, 2021/02/24
- [PATCH v22 17/17] i386: move cpu_load_efer into sysemu-only section of cpu.h, Claudio Fontana, 2021/02/24
- [PATCH v22 16/17] i386: gdbstub: only write CR0/CR2/CR3/EFER for SOFTMMU, Claudio Fontana, 2021/02/24