From patchwork Sat Aug 24 21:34:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172142 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2415317ily; Sat, 24 Aug 2019 14:35:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4bOvYEbA0oMDmE+N2KG0JvN6rkJ6rGP30WNvpoJwUqIQ8dHM15uH/rN1VUhjwj4o18Fz5 X-Received: by 2002:ac8:4915:: with SMTP id e21mr9447479qtq.5.1566682519678; Sat, 24 Aug 2019 14:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566682519; cv=none; d=google.com; s=arc-20160816; b=u0IFHKWaYgPtGNquV2CKtKF/9C36Xmk6AOG8Ke8t+hB2q/an7GAyXEq47txVXtPHWt 4CQYJ4oBIUSJjAioul0g8Sya5RusWDUNdUjh3hiUVKaBEr4SvWhDQ+HnIVqJgjkUVX6a LDC32g6xmX7e6MIhVT6o3CRQ02/M/sRgQsy84NpdsRx2B+FrBy7sUA02JbUc6mFPunaA aWnGe0nfb9ueJlFfxkKkMlw31GZghYH9vh77CbYTx9sgW0+cmB+SWCi8JbtkZ2kLCbjx 09u/DksoD2HRbjYc1khouaOFG51yyKi4HzqQSt23gavnsRW1zIAsQ4G3UV+za3rwX1Wv +XMw== 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=zPthgjq3EApjczyIKc35H4LPep1TgUZB2P7mpwIR2W8=; b=Ncy6mewdQ+p44OP+b0esRaGZfxou40W7TXnoyKseRHiczCs/fUuNKBBKBUXOSpB4M1 r+KRhyJ5kvegY6AMIRyg+2iVAxSuo1i68t/ehaa9/CHoqC7GEOVuhp2fOMho8RZSBGu0 IKHgqGLOL+b8jKMivEIPePti6S2ZTQfAruvjh1OG5bvL0FgalrvbAG5qSBv35vIeTIO7 FiR0drK1Iq3fisQngqh3ZjvHPx/U5VInfS9XivwKixkzULbE8XTrIrzHou5cgEZmdei+ gzCm8pBahhlN5LR5g2PvH7tvWfa7WRqtEiMNRp+3qxVQfbcImoxZZLkDzQP7YDbZzJSW yo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OXOrtwFz; 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 x78si4919938qka.83.2019.08.24.14.35.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Aug 2019 14:35:19 -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=OXOrtwFz; 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]:39452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1dgs-0001Lu-VI for patch@linaro.org; Sat, 24 Aug 2019 17:35:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36314) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1dga-0001LU-UH for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:35:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1dgY-0002zm-NE for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:35:00 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:34038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i1dgW-0002wM-GV for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:34:56 -0400 Received: by mail-pl1-x629.google.com with SMTP id d3so7772575plr.1 for ; Sat, 24 Aug 2019 14:34:55 -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=zPthgjq3EApjczyIKc35H4LPep1TgUZB2P7mpwIR2W8=; b=OXOrtwFz+iS1F93vstxPv8KYrM6P19i14c4gDYAfGkuLaZRj8rJx2nh+js4YpZf4k0 H0sAK0KgcPCsB7HnLkwtfLOXJrp3OIbXc1it5052lMZ6EC5OVfIqhakwaMQVnNo6h5Kg 5P+YvywnvxQ7HY7XGaAQZ79m8MXbpV9YZfxx4/h8zC6DG3+qfOGEyoI7iMasb9uJn6JD vEjAHF9RsozWB7qBfAoWkuPYmFge1QJsEhJoq7AX4zfgWV4Kf5ILsGrusNF99+4TC1QI zVY3JmFtsX2kEShXr6beznnK6GtMp4xXOvqSIVUtXqp3oGDRd0fSLU8JEw+14tAtcktL 3OJQ== 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=zPthgjq3EApjczyIKc35H4LPep1TgUZB2P7mpwIR2W8=; b=mrnpoQKx9sAPLawV6BxkNFtOaGH1CAccKWxYI7IV+TUjDoU/1dVO0WTI9Qevm/myCs dzvX1ar0Q+Rf7NTidaPdFgUXyGYPXSXI4vZJ3grYHewLIKasQ+O5mBS+4YuWNUG/JGc+ rQB6tUnXv63P1KH/9+Z1Xr+s/wH4DpHN52IL17sOWEfAykauXoiA9JLWtGGpvtEtF0MF B3V8dy3vycOHG7zCVGZwrVDm8KEnhYB2LUiYovWffBrdOHPMOIF2NYUu0i66cVpRWo0x 22lS+QTsl3Vmi7Ry3x1e2Q7Zc0+PLSO6dn5S1T0hinrdESF3seLKYjfaXOTm6tseJqN+ W5fw== X-Gm-Message-State: APjAAAVO7NgOuFgc8Kn01o0MpsmYVB9ejqFd7JwkrEBmBixupwuTZEPi zoRYNcWkGGbuW02YuHGl1fmiuiAkKNg= X-Received: by 2002:a17:902:ff02:: with SMTP id f2mr10742191plj.99.1566682494296; Sat, 24 Aug 2019 14:34:54 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 81sm6325753pfx.111.2019.08.24.14.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 14:34:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 24 Aug 2019 14:34:45 -0700 Message-Id: <20190824213451.31118-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::629 Subject: [Qemu-devel] [PATCH 0/6] exec: Cleanup watchpoints 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, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As discussed with David earlier this week, the current implementation of watchpoints cannot work, at least reliably. We are raising an exception out of the middle of the i/o access path which does not even attempt to unwind the guest cpu state, nor does it have the information required to do so. This moves the implementation to the cputlb helpers. This is a point at which we can and do raise exceptions properly. In addition, this fixes a bug in that unaligned stores were detecting watchpoints in the middle of the byte-by-byte operation, which means that we didn't signal the watchpoint early enough to avoid state change. r~ David Hildenbrand (2): exec: Factor out core logic of check_watchpoint() tcg: Check for watchpoints in probe_write() Richard Henderson (4): exec: Move user-only watchpoint stubs inline cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK exec: Factor out cpu_watchpoint_address_matches cputlb: Handle watchpoints via TLB_WATCHPOINT include/exec/cpu-all.h | 8 +- include/hw/core/cpu.h | 37 +++++++++ accel/tcg/cputlb.c | 156 ++++++++++++++++++++++++-------------- exec.c | 167 +++++++++-------------------------------- 4 files changed, 173 insertions(+), 195 deletions(-) -- 2.17.1