From patchwork Fri Apr 2 16:18:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 414380 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1535791jai; Fri, 2 Apr 2021 09:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+FW9ANmnO2rGW0C2DseYBr7Ysyy+aClGN3vz4QwFPte+amGoXevD/XAc89g/5b8b4UkRw X-Received: by 2002:a02:9663:: with SMTP id c90mr13790989jai.16.1617380337788; Fri, 02 Apr 2021 09:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617380337; cv=none; d=google.com; s=arc-20160816; b=hmxP/tLmY02qNC2hUZk9RClaZjs5CawbKJ5OIlz++esCPc2AesaKEx639z7YyzglD9 fZm20rvTwVeQK3ACg0QNP0AhkLEzdCZdrtMihT4KKmwWb/BCl27SnnDbI1eIdmAQgJGS q1YT+6V+VPqQ3r6AwR1claqQxvIdOjN19IaBpZxDRqEXXvPwxAPIuixqi0abTXDhMVOX 7QK85UPHBRmQylqI6nWQ0GiTjK6aX4Ieq6weZj/PkTVcnralmOTWK/2qINggLiNEZ7ib JzM0ci3OHDI7jjjbW+NQ0VTXc1orS8uUuyEsaRuq4A/SQWnrqHujw/igP/F0cd57uqgE hjCQ== 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=RhHqeyidCB+9/uyN78QecO6UZ1exOGFoiaz07QlfopQ=; b=xxYzSzxPYp4dy1BltW4L7HBl/mxhNN/JEspgATNWnRqHSOJqIk3XcOf3pRTqbsH9c8 WLudzQL8EvPVdF5lcTBAKUCQQU6rnQaO/muVmpgFb3QDB1SdFES43CtflAiKj4YPqA09 eslsOqmftuHlOkFOl9h0RNN95L+6xrlsJZutkMMIbv3QxjBpmuWadicA7wYbubvWhjcK NYO0uioNgyn7q4sS3Qa0PaHNhxiKP5cp+HamDnekml6nITcpnIbwiextDeNzjJ0l1acy CnYLfDj4iomYk0RStpv+PXm6zBZ9UqGQpuB8ojOjCrDhJCtIw69gV0BFPLV3X6V+YvVH UQqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QkZCKP+k; 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=pass (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 g12si7606781ilc.71.2021.04.02.09.18.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Apr 2021 09:18:57 -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=pass header.i=@linaro.org header.s=google header.b=QkZCKP+k; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSMVd-0000v1-7Y for patch@linaro.org; Fri, 02 Apr 2021 12:18:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSMVP-0000tq-5S for qemu-devel@nongnu.org; Fri, 02 Apr 2021 12:18:43 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:35588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSMVM-00035A-Ex for qemu-devel@nongnu.org; Fri, 02 Apr 2021 12:18:42 -0400 Received: by mail-pj1-x1029.google.com with SMTP id il9-20020a17090b1649b0290114bcb0d6c2so4828596pjb.0 for ; Fri, 02 Apr 2021 09:18:38 -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:mime-version :content-transfer-encoding; bh=RhHqeyidCB+9/uyN78QecO6UZ1exOGFoiaz07QlfopQ=; b=QkZCKP+k2IrB/f8r4ebE4hAAOiTl0bbs1komSIkEebZKiL13cgMo46b5tls1Tnw5Ht a9lViBULc9+pHNRjxzqlNFxyLrwydS+iMfEbjRsaaFolz3vzRk8ux22xH65FzAUeCU/R fhPZGZBKRK93GOfRWyUqE/UhvOS3DAyCinFDz8Wqe+/l1WAMrbNvCxVDQDhoCVUSnPmT RhUjp2GoAgVsbxK99YkO1dPolapct8j2quRm9Q78HbHsnG4wCOtI64jvPmKv4FsPfL/Y C6me8slgLSU9XRhkO7cJh1Vri3vv5p7PiMhTlp5fR9pyXOjpL6gfuHi0CNv5L1Vp0+hM 3Reg== 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=RhHqeyidCB+9/uyN78QecO6UZ1exOGFoiaz07QlfopQ=; b=UTc6soj9b3qHJlEcp/T3EYafP1QpeuOLXw7EipMd7cv3kZUvwYn3uS/oh2fBbLDBTZ nJpojKgJhdgfbxRnPsGx+iCMv6eLPT9tTVAVI4jqdRHpAx/txAx1IuYCw/vRpsG11GtU eRF6UR4HzYiUbrt3sqXyCKDE/mDvOrfijBqqh7yEm2Q34okwV2UH+il0aiGpMLOkI2V7 StfAGe3hQw6z5yT5n97DxTBm4KdWxyZbA+Uh2r48gjWXhoFbjIFvAXHHl6Aojfg890Kt tZXnBlr+msWC1Pyhhf/g5fVeI9YkeJpmlzEycD2qf/LvcG5+7Y4MFH2eGpaQfTErBhKI oP0w== X-Gm-Message-State: AOAM531crU5PS8UYrZjrEKwdlkz8kSD8cyZZ0xfd81Okd2bcKrQH/ILZ pvyb+ei+ujD72BzdsrouQqak7NfR2+16Rw== X-Received: by 2002:a17:90a:5587:: with SMTP id c7mr14008245pji.5.1617380317698; Fri, 02 Apr 2021 09:18:37 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id m7sm8821761pjc.54.2021.04.02.09.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 09:18:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 0/3] target/arm mte fixes Date: Fri, 2 Apr 2021 09:18:32 -0700 Message-Id: <20210402161835.286665-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In addition to re-instating the "is tag checking enabled" test in gen_mte_checkN, add a fix for a second bug in mprotect. I have verified that the 5.10 kernel, running in system mode, allows setting PROT_MTE with mprotect. r~ Supercedes: 20210402053728.265173-1-richard.henderson@linaro.org ("target/arm: Fix unaligned mte checks") Richard Henderson (3): target/arm: Check PAGE_WRITE_ORG for MTE writeability target/arm: Fix unaligned mte checks accel/tcg: Preserve PAGE_ANON when changing page permissions target/arm/helper-a64.h | 3 +- target/arm/internals.h | 13 +-- target/arm/translate-a64.h | 2 +- tests/tcg/aarch64/mte.h | 3 +- accel/tcg/translate-all.c | 9 +- target/arm/mte_helper.c | 171 ++++++++++++------------------ target/arm/sve_helper.c | 96 ++++++----------- target/arm/translate-a64.c | 31 +++--- target/arm/translate-sve.c | 9 +- tests/tcg/aarch64/mte-5.c | 44 ++++++++ tests/tcg/aarch64/mte-6.c | 43 ++++++++ tests/tcg/aarch64/Makefile.target | 2 +- 12 files changed, 222 insertions(+), 204 deletions(-) create mode 100644 tests/tcg/aarch64/mte-5.c create mode 100644 tests/tcg/aarch64/mte-6.c -- 2.25.1