OSDN Git Service

i386: split svm_helper into sysemu and stub-only user
authorClaudio Fontana <cfontana@suse.de>
Mon, 22 Mar 2021 13:27:52 +0000 (14:27 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 10 May 2021 19:41:51 +0000 (15:41 -0400)
commitb39030942dc62a937f5746acf346830d711f4afa
treef8e0c7c117acd6d933a0de28ab88bf8d42f79f74
parent83a3d9c7402065ca28160e6b524d53ae1eaeba8d
i386: split svm_helper into sysemu and stub-only user

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;
}

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210322132800.7470-17-cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/meson.build
target/i386/tcg/sysemu/meson.build
target/i386/tcg/sysemu/svm_helper.c [moved from target/i386/tcg/svm_helper.c with 96% similarity]
target/i386/tcg/user/meson.build
target/i386/tcg/user/svm_stubs.c [new file with mode: 0644]