From patchwork Fri Jan 25 22:57:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156645 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp913841jaa; Fri, 25 Jan 2019 15:12:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6x6hFPMm49PcQXjUwLvNuZpHtC3ikDq9frWyNkZZJZz4R4Eu1rZSdFyNIQz83ef+t/VkOl X-Received: by 2002:adf:e78f:: with SMTP id n15mr13420716wrm.115.1548457965326; Fri, 25 Jan 2019 15:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548457965; cv=none; d=google.com; s=arc-20160816; b=OpAfrcnlZ61pTX1EVPmBOcdrGeQrKbgCqKxojNStsjQAbWuwvLqhCzumZiSGTkw6YN F+6jeK7s1+YIwBN48atVrUMdXy/ZlE2jMHfeOVSjH6lFjhhxE9azZxYNk9iA7eY+FE1L l+XvYBshaoWLC9aT2uPnvtZaJ3NeV5dq+EzEuWq6cV5ctew02Jt/BRZTqIEW+nxvGJkv x5F4UUmuSMeWfo45Lv0v1x3XhfKfRyN8tTbpc5yLzlBJnsYIWYw/Go+vtTads/h0XBtA F7OcJEnPN0/+DlJW+w9tC9bSGRIBir2XBpOaR5ZAHnYngSbz1/jqc35f4Cwh6j8CdM1q Phag== 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=eAN8JYVbSnX+ldVfWjGFmsPXa8V/C/8OAJUAV3yGxuM=; b=K+XyHNM4gfeXGMIECKCT1DUnjXcZnKl4s0H4IHEZImIczlGiPIRVtP3247A8yqljEa gwPfDXSNESweJiBOQrL6voQNsrYrkjejsTpKxTHtJutN90fO+ABWBETylqp3hu+PZ9wN UmiYeRjQYGf55b3DDIXWC0C/NQAoQQbhEmYAfxRND3nwXXZ5rnXNsXo/d0/Aa3j5kweT JL2bUk/1ViPUqA/rSPa7O7gRAoy6/zvEpeQw7RTYteVplqNW0euCC0efMqSZAAAp+UU5 +VcoKSCu0Gi18lNNhQuNlwxAmvqsT8Q5Nhp11+NPvofV2l3IsWJppXVZANsrLbjIcYfj ewlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M3AugaO4; 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 21si34462388wmw.118.2019.01.25.15.12.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 25 Jan 2019 15:12:45 -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=fail header.i=@linaro.org header.s=google header.b=M3AugaO4; 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 ([127.0.0.1]:52200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnAeS-0005W9-7f for patch@linaro.org; Fri, 25 Jan 2019 18:12:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnAe4-0004rv-0G for qemu-devel@nongnu.org; Fri, 25 Jan 2019 18:12:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnAPf-0005Pd-6C for qemu-devel@nongnu.org; Fri, 25 Jan 2019 17:57:31 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:42761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnAPe-0005Od-So for qemu-devel@nongnu.org; Fri, 25 Jan 2019 17:57:27 -0500 Received: by mail-pl1-x641.google.com with SMTP id y1so5198329plp.9 for ; Fri, 25 Jan 2019 14:57:26 -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=eAN8JYVbSnX+ldVfWjGFmsPXa8V/C/8OAJUAV3yGxuM=; b=M3AugaO4W12+MtXOmZlLU5wNlbioeVjxVmMPRfAopP20LfqTx0tbbxZDsIfNJp+DCr kB3UdXFNveoLwJH5c/LckscHBy5nI5OTAq7bel/BWaDU3oPlYlGZKRjy3lwLZmI2BigQ 4gXQzBAchpCX0LVdQFY0vjrmAcVm11gGRHX9A= 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=eAN8JYVbSnX+ldVfWjGFmsPXa8V/C/8OAJUAV3yGxuM=; b=tS8lyEYMO5k3xKuDPlVxOjLQivCUMFcdCiuVXKLV4n6KMAD0JZ1B2IR5HHepIaXxwx rMdGS7iPrnmv4oRQrg3LpuOM57JPi320EGq/tFWOwo8TLCcCcLTpk0d6cBqSo8ETm7r/ kyGVpnf5HMquH89LS2m9qRYi6NUKUpzJH3lltp2uMZoQsnkp2q9gqSmONqa4zj0gw4sT TNn8uK/IE60LNGcNe20Uhyo83cExi622/m8/BxlQuIKOAd3tlEHsow8lcnyrCKD7z9Mw Vc9Oz8CfgoZPqP/FFt6zGeOPpkHsSX943upvh0l/lrHCmAzmp6h0kUikwGTU4aQQxToB MwCg== X-Gm-Message-State: AJcUukdijmalDwV2/XPeMxfV2WU4VTvA76djzFJyTf2FPj1IvHIKvPuv rmxyneGJ0y6J9ff1MevFEPFlnYb4W9I= X-Received: by 2002:a17:902:584:: with SMTP id f4mr13271405plf.28.1548457045347; Fri, 25 Jan 2019 14:57:25 -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 c7sm39148321pfh.18.2019.01.25.14.57.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 14:57:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2019 14:57:14 -0800 Message-Id: <20190125225714.10234-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190125225714.10234-1-richard.henderson@linaro.org> References: <20190125225714.10234-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::641 Subject: [Qemu-devel] [PATCH 6/6] tests/tcg/aarch64: Add pauth smoke tests 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tests/tcg/aarch64/pauth-1.c | 23 +++++++++++++++++++++++ tests/tcg/aarch64/Makefile.target | 7 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/aarch64/pauth-1.c -- 2.17.2 Reviewed-by: Alex Bennée diff --git a/tests/tcg/aarch64/pauth-1.c b/tests/tcg/aarch64/pauth-1.c new file mode 100644 index 0000000000..9bd8d28ede --- /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 = &x, *p1, *p2; + + asm volatile("pacdza %0" : "=r"(p1) : "0"(p0)); + prctl(PR_PAC_RESET_KEYS, PR_PAC_APDAKEY); + asm volatile("pacdza %0" : "=r"(p2) : "0"(p0)); + + assert(p1 != p0); + assert(p1 != p2); + return 0; +} diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 08c45b8470..e80d07276c 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -8,10 +8,15 @@ VPATH += $(AARCH64_SRC) # we don't build any of the ARM tests AARCH64_TESTS=$(filter-out $(ARM_TESTS), $(TESTS)) AARCH64_TESTS+=fcvt -TESTS:=$(AARCH64_TESTS) fcvt: LDFLAGS+=-lm run-fcvt: fcvt $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)") $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) + +AARCH64_TESTS += pauth-1 +pauth-%: CFLAGS += -O -g +run-pauth-%: QEMU += -cpu max + +TESTS:=$(AARCH64_TESTS)