From nobody Mon Apr 29 23:39:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631728339387903.8306673521546; Wed, 15 Sep 2021 10:52:19 -0700 (PDT) Received: from localhost ([::1]:40364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQZ50-0003WE-9g for importer@patchew.org; Wed, 15 Sep 2021 13:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQZ2o-00012M-Ai for qemu-devel@nongnu.org; Wed, 15 Sep 2021 13:50:02 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:42793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQZ2h-00037l-Fl for qemu-devel@nongnu.org; Wed, 15 Sep 2021 13:50:02 -0400 Received: by mail-pg1-x52f.google.com with SMTP id q68so3459942pga.9 for ; Wed, 15 Sep 2021 10:49:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g4sm311667pjt.56.2021.09.15.10.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 10:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=75RqB79QvpeJPK1TnV3ytIKNiMyyMPujvshHYxsAxvE=; b=mnSP83B5TSJ+mLg5oy7b+32S1DAKt08gQFhJyYmPPxHSAYUUlUzZ58K6zgQjiOACD7 DKJhAn2Ia9Jn/mr6z7A+C1EHo+Wn75m4rroX4feX8bjpZ+zkj6v39wr95uqGkVneOot8 BNEWVExd2cl/++bqCqSa2W8jFAXHTjzNSE87Txcd61QF8/4uq3iXkM6Dz0/ijANdN9Cz 4bqAQDuafLCYyTe/RnNbe2KD3UHaufi4qFlR2iondoLJZdGicOSxf19lzAC7tsxTBTA9 aHnAW+tWjU/hkYnis6DcZWdRHhxmyJ229+KX8EP3tvegr8btBj6MxPtd6JX5FNR3UM/8 0XeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=75RqB79QvpeJPK1TnV3ytIKNiMyyMPujvshHYxsAxvE=; b=PRK4CC59yiYyytWWELqmq8Ir0jUKfDYCbtiJAUPRptL4GxsdJUr/Urpdg6wnGBtLCN /6VO8eDRlYaoHJbIPdY7D74uBSmBlHV9n+aFsFv0Ze/iYrOGLTokGjDxAjW5vdQr1zP+ NtmtDxhi4IT38BAeH9YOWarY47wIXfNXdIvRuwxgMUp/H8r66Wmyw/zJ8U/8nWPZ+mRU HjQR80W6xVME7Pe6M0YBKQMwpkQOEcsxw7kIjtFp2OwN9EvtEHtOlqjeFUVlD8e/sh9O KYKuLvv9NMa1mTfAP/vbYt7x/ehFQvQTZrcEvtfvh1pb/AfjQLcw4cvljppec9RiyCbm ykbw== X-Gm-Message-State: AOAM531DeswzxVQd2eYd3ngcduWnSIuVL63Wnz+euT2XVwP2L2YennQx FpbCpvXOxUJd7AQFCqgDaqeZf9098i/wLw== X-Google-Smtp-Source: ABdhPJw1x1DW3ygvI1NfJQZP75Cg7C2yYSpGQlrQ/cpC+zefW0gw/yeLpoAcdMR7nIo1iDF+044hIQ== X-Received: by 2002:a65:404d:: with SMTP id h13mr943458pgp.130.1631728193850; Wed, 15 Sep 2021 10:49:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/2] linux-user/nios2: Properly emulate EXCP_TRAP Date: Wed, 15 Sep 2021 10:49:50 -0700 Message-Id: <20210915174951.1852266-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210915174951.1852266-1-richard.henderson@linaro.org> References: <20210915174951.1852266-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, crwulff@gmail.com, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631728340484100001 Content-Type: text/plain; charset="utf-8" The real kernel has to load the instruction and extract the imm5 field; for qemu, modify the translator to do this. The use of R_AT for this in cpu_loop was a bug. Handle the other trap numbers as per the kernel's trap_table. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 5 +++-- linux-user/nios2/cpu_loop.c | 35 ++++++++++++++++++----------------- target/nios2/translate.c | 17 ++++++++++++++++- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 2ab82fdc71..395e4d3281 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -158,9 +158,10 @@ struct Nios2CPUClass { struct CPUNios2State { uint32_t regs[NUM_CORE_REGS]; =20 -#if !defined(CONFIG_USER_ONLY) +#ifdef CONFIG_USER_ONLY + int trap_code; +#else Nios2MMU mmu; - uint32_t irq_pending; #endif }; diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 9869083fa1..d76bdb2891 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -37,9 +37,10 @@ void cpu_loop(CPUNios2State *env) case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; + case EXCP_TRAP: - if (env->regs[R_AT] =3D=3D 0) { - abi_long ret; + switch (env->trap_code) { + case 0: qemu_log_mask(CPU_LOG_INT, "\nSyscall\n"); =20 ret =3D do_syscall(env, env->regs[2], @@ -53,26 +54,26 @@ void cpu_loop(CPUNios2State *env) =20 env->regs[2] =3D abs(ret); /* Return value is 0..4096 */ - env->regs[7] =3D (ret > 0xfffffffffffff000ULL); - env->regs[CR_ESTATUS] =3D env->regs[CR_STATUS]; - env->regs[CR_STATUS] &=3D ~0x3; - env->regs[R_EA] =3D env->regs[R_PC] + 4; + env->regs[7] =3D ret > 0xfffff000u; env->regs[R_PC] +=3D 4; break; - } else { - qemu_log_mask(CPU_LOG_INT, "\nTrap\n"); =20 - env->regs[CR_ESTATUS] =3D env->regs[CR_STATUS]; - env->regs[CR_STATUS] &=3D ~0x3; - env->regs[R_EA] =3D env->regs[R_PC] + 4; - env->regs[R_PC] =3D cpu->exception_addr; - - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + case 1: + qemu_log_mask(CPU_LOG_INT, "\nTrap 1\n"); + force_sig_fault(TARGET_SIGUSR1, 0, env->regs[R_PC]); + break; + case 2: + qemu_log_mask(CPU_LOG_INT, "\nTrap 2\n"); + force_sig_fault(TARGET_SIGUSR2, 0, env->regs[R_PC]); + break; + default: + qemu_log_mask(CPU_LOG_INT, "\nTrap %d\n", env->trap_code); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLTRP, + env->regs[R_PC]); break; } + break; + case EXCP_DEBUG: info.si_signo =3D TARGET_SIGTRAP; info.si_errno =3D 0; diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 08d7ac5398..485b487665 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -636,6 +636,21 @@ static void divu(DisasContext *dc, uint32_t code, uint= 32_t flags) tcg_temp_free(t0); } =20 +static void trap(DisasContext *dc, uint32_t code, uint32_t flags) +{ +#ifdef CONFIG_USER_ONLY + /* + * The imm5 field is not stored anywhere on real hw; the kernel + * has to load the insn and extract the field. But we can make + * things easier for cpu_loop if we pop this into env->trap_code. + */ + R_TYPE(instr, code); + tcg_gen_st_i32(tcg_constant_i32(instr.imm5), cpu_env, + offsetof(CPUNios2State, trap_code)); +#endif + t_gen_helper_raise_exception(dc, EXCP_TRAP); +} + static const Nios2Instruction r_type_instructions[] =3D { INSTRUCTION_ILLEGAL(), INSTRUCTION(eret), /* eret */ @@ -682,7 +697,7 @@ static const Nios2Instruction r_type_instructions[] =3D= { INSTRUCTION_ILLEGAL(), INSTRUCTION_ILLEGAL(), INSTRUCTION_ILLEGAL(), - INSTRUCTION_FLG(gen_excp, EXCP_TRAP), /* trap */ + INSTRUCTION(trap), /* trap */ INSTRUCTION(wrctl), /* wrctl */ INSTRUCTION_ILLEGAL(), INSTRUCTION_FLG(gen_cmpxx, TCG_COND_LTU), /* cmpltu */ --=20 2.25.1 From nobody Mon Apr 29 23:39:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631728417583172.37439325416835; Wed, 15 Sep 2021 10:53:37 -0700 (PDT) Received: from localhost ([::1]:43026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQZ6G-0005Il-BG for importer@patchew.org; Wed, 15 Sep 2021 13:53:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQZ2j-0000uG-Fb for qemu-devel@nongnu.org; Wed, 15 Sep 2021 13:49:57 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:42795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQZ2h-00038f-Pd for qemu-devel@nongnu.org; Wed, 15 Sep 2021 13:49:57 -0400 Received: by mail-pg1-x531.google.com with SMTP id q68so3459966pga.9 for ; Wed, 15 Sep 2021 10:49:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g4sm311667pjt.56.2021.09.15.10.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 10:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mV2eu/Zav+aVRqycI4SiuColM6i5MZEh5iI5/KRQ2x0=; b=IT6WbsAItzILiqzNwuskc3kHAUDmVsx1ahoVDCIzZzeqqDaO9cbgCR5ZdE8M5rKNvO 6d0mYGef7bWjzwD9WTHj4frx9hhRUgMOQ1tYUFhH8aLVohecFsCKi+aeXe+cEz+fvuY/ AAIDRrP0PIKRdN4SXaDrW99WnU0D4FjjrdIeTp4pLuoHWUNCIw6ZYsAYulS/bXlPSQKM HCiXkLfFt3rmY9HfFyd5tBIDryhgfQ5A5K83Be3YpG5JL49tmG6H6+cnXs6jCVrPlMcS 7yI0GoLXS7WE/itE9onVCwGrA7XbXemwVBCICYkMjO7pC12L7r36kYrFp3n7f6mLtZoY A7CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mV2eu/Zav+aVRqycI4SiuColM6i5MZEh5iI5/KRQ2x0=; b=N9hG5dWuTsrrdARiMw7Gq5AFpU2yk7ASIK647Dr3EyCIC8mwXe4xfwKYdwHbNXugHJ nOfVfVklBxyWKRJjJWaavXDvvWPD4S+SFL0ibF3gM+2ElSzn1jWA6NejUMLIE2yvLOVb /3bcegWqxGqhaa2gPJArTSFRYKulUJ9C2GKCxHDmOyhMRGHLscu9MrvsSnKnU0dyWJ/X QHSutY+D5v+sD7nN09bfnyQjdO2tU50opqrCRQuwufOpOhcrYbUIxwpVcB+zcCjJg3h7 HT1HtagaBGLsgYBWRfg/LH+JKWoq6/sAvJOmy6ejoB+6pexKA6ebi5oJUJUVne7r8jQy sxqg== X-Gm-Message-State: AOAM533KQq4GM6WVuGT94JNblRubMJhNhw1gdaR1RfasXScbctg3Og3b UpzuAqBJUsqfphQOSDnD2J+Srpg2eG7n3w== X-Google-Smtp-Source: ABdhPJxiQya/J+rwXL4kSr7HEhylzNJ6tqHVIhgBc8X+9OwEB8/mCu3C0F7dmIYiQmgKRWL9BrYtsw== X-Received: by 2002:aa7:8426:0:b0:438:3550:f190 with SMTP id q6-20020aa78426000000b004383550f190mr1095691pfn.19.1631728194493; Wed, 15 Sep 2021 10:49:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/2] linux-user/nios2: Map a real kuser page Date: Wed, 15 Sep 2021 10:49:51 -0700 Message-Id: <20210915174951.1852266-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210915174951.1852266-1-richard.henderson@linaro.org> References: <20210915174951.1852266-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, crwulff@gmail.com, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631728418078100001 Content-Type: text/plain; charset="utf-8" The first word of page1 is data, so the whole thing can't be implemented with emulation of addresses. Hijack trap number 31 to implement cmpxchg. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 35 +++++++++++++++++++++++++ linux-user/nios2/cpu_loop.c | 52 ++++++++++++++++++++----------------- target/nios2/translate.c | 9 ------- 3 files changed, 63 insertions(+), 33 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 01e9a833fb..e78c0af183 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1091,6 +1091,41 @@ static void elf_core_copy_regs(target_elf_gregset_t = *regs, const CPUMBState *env =20 static void init_thread(struct target_pt_regs *regs, struct image_info *in= fop) { + static const uint8_t kuser_page[128] =3D { + /* __kuser_helper_version */ + [0x00] =3D 0x02, 0x00, 0x00, 0x00, + + /* __kuser_cmpxchg */ + [0x04] =3D 0xfa, 0x6f, 0x3b, 0x00, /* trap 31 */ + 0x3a, 0x28, 0x00, 0xf8, /* ret */ + + /* __kuser_sigtramp */ + [0x40] =3D 0xc4, 0x22, 0x80, 0x00, /* movi r2, __NR_rt_sigreturn = */ + 0x3a, 0x68, 0x3b, 0x00, /* trap 0 */ + }; + + abi_ulong pg; + uint8_t *ph; + + pg =3D target_mmap(TARGET_PAGE_SIZE, TARGET_PAGE_SIZE, + PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0); + + /* + * If the mmap doesn't give us exactly page 1, there's nothing + * we can do, and it's unlikely that the program will be able + * to continue. FIXME: Error out now? + */ + if (pg =3D=3D TARGET_PAGE_SIZE) { + ph =3D lock_user(VERIFY_WRITE, pg, sizeof(kuser_page), 0); + memcpy(ph, kuser_page, sizeof(kuser_page)); + unlock_user(ph, pg, sizeof(kuser_page)); + target_mprotect(TARGET_PAGE_SIZE, TARGET_PAGE_SIZE, + PROT_READ | PROT_EXEC); + } else { + target_munmap(pg, TARGET_PAGE_SIZE); + } + regs->ea =3D infop->entry; regs->sp =3D infop->start_stack; regs->estatus =3D 0x3; diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index d76bdb2891..fd3f853ac2 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -20,11 +20,11 @@ #include "qemu/osdep.h" #include "qemu.h" #include "cpu_loop-common.h" +#include "signal-common.h" =20 void cpu_loop(CPUNios2State *env) { CPUState *cs =3D env_cpu(env); - Nios2CPU *cpu =3D NIOS2_CPU(cs); target_siginfo_t info; int trapnr, ret; =20 @@ -71,6 +71,32 @@ void cpu_loop(CPUNios2State *env) force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLTRP, env->regs[R_PC]); break; + + case 31: /* QEMU specific, for __kuser_cmpxchg */ + { + abi_ptr g =3D env->regs[4]; + uint32_t *h, n, o; + + if (g & 0x3) { + force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, = g); + break; + } + ret =3D page_get_flags(g); + if (!(ret & PAGE_VALID)) { + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR= , g); + break; + } + if (!(ret & PAGE_READ) || !(ret & PAGE_WRITE)) { + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_ACCERR= , g); + break; + } + h =3D g2h(cs, g); + o =3D env->regs[5]; + n =3D env->regs[6]; + env->regs[2] =3D qatomic_cmpxchg(h, o, n) - o; + env->regs[R_PC] +=3D 4; + } + break; } break; =20 @@ -81,29 +107,7 @@ void cpu_loop(CPUNios2State *env) queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case 0xaa: - switch (env->regs[R_PC]) { - /*case 0x1000:*/ /* TODO:__kuser_helper_version */ - case 0x1004: /* __kuser_cmpxchg */ - start_exclusive(); - if (env->regs[4] & 0x3) { - goto kuser_fail; - } - ret =3D get_user_u32(env->regs[2], env->regs[4]); - if (ret) { - end_exclusive(); - goto kuser_fail; - } - env->regs[2] -=3D env->regs[5]; - if (env->regs[2] =3D=3D 0) { - put_user_u32(env->regs[6], env->regs[4]); - } - end_exclusive(); - env->regs[R_PC] =3D env->regs[R_RA]; - break; - /*case 0x1040:*/ /* TODO:__kuser_sigtramp */ - default: - ; -kuser_fail: + { info.si_signo =3D TARGET_SIGSEGV; info.si_errno =3D 0; /* TODO: check env->error_code */ diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 485b487665..77706dd805 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -795,15 +795,6 @@ static void nios2_tr_translate_insn(DisasContextBase *= dcbase, CPUState *cs) dc->base.pc_next =3D pc + 4; =20 /* Decode an instruction */ - -#if defined(CONFIG_USER_ONLY) - /* FIXME: Is this needed ? */ - if (pc >=3D 0x1000 && pc < 0x2000) { - t_gen_helper_raise_exception(dc, 0xaa); - return; - } -#endif - code =3D cpu_ldl_code(env, pc); op =3D get_opcode(code); =20 --=20 2.25.1