From patchwork Fri Jan 15 22:46:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 363788 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp269708jap; Fri, 15 Jan 2021 14:47:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfREBGHuKbg0HaDNz/Q+hMvBQxJcZPlK/vsgHDfIyfDtWDxFNhyxizWji18FCOTsUPI8dV X-Received: by 2002:a25:d295:: with SMTP id j143mr22326292ybg.20.1610750868829; Fri, 15 Jan 2021 14:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610750868; cv=none; d=google.com; s=arc-20160816; b=VmpMPOMvD6Ffaj4QFsupLwA7itxYu7I8RdxC0EMbOrW/b5pGtuOvP4pZVh2p59cR+V a5ZEzgfUMfsN5jVLm2s0pfxJVgLEKQWw84sVJwVDHYHEO5OsIjmmryaynqWKu8lJMwAq 9a3cFSJQklpXEMt5SjoddKX99sA1UMNBfGlAg14H7lnlOsNfEGaEJ7+dRa4yvKWYoaR4 ZEjCwnzXjiXblim5I7890F2GUsbUk7yTVRFuUPde/IR+yIsV/ARhe1Z//6MDlO2U5HEP 0UNJ8jRJFn6NpsYc4+6UIMTayWGbM6wqWwgiIGS3sWtgnaz8EQ1CGgU5D5ffJTImZCgk s1qg== 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:message-id:date:subject:to:from:dkim-signature; bh=pILtCL3+WOm9enm51rY0JFGFgNs8LZRCjkNlG93rpNA=; b=Q+g3J4eNSS0POnuJNZcAJ3VjFf2o8HwDRgKm859+9pfTEkkEPeeJxxdI1CdFvZUPHv D3ubeczqhNiFpoD6Dr2tqlAxZpTasHMCQSVWKcnVEjBBZVDK5nZPe9BUu8q6/79ebztS GVu94gUHVL7a3Q64RStnllb/M6i8IsDrXlbY8RakaJhaEXP89EALsXmRITS+R12ttQPL tcVOgzOLOEAgU7E93EmZsqH6Y2emv3TQ24Zv2Z5ZLKIgOu5JoWGw3tHX2YWTin7ZKMsA sOwifhAzIfyD9EDRhdlpBzgeXA4MguMIr4XNf/TDudebeC7CWlTao+aIDaFwkWB/mK/j puLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W3vq9ozS; 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 a9si9551848ybc.91.2021.01.15.14.47.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jan 2021 14:47:48 -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=W3vq9ozS; 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]:49880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Xsi-0003Uv-BO for patch@linaro.org; Fri, 15 Jan 2021 17:47:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0Xro-0003UW-K5 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 17:46:52 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:37601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0Xrm-0005AB-Kv for qemu-devel@nongnu.org; Fri, 15 Jan 2021 17:46:52 -0500 Received: by mail-pl1-x630.google.com with SMTP id be12so5452309plb.4 for ; Fri, 15 Jan 2021 14:46:50 -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:mime-version :content-transfer-encoding; bh=pILtCL3+WOm9enm51rY0JFGFgNs8LZRCjkNlG93rpNA=; b=W3vq9ozSZ255uAJRfsRNCK1EHdnjZPBsiN71XY2PMGdxkttPVUfvVFaZJXW9qH9+8M 1lguNXyPerolwKYRjTSXNS3OLXbWJP5CeqREWLEeqgq2dj4EPhAGim+LRuWds2LKoLME q18nPaJOj2GsSadHNfY9pVDxcHR+WTqAPEAbcxetM0HapurKC+qa/Na6DXYtdBRoOy5R Nqnp8piu0bBelGwUquuaYZxRIkeAYghF4HvVbauM9ijF21gAoYxPmYWyO5PX44mJFmP/ 6W+ys/dg22LUfoW4GcynMwcQz1CjoZF0j53enhSAIVTPfrYwQZ+3iDRSIY8uDYV2WOUt fqvA== 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:mime-version :content-transfer-encoding; bh=pILtCL3+WOm9enm51rY0JFGFgNs8LZRCjkNlG93rpNA=; b=dgpCoP9+9873ENAMiorJDUXaT6MNv2aFFtuwYccHP/xyHSCDLL/NnSxdzwskBIML15 NUDmggaGPITyBKbdM2ItyQ9cSOnoytqej7Kr+7F2EsEpjsTNELQnEqvSiJwWH+2zQbnr ThkbMLDJ1Qt7TN62UB3AuQLtxQ8UyJHF/cJlXMKUD+VytlD+V4DLZ4Ofzdjkf8xofLQ5 5Zl8CuTzgCxzZiAvGUaTAIMHdMgxXKE8eTMkjGRBpNhAhEmjGhprzD5LAfiV3tIA9YcR gU0rs6YoPGp4YvId3XOU8C/zzIUPKgGVs1Q8o5YNh31BlI9X/a84xkN2GiXxG7sqs/qT HnIQ== X-Gm-Message-State: AOAM531kB41dJ/WbKfKPNjIs/OjHA1X+DcmpLARAVA8vHeaAwl85BoDP rX/UYGlMhJ6gn8uxfnbcr2mQlzv0wpPG6vMm X-Received: by 2002:a17:902:b717:b029:dc:3e69:80e8 with SMTP id d23-20020a170902b717b02900dc3e6980e8mr14707442pls.40.1610750809022; Fri, 15 Jan 2021 14:46:49 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id s13sm9521700pfd.99.2021.01.15.14.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:46:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 00/21] target-arm: Implement ARMv8.5-MemTag, user mode Date: Fri, 15 Jan 2021 12:46:24 -1000 Message-Id: <20210115224645.1196742-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 kernel abi was finally merged into 5.10. Changes for v3: * Split out type changes to separate patches. * Add doc comments; tweak alloc so that the !PAGE_VALID case is clear. * Do not overlap PAGE_TARGET_2 with PAGE_RESERVED. * Use syndrome.h, arm_deliver_fault. r~ v1: https://patchew.org/QEMU/20191015163254.12041-1-richard.henderson@linaro.org/ v2: https://patchew.org/QEMU/20200605041733.415188-1-richard.henderson@linaro.org/ Richard Henderson (21): tcg: Introduce target-specific page data for user-only linux-user: Introduce PAGE_ANON exec: Use uintptr_t for guest_base exec: Use uintptr_t in cpu_ldst.h exec: Improve types for guest_addr_valid linux-user: Check for overflow in access_ok linux-user: Tidy VERIFY_READ/VERIFY_WRITE bsd-user: Tidy VERIFY_READ/VERIFY_WRITE linux-user: Do not use guest_addr_valid for h2g_valid linux-user: Fix guest_addr_valid vs reserved_va exec: Add support for TARGET_TAGGED_ADDRESSES linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG linux-user/aarch64: Implement PROT_MTE target/arm: Split out syndrome.h from internals.h linux-user/aarch64: Pass syndrome to EXC_*_ABORT linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error target/arm: Add allocation tag storage for user mode target/arm: Enable MTE for user-only tests/tcg/aarch64: Add mte smoke tests bsd-user/qemu.h | 9 +- include/exec/cpu-all.h | 47 ++++- include/exec/cpu_ldst.h | 42 +++-- linux-user/aarch64/target_signal.h | 3 + linux-user/aarch64/target_syscall.h | 13 ++ linux-user/qemu.h | 19 +- linux-user/syscall_defs.h | 1 + target/arm/cpu-param.h | 3 + target/arm/cpu.h | 24 +++ target/arm/internals.h | 245 +------------------------ target/arm/syndrome.h | 273 ++++++++++++++++++++++++++++ tests/tcg/aarch64/mte.h | 53 ++++++ accel/tcg/translate-all.c | 28 +++ bsd-user/main.c | 2 +- linux-user/aarch64/cpu_loop.c | 61 +++++-- linux-user/main.c | 2 +- linux-user/mmap.c | 29 ++- linux-user/syscall.c | 73 +++++++- target/arm/cpu.c | 19 ++ target/arm/mte_helper.c | 39 +++- target/arm/tlb_helper.c | 15 +- tests/tcg/aarch64/mte-1.c | 25 +++ tests/tcg/aarch64/mte-2.c | 42 +++++ tests/tcg/aarch64/mte-3.c | 47 +++++ tests/tcg/aarch64/mte-4.c | 42 +++++ tests/tcg/aarch64/Makefile.target | 6 + tests/tcg/configure.sh | 4 + 27 files changed, 856 insertions(+), 310 deletions(-) create mode 100644 target/arm/syndrome.h create mode 100644 tests/tcg/aarch64/mte.h create mode 100644 tests/tcg/aarch64/mte-1.c create mode 100644 tests/tcg/aarch64/mte-2.c create mode 100644 tests/tcg/aarch64/mte-3.c create mode 100644 tests/tcg/aarch64/mte-4.c -- 2.25.1