From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1WVE-0006Mp-1S for qemu-devel@nongnu.org; Sat, 14 May 2016 06:08:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1WV8-0002j3-AV for qemu-devel@nongnu.org; Sat, 14 May 2016 06:08:55 -0400 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:32913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1WV7-0002iY-3l for qemu-devel@nongnu.org; Sat, 14 May 2016 06:08:50 -0400 Received: by mail-vk0-x233.google.com with SMTP id z184so10875874vkg.0 for ; Sat, 14 May 2016 03:08:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1463202423-19943-1-git-send-email-tsunghan.tw@gmail.com> References: <1463202423-19943-1-git-send-email-tsunghan.tw@gmail.com> From: Peter Maydell Date: Sat, 14 May 2016 11:08:28 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] target-arm/helper.c: fix access rights of SP_ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tsung-Han Lin Cc: qemu-arm , QEMU Developers On 14 May 2016 at 06:07, Tsung-Han Lin wrote: > Fix the access rights of SP_EL2 and SP_EL1, which should be able to be > accessed from EL2 and EL1 respectively. > > Signed-off-by: Tsung-Han Lin > --- > target-arm/helper.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index a2ab701ca5c2..8d4b03b5141b 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -3326,7 +3326,7 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { > .fieldoffset = offsetof(CPUARMState, sp_el[0]) }, > { .name = "SP_EL1", .state = ARM_CP_STATE_AA64, > .opc0 = 3, .opc1 = 4, .crn = 4, .crm = 1, .opc2 = 0, > - .access = PL2_RW, .type = ARM_CP_ALIAS, > + .access = PL1_RW, .type = ARM_CP_ALIAS, > .fieldoffset = offsetof(CPUARMState, sp_el[1]) }, > { .name = "SPSel", .state = ARM_CP_STATE_AA64, > .opc0 = 3, .opc1 = 0, .crn = 4, .crm = 2, .opc2 = 0, > @@ -3526,7 +3526,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { > .resetvalue = 0 }, > { .name = "SP_EL2", .state = ARM_CP_STATE_AA64, > .opc0 = 3, .opc1 = 6, .crn = 4, .crm = 1, .opc2 = 0, > - .access = PL3_RW, .type = ARM_CP_ALIAS, > + .access = PL2_RW, .type = ARM_CP_ALIAS, > .fieldoffset = offsetof(CPUARMState, sp_el[2]) }, > { .name = "CPTR_EL2", .state = ARM_CP_STATE_BOTH, > .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 2, The ARM ARM defines that SP_EL1 is accessible only from EL2 or higher via the system-register instructions, and SP_EL2 only from EL3 or higher (see table C5-7 on page C5-288 of the v8 ARM ARM DDI0487A.h, or the register description pages for the two registers). Why do you think this is a correct change? thanks -- PMM