From patchwork Sun Feb 16 19:43:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183561 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4180027ile; Sun, 16 Feb 2020 11:46:29 -0800 (PST) X-Google-Smtp-Source: APXvYqyekZ3QyRuIBjgzDuW7EL8BgG2zxXuZssftPUG//4Soa50HyjxMYSu1UPmGw26Uh2YnZQ6P X-Received: by 2002:ac8:60d5:: with SMTP id i21mr10779088qtm.341.1581882389305; Sun, 16 Feb 2020 11:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581882389; cv=none; d=google.com; s=arc-20160816; b=L+LbS5irjB+gfcPtcsKaY3BwhC12aFPMRijLlOklDkGdwzeYjZEFzPIEXmloJ8E/1g pBvbKsajEhPgGJ5EU41TvANqF89cIY91HD/xRam/vOSJpBfqs6L660/oMgHrgCGDIIJw +yKyA4o755qALBJe8t8wz6k+odCNiZHG+miHO30WyMpkNYS39MRSVgXDnZRhAxbDP1Sr L6ezMdicKlNmTF0eRtcy3ML8n8Mk2axMtYTc890qxAHRTZgRl4ET4LmzWvkXtQPkwqxr DfdaXhofluXq+Dw1xPkbAkR4meMOVmJsnOO1rFAD9FBpzTf7g1VjSZsupyEdqGaeXME8 8EbQ== 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=o5rb+tTqydiafB3qvUsAq8/vvIee2NCXymu3BNnsCeA=; b=oEA41+HhyhsieMTC/CX/d4Tx73+C5yOszKHKEHoKCb+L3R42a83F5g+AYRdCDGSfOV ix/n1uL48UwYYrwB7edclHifZmRG2F5Qlnx/3TfRVrkGBx/DCDKb8GSxtA0HCObEErX1 LNfoW2WktO/R6cqGrty61oxajyoDTkCU8MGKIw6PG/u0+brQbUj5YyQzWOMnNGwwGxMK dzAxzf4d3YpgobOg6tt7RPWK7jzgTePvTwN1k4oJ7WIjwqO0fVBnSgF1KdUYvJff1oFz 4EbgFJXVrXgNMNXAkbHJMIC1hqtDGYo05xbwJ36HHM0pDnDnDTB9wbVVFf69tXcjj4jx vPPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cxe7iddO; 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=pass (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 n21si5596158qtp.21.2020.02.16.11.46.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Feb 2020 11:46:29 -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=pass header.i=@linaro.org header.s=google header.b=cxe7iddO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3Ps4-00078t-Qj for patch@linaro.org; Sun, 16 Feb 2020 14:46:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34687) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3PpU-0003cB-Qs for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3PpT-0005Vz-UO for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:48 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:40643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3PpT-0005UY-PS for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:47 -0500 Received: by mail-pg1-x541.google.com with SMTP id z7so7889861pgk.7 for ; Sun, 16 Feb 2020 11:43:47 -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=o5rb+tTqydiafB3qvUsAq8/vvIee2NCXymu3BNnsCeA=; b=cxe7iddOrSkEDv3h8Adzge4QnP2tHnoLUREsspOnGULi2hA4rvwPhdK2yVcFNtYIAM 2UFCIxdfJOtv6rV07IukYdTNXgbJY6azbMleoBwlHGNlBu1HE+I62wWGTqywFJU/nIhD l9CekVxC8I3WDeRZurSNdg2ehK1Bz9AWo3KETOMwiht4fVORzmfEIYBklsLuRK4IRv4S uwkHw+Pbt6yGEpw7VFNcfwpaybtKiagOqXHqpGPZgzN4eIz1b/4ow9P0WXKJss7zbvW3 at4dZbpYmk+FMbcBAU9WyqdPmOWiFWU/YoeYQKypar3JTcLQEYu/kAWBuvTRtXSuZelt r1tw== 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=o5rb+tTqydiafB3qvUsAq8/vvIee2NCXymu3BNnsCeA=; b=eAMprY6Qp9EhRMDketksJMsuzRRiZb1sNEIBOrOXeWotqDAkQ1CbNO5PhkXxt3z1vb U8gOtYErp4xKnmUJLAfHtnUSiMavATnpm4cZ/Ng5kDInx23LYF0bINBmE7FkBjoZrHXm +aRRPhncRgFdFG2Q3fKKX7kI6x43ysTReXGqvC/8rTyQko94/8IJ+kIO1WdxmDtNllqN HyJWI31QatQM4jlmkQfS1J6Eecm9+DtdP0xrkDMGSe1yanRHzwcKUymPXwUIzl11L4MM 5qUVzEq5ObOvkdQxijIMCqMaUtLSZ7Ac7VhGfuOPdigzA5xPz9IfRTXJSQbj2TAZkQq1 gbxQ== X-Gm-Message-State: APjAAAVvSvBnFLvbkRPzJEhSnj2iJd6q4zin7EyNSzWzFY//yen/k305 W1d3760itURH7eILmwtglOIZX2HW178= X-Received: by 2002:a63:306:: with SMTP id 6mr14143415pgd.337.1581882226497; Sun, 16 Feb 2020 11:43:46 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y127sm13945188pfg.22.2020.02.16.11.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 11:43:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 1/4] target/arm: Use bit 55 explicitly for pauth Date: Sun, 16 Feb 2020 11:43:40 -0800 Message-Id: <20200216194343.21331-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200216194343.21331-1-richard.henderson@linaro.org> References: <20200216194343.21331-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::541 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The psuedocode in aarch64/functions/pac/auth/Auth and aarch64/functions/pac/strip/Strip always uses bit 55 for extfield and do not consider if the current regime has 2 ranges. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/pauth_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c index 9746e32bf8..b909630317 100644 --- a/target/arm/pauth_helper.c +++ b/target/arm/pauth_helper.c @@ -320,7 +320,8 @@ static uint64_t pauth_addpac(CPUARMState *env, uint64_t ptr, uint64_t modifier, static uint64_t pauth_original_ptr(uint64_t ptr, ARMVAParameters param) { - uint64_t extfield = -param.select; + /* Note that bit 55 is used whether or not the regime has 2 ranges. */ + uint64_t extfield = sextract64(ptr, 55, 1); int bot_pac_bit = 64 - param.tsz; int top_pac_bit = 64 - 8 * param.tbi;