From patchwork Sat Aug 24 21:34:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172144 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2417384ily; Sat, 24 Aug 2019 14:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg1uwYcXTCS0gwyOkv07wvc3p9YEn2h67uKB/5vmRNJ2FviWMFeLElC5W9SfGKmegcglsi X-Received: by 2002:aed:3363:: with SMTP id u90mr11184700qtd.7.1566682721967; Sat, 24 Aug 2019 14:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566682721; cv=none; d=google.com; s=arc-20160816; b=OlqEcrJ2MJDaWRAjJ1EXVKbJBkFcv7eBsMLD6G7p5f4L+A8OSL3W5qjEUgKF2Skz7B xuXAlXjuxZFpwNPkSRD5fBeyeOIxFtdDJBvJEMmblWu9IBilo/9nKi23zcy8UP506W7k sSEBjNUsdDrgx47AqjhF4v4N5ooZt+1x2n40reEPSn5yL232QzxnTGu7JPBQnhauXTzT pe2uiLswuNuy1Uyvo10CcFjd45o0y8+on82iQpc8u3GFeDw4mYSvG/aiCmc7XyE1jNK8 gWpGEtEHTLRmG17AettlL7nmqQ5C2nWLHkhl8Hv5s9Z48If7gY6eLmehw06B6ADJJyNo LqBQ== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=QLLa7oQzyNor8g5gTrV1Ih0+YyC/eiYlSSeR+q2HgEY=; b=juIbzeuih3SlaJ19Erg3E7ZZxFq39wydotSKNOcHlIBHHWfeMSfIeB0LYO2lit8HOX vzqzgMzN6Be9KG2YBWEyZGFKuN7j2xS4VTwm7w0CvYz6uuHusZhxNKMhavT+/J8MoKrR VWr/daSguBB0U9r/afXh7+lCtQ4jKsRUw9uc74jQuXyNo5yWFH3z+Yxy6dHzQJmIpvtw AlB/v1iAzLybGsYdOd1R6Mz2QDmjDUJhb8yyGxMK+oU/+f/I64Wf2uo08iBTJFzuFs2M QhbHDhvP07+LzSaV3zZnimOI0IxveyS+5W3IlllO7hbTecBU1p2MVm5Oi486nrRtWvmF 55Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=En1UUyrg; 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 h6si4513262qkm.104.2019.08.24.14.38.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Aug 2019 14:38:41 -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=En1UUyrg; 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]:39504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1dk9-0003XU-GD for patch@linaro.org; Sat, 24 Aug 2019 17:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36333) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1dgc-0001Lf-Pf for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:35:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1dga-00031a-N5 for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:35:02 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:43371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i1dgY-0002xa-OO for qemu-devel@nongnu.org; Sat, 24 Aug 2019 17:35:00 -0400 Received: by mail-pf1-x442.google.com with SMTP id v12so9038138pfn.10 for ; Sat, 24 Aug 2019 14:34:56 -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; bh=QLLa7oQzyNor8g5gTrV1Ih0+YyC/eiYlSSeR+q2HgEY=; b=En1UUyrgUGT8iUh8n38uG58R3mBWmOF+zjaCpwoX6dTbq+TV/nuUJZy6g/2anJlf0m yz0Hmnb/aP7EsFJmjumP7523NCkpzJ3/hmzD4IDSb1y5yfJDfj6lKos/8KhW5GZxCcoV B0eTUU0g2G2I6csQmH+HlydAbkFWopqhhzTKTcRZxkHjgvsJf0ns1B5plu7ogbsng9P4 K3oTPml3fGYrncaScbYKL5uWIeYzQnyVAjckioCO732603remXhLPzQvzcuMoN7VSwNN DYgBjcBfQb/GFEGiJJyccA9WQHme3MxNhPMBd6FrmczzbznsA+nbELNgF5mIZDo4/oLU /gYg== 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; bh=QLLa7oQzyNor8g5gTrV1Ih0+YyC/eiYlSSeR+q2HgEY=; b=tBfWrOh7hJeOOpM3r+ywxMZmz8GfCQOatRXtPXFyIouuilFUdqriQoyLIUl5dB2y1w 2BxjuX9SqAgbu6WXLqnxvFBWjETqEVwhTBVKUg6DEzr1PBASmFPtEQ6XG3ifRiLw8Gun IpQe0aD0DkT/hwwft2bw8B9a4hfVMI6XXehikGUzK+cKg0UC+qg+1mP7yuNDEYLRakCO jqwftMcv4QzF+pG/RoFUdXY333yZrD2nVBpbdFVxayRYAHsy5gfG/E6tlNXg7AqO2Nkr 6qhD6h1s+cFqR4iDLwWEl+0eJfb4x1OYtLyGk5Uk4d0G2F6SZvFdXhGlNZqguG79CIUO sW6A== X-Gm-Message-State: APjAAAVIxhDoiAzTP3dVihwGeqPmQie6PIaSOxj2Xv0nPZtSVCNTAdIx SrJ4Ng44Hc5iu4wlKHPTNLaBtfn9mog= X-Received: by 2002:a62:35c6:: with SMTP id c189mr12431590pfa.96.1566682495598; Sat, 24 Aug 2019 14:34:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 14:34:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 24 Aug 2019 14:34:46 -0700 Message-Id: <20190824213451.31118-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190824213451.31118-1-richard.henderson@linaro.org> References: <20190824213451.31118-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH 1/6] exec: Move user-only watchpoint stubs inline 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" Let the user-only watchpoint stubs resolve to empty inline functions. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 23 +++++++++++++++++++++++ exec.c | 26 ++------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) -- 2.17.1 Reviewed-by: David Hildenbrand diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 77fca95a40..6de688059d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1070,12 +1070,35 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask) return false; } +#ifdef CONFIG_USER_ONLY +static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, + int flags, CPUWatchpoint **watchpoint) +{ + return -ENOSYS; +} + +static inline int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, + vaddr len, int flags) +{ + return -ENOSYS; +} + +static inline void cpu_watchpoint_remove_by_ref(CPUState *cpu, + CPUWatchpoint *wp) +{ +} + +static inline void cpu_watchpoint_remove_all(CPUState *cpu, int mask) +{ +} +#else int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, int flags, CPUWatchpoint **watchpoint); 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); +#endif /** * cpu_get_address_space: diff --git a/exec.c b/exec.c index 53a15b7ad7..31fb75901f 100644 --- a/exec.c +++ b/exec.c @@ -1062,28 +1062,7 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) } #endif -#if defined(CONFIG_USER_ONLY) -void cpu_watchpoint_remove_all(CPUState *cpu, int mask) - -{ -} - -int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len, - int flags) -{ - return -ENOSYS; -} - -void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint) -{ -} - -int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, - int flags, CPUWatchpoint **watchpoint) -{ - return -ENOSYS; -} -#else +#ifndef CONFIG_USER_ONLY /* Add a watchpoint. */ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, int flags, CPUWatchpoint **watchpoint) @@ -1173,8 +1152,7 @@ static inline bool cpu_watchpoint_address_matches(CPUWatchpoint *wp, return !(addr > wpend || wp->vaddr > addrend); } - -#endif +#endif /* !CONFIG_USER_ONLY */ /* Add a breakpoint. */ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,