From patchwork Wed Apr 22 04:32:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185655 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp296842ilf; Tue, 21 Apr 2020 21:33:33 -0700 (PDT) X-Google-Smtp-Source: APiQypL4LjGBaIzKsNU0jnQmkx0pawzuIX2obn2451jQqt7NVUDvmF9EOI/blA7+aCTSb1UN2scM X-Received: by 2002:ac8:6d2c:: with SMTP id r12mr24783923qtu.355.1587530012930; Tue, 21 Apr 2020 21:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587530012; cv=none; d=google.com; s=arc-20160816; b=mb7BYybrWROuojkf4fWxZkLuQ3A4x8T3VvXRTjDzW6O8BhH3i83uL0Du6fkhm4/o5a ETE1Z4LCKWpelA3V/JK5v5tH++vLkbV59X+grSQBtAdPklPf0tgcoJbd7YsZ4SK6jdhh RJYAOWqd545gnBoW2AF+T4VhpnqWca/+Vnioxyj7mrE8//zb699RoN94AMGCaZ2ZVps9 nZBUIuuH6lj5uQU5MVofsFacOStbtWAD2WMuCKG8zqaDqtIoDHZj/outrACGlCB2DUNS 9iCo8EW5Z/NcrLriae/2tXbeq3UVN1erMVm6J59O9H9TmlQYoirchP0VBx8D9/zPNQJC sQag== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wfD3qzrTNTYWcIz1faBmR4+bRJgKxyAneWjssHLJ1no=; b=Vu1cmu5UsvspqfO72hBuNG2nR5opE7SlW2cz1xAQWL1nNVhGWapi0RTrRXZed2+zUw KVqzYeoFgHK94HwTC2eF4Ui+pY0P5SUdo43nJjpqLpLEzo0ho43ANuUbC4o/xSRunZNZ SzW5z+nO9fvtyQ53L9iOuEzWBjj3AB50l/pLY/iTFPted2n2b6S7QDz89vURhLi28fW+ htxumBmoME8T+E/9EvhF7fsPLSbeOBAEhnd/T1Ty3hf4Koy8i+tsXWccK1Q1dLbjP+Vs kQyzT5zjUOYdkUJE0pPwmWWaSdhQuxZQc7CDARYgUJzJrSXqn6u8/EyTtUDL4QxhVKON e+QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fOwcxgGf; 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 c76si2630585qkg.222.2020.04.21.21.33.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Apr 2020 21:33:32 -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=fOwcxgGf; 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]:41130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR74m-0000Qg-0w for patch@linaro.org; Wed, 22 Apr 2020 00:33:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR74V-0000Nf-Uj for qemu-devel@nongnu.org; Wed, 22 Apr 2020 00:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jR74V-0004dD-Dn for qemu-devel@nongnu.org; Wed, 22 Apr 2020 00:33:15 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:43317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jR74U-0004ZV-S4 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 00:33:15 -0400 Received: by mail-pf1-x444.google.com with SMTP id v63so434008pfb.10 for ; Tue, 21 Apr 2020 21:33:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=wfD3qzrTNTYWcIz1faBmR4+bRJgKxyAneWjssHLJ1no=; b=fOwcxgGfIr5FBkD3yUmUPjqtuEW1Da+0ABHfYwu+6a3XUr9+WZaH9sFdq4ZRZNUR5N odFKdauq5u/AybXpMNThlWxPRVyzv7RdzEQMgxwm+fe0YHw29PP+jHZL/ARxqSkSXPXl F49HXdt6yh9snFAdIe2AgMKZZAzL8I+qNZcskD7fzWQOxpmtC90Dc+l3hqHUcIGEW9RQ iGI9D5b5PuSNHzmbceGiKYQg3EGCbhQxWsu8C690ZNZbNF7Zd/FnQAtxyQzV7nWH+A/J gAO4THKysdhZ0a7M1RwaoZNxWLCzofTiVNWGi0aPBxA/vyXKjaRaMz1wkoXC0yHxSxRA 2jXw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wfD3qzrTNTYWcIz1faBmR4+bRJgKxyAneWjssHLJ1no=; b=UKPnn/WpoF0UhaeFaaPs6CveOzkIHSSrV8IwhO0tM3WX2SsNYB/LeMhQTxH5lKrhB1 3X1miN6QOfEL8UC9qtiH/r8V1xCdkabH4nxlosOx+cvfqaQpOQkNhvc/YqkxWDxJfnkF tCnP1h4I9JnfOxv1Pgz5UtHGV1rB4/ey5MTkH9/97WjN9uj08vu+XHg8i1EO6hPMzGb2 iz22j4Kmr2DwGGQ53l5xyRir3drmZwuY2NF8nkh8PgptBZyoXk3GMW/WenFy8ZAgl38F kumyOAm9YfRZt+HKN+wl64lwYZmv9cbSxuYAxv3pEL02HY60fgVUZR3MyHiZdRvv10dg AzKQ== X-Gm-Message-State: AGi0PuZO1RBbo4X4TQn0n4wz7CBst4GOoKLDCReohyubCj4rDBR1CZ0g bN1hd/yC9Z1ItTqv0+68Mbd3lT9iXPE= X-Received: by 2002:a63:4646:: with SMTP id v6mr25769727pgk.426.1587529992763; Tue, 21 Apr 2020 21:33:12 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id l137sm4129613pfd.107.2020.04.21.21.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 21:33:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 01/18] exec: Add block comments for watchpoint routines Date: Tue, 21 Apr 2020 21:32:52 -0700 Message-Id: <20200422043309.18430-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200422043309.18430-1-richard.henderson@linaro.org> References: <20200422043309.18430-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x444.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::444 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" Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5bf94d28cf..07f7698155 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1100,8 +1100,31 @@ int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len, int flags); void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); + +/** + * cpu_check_watchpoint: + * @cpu: cpu context + * @addr: guest virtual address + * @len: access length + * @attrs: memory access attributes + * @flags: watchpoint access type + * @ra: unwind return address + * + * Check for a watchpoint hit in [addr, addr+len) of the type + * specified by @flags. Exit via exception with a hit. + */ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, MemTxAttrs attrs, int flags, uintptr_t ra); + +/** + * cpu_watchpoint_address_matches: + * @cpu: cpu context + * @addr: guest virtual address + * @len: access length + * + * Return the watchpoint flags that apply to [addr, addr+len). + * If no watchpoint is registered for the range, the result is 0. + */ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len); #endif