From patchwork Fri Jul 19 21:03:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 169275 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4325035ilk; Fri, 19 Jul 2019 14:05:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5KneZoiTi5FCcSERMYxc0uftK0sU1NrlQ29gXjIC3LyN+JAt41xKKbD8aYFTVw7/RJ92W X-Received: by 2002:a50:aa14:: with SMTP id o20mr48782364edc.165.1563570346869; Fri, 19 Jul 2019 14:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563570346; cv=none; d=google.com; s=arc-20160816; b=vAxw4WtoJjTLNAifgwcVPPGcOhNTwKFARWhOcCcnIirfVTLRxLo2BK7Uljztk/Svp3 vraA/zyITfu74gufOg03FtcP05qOXDA1Ta3ryH+j00CcY3Hah/qNKaA6Kp3St+N4Bgsw hJ+OMcnaSdCugRUtBLs0tauU5BSrh43L0RV8Z8UPQFgox3WZQBzw2qLDkdwnzwxTW7dk HpBHkkSuF1tVaFDcMI2mqeHJNqjwSxnvVmsgIjF6q56khjpdL3aO3mrK1J5RS9bHLDE8 MewXeKRi8w7xGlV8GWSOOcginEt44pVx16uE8mtrDrj8e/p8WXCE51XARFVI93Y3ukvR oHsQ== 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=q16Z6V/byGstcVAnFkbLcB6CkWJAuthTp/eBqCA8iHY=; b=xfF9WvdniFZyoV1xy2YwoOpX4h49kae9ibK4d2qy1k3qtpmwZ/I43ITI2QpeRoGg3Z BfDZODkKG5uziRkSP5kTmLOQKhoYMGC96yUYittU38QUIiRazYpEW0M0odXfrMYkk+jw aMT1aViG4ktVqG1usdP6XZ4ZgilsJ4Tf5bl7GEZiJHXmP+eK0oGGwW7dkDm1rwxTjsKx 4gV70RMPDzIHVZ9p68L2PXR4mjJxSNHrJOv8iUIaM6V9IyAyenPxwsFl7vzTz6WoK40c fPxon0dAMP/UjviGOXfpDJPYXB88ka6RRsgBURoRWrTNqzI46r593XN9cMhoQRaktq8X QEuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VGr5Jh50; 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 m14si568962edc.388.2019.07.19.14.05.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jul 2019 14:05:46 -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=VGr5Jh50; 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]:48202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoa4W-0003Ur-TV for patch@linaro.org; Fri, 19 Jul 2019 17:05:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55272) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoa3d-0008Nz-Nx for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hoa3b-0005bZ-Lz for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:48 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:37501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hoa3a-00057i-3H for qemu-devel@nongnu.org; Fri, 19 Jul 2019 17:04:46 -0400 Received: by mail-pg1-x542.google.com with SMTP id i70so4229534pgd.4 for ; Fri, 19 Jul 2019 14:03:37 -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=q16Z6V/byGstcVAnFkbLcB6CkWJAuthTp/eBqCA8iHY=; b=VGr5Jh50vwbOQDkr3N0O4cPMhzm/QTZ4jFE870g+zk3A+oEfZ2q4Y+7XdOM5Ypn2oy vyqJbk9wOPswHQSsWDG1c5x3uLoWzwJzCwf7e32FKINj6qhN7g31sy3LpbA3vqRa2D9x fYXEhTlSNmdkvKi3QRdB+5vygWE7NkqWxac/OrxR3hBE0qKQP0+YCrgYC3pLcEkV9zHj CqUgpolLc/J3Jb5koy1oKf+aiLTNm4IvlbQe8+tFLIXJe6g0ftiGgLXopVgDGuF2UVsg TcJWwQMCmzrwpD/p8NB7eE7pGfAvOWrXYBwzY6fl13DAcWIBhnPbAA0N/UE99FRyzFti tk+A== 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=q16Z6V/byGstcVAnFkbLcB6CkWJAuthTp/eBqCA8iHY=; b=gVXaug8jJmUZ/QfWgM31HzZHaobrFTcufZTUGMdMAo6ge42eZYBiEm5xDzdZzyMPuM VlYOH28ESV5WVbrj0hJKVXmHR9W7x4LvORil9BwfN4kPFQ+2brvMhQSyrur+d71rNw+V 2J/CFw6Ndl6rcyOptHI4+wTzQSqEIu2VJZY1o8TEogplXw089fnJ7k7qOIarw57yNzLJ 9rZvQfqXzzb5oa/9TZ0zo/dFvT36KOhtsIm17FdoPKFgJRbfo1My46Wg9dWp5ihlZUHG sArIje5vmUyXXWI0OjxsBDodPPKrkVS2/NIaB4S7EdbJ+i/P5ttTZCPTsiZ2mEs6VjJ8 S3PQ== X-Gm-Message-State: APjAAAXxF/yPlAsHvXL00S1d9Fl00o14leGyDBSMWcrldheBvsX2bmjv bqPcqplTFrI+NuOu+THrFMLzkTagrYc= X-Received: by 2002:a65:60cd:: with SMTP id r13mr29218513pgv.315.1563570216818; Fri, 19 Jul 2019 14:03:36 -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.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 14:03:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 19 Jul 2019 14:03:09 -0700 Message-Id: <20190719210326.15466-8-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::542 Subject: [Qemu-devel] [PATCH for-4.2 07/24] target/arm: Enable HCR_E2H for VHE 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" Signed-off-by: Richard Henderson --- target/arm/cpu.h | 7 ------- target/arm/helper.c | 6 +++++- 2 files changed, 5 insertions(+), 8 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée diff --git a/target/arm/cpu.h b/target/arm/cpu.h index e6a76d14c6..e37008a4f7 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1366,13 +1366,6 @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask) #define HCR_ATA (1ULL << 56) #define HCR_DCT (1ULL << 57) -/* - * When we actually implement ARMv8.1-VHE we should add HCR_E2H to - * HCR_MASK and then clear it again if the feature bit is not set in - * hcr_write(). - */ -#define HCR_MASK ((1ULL << 34) - 1) - #define SCR_NS (1U << 0) #define SCR_IRQ (1U << 1) #define SCR_FIQ (1U << 2) diff --git a/target/arm/helper.c b/target/arm/helper.c index 3a9f35bf4b..0a55096770 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4623,7 +4623,8 @@ static const ARMCPRegInfo el3_no_el2_v8_cp_reginfo[] = { static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { ARMCPU *cpu = env_archcpu(env); - uint64_t valid_mask = HCR_MASK; + /* Begin with bits defined in base ARMv8.0. */ + uint64_t valid_mask = MAKE_64BIT_MASK(0, 34); if (arm_feature(env, ARM_FEATURE_EL3)) { valid_mask &= ~HCR_HCD; @@ -4637,6 +4638,9 @@ static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) */ valid_mask &= ~HCR_TSC; } + if (cpu_isar_feature(aa64_vh, cpu)) { + valid_mask |= HCR_E2H; + } if (cpu_isar_feature(aa64_lor, cpu)) { valid_mask |= HCR_TLOR; }