From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCb-0006IG-82 for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqHCZ-0007jy-Lo for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:28 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCZ-0007jn-Ey for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:27 -0400 Received: by mail-wm0-x241.google.com with SMTP id b184so6755090wma.3 for ; Sat, 01 Oct 2016 03:07:27 -0700 (PDT) From: Artyom Tarasenko Date: Sat, 1 Oct 2016 12:05:19 +0200 Message-Id: <1475316333-9776-16-git-send-email-atar4qemu@gmail.com> In-Reply-To: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> References: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> Subject: [Qemu-devel] [PATCH 15/29] target-sparc: allow priveleged ASIs in hyperprivileged mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Richard Henderson , Mark Cave-Ayland , Artyom Tarasenko Signed-off-by: Artyom Tarasenko --- target-sparc/ldst_helper.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 5fb9024..70febcb 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -1295,10 +1295,9 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr, asi &= 0xff; - if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) - || (cpu_has_hypervisor(env) - && asi >= 0x30 && asi < 0x80 - && !(env->hpstate & HS_PRIV))) { + if (((!cpu_hypervisor_mode(env)) && asi < 0x80) + && (((env->pstate & PS_PRIV) == 0) + || (cpu_has_hypervisor(env) && asi >= 0x30))) { helper_raise_exception(env, TT_PRIV_ACT); } @@ -1727,10 +1726,9 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, asi &= 0xff; - if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) - || (cpu_has_hypervisor(env) - && asi >= 0x30 && asi < 0x80 - && !(env->hpstate & HS_PRIV))) { + if (((!cpu_hypervisor_mode(env)) && asi < 0x80) + && (((env->pstate & PS_PRIV) == 0) + || (cpu_has_hypervisor(env) && asi >= 0x30))) { helper_raise_exception(env, TT_PRIV_ACT); } -- 2.7.2