From patchwork Sat Aug 3 18:47:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170508 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2351728ile; Sat, 3 Aug 2019 12:04:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcaeP041ywKUUZDGhuYpeXSDtn2uL5sm722jr2RRmhWpg3UAINVvpePDdQnBLhQMwxjbF6 X-Received: by 2002:a0c:bd1f:: with SMTP id m31mr103199952qvg.54.1564859066404; Sat, 03 Aug 2019 12:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564859066; cv=none; d=google.com; s=arc-20160816; b=VLlSrVegmxmxb7CnprJDi2rApSYQ8y/Glnt6yZOnb9xbyV6CM/ygZZ7Q/gkS61nvRb ucbHHSZcx5wopXodO5tNQI87Mkc+uHF3Yl+3iPsT2YfgH9yPA9Jz9dqNk1RBnPZHX+D+ PlPK61ht8qWhdJDgZNcikGjRlAwLskAoIet2wwUM8h8a8JGMfvuBbM3SWlgvCz/oya9B ZCpuuGi0RqHfwvQEBxb3/dO+EwqN5lWBOIcnaJ1attyvmjTPOL8blaUs1Y96gpvpK6LY kexozgc8nbnqBT7kccTPa2MJrj54yPWBpeq6xisAVWCXiGyXD3Qo3g8uRzrNb330nUBt HONw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=1OFhZYB7REGpAAmdzyA7otQ/hGEth32oUJ6nOIibRSY=; b=m+GwZxDAKlDa+D/daLOvNP27v6FxTTUe6JNNGY3hSuxPO3DYYpiyq6fmrKLH7KITF2 dH1U1tlsMTZsJZpJDSsjw4g1lnLQbGgrngz8Pl8Ji6FOVFIStCJNfchQchcMeccygPj1 /WsD84ylzhl1L29FCTrVYTWHXFwtFePAZKiDWTRjsmEi6m//6OKe5WsaeqQN+g0PrbwM PjUGQPCpKcXpC1A3DvtHNZVR4W0Eml9kuK2kwVV9PWzZA527WtQMYZUWQROnmUUqSDAc dhsrXwcW75VsIucFCZGIkRP7zu6ckuwXVNs/XEKCYFiv65sdVyJ7hxSSxMcfBGvz1MDD rnjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Q2KjR7sz; 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 u40si48969360qvg.25.2019.08.03.12.04.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Aug 2019 12:04:26 -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=Q2KjR7sz; 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]:41690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htzKM-0008C0-1R for patch@linaro.org; Sat, 03 Aug 2019 15:04:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33108) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htz5K-0007GI-LZ for qemu-devel@nongnu.org; Sat, 03 Aug 2019 14:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htz5J-0007WE-OA for qemu-devel@nongnu.org; Sat, 03 Aug 2019 14:48:54 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:42856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htz5J-0007QN-JI for qemu-devel@nongnu.org; Sat, 03 Aug 2019 14:48:53 -0400 Received: by mail-pf1-x441.google.com with SMTP id q10so37607491pff.9 for ; Sat, 03 Aug 2019 11:48:42 -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 :mime-version:content-transfer-encoding; bh=1OFhZYB7REGpAAmdzyA7otQ/hGEth32oUJ6nOIibRSY=; b=Q2KjR7szqQzFJBEH2NX0Shzd0whUpZj611QA5mIAYhzgpKlRBh5ODsGM5FpzlG4XYN E60p6k7knFLoG/3l6e6jb7NjxMSe0Uv8+wqgGre6LtOAO8f9GbaDAC+QVVD/ZN5iyITN lGdwQcy388XZhoO0jJnjvMrs8PgL8MKY8f2zAiABXU4jRRFArYBaW2DC9HbECCXS3boA MVFaJlKA0Jjiem7h2Fc2fVhhL4udB+lpnGcgR8fnzJZy8uhg7VgTozjHaTNGGsA68nb+ pNMQWGe5juX6arF/6MAQUZs+Ue9hikLMS6b4/+dUo5QLrj218JfX5gH9w7La9BbmqPbo yNEg== 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=1OFhZYB7REGpAAmdzyA7otQ/hGEth32oUJ6nOIibRSY=; b=PiA56Qe461Ikjgo524YDH1tBp04+AV3VRRgNXiGQvkN7Yi5N6SeyQ2fUje4QgvDXRt uOMj9niWmdtcyy9v0T489aBsjEo5HQPX2dR449GR97yt0MF05PbqyrUik0KVGxVGzKfw EYUAWR2YkTCMOCehSHN6Xu3+4G8pYyXIcuF9lY44tC7occMjSfKZiMLEgIHWvxlwVvCp d3WC4AYge3u5p99XoIGTsY0+BnOWnYlXALLD4aekRpkDBgKsIBNBXa5uJ4DjiAV57CKP 7vEOu+rl5I7gc/vEJqvr6XzjdsHmruap9M8bzXSkLLd4o1gVAGB8QjUwf4R9uAu/Yh6T eQBQ== X-Gm-Message-State: APjAAAVEJHwRwsdPHVwFIIpIEUcLirj1kS1kpm2LIXQQ+R0hIeeL88aM a8i7F+w43qWGAi77C507n73S396lM+4= X-Received: by 2002:a62:ac11:: with SMTP id v17mr65823645pfe.236.1564858121535; Sat, 03 Aug 2019 11:48:41 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id q69sm15405454pjb.0.2019.08.03.11.48.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 03 Aug 2019 11:48:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 3 Aug 2019 11:47:59 -0700 Message-Id: <20190803184800.8221-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190803184800.8221-1-richard.henderson@linaro.org> References: <20190803184800.8221-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::441 Subject: [Qemu-devel] [PATCH v3 33/34] target/arm: check TGE and E2H flags for EL0 pauth traps 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, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée According to ARM ARM we should only trap from EL0 when TCG or E2H are 0. Signed-off-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/pauth_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c index 42c9141bb7..9fa002068e 100644 --- a/target/arm/pauth_helper.c +++ b/target/arm/pauth_helper.c @@ -371,7 +371,9 @@ static void pauth_check_trap(CPUARMState *env, int el, uintptr_t ra) if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { uint64_t hcr = arm_hcr_el2_eff(env); bool trap = !(hcr & HCR_API); - /* FIXME: ARMv8.1-VHE: trap only applies to EL1&0 regime. */ + if (el < 1) { + trap &= !(hcr & HCR_TGE) | !(hcr & HCR_E2H); + } /* FIXME: ARMv8.3-NV: HCR_NV trap takes precedence for ERETA[AB]. */ if (trap) { pauth_trap(env, 2, ra);