From nobody Tue Feb 10 03:39:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549051006234124.40506882037391; Fri, 1 Feb 2019 11:56:46 -0800 (PST) Received: from localhost ([127.0.0.1]:60899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpevd-0001xM-9X for importer@patchew.org; Fri, 01 Feb 2019 14:56:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpetu-0000xl-Qg for qemu-devel@nongnu.org; Fri, 01 Feb 2019 14:55:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpets-0002CS-Jj for qemu-devel@nongnu.org; Fri, 01 Feb 2019 14:54:58 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:37093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpets-0001pr-5B for qemu-devel@nongnu.org; Fri, 01 Feb 2019 14:54:56 -0500 Received: by mail-pl1-x644.google.com with SMTP id b5so3736630plr.4 for ; Fri, 01 Feb 2019 11:54:11 -0800 (PST) Received: from cloudburst.twiddle.net (97-126-115-157.tukw.qwest.net. [97.126.115.157]) by smtp.gmail.com with ESMTPSA id j6sm17351809pfg.126.2019.02.01.11.54.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Feb 2019 11:54:09 -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=M3TKKfqGt93rsoNtYGhEal1qEw2yURPi46cM7O017vk=; b=LAwbcOaQlOW/IcJ86pW9JTcy4LeFjgrug8+cG4mB3r6VbF6yNh27PF5jFK7V10+lxt efZbsPzU61sWIdPtaPUcYx9zacz7KCp9BDnjmYKk38AUiuP2MpkUGIdA5Z1c7DLnZXYe lhtr3M54OJw01KBPZurflwVyBIX909JIJ/MV0= 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=M3TKKfqGt93rsoNtYGhEal1qEw2yURPi46cM7O017vk=; b=COyxR25r5q3QIhFl/t12LqBxVYurWyceLUxLNGvSmr+LwPzyATampFuzXmm2mHjvlL lB9vxDaHT2KlTvO6iHE9sJI1UyCt6Bcxxkznu70wJ/UXvtskhk2dJ+OwwYbCM3nsw8Gz GMCI5MI/c0fKOyx1QSIdZcI1BCXMmYKjRaatcayviLlJ/BybgwagB7Qt86+U8BL8sWye r9Juu9Ce/HM6aVwmcF5h2Zadz0JDHHwsDKzztR3eZq+W5O1X+SRvQQSUfNGRS7NukSgd wF7irHAR+3gKZ4FYVCBdGBjpeA9TjBEevzQsosPD+Y2XSeo0MP1Mb0zTlZdUaPm+fhmi 3q7g== X-Gm-Message-State: AJcUukcDlf2vskEYhoO9+vg22tOvt0CQV2pLpC/w4Q5G8dbEjdL7RywJ gCKqCL80JHheC8P11iLqPQ4nrI9JPdE= X-Google-Smtp-Source: ALg8bN4Yalhdh0nGQc0eaMQW8urnC12aWOf50796BALLwBi64T3mdPg8GFsSNn78XCrHmrD5yQ1TOw== X-Received: by 2002:a17:902:33c1:: with SMTP id b59mr40438006plc.220.1549050849959; Fri, 01 Feb 2019 11:54:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 11:54:04 -0800 Message-Id: <20190201195404.30486-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190201195404.30486-1-richard.henderson@linaro.org> References: <20190201195404.30486-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH v2 2/2] tests/tcg/aarch64: Add pauth smoke test 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, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- v2: Pass all 5 arguments to prctl; remove -O1. --- tests/tcg/aarch64/pauth-1.c | 23 +++++++++++++++++++++++ tests/tcg/aarch64/Makefile.target | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/aarch64/pauth-1.c diff --git a/tests/tcg/aarch64/pauth-1.c b/tests/tcg/aarch64/pauth-1.c new file mode 100644 index 0000000000..ae6dc05c2b --- /dev/null +++ b/tests/tcg/aarch64/pauth-1.c @@ -0,0 +1,23 @@ +#include +#include + +asm(".arch armv8.4-a"); + +#ifndef PR_PAC_RESET_KEYS +#define PR_PAC_RESET_KEYS 54 +#define PR_PAC_APDAKEY (1 << 2) +#endif + +int main() +{ + int x; + void *p0 =3D &x, *p1, *p2; + + asm volatile("pacdza %0" : "=3Dr"(p1) : "0"(p0)); + prctl(PR_PAC_RESET_KEYS, PR_PAC_APDAKEY, 0, 0, 0); + asm volatile("pacdza %0" : "=3Dr"(p2) : "0"(p0)); + + assert(p1 !=3D p0); + assert(p1 !=3D p2); + return 0; +} diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index 08c45b8470..2bb914975b 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -8,10 +8,14 @@ VPATH +=3D $(AARCH64_SRC) # we don't build any of the ARM tests AARCH64_TESTS=3D$(filter-out $(ARM_TESTS), $(TESTS)) AARCH64_TESTS+=3Dfcvt -TESTS:=3D$(AARCH64_TESTS) =20 fcvt: LDFLAGS+=3D-lm =20 run-fcvt: fcvt $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)") $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) + +AARCH64_TESTS +=3D pauth-1 +run-pauth-%: QEMU +=3D -cpu max + +TESTS:=3D$(AARCH64_TESTS) --=20 2.17.2