From patchwork Mon Jun 30 23:09:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 365815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4744F140096 for ; Tue, 1 Jul 2014 09:20:10 +1000 (EST) Received: from localhost ([::1]:37129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kro-0007GD-CJ for incoming@patchwork.ozlabs.org; Mon, 30 Jun 2014 19:20:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kjE-0006MH-D3 for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1kj8-0003b4-Mn for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:16 -0400 Received: from mail-oa0-f44.google.com ([209.85.219.44]:49799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kj8-0003ao-Ig for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:10 -0400 Received: by mail-oa0-f44.google.com with SMTP id i7so9750021oag.31 for ; Mon, 30 Jun 2014 16:11:10 -0700 (PDT) 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=TO0ZnyXH5oYxpkEVnLVB/gr2O8qfd3pgmeoXavTVh00=; b=C5MuU3cp75YntJYolFAzq7nkM8FQ2A7H+Bpw9YFVnNfx0+v3H6cJxRT9U1Ihe1s84M zXIfMTVF6cuojwQ/MF0HFRabhVX9gK+yuoazwBUUGcAsmOaPX1wgy2LOAl5PZzI7e91N +BycpLEvNOTageEYrcbEdmm0ACDLTm3GBA8q5rC6MmwJlQ+eQOu8w6aHjrU3h1HBePq4 v6CFz4cJ0RGxxOoGdSJkBQyHvDFG7vjUKk0ywMYqUWtpHC2PjqM4qMGofA/F5qR+LJy4 p8v/glUJs7dfyvSgT/UcfZuOK470AV9yAMHQ+pvTl7HzJxP45bbSbvSF2qnMnUq7Vfa/ 0pUA== X-Gm-Message-State: ALoCoQnDvhqhvLUkBHaespWpJ44tIaIDX+zVTCFYOk2KlmXosF6N1lXdauR8J9G8AZaOAJJx7hdu X-Received: by 10.60.46.229 with SMTP id y5mr46636934oem.7.1404169870208; Mon, 30 Jun 2014 16:11:10 -0700 (PDT) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id cu7sm76370192oec.12.2014.06.30.16.11.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:11:09 -0700 (PDT) From: greg.bellows@linaro.org To: qemu-devel@nongnu.org Date: Mon, 30 Jun 2014 18:09:22 -0500 Message-Id: <1404169773-20264-23-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404169773-20264-1-git-send-email-greg.bellows@linaro.org> References: <1404169773-20264-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.219.44 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, Fabian Aggeler , Greg Bellows , serge.fdrv@gmail.com, edgar.iglesias@gmail.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH v4 22/33] target-arm: make CSSELR banked X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Fabian Aggeler Rename CSSELR (cache size selection register) and add secure instance (Aarch32). Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows --- target-arm/cpu.h | 10 +++++++++- target-arm/helper.c | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 1fcccc8..bc8291a 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -177,7 +177,15 @@ typedef struct CPUARMState { /* System control coprocessor (cp15) */ struct { uint32_t c0_cpuid; - uint64_t c0_cssel; /* Cache size selection. */ + union { /* Cache size selection */ + struct { + uint64_t csselr_ns; + uint64_t csselr_s; + }; + struct { + uint64_t csselr_el1; + }; + }; union { /* System control register. */ struct { uint64_t sctlr_ns; diff --git a/target-arm/helper.c b/target-arm/helper.c index 3b663f1..4a3b463 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -700,7 +700,7 @@ static void vbar_write(CPUARMState *env, const ARMCPRegInfo *ri, static uint64_t ccsidr_read(CPUARMState *env, const ARMCPRegInfo *ri) { ARMCPU *cpu = arm_env_get_cpu(env); - return cpu->ccsidr[env->cp15.c0_cssel]; + return cpu->ccsidr[A32_BANKED_REG_GET(env, csselr)]; } static void csselr_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -808,10 +808,11 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { { .name = "CCSIDR", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .crn = 0, .crm = 0, .opc1 = 1, .opc2 = 0, .access = PL1_R, .readfn = ccsidr_read, .type = ARM_CP_NO_MIGRATE }, - { .name = "CSSELR", .state = ARM_CP_STATE_BOTH, + { .name = "CSSELR_EL1", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .crn = 0, .crm = 0, .opc1 = 2, .opc2 = 0, - .access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.c0_cssel), - .writefn = csselr_write, .resetvalue = 0 }, + .access = PL1_RW, .writefn = csselr_write, .resetvalue = 0, + .bank_fieldoffsets = { offsetof(CPUARMState, cp15.csselr_s), + offsetof(CPUARMState, cp15.csselr_el1) } }, /* Auxiliary ID register: this actually has an IMPDEF value but for now * just RAZ for all cores: */