From patchwork Wed Jun 5 20:57:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165925 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7855508ili; Wed, 5 Jun 2019 14:00:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJbqhqNHi3i1fgoN86qc2yQtPiNyoiQ/AMoKJf3izZW1R/k4rDmfymAv1vh2fNU/7gn98U X-Received: by 2002:ac8:2c33:: with SMTP id d48mr37412204qta.40.1559768454419; Wed, 05 Jun 2019 14:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559768454; cv=none; d=google.com; s=arc-20160816; b=QkTjpuj0vKnM7T50S4FAMiGSH79RP8HRP6dDVZXDYG1EAvODL/Z8OlniFn2k/A+LF6 myPjGzZ+cgmuYs2D35kBEdwMyveeFOkZppUfphfyoNWABwqm3u3lqqSJSdP4rMFzJs2B 6/n+en/6GzugxT4bKbgRfCRB4b3ghGISuHqEFkFlpNN9E1Weecbd5Y1GPzCy3Ung2D5E pEjSWUVlGK7VJYI264NHa9B9qeJTS0vz4R6dPu0ljKDiBkvwiCLfRTzy87ZoySFB48u6 6KE7mTZGkQc4OKAOweI+sF93Zy4ILrc/yWLuBae+VMzLxLhD0Q7o1OBGRboiOeCMjp5o zqpQ== 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=W6HDhQJMBdxe5wJFgzRB2+t1x+cTtvvyIgBUjEbLKfs=; b=YMPeOmHDWSLr+ZdhlbZ6jp1xd3LRaA7Qe//x+OW0NnAXbBfNGF43HKaGl83JiAEITQ vu/3VKpcKqBSy8on8qz2HUREPzk/alTkJpJsd5WQ7UUSqbo/wMUKDBAGz8HQg1+j4Nnp 8N1p+uqfNyzVxot7gTi1UPw132BT9WtAliM30xHNISaNfRFRAXBARwNREittIRLWy3gD +AoBDx5nb2o1Uim8ojYfLq7Ai5NWmJF4HNB7VMwKg4sttHEe8U2ffvicREZLJTyyJB+t hlXxYrfVsqLVYe4d/5LtbFDiXRyM/9bcn4rvs8cJ72YeH242urX/uOGdsOhRAhRGXiyG qxfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q4HL3wPq; 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 c18si695375qtm.103.2019.06.05.14.00.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 05 Jun 2019 14:00:54 -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=q4HL3wPq; 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]:49958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYd1h-0000me-T9 for patch@linaro.org; Wed, 05 Jun 2019 17:00:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYcyA-00068g-8f for qemu-devel@nongnu.org; Wed, 05 Jun 2019 16:57:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYcy9-00082H-1p for qemu-devel@nongnu.org; Wed, 05 Jun 2019 16:57:14 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:34602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYcy8-0007zs-PR for qemu-devel@nongnu.org; Wed, 05 Jun 2019 16:57:12 -0400 Received: by mail-ot1-x341.google.com with SMTP id z24so2087252oto.1 for ; Wed, 05 Jun 2019 13:57:12 -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=W6HDhQJMBdxe5wJFgzRB2+t1x+cTtvvyIgBUjEbLKfs=; b=q4HL3wPqkPUTCX1upK44DzH2jCj02ieD6b0YpeC0R/MEdah0OXekz6TmD6F5cWnHpE 9RKOu8xmj0bENhBs1Utf2n9JyQTVzR2ItMaIVhWx5tNkXHlEeDG3eAZw9ibK+x+ScRdM kDYpw8DTmEqpcMrVAgH7oA4QwyNv+JmlqW94/hbv+AA/RUMotwdFYQKSG4bQA68p+iCa pO5cmfXp8XrrZB9GIUERzJBXHl3iYdd0siEL4Yawnrd7u2uxRG9PS6BJw2Cfyf7Hf0yR rhe6mW+swv5WxkrLKYXgP+mIbms/UobnPZ3o9ez9hg54ThKb7fFXFnNV4eM9KE6fqLVg zypQ== 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=W6HDhQJMBdxe5wJFgzRB2+t1x+cTtvvyIgBUjEbLKfs=; b=OT/DJVnnoqvsAX2qtMU+gfhOg14gGvE/6/iiPsQZHZQu32f5EWJnx+NdzHu05MPBWM 3J5VIM29BVl1F9BJ2Nxx3lIpqIcVQwIeWMKJnnL7YzbDgopTiHrkvmte8iNTRKGFiVEB 5RrCk460rKfxk2+byLK9ezv8vxqRCREZ6ErP+imqjOgHfFjRkejP71GgH/4zc4Mjp4GM UhxwqTsnyn/us9K1cFaULx4RGr3Bxf5ATrw40jCifjtGk+IFRDN6kC1rI3ZwsAFBy2/5 r1HRKSl8TU+vPMg3dYctSSDra2mgHHkEGTThhPVIx6wxvJBSaLHG38zrTZo9YcMF7JJA +72Q== X-Gm-Message-State: APjAAAXgJqxgWBsvfaFavmxUYF0uq7yTtNBDJSzWdWlZvldpEpWiNL1i ySGdjLvx/1c9rSiXdMb63Yyu7yh4YsRWIA== X-Received: by 2002:a9d:5cc2:: with SMTP id r2mr11408179oti.122.1559768231571; Wed, 05 Jun 2019 13:57:11 -0700 (PDT) Received: from localhost.localdomain (200-56-192-86-cable.cybercable.net.mx. [200.56.192.86]) by smtp.gmail.com with ESMTPSA id f5sm7414155otl.51.2019.06.05.13.57.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 13:57:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 15:57:00 -0500 Message-Id: <20190605205706.569-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::341 Subject: [Qemu-devel] [PATCH v6 0/6] linux-user/aarch64: Support PROT_BTI 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, qemu-arm@nongnu.org, Dave.Martin@arm.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Dave Martin has recently posted a kernel patch set for supporting ARMv8.5 Branch Target Identification in userland. http://lists.infradead.org/pipermail/linux-arm-kernel/2019-May/654654.html While that support is not yet in the upstream kernel, it looks to be close to its final form. Note that the patch set spells this PROT_BTI_GUARDED, but review suggested to rename to PROT_BTI. 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. r~ Richard Henderson (6): linux-user/aarch64: Reset btype for syscalls and signals linux-user: Validate mmap/mprotect prot value linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI include/elf: Add defines related to notes for GNU systems linux-user: Parse NT_GNU_PROPERTY_TYPE_0 notes tests/tcg/aarch64: Add bti smoke test include/elf.h | 48 ++++++++++++ include/exec/cpu-all.h | 2 + linux-user/syscall_defs.h | 4 + linux-user/aarch64/cpu_loop.c | 7 ++ linux-user/aarch64/signal.c | 10 ++- linux-user/elfload.c | 83 ++++++++++++++++++-- linux-user/mmap.c | 122 ++++++++++++++++++++++-------- 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 + 11 files changed, 387 insertions(+), 44 deletions(-) create mode 100644 tests/tcg/aarch64/bti-1.c create mode 100644 tests/tcg/aarch64/bti-crt.inc.c -- 2.17.1