From nobody Fri Nov 7 02:09:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544765200129421.4221756848119; Thu, 13 Dec 2018 21:26:40 -0800 (PST) Received: from localhost ([::1]:59440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXfzc-0005op-U5 for importer@patchew.org; Fri, 14 Dec 2018 00:26:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXfxW-0004On-Bx for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXfxR-0005Jj-GQ for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:21 -0500 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:46940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXfxP-0005Iy-K2 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:15 -0500 Received: by mail-oi1-x242.google.com with SMTP id x202so3606881oif.13 for ; Thu, 13 Dec 2018 21:24:15 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id r1sm1845379oti.44.2018.12.13.21.24.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 21:24:13 -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; bh=sXNa5kiWHyvH55kN+5zwG+Y/7FtWzXdt3Wqp2JQJMqU=; b=cx5uh0mprpuMe0TVpAzg1NimXHgNf48Dp37Y6BeZJWtr+1/qbgbrW+7iS/IzO+ENQh YvdAvlf99mMVsCMMkbXrl8PwTegUpSv1CUneIU+62bQj8Yzb8CAlEBceY4Ee2KespvZ9 wTHp3pE17TnGIUznkHyWnvKVQzNLos2XsCLRc= 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=sXNa5kiWHyvH55kN+5zwG+Y/7FtWzXdt3Wqp2JQJMqU=; b=gP/H4+CT7jQwhPGhc/oI1bV0kWmq7/rNIyAGLdem+LD0+NZdcmpP47tB9EarAkoYnj S5ihOyBUk0WANALS+ZKnMLWqhOivz93idosuVyQVq+4WLvaPRdr4o/3ZUVC00SztGiEE cmZ6mAzli+HFLmCqNhpbcOe9zrWexqUdEmts2uMxLnUdHayGZXqN4ju9jwNl0i9NnYqh BST6lZCTaXOsgvENuAhPfIkFS3y4NfxZMhS1zCupuVogwaOcmDq+ZN2/Ma5S7u8UhLzH UESKdYQThpUcOUeoPx+L38I1uCoD+B3BUVSmCt55jKL2znLAaqOgGOV8Sdl+y28Lz2ej PGSQ== X-Gm-Message-State: AA+aEWaVXdVNuUZ4K7TrlpTO+jpZk1vJTNXYSi1rwY/cq6miP4XBmEbr 48BWF59kxX//bgO4BAdhxUvi95qkfTkB3w== X-Google-Smtp-Source: AFSGD/XjfGBy/ukKQA4TiIKXDRfHn6swx0ShoYKAmidK1Dsqj2XstyG/ZWZAas43scoSfZfuzy9sHA== X-Received: by 2002:aca:a648:: with SMTP id p69mr950567oie.205.1544765054514; Thu, 13 Dec 2018 21:24:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 23:23:44 -0600 Message-Id: <20181214052410.11863-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181214052410.11863-1-richard.henderson@linaro.org> References: <20181214052410.11863-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::242 Subject: [Qemu-devel] [PATCH v2 01/27] target/arm: Add state for the ARMv8.3-PAuth extension X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add storage space for the 5 encryption keys. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell ---- v2: Remove pointless double migration. Use a struct to make it clear which half is which. --- target/arm/cpu.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c943f35dd9..39d4afdfe6 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -201,11 +201,16 @@ typedef struct ARMVectorReg { uint64_t d[2 * ARM_MAX_VQ] QEMU_ALIGNED(16); } ARMVectorReg; =20 -/* In AArch32 mode, predicate registers do not exist at all. */ #ifdef TARGET_AARCH64 +/* In AArch32 mode, predicate registers do not exist at all. */ typedef struct ARMPredicateReg { uint64_t p[2 * ARM_MAX_VQ / 8] QEMU_ALIGNED(16); } ARMPredicateReg; + +/* In AArch32 mode, PAC keys do not exist at all. */ +typedef struct ARMPACKey { + uint64_t lo, hi; +} ARMPACKey; #endif =20 =20 @@ -605,6 +610,14 @@ typedef struct CPUARMState { uint32_t cregs[16]; } iwmmxt; =20 +#ifdef TARGET_AARCH64 + ARMPACKey apia_key; + ARMPACKey apib_key; + ARMPACKey apda_key; + ARMPACKey apdb_key; + ARMPACKey apga_key; +#endif + #if defined(CONFIG_USER_ONLY) /* For usermode syscall translation. */ int eabi; @@ -3324,6 +3337,21 @@ static inline bool isar_feature_aa64_fcma(const ARMI= SARegisters *id) return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, FCMA) !=3D 0; } =20 +static inline bool isar_feature_aa64_pauth(const ARMISARegisters *id) +{ + /* + * Note that while QEMU will only implement the architected algorithm + * QARMA, and thus APA+GPA, the host cpu for kvm may use implementation + * defined algorithms, and thus API+GPI, and this predicate controls + * migration of the 128-bit keys. + */ + return (id->id_aa64isar1 & + (FIELD_DP64(0, ID_AA64ISAR1, APA, -1) | + FIELD_DP64(0, ID_AA64ISAR1, API, -1) | + FIELD_DP64(0, ID_AA64ISAR1, GPA, -1) | + FIELD_DP64(0, ID_AA64ISAR1, GPI, -1))) !=3D 0; +} + static inline bool isar_feature_aa64_fp16(const ARMISARegisters *id) { /* We always set the AdvSIMD and FP fields identically wrt FP16. */ --=20 2.17.2