From patchwork Sat Oct 1 10:05:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9359169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 045E5600C8 for ; Sat, 1 Oct 2016 10:33:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF51A29948 for ; Sat, 1 Oct 2016 10:33:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0F7D29967; Sat, 1 Oct 2016 10:33:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 800CF29948 for ; Sat, 1 Oct 2016 10:33:31 +0000 (UTC) Received: from localhost ([::1]:55054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHbm-00039P-7Y for patchwork-qemu-devel@patchwork.kernel.org; Sat, 01 Oct 2016 06:33:30 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A+rB7qAUGBVhUulKGzie9XjIUV5flu9QmVkr6B/yFwI=; b=uNHvYbE5xRWFXmNve4RtVx9/PU21s4URapqaaHbozG8+Htpuk4h8wwsQ/BYCeaoYIa 8wZT44W0bVDBcOgcQh0AgBNo238AUfzi3sOunoISQyLhoOS6bmQFIH6tF4EK68RzzU0H q3hFUq5sWjno3zlHlf6LivWY88A35/YofOT/9JyEvw/27V/5FLCYZsFJKRTnyf8rZPol 3wAfamQCv8hX2NmENtbdt897iGUpZ4DxZ16qDf3VE1JeSNq0TTSjB/7TiKroSLTq03Bc kYTdyPIkzvXx+U6dZhRgLI2lJWwG5WUp+XbQp3cx6Eol9Ztf4Ni53hcfeVqcaJlqZJnP +LDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A+rB7qAUGBVhUulKGzie9XjIUV5flu9QmVkr6B/yFwI=; b=YRlVXFgGgCKAYdRm2ABK4Cv3uaXvMv1/f5EH9iwYcoVQGUIsae+BTgo5zp90RA0k71 EyC7sIt0+5Sm1YojDEbKnUTYdAd9t3lqdOFALM/otu4Azv6rGk2Cu1Y9N/ejHrLGMj+r ATcNaTuc8URZCm9toA6vgQK5DGc1+r422R5bkczxQMVoNDbhyksvg+hxPJOCLnksqLrV iCLMny1wkiWX9/RZ5H1fKacDzGMEgmJ+phMFLNBLqAG4aJpqQMqq3qOs2N6cuZuz+InC yFmHRFWkxL1e//Pf6dRykjC4agWqr8zinHvQpd3aHuWZITQhBmg5bZ5HeiIz7I9iKa64 iyBg== X-Gm-Message-State: AA6/9Rk/a+e5IZeErCvTW+9ykbOUlv0yleT3NNtHC4fj16d5AaCEn4riHOJqtQz301454g== X-Received: by 10.28.24.14 with SMTP id 14mr1507918wmy.107.1475316446899; Sat, 01 Oct 2016 03:07:26 -0700 (PDT) Received: from localhost (x55b4da19.dyn.telefonica.de. [85.180.218.25]) by smtp.gmail.com with ESMTPSA id j198sm8470177wmg.4.2016.10.01.03.07.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Oct 2016 03:07:26 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Sat, 1 Oct 2016 12:05:19 +0200 Message-Id: <1475316333-9776-16-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> References: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 15/29] target-sparc: allow priveleged ASIs in hyperprivileged mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }