Received: from eggs.gnu.org ([2001:4830:134:3::10]:52545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btiKJ-00005p-35 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 17:41:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btiKF-0007t8-Uu for qemu-devel@nongnu.org; Mon, 10 Oct 2016 17:41:39 -0400 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]:33683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btiKF-0007sS-NZ for qemu-devel@nongnu.org; Mon, 10 Oct 2016 17:41:35 -0400 Received: by mail-pa0-x243.google.com with SMTP id hh10so175837pac.0 for ; Mon, 10 Oct 2016 14:41:35 -0700 (PDT) Sender: Richard Henderson References: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> <1475316333-9776-10-git-send-email-atar4qemu@gmail.com> From: Richard Henderson Message-ID: <49b68272-fb91-ed4d-b06b-2b6312f6a5db@twiddle.net> Date: Mon, 10 Oct 2016 16:41:32 -0500 MIME-Version: 1.0 In-Reply-To: <1475316333-9776-10-git-send-email-atar4qemu@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/29] target-sparc: hypervisor mode takes over nucleus mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko , qemu-devel@nongnu.org Cc: Mark Cave-Ayland On 10/01/2016 05:05 AM, Artyom Tarasenko wrote: > Signed-off-by: Artyom Tarasenko > --- > target-sparc/cpu.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h > index 0b5c79f..fbeb8d7 100644 > --- a/target-sparc/cpu.h > +++ b/target-sparc/cpu.h > @@ -699,10 +699,10 @@ static inline int cpu_mmu_index(CPUSPARCState *env1, bool ifetch) > #elif !defined(TARGET_SPARC64) > return env1->psrs; > #else > - if (env1->tl > 0) { > - return MMU_NUCLEUS_IDX; > - } else if (cpu_hypervisor_mode(env1)) { > + if (cpu_hypervisor_mode(env1)) { > return MMU_HYPV_IDX; > + } else if (env1->tl > 0) { > + return MMU_NUCLEUS_IDX; > } else if (cpu_supervisor_mode(env1)) { > return MMU_KERNEL_IDX; > } else { > While playing with your patch set, I discovered that we also need a patch to get_asi for ASI_N et al to retain MMU_HYPV_IDX, and not decrease privilege. This happens *very* early in the prom boot, with the first casx (when casx is implemented inline). r~