From patchwork Sat Jul 17 22:18:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 479264 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2748561jao; Sat, 17 Jul 2021 15:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtzT2RxP1lnEtP45IznOi0YlSw5r4Pi89BaS8u7G45d1OdSKLXyAStinM5uqbPrRRXsCRI X-Received: by 2002:a05:620a:2991:: with SMTP id r17mr16740436qkp.252.1626560920606; Sat, 17 Jul 2021 15:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626560920; cv=none; d=google.com; s=arc-20160816; b=LvJ6P6220WYocuEevmmBNUn7bs+dng6sib1WRgyaujPCznUnMkgobsuAFcXvuvGXiV r+dx8VMYgyAm/nkU3vkRGr0saQfknnkkcBbWIqZcmHeY1VGm0BM5j5HJ2zgcoqHK+TTh DJRPDQeVDiwKft0Ma4ODku/1NUonOCAzMhoxeZP1mYKaGQNUKjnNw5Xj/JKIRtGiy+20 10+vRgIxHnrHViGWckBbFvdM9veFcxlTpy/rcKFAx7p9wkuf8hxU7yd8sVKfRWRk2/l7 gNVVsqlqIxXOMM5yRxL+c3wVVMY446FqC8a2xw2j5F8pLU1AvEmO5eQMSZyaAcIIwv15 rl0A== 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=4vJFTwgrLYV+L/7QAHTqeXEOD1JYdbKVZbtwn9ca/8k=; b=mD8OJeiD5rx2i0yoGf9v0okc7GZEwSRGTRNSprV9uygN5JbMNOCRNsS+IyXfoAncFd 9M1FpuqnYRoU/1+zq8o1be5lVNOTaETGSe/BoMTRqPFUhjtkCQR+BGy1RofHAYRGQBjT B12YFYaPzuPHeW6d4MV9lT63xD4VPUpyZRzoQ/giyk9CWbfLVK/1M8/QR3ROnzmPiGHU 8+MJ440TKtDyqsqGzIu+UlR0tGi6jpf1ynjRnMd/dwjrc2ioEhKgSQ9E/9O9SRVk08uu yeR/oVOJtwHv/mJ++XcBVH2OGnOT+T28g2pbgVw91B0tpr2T/scwHaFurumW9sz+lwXP jw6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bEdI9q8n; 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 dv3si12068937qvb.199.2021.07.17.15.28.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Jul 2021 15:28:40 -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=bEdI9q8n; 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]:34432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4snY-0002Cj-2X for patch@linaro.org; Sat, 17 Jul 2021 18:28:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4seD-0006xI-Nb for qemu-devel@nongnu.org; Sat, 17 Jul 2021 18:19:01 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:33469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4seC-00021I-7X for qemu-devel@nongnu.org; Sat, 17 Jul 2021 18:19:01 -0400 Received: by mail-pf1-x433.google.com with SMTP id m83so12650949pfd.0 for ; Sat, 17 Jul 2021 15:18:59 -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=4vJFTwgrLYV+L/7QAHTqeXEOD1JYdbKVZbtwn9ca/8k=; b=bEdI9q8n47BduQgIUqtwsZKqDjwEvmJ71M0zy4w6Loh9szTjokvoFekdoLzn/257Rj qrNcQk+bvHi0DflfAP+IcNYVlYVW9S3ARcgCwlMpSvC3722Le+s431zDoeIybXSG4I0T oCfDjUjoS2F6s834ncYV42efNvaFgHRWySfRfoJQw71a9sbteprchfIsaazF2dNAi/A+ owzHfq6oWfpLB6eNu0JX/dzYNMP4bNhvbo/f18q4iuJN2WRlUgPbTrkxP+S1Ol3USjTe AvJMJTYbScjP0Mj6J8999Vu7ZdTtz2tCb49axMAf8AMo8ZwbM5g7miNR+qu6VqoaRM0b WhWQ== 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=4vJFTwgrLYV+L/7QAHTqeXEOD1JYdbKVZbtwn9ca/8k=; b=MVatzp7CVogJRWDDuWFmwUAYk8BgQdB8nDdZewrnrx5bk4Fy723hBJCB0hPx4yeSOE 7p2IBU3q8Q5BGfM4/8/WdywOMtUYgDKaq6g6jUxQsRd99JkXxszHJYtltqTk9oQzrjRZ zegsAjL3Gy1hQ2cLM6QQOFx4fXQmg52/8w8Kbjzp8L7om9GrjwPsIk5U6sN/mndUj5Od yiMMHrSKHGuPlAFrE9cQTIltOL8GzVwFvw1peh2CVqEO2YzPYmzdeb8Iuv0NknkH0z2q KqUvNB3g4OX415WJRrLYrL4wquxX2eFJUrrkWTMYT20h1DP9l3BfDbXbXfUspyg5ZZPX xYIQ== X-Gm-Message-State: AOAM530yqbQAhN/t7JSkE/QjB6mCoyKbODxxhb4zjhfYgowh76pM8juT si7YL9Zjr+MerZoH79sSqdoixtZWxONihw== X-Received: by 2002:a05:6a00:2ac:b029:331:690d:7f26 with SMTP id q12-20020a056a0002acb0290331690d7f26mr17387355pfs.78.1626560338979; Sat, 17 Jul 2021 15:18:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id n14sm2405091pjv.34.2021.07.17.15.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 15:18:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 10/13] target/riscv: Reduce riscv_tr_breakpoint_check pc advance to 2 Date: Sat, 17 Jul 2021 15:18:48 -0700 Message-Id: <20210717221851.2124573-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717221851.2124573-1-richard.henderson@linaro.org> References: <20210717221851.2124573-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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: peter.maydell@linaro.org, mark.cave-ayland@ilande.co.uk, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The actual number of bytes advanced need not be 100% exact, but we should not cross a page when the insn would not. If rvc is enabled, the minimum insn size is 2. Signed-off-by: Richard Henderson --- target/riscv/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/riscv/translate.c b/target/riscv/translate.c index deda0c8a44..5527f37ada 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -973,7 +973,7 @@ static bool riscv_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that the logic setting tb->size below does the right thing. */ - ctx->base.pc_next += 4; + ctx->base.pc_next += 2; return true; }