From patchwork Fri Oct 29 04:33:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516438 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp442089iml; Thu, 28 Oct 2021 22:55:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU1nT4S29wg3KE6tJ0j6/MYGwMz2T8mrHDmxht1GTERezO/TcCxdwWDuBOcU7kdmUJhyw6 X-Received: by 2002:a05:6830:239b:: with SMTP id l27mr7090112ots.115.1635486909079; Thu, 28 Oct 2021 22:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635486909; cv=none; d=google.com; s=arc-20160816; b=kTELDwtVTi9opSL4SrlMH3Qw4Qb+5q+tV7PuhYKTrU0BU9nKcwo4YfCzwHpBQT8Omw W8VKClh9nrvdiWzQY7bWjkfC/HUIVABVTo8Xh3mwSvUTqz08gxjKEgmXG04rgV3ptLb7 Ku1GDLZpVeZI0Ioa1u4q7HTAs7ISvHFtQ8q1zTayehDuZHyvHhSmmVrvYuG9Ocb3Ww5S nlpU28NdU1OOIUPrPSoZIen8q2HAWCNGfCXBkUhqVHpbhzIUjRbj/P3kpyoSmW5jPtmL O0lpAs4KE5CUwx6fhCB0pZ2PxauowaFbya59vOv25RfZ16jiWMhhCB3WU5CGjLtWrOrb 3aAA== 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=Y3wWK4kTFEJCz0QHTFpGH7uNAR2Mgy+YfWQ3IzNlXl0=; b=Z6ufDq01DP6djBO4I9ewK5RcFV8AJUdHy4ULshv5BDdetda7YpuZYk0F0vpEuKXbam xALq9QAzg3frKCwWIdTFYU2gnc86r6RVA8anPhVIk4+OH54y413r/w7jrMCVih+1OGHX HUgqxZzXG1945P+aVGzZAtwR82wH42W41wE+ZxjgzF5afLMXnwDCX1pup3iAO3YJV4wz VUBieQPOyR1ro5lc3yvQpyKTsPa0D1nWJ99NBJvnFdgAyc7C7OQdy5O1IVzOVB6+TbVq 9eF1CLUZOlba2XWz76C+gLEuJK9DS1v5jQCI2qs0gcOx/nbkrDOLD1/y5mMK/62bomPg smhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UAGi1O0l; 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 a3si6068030otj.76.2021.10.28.22.55.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 22:55:09 -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=UAGi1O0l; 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]:48416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgKr6-0004ed-5k for patch@linaro.org; Fri, 29 Oct 2021 01:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJds-0002dF-EE for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:37:24 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:46875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJdo-0000Q1-II for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:37:24 -0400 Received: by mail-pf1-x435.google.com with SMTP id x66so8066510pfx.13 for ; Thu, 28 Oct 2021 21:37:20 -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=Y3wWK4kTFEJCz0QHTFpGH7uNAR2Mgy+YfWQ3IzNlXl0=; b=UAGi1O0lZMRk43GTkYWQKKZWeA9hiMjHTjzXx71iVXL+pbaD78PwnO23Xk5x14qIrh nIUYRatoVZfVSG6LPA8Eo5LAL0GQIXYtkkgajeArJntFm93J3WV2ljHgasac6kQ6VP42 Wc44NNQV6In2VtR+hqP+eHQOLMVeZM7iSN//7CZ7ztygbYNm2l3pzWEeQ1eG7qCR7h0J m7sfnz6RceU8q6QhV5tQ7fdm0+wzDxhR1PA/0wUCTiDZjCitICgdUla98B0u6EGbD/DY V8fPCOPryqYW8F3j1+N7UIkXltcMFpQK/OSJCQSX/7dYxGIMaQQoHIbGtO2wCFozQF7j X3eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y3wWK4kTFEJCz0QHTFpGH7uNAR2Mgy+YfWQ3IzNlXl0=; b=mFs2ykaBR7jj7eI263bJOdD2ehSi8wB+uXHpIEH5Ufr6eLn4fbvUVzO9VAJqUKhFRJ v2ghfpXjSV++ac+3RDVKtxq84vUoNy1Y5RZz+8PknE27V34hRFx50PQfdCgKKE5/K5jJ AC6zhuGc5tLskuYoIPAZyQNhJJlvjPZmqjAbfFkNw1xlewNj3aVFLRqaRFbettOieEXm lAH6Lc4c3GV0TR9KFA/lef3jQrcR+zVNTBjWHbUX9gyqCih3PASUpoTLBHAgzSzLlG33 Yj+mRtgxyI7MOeEbLlpgHqruosv6HlLa46F7/skjJwcFrDGlyeDiwb/ZGAoOXwTF7MGY vUqA== X-Gm-Message-State: AOAM5330WJRhZW+XKfatrmfn/jHDwl9aZghRMI2wzH0K0nZLYjnM4X7e gF4hp67GAxOTfpuKExjVJD9wQbSLeEp77w== X-Received: by 2002:a62:7d8d:0:b0:47b:dfd7:e888 with SMTP id y135-20020a627d8d000000b0047bdfd7e888mr8646274pfc.42.1635482239221; Thu, 28 Oct 2021 21:37:19 -0700 (PDT) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id b8sm5228232pfv.56.2021.10.28.21.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:37:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 60/60] softmmu: fix for "after access" watchpoints Date: Thu, 28 Oct 2021 21:33:29 -0700 Message-Id: <20211029043329.1518029-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029043329.1518029-1-richard.henderson@linaro.org> References: <20211029043329.1518029-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk Watchpoints that should fire after the memory access break an execution of the current block, try to translate current instruction into the separate block, which then causes debug interrupt. But cpu_interrupt can't be called in such block when icount is enabled, because interrupts muse be allowed explicitly. This patch sets CF_LAST_IO flag for retranslated block, allowing interrupt request for the last instruction. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Message-Id: <163542169727.2127597.8141772572696627329.stgit@pasha-ThinkPad-X280> Signed-off-by: Richard Henderson --- softmmu/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 9765a509d2..b9a8c1d1f4 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -946,7 +946,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, cpu_loop_exit(cpu); } else { /* Force execution of one insn next time. */ - cpu->cflags_next_tb = 1 | curr_cflags(cpu); + cpu->cflags_next_tb = 1 | CF_LAST_IO | curr_cflags(cpu); mmap_unlock(); cpu_loop_exit_noexc(cpu); }