From patchwork Fri Jul 19 21:03:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 169279 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4326180ilk; Fri, 19 Jul 2019 14:07:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbXp9wiWPT6wQP+JbvvAi//kbPeby8wbBK9zyXNUVWlki0wE3APqI+VSxU54eENVJKseuJ X-Received: by 2002:a17:906:1911:: with SMTP id a17mr42764236eje.290.1563570420859; Fri, 19 Jul 2019 14:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563570420; cv=none; d=google.com; s=arc-20160816; b=DRxdZMDJAZnSXa/wqRqEFimY0vmlC3r9GBsMAfD20m3gHgpIP97s6sZ1XItgtafGg/ bHb2h+02g6YfbZri3eL8MYSlmOS7ppgsPAK7JCOdCY0nWQzHNHaDgLOFT8/IrM7uGep7 4Xe9EtPn9m2wpRKuzsmUcpAzbC6GtZrA4bLKITIu4mARHS3FjGryLgyLx2by3sao5lgf dQsEkUSPJ5GmQOOsNPNj0JB3CNyNB9RHT2OZ8QlrRBpxRetpSBGBrmiYfKArFNwyYieg epiB4ET/i1ay2pgCNcTMTA/8zzcdQmuWIyTRguVKzQPUTxY3TlGP6MmBMYZsvvUeRY8T D3+A== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=OcsEJOTB78UGcdvycEnpdFbtKzZSWFgFYymdrWCmqJI=; b=yt8tS+NZjriuWRaYObWIwSD8FqaCCasKukjCh09Pz9i9UCBYEmeGwRZ9LBFqKuYiQW W2gxGjiV7m2eVRtrGT6scXHgJuyT3YawJyzUYuBZpqJ0z2st1GA+wftrFn2YTI2ymbHo aYnLhq7sfkVSvclQMuugunQIA2wmorhQlQ8gg1/Q3BjRL8uXNLZX9GVMLFlLLHtR/ero nhtrmZU5asYMZB0rsyPTkugX85DV5MY5Q8AUpDCFGKOejJY0HLevOxHduyRz5QmM0qt0 6fR1aDbYsv/k6RXKhlcZjNVqo5rqtfVx3r/HGvcDSdP+N5pMiqA2Pa/iOq/ShoogWH88 tw4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HSYCYLmd; 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 i13si309387eja.216.2019.07.19.14.07.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jul 2019 14:07:00 -0700 (PDT) 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=HSYCYLmd; 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]:48272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoa5i-0007Rz-ID for patch@linaro.org; Fri, 19 Jul 2019 17:06:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55179) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoa3Y-00084E-Ri for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hoa3V-0005XY-Ig for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:43 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:41756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hoa3T-00058S-AG for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:41 -0400 Received: by mail-pl1-x642.google.com with SMTP id m9so16102967pls.8 for ; Fri, 19 Jul 2019 14:03:40 -0700 (PDT) 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; bh=OcsEJOTB78UGcdvycEnpdFbtKzZSWFgFYymdrWCmqJI=; b=HSYCYLmdDzbD3ZUpLDiHLF66nlPHVr/TiC8xuH1MpvktCb6nbDOlXaOj1lyWC3jR+7 GcguiHBi22gG+FfxpGhqrxDm4v1g8DjSH6UQPODbM0SRIXKnPSgOrGRguwL8seX+UiO9 AEFI8hA018qRB4hYFu76NrWopd8PI+Rbl77WL88jL3nNw03nzHqAjszUMO57RVW3Al+H mQzWSTnYFBPG8NfTz0Kut+fBXuWvjiZr8QToveTsVvV5kL5AuL6ppoDPCR3yF01YGXZf QbVOPAhfLrUroSu+czU0jsy1jgJ9FMDp9n9yPNE/dRC89iWnjw78nwNdD8QB5z0+cnvO vkyQ== 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; bh=OcsEJOTB78UGcdvycEnpdFbtKzZSWFgFYymdrWCmqJI=; b=YDqwtinEOBC+k24mfuVyY0v3kl+yqWd2Wss5HJ2jK529ys6iDueEIAnoPKyPdlFD3+ XPHcjAAhzTyLaNQAZancLhPKWEoiKwXg87hApmnhdyb60YP+rWmLceNfgkpBn7lkTwEo PHZQd+7se3YQTQh480StgMTp38w3EcWSJRN/3NaiAAV6CHQcNnnivP9tgU7tAH8I4cnp ZSMvnPp2sdiiits0daSQUBBL/7gXpvXCw7anTj2NzbzYjcK0shqRdQLAzomdoxxOC3ki YG7S/KvzTltRJBmAk87ifT4kDY4LvLS+yz4XCGoLyIQu+SGM2bHMBjEmLF2cXaWzQbr5 4afQ== X-Gm-Message-State: APjAAAVXsXCevRXOgzmiqgJ5v7yveSPsWO1ftw/6woKFxULrNzXfw108 6k0cR+5k4g2nDE5M6SJdqk5fKLcs4Is= X-Received: by 2002:a17:902:a417:: with SMTP id p23mr58208281plq.136.1563570219317; Fri, 19 Jul 2019 14:03:39 -0700 (PDT) Received: from localhost.localdomain (97-126-117-207.tukw.qwest.net. [97.126.117.207]) by smtp.gmail.com with ESMTPSA id i6sm32724751pgi.40.2019.07.19.14.03.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 14:03:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 19 Jul 2019 14:03:11 -0700 Message-Id: <20190719210326.15466-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190719210326.15466-1-richard.henderson@linaro.org> References: <20190719210326.15466-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH for-4.2 09/24] target/arm: Add TTBR1_EL2 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, beata.michalska@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. Signed-off-by: Richard Henderson --- target/arm/helper.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée diff --git a/target/arm/helper.c b/target/arm/helper.c index d1bf31ab74..da2e0627b2 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3449,6 +3449,15 @@ static void vmsa_ttbr_el1_write(CPUARMState *env, const ARMCPRegInfo *ri, } } +static void vmsa_tcr_ttbr_el2_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + raw_write(env, ri, value); + if (arm_hcr_el2_eff(env) & HCR_E2H) { + /* The ASID field is active. */ + } +} + static void vttbr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4844,10 +4853,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, @@ -4881,7 +4888,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, @@ -6807,6 +6814,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);