From patchwork Thu Sep 1 05:48:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 601788 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp209396mae; Wed, 31 Aug 2022 22:54:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR40YQge244ZO4RXqJTOiKVuuBWN6ghXLB32HTFGfevU3JdIuw4XuXV+jKpEaAyIHfRW19B4 X-Received: by 2002:a05:6214:f21:b0:498:fada:9416 with SMTP id iw1-20020a0562140f2100b00498fada9416mr19646360qvb.84.1662011690587; Wed, 31 Aug 2022 22:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662011690; cv=none; d=google.com; s=arc-20160816; b=w9948O4N4LYzcUdDypXi8dp/hEIJFkOrPoWr7DbwjTMHkeLJijVM7vnvHkQcoCBy+N y5nPhZtDpGvS78pHxJlAQSE8gd4Xa9EdHSOaldXUAzJRRrzpqk+5MXd/IZ+skUj9529N cTFOUhnccbEx2DcgOk6iyZURN71a47OiEczwAqOVNCQ9ZL+7F7VSEUb0Q8wFLY7/Ha0q rEGXGCRPSVgyl85e9BLq0qCMU8xFHpvtOErybQmCmpMyQK4Fu6BenUp4qExgeRWi9DXc 9TrxblqL6iJ8Rxbg0p9IV8tpkyagJsO46cL4//0h/un+tKSzJfYKp0TB4ZN1CBDC3rLa 7VmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=onqIs+XT2WZfG8WtGyXgNUrHr/Df9zcYrXD6nOSwGCs=; b=Dbnl8B/I7o2Uh56IC+oD7DrdpJGmkzaXoYM0+lCbBwKehfvwRFG3y49/RcpimeFdCw XWmuCJUnP08BDCjtlqVqkkgG/UdmV7V5nlDHlf2DJsu1MxmbySaDr+gnyfVx2DdD46WN SX2XMjTgDJ6in18kLLOWri6eRi8w8UbriZWlfzbjqHWX6uCabyYo76tL//dO2OCqZbke GcKhcnTdGHZxKoYYmpq+J09M7US+UywGpdDJTRSZ6OVVzPiNeYPqMn68IaO7kSiEsizq permaCI+UU3HVQ4qRCF7IffdfksvPJ2YpceTNyCBdqsIK7trAbLFokv+BH9O2gvPjmxX qhqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uQBW/8tn"; 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 10-20020a0562140d6a00b0049905897ce1si6089919qvs.42.2022.08.31.22.54.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Aug 2022 22:54:50 -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="uQBW/8tn"; 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]:38592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTdAA-00030k-65 for patch@linaro.org; Thu, 01 Sep 2022 01:54:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTd4Q-00073y-Lo for qemu-devel@nongnu.org; Thu, 01 Sep 2022 01:48:54 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTd4O-0002T6-Uc for qemu-devel@nongnu.org; Thu, 01 Sep 2022 01:48:54 -0400 Received: by mail-wr1-x436.google.com with SMTP id u17so1590833wrp.3 for ; Wed, 31 Aug 2022 22:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=onqIs+XT2WZfG8WtGyXgNUrHr/Df9zcYrXD6nOSwGCs=; b=uQBW/8tnJAsg7rFDlHOWg8jdifLXntZjgajxOcGQzxgXtKIlJcCDNzwRMMOh5hVFEO /IwhD4Cs1yVahJXjiIm2G4rKb5M8xc2mNOLDPbX4gLV2GlDc2csrDAKApWw7qUltPpYr Jw0PWiHGhqfcXpM5d4TllpA8xGMDrKtB/zmDymTQwSTDAoNyaWObb1FztG0/1aAK/Cmz Q8xuWNhJt/ux9jgfrkyryunPABrvC941pzlo+shDPP/JsBF+saBcSkbWeDBC/lGz1kap l5av28iMP/kSWW1WMsmGN8ukET5dVPTU9UtYBCSJ+xn0DmMi0WY+UVtUT5lYBkL+pPAj QHdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=onqIs+XT2WZfG8WtGyXgNUrHr/Df9zcYrXD6nOSwGCs=; b=jUqfocP8rApcfVVPQtOfOPDnjohAgUWhUmjzpsBuO2hs8LqyXG3nIy1B9SVOvPxUpI gG5zQm963tXBzXQbYZi5rlwhRBcfiG0cbOWKS7493JXJWJ3ACrs7bRSPlTq4zc96KhQB ZKvHdb1pvNsq/PCxYUNaxiTC+pj21r0BlkYX0Anl8oXnzsBI9FobhwdoOEfkeqga5LKk 7cT704/Y+YEzuY5UfRYIal2eosWl5emFwCMflgA8Us3+EyyF2x0FhH14vmcpf3asTKxr xUD3B95fss63UKYFdNXmaGeqEoL/BcGflx29V8xJzL3sMLLYgdamifRhBoElZKknXy+t 2ZuA== X-Gm-Message-State: ACgBeo0fvcmgCC9ENJjMU6UJD4S5FNzeJ9xLVuFSkTpmZgmBiYrBz6lQ n710/5FIDtTBr/w9bDYk+W6Zab7BqCYBc5ljGk4= X-Received: by 2002:a05:6000:1e18:b0:226:e095:a98c with SMTP id bj24-20020a0560001e1800b00226e095a98cmr7087054wrb.235.1662011330233; Wed, 31 Aug 2022 22:48:50 -0700 (PDT) Received: from localhost.localdomain ([87.192.221.83]) by smtp.gmail.com with ESMTPSA id q13-20020adff78d000000b0022533c4fa48sm13429938wrp.55.2022.08.31.22.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 22:48:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Michael Rolnik , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 3/4] target/avr: Only execute one interrupt at a time Date: Thu, 1 Sep 2022 06:48:42 +0100 Message-Id: <20220901054843.31646-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220901054843.31646-1-richard.henderson@linaro.org> References: <20220901054843.31646-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We cannot deliver two interrupts simultaneously; the first interrupt handler must execute first. Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/helper.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/target/avr/helper.c b/target/avr/helper.c index 9614ccf3e4..34f1cbffb2 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -28,7 +28,6 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { - bool ret = false; AVRCPU *cpu = AVR_CPU(cs); CPUAVRState *env = &cpu->env; @@ -38,8 +37,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) avr_cpu_do_interrupt(cs); cs->interrupt_request &= ~CPU_INTERRUPT_RESET; - - ret = true; + return true; } } if (interrupt_request & CPU_INTERRUPT_HARD) { @@ -52,11 +50,10 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (!env->intsrc) { cs->interrupt_request &= ~CPU_INTERRUPT_HARD; } - - ret = true; + return true; } } - return ret; + return false; } void avr_cpu_do_interrupt(CPUState *cs)