From patchwork Sat Aug 3 21:07:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170511 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2429459ile; Sat, 3 Aug 2019 14:08:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7rWvOY4axUK7zLWJRij1RoT8qxl+6Zh/xB3xfHHp1FgjMya5N8AkOhT2EdcA/8+KmOqKi X-Received: by 2002:a17:906:6986:: with SMTP id i6mr6538551ejr.89.1564866513296; Sat, 03 Aug 2019 14:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564866513; cv=none; d=google.com; s=arc-20160816; b=SNjxVEp3j1mNH4DH6pZ+E9IcuInDkZuRE9pUjvmNbB49Vcyccgh1P/LC9gOXeq3EDf ApSCA7iMpAuIcNnpNHa0NWNnEtmYAYYIcq+NZxh0rxHexkDUO2F9+tR4DdnYFY7dwbUr 9XY3uV/JDaWUr54T0/ZVad4TdD55vIdeLAVr7vljCGYZ3W/4PtGNRqmU5VfzBDPLaewo X2dTintgNBR9ietl9ftFJmoPQYKqQVcTV9TsaLPXKBJIuXUh96+r70APFr7KWs90hfNT j5UVEJ0Jy374WrH51VrP46euov4IkynJG1i/S/ZfJVlYBe26neUPZSx74fyZKw2xI0q6 S4mg== 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:message-id:date:to:from :dkim-signature; bh=NSPLjACG69kNYWPaNBk+06B1y1rFaDkEzgMb35jlC8g=; b=Ir5CZ8P5F8+VKqOa2nNCYc1Y8d/Ca7RbUagh4hR9BmPCpbFv/QZLh6yFttiZGb2C7f Zs8ZrvTY8yX+RqrqgBwFvhBr+HtSJeBF/aLEL1gci5Ifu+qh1ZHYZwuhAevIz1n12XhN 5fhdWpNc7MRH8iYmzYZToU2pwteGALV0X4robt5xY8u412WZcjgvu0FCssUWnVLR77Lk SFvxtUWyKEtVVkM5GMQ/+V0j4xBgQDQPmK8CeB0x08ap7pWQmih9Q/kQ/0Ok3o2wCDYU edTb1tmCmmNMQ6iIu9B2zhlTHQTJwrzGl/U9/hLsOFAZzANMH9RxInrft/e92u6SUT1n B3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oCnDlNNf; 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 s11si22785349ejo.354.2019.08.03.14.08.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Aug 2019 14:08:33 -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=oCnDlNNf; 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]:41990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hu1GS-0000zo-Ag for patch@linaro.org; Sat, 03 Aug 2019 17:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51923) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hu1GD-0000xa-KE for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hu1G5-0005MO-Hm for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:12 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:38614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hu1G4-0005LX-NM for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:08 -0400 Received: by mail-pl1-x643.google.com with SMTP id az7so34925757plb.5 for ; Sat, 03 Aug 2019 14:08:08 -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; bh=NSPLjACG69kNYWPaNBk+06B1y1rFaDkEzgMb35jlC8g=; b=oCnDlNNf5zNP3/Oi+lvw0lUsjJpABryCJ+9Jb9i/DaJgNIytsrFiiyfeWkedYUEXtL dJjzmeBuc8pYvNjXU2A6PD4Ygjg6nyzFS9RZMXYr01n1oCaqwy1qIiVXQcQzWlSq5DBM l/chYORv/qjUFsuVWPP3pxQY/24q3gwokexTc5/HG0msH7LtDKJOBgQfjhkXg/vXtjP3 WQoDMb7hGxzNi62o2BzHXk865GiC0wMA46DRCpAo9rn5SML4GFNEBtvkQbdBL0i+6ar8 jKsuxD3QuJuCv4ZFQ/8LTw0w9rJ6ID8hk1AWj/vafPx0rNv4k7iXxy/8DWCpHDS08Dx3 rNHQ== 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; bh=NSPLjACG69kNYWPaNBk+06B1y1rFaDkEzgMb35jlC8g=; b=tjX6mxAo5Ws3AV2Q63LpeT2h9tGTUYpMi6gH5WA7h7L1wlo1dsCxU9gz5ueEZVvLn2 dd+ljKAbicLHokP0T3Gz7TgUxWK3kozdIXELgfTyTPThJmgrXweA0EFTsIPyQkxxNw22 5UUcdGMjZ+SfP1w5gH8vq810UjeCBH/OLm/J+zWgB+lw7cB8LpfGKoHQhsEs+9/i7sTE qoYEEffQUZi3IRPVbFzKdFxAYncEpAc5Z1vvb2BVKhvmwBmtVT5fyurbQi0NbjWUcmi2 Qjec6BYYLtXIU5l0doZhOWM7oNHWqvQAU5/1VKyoAsD09gxCXj1ZMWpk3614irBmDixn TOCg== X-Gm-Message-State: APjAAAWRKB2rQLqKi/JhwNk07w2IWZcwjW4S+OcOO1XI9UPCrw6nFsDV BwE7Y4dMnn/fzd2ZtYHcdpAq5rAKntg= X-Received: by 2002:a17:902:1e2:: with SMTP id b89mr30397176plb.7.1564866487066; Sat, 03 Aug 2019 14:08:07 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id x25sm110129644pfa.90.2019.08.03.14.08.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 03 Aug 2019 14:08:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 3 Aug 2019 14:07:57 -0700 Message-Id: <20190803210803.5701-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 Subject: [Qemu-devel] [PATCH v7 0/6] target/arm: Implement ARMv8.5-BTI for linux-user 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, Dave.Martin@arm.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Changes since v6: * Rebased on the ARMv8.1-VHE patch set. * Review from Dave Martin: + Remove PSTATE.BTYPE adjustment on syscall entry. + Rely on PT_GNU_PROPERTY to find the NT_GNU_PROPERTY_TYPE_0 note. + For the test case, add a linker script to create the PHDR. Changes since v5: * New function to validate the target PROT parameter for mmap/mprotect. * Require BTI in the cpu for PROT_BTI set. * Set PSTATE.BTYPE=2 for the signal handler. Adjust the smoke test to match. * Tidy up the note parsing. Based-on: 20190803184800.8221-1-richard.henderson@linaro.org "[PATCH v3 00/34] target/arm: Implement ARMv8.1-VHE" r~ Richard Henderson (6): linux-user/aarch64: Reset btype for signals linux-user: Validate mmap/mprotect prot value linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI include/elf: Add defines related to GNU property notes for AArch64 linux-user: Parse NT_GNU_PROPERTY_TYPE_0 notes tests/tcg/aarch64: Add bti smoke test include/elf.h | 22 ++++++ include/exec/cpu-all.h | 2 + linux-user/syscall_defs.h | 4 + linux-user/aarch64/signal.c | 10 ++- linux-user/elfload.c | 94 +++++++++++++++++++++-- linux-user/mmap.c | 121 ++++++++++++++++++++++-------- target/arm/translate-a64.c | 6 +- tests/tcg/aarch64/bti-1.c | 77 +++++++++++++++++++ tests/tcg/aarch64/bti-crt.inc.c | 69 +++++++++++++++++ tests/tcg/aarch64/Makefile.target | 3 + tests/tcg/aarch64/bti.ld | 15 ++++ 11 files changed, 379 insertions(+), 44 deletions(-) create mode 100644 tests/tcg/aarch64/bti-1.c create mode 100644 tests/tcg/aarch64/bti-crt.inc.c create mode 100644 tests/tcg/aarch64/bti.ld -- 2.17.1