From patchwork Tue Dec 3 02:29:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 180662 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp939510ile; Mon, 2 Dec 2019 18:36:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwpuPhvVzcyFWvpg4I9h7RQAiTVvx/MxHGIxmX7/Mr6hXeAFWx3hjdqqa5W5zZ2kqcacZhj X-Received: by 2002:a17:906:cd0a:: with SMTP id oz10mr3452192ejb.210.1575340613150; Mon, 02 Dec 2019 18:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575340613; cv=none; d=google.com; s=arc-20160816; b=UiO3CFt1JkaG6B+yRG8sBq+DnuinZ0AaBaXc65LZMmKIhgtdzcpLa3fVHGYZ8swHRi s41mIU/GQXIgRGhB3bn5NceyS5TkqW9UY435hR/3eUeo+2xV1lZY38okNnxn7HGrxeQw cIu52T1h+XOVwXKsfwtZPBPuiW/Ehk9fjPngAiP8qe0vuewK7mHGzLQqdfcNcbJQOAb8 am7RTMrAYWNgQ9+OcYMV0eOQTV32Lp3gJptICk1+j5HF0AL8Jc/REiTijmABOsJB8sCY o+zWaMcC/ArDjCsHAzwDciN5SEbhQwJxmr5zv7PjWzqNpA3Izcebze8zbNZtXyRHIeF+ vGtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=g10Bq1OMZeg/ZBhQAkp+7YToyhofBnM8pkI8wVPAgyc=; b=VEFZm5Zsb/Xgtay4W97lK1gZrvdRMTM8R0YTgpKmArdWih0shXu31QUj4Mn0hX6BPs YiEHiE2SP+OHNTlKbOHaor8ZUi1L6ZFKVSnnH2AmaF+5MEFOIM2u8AFzhVullNy6i6nF cN/EZ+B4xWUBbyavq33B14S8/tkgnfJt+5JHvdSQbxYQG7KZmDOHZLZnl1kZ+dROkR7k TzNqyv04YEbqOwzBRcuAHMdLwBHWPaLVarRdrNqTLF7vBTMvjO3Fit9Pn7lweJr8V38o 7VbSm7kbSCNtSUl4WZszYz32PKU5qdPsWe3P947cPFYxUngrwMebEXsKjfMaDWj6MFfb /jZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=evxaY1QU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z5si1175460edx.33.2019.12.02.18.36.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Dec 2019 18:36:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=evxaY1QU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iby3X-0002BV-IZ for patch@linaro.org; Mon, 02 Dec 2019 21:36:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59457) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibxwh-00031M-C9 for qemu-devel@nongnu.org; Mon, 02 Dec 2019 21:29:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibxwf-00080c-TO for qemu-devel@nongnu.org; Mon, 02 Dec 2019 21:29:46 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:43923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibxwf-0007zY-O3 for qemu-devel@nongnu.org; Mon, 02 Dec 2019 21:29:45 -0500 Received: by mail-pl1-x642.google.com with SMTP id q16so995479plr.10 for ; Mon, 02 Dec 2019 18:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g10Bq1OMZeg/ZBhQAkp+7YToyhofBnM8pkI8wVPAgyc=; b=evxaY1QU7cax/t6xE2PUpr+13+A251LZLRN3oAz75ntZuNfYGfS/eO5AUq4KF2KY5g DzLsiFAwfOz5m2V1uTm/ybHgR+ndnQfa4DoMyD9DM6SGWhMSu9cKENC0GKty7mnQYAYt VHklVwlgODSrS2nVTxxNv3SmHaHeXk9c7HZHltFrGT6dBXTEOjS20Um7ZOw+0xH/Fb59 c724Twcse0A+Vd9PUBEM7TPGp0I+9ygwppyZCoezMUoYc7NWWqdSs4AX99b0ZwXrKSLF 8AF0FxNvUbX+IYCI7FY8A5GqulKzcCB7493i+l9n+1Lhngxv4Ve+P+yPpmjNUzba6YEA za5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g10Bq1OMZeg/ZBhQAkp+7YToyhofBnM8pkI8wVPAgyc=; b=FDy0DpOaKWxMDszjMWEqi7u3/bc0dHij2QTlJ9UFeCgEW9tpCvofpiyyMip8XZepGv 5v5XPrVB7Qb6kg3VVvWkemyB7578fPpYEaxGUEsBfP14tR5CXQ4gxHCmYW2bClwiyMOd pkSMIcqWP6mTlYImptl5IkiSwmMPkefuLSe2Xut+iYbRDs7u/3vA9C/R6GX42l7lRVZm EY2YBJVBbSDXDNn03rrPNSfzaYtDVS1HCKRJoQyE87h9kkyQ01AQAXxzyHwzqfsNaP+G NFRPDaDlWxTeqSrQ4+zHa5mRHOjKu+nKAgu1GO7rt1Xth6v5gPfEc6UtiT/fo6Zl8llk bFhw== X-Gm-Message-State: APjAAAUH6ex20yjRUlCpq+gvCe3f2kUNnnlyPjHlnCJT2SuLnctjly7S YIg3VnJRiofKBdRkYm/4vIt4FaCu4C0= X-Received: by 2002:a17:902:ac8b:: with SMTP id h11mr2668987plr.87.1575340184343; Mon, 02 Dec 2019 18:29:44 -0800 (PST) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id q22sm873695pfg.170.2019.12.02.18.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 18:29:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 04/40] target/arm: Add TTBR1_EL2 Date: Mon, 2 Dec 2019 18:29:01 -0800 Message-Id: <20191203022937.1474-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191203022937.1474-1-richard.henderson@linaro.org> References: <20191203022937.1474-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At the same time, add writefn to TTBR0_EL2 and TCR_EL2. A later patch will update any ASID therein. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/helper.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index b4d774632d..06ec4641f3 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3484,6 +3484,12 @@ static void vmsa_ttbr_write(CPUARMState *env, const ARMCPRegInfo *ri, raw_write(env, ri, value); } +static void vmsa_tcr_ttbr_el2_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + raw_write(env, ri, value); +} + static void vttbr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4893,10 +4899,8 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { .resetvalue = 0 }, { .name = "TCR_EL2", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 4, .crn = 2, .crm = 0, .opc2 = 2, - .access = PL2_RW, - /* no .writefn needed as this can't cause an ASID change; - * no .raw_writefn or .resetfn needed as we never use mask/base_mask - */ + .access = PL2_RW, .writefn = vmsa_tcr_ttbr_el2_write, + /* no .raw_writefn or .resetfn needed as we never use mask/base_mask */ .fieldoffset = offsetof(CPUARMState, cp15.tcr_el[2]) }, { .name = "VTCR", .state = ARM_CP_STATE_AA32, .cp = 15, .opc1 = 4, .crn = 2, .crm = 1, .opc2 = 2, @@ -4930,7 +4934,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { .fieldoffset = offsetof(CPUARMState, cp15.tpidr_el[2]) }, { .name = "TTBR0_EL2", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 4, .crn = 2, .crm = 0, .opc2 = 0, - .access = PL2_RW, .resetvalue = 0, + .access = PL2_RW, .resetvalue = 0, .writefn = vmsa_tcr_ttbr_el2_write, .fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el[2]) }, { .name = "HTTBR", .cp = 15, .opc1 = 4, .crm = 2, .access = PL2_RW, .type = ARM_CP_64BIT | ARM_CP_ALIAS, @@ -6959,6 +6963,10 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 4, .crn = 13, .crm = 0, .opc2 = 1, .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, cp15.contextidr_el[2]) }, + { .name = "TTBR1_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .crn = 2, .crm = 0, .opc2 = 1, + .access = PL2_RW, .writefn = vmsa_tcr_ttbr_el2_write, + .fieldoffset = offsetof(CPUARMState, cp15.ttbr1_el[2]) }, REGINFO_SENTINEL }; define_arm_cp_regs(cpu, vhe_reginfo);