From patchwork Tue Jul 2 23:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 809143 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp442519wru; Tue, 2 Jul 2024 16:43:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJZyDc+ef6RaJWtlmQpeOc9BkotxHqDwbWd391eZOvQjfcV2XODBc1moP7gNaB8x8DJvbe8ldPpRfHqY/kS4WM X-Google-Smtp-Source: AGHT+IE7Kqwm/a+6/8D3eRbFv+u4Kn+02OxJQmN/PrBxqX4Deu5bMVsCOopGdSQGBxZ+A9G5eXV7 X-Received: by 2002:a05:622a:38c:b0:446:59ab:5695 with SMTP id d75a77b69052e-44662e6baddmr131585041cf.54.1719963810478; Tue, 02 Jul 2024 16:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719963810; cv=none; d=google.com; s=arc-20160816; b=h3GCgWsQ/8N+zbD1ffl5w1c35K4WTBqKed+tyLCW0j46Rj+KyI5rzXMsifooMh6dVK zDtJ7smGcVS5tkGEaiHiSqfPgrtHqXI0CRppFa8qc544x6mALLgFh0St4ja5ZWhngkrN saKUoGDY5uD8QMKIAJlySfO4ehd8XLzVsVpSHKBn2g2Wsat4KninhHd8rnapepa+u2Ce 1iQeJXE+GebHu/IGYAbP6gJzscDhfnIDYJoW+sx+jmvs3yz0t/ab3YmHTQYWlPbqQyYo SheI8EhXWTKy1uMohGYplpvI7cPsKBOAaBwsQt0/OY/Aykny9yvbP2U8dUKzl9MXxcYM l1yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=mZ5AdtoXeBWo04SqXtXVV3bVy8fFh+q0Y63ABmnLjpU=; fh=Fz3OM3AGXo6S/XDNq12jK+U+cl8IKdGchX/2GB3YVy0=; b=OyjFWqLc+IcuRXh8i8skDWAXLMZ5tCsXAQbNobyfS1CC5MPYNXYXId0fVZaq2zADJO NvKm4EkrCUiSnRIWywQHvxtgokK4ELhYZLyxPgWwLqwy0hfMDp9HnvDZKP2NtkDRHIlv U6lU71+C+xcV8u3fSWKWPXk2V6pLMm90OoBaTkuq8XjZKERVxg1E6wkM2+ZAG0MNg8KK 6hR6cJk2++Im1ICd4pTdYnw2RZTLn2TVvlchDKgWPjeikZTKsC60bN6/idfgZTjZF/T5 /5/bV0wxfkR+AZUcQtVFt2jzZqJAU3/bDl1ZgONcTYNOjarBVRpG9xB6IWlCwgc9/wY3 f7aQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HS2CvEqS; 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 d75a77b69052e-446514aa0fasi121553751cf.521.2024.07.02.16.43.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jul 2024 16:43:30 -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=HS2CvEqS; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOn8c-0007nJ-Jp; Tue, 02 Jul 2024 19:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOn8P-0007lQ-CV for qemu-devel@nongnu.org; Tue, 02 Jul 2024 19:42:05 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOn8J-0006Mk-C0 for qemu-devel@nongnu.org; Tue, 02 Jul 2024 19:42:05 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-710437d0affso2816836a12.3 for ; Tue, 02 Jul 2024 16:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719963718; x=1720568518; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mZ5AdtoXeBWo04SqXtXVV3bVy8fFh+q0Y63ABmnLjpU=; b=HS2CvEqSFlkzP8SzQLvpFM9t7L1geY47WOyZJI4LHQc9CPSNsSWCEEP1sLAMxfjQsD qawWm93eZZLFMKTK9ytjzja5XGPr5VMszhg6yODKE4EirqYtFjTzw8llUAx7Hl/U5FKK mP+65et3CAGNfFoq6V9CKbAO5I3HDIjAjNC3/CK7VLX7SiYy3zSfXqHQHcgvcBSDequd p11ChWRe9Qexgbp+QpWDjH7uUWfQfbIeitTW6YGPEiTpJo7gd8oBFmH/mMqNJnRJXF3q bc8njGPsDd9cA8ng2PqTSsIPJSZHSEwOlheUKkGXqbhN6TR/szQ0e6vFLzQz8iMt6GxJ LbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719963718; x=1720568518; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mZ5AdtoXeBWo04SqXtXVV3bVy8fFh+q0Y63ABmnLjpU=; b=U6KCFbMadwbF7WlpJzlBtJM5sJOoxyb9d8h+L583S7hXnyjnfU3B26A6c2nzmgrjSV KRE7k432KCy2YZ20OgmvLfRYWfCCxcMZzyQdVu/DRfCHqMkZdicwwMRxTfpqHdtLnhvp ENk12iS7L9esQnDLR4qT38/S6f5/nOA/ZME7C9lRESfa6qM1PidOxn/OuCjCXSiDAYc+ XKk/Ox33i/e3FKE0/6vyoZ6QOsaQOQOdzqUl8ym8FpFo/Z3NKOISF+5VI36wGkWOM2fj 9F1GV63rMomcs4lVC5okCTjHZoCTHXdbivWXFlMJ2xiKGbcDEE1PhBjrM3dvfJDUnvId Nz1g== X-Gm-Message-State: AOJu0YxP0fgT1WU2/m+1WNRBNircSU0lDk6GK8DdXXU6jtovJDD2kv+E J0Yxy6MqFlXzVB4vpmzalzxVDQyku/NPUwhXkW8LeE6vTzSuzCkxrcEzWnhVYlsFOg3zs+RBpc6 8 X-Received: by 2002:a05:6a21:999e:b0:1be:c42f:be42 with SMTP id adf61e73a8af0-1bef61019f4mr11018847637.19.1719963717603; Tue, 02 Jul 2024 16:41:57 -0700 (PDT) Received: from stoup.. (174-21-76-141.tukw.qwest.net. [174.21.76.141]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac15993c5sm90403755ad.244.2024.07.02.16.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 16:41:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, iii@linux.ibm.com, david@redhat.com, balaton@eik.bme.hu Subject: [PATCH 0/2] target/arm: Fix unwind from dc zva and FEAT_MOPS Date: Tue, 2 Jul 2024 16:41:53 -0700 Message-Id: <20240702234155.2106399-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While looking into Zoltan's attempt to speed up ppc64 DCBZ (data cache block set to zero), I wondered what AArch64 was doing differently. It turned out that Arm is the only user of tlb_vaddr_to_host. None of the code sequences in use between AArch64, Power64 and S390X are 100% safe, with race conditions vs mmap et al, however, AArch64 is the only one that will fail this single threaded test case. Use of these new functions fixes the race condition as well, though I have not yet touched the other guests. I thought about exposing accel/tcg/user-retaddr.h for direct use from the targets, but perhaps these wrappers are cleaner. RFC? r~ Richard Henderson (2): accel/tcg: Introduce memset_ra, memmove_ra target/arm: Use memset_ra, memmove_ra in helper-a64.c include/exec/cpu_ldst.h | 40 ++++++++++++++++ accel/tcg/user-exec.c | 22 +++++++++ target/arm/tcg/helper-a64.c | 10 ++-- tests/tcg/multiarch/memset-fault.c | 77 ++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+), 5 deletions(-) create mode 100644 tests/tcg/multiarch/memset-fault.c Acked-by: Ilya Leoshkevich