From patchwork Thu Mar 3 20:46:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 547814 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp969158imq; Thu, 3 Mar 2022 12:49:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0Oqi5g7gjB7iQXhZUf/KoudZSoGa++V3ofahKPGdbNEq4gjPMttWBKHkXfHp+fo5pTMzR X-Received: by 2002:a5b:689:0:b0:61d:9014:bbbe with SMTP id j9-20020a5b0689000000b0061d9014bbbemr34681804ybq.34.1646340582258; Thu, 03 Mar 2022 12:49:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646340582; cv=none; d=google.com; s=arc-20160816; b=j49/gQf0GUo6IB8QQhRAyIIQpIWNGoFWL/2/dty3EHElomY397D3+uf9S2Lmgq4VBZ Oy61Qsph9smypxXntrNIMAeL6DBieMD/d8Ngbi80ESUP0vPrWnLDt6ULILHBEd4gWvhL wGhpY/JoS59Mac/FilkKDO/04ZwR4qE4yoxH2hZ9scFSo4feCDMPSRtotE7xtE+rnGk7 RuI1ESUAtZsmiQ1OzNiUG8tLHM6YnEwriBsNaLtBXb78thaHmSHUcctWHG5JUsLJWf/L Od+CwtpR5/JNe0B0U3iQDi4hQMScmVhlWg5X6PnJ4qfCJzYuu1BfCybY/Akfxt+9GY3d zHZQ== 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=ngdOSpEXdyoj/2hX4DgLlWUWJ0os8VUKvzBanI2gIUE=; b=n08BJTjD970AstgbwX1/yj0Sx+1c+S9VB7psr9PAU8B1LGxvFIOz8g/8FeI7BGKped +2mTx7FTdWZYIU04RD/vd0vfb50cH8ciR+4WS0iA/b1tZWS6odX8i6vkTBzfqcO+QHtq Z4Q0+ORkVFxgzAZKhSXZj/VL81qbqxJWsQxvSHORiMx1I6+GRUajneYpHL6ofcRXs0ER oGC6ATOMf5ouuptn8AuD2Z6f+lI+MLjaZkKdz+ELVb2auRCLoaGfC16fF198CTNC0eem +2MVqJ53hbLYicjjE62FZ91ImUUiGqfGTnQREAHnk47eh6hiT4bzip0BJaLvnNLOYgF6 7udg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RvUciXSh; 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 k84-20020a815657000000b002dc04cea63fsi2519355ywb.292.2022.03.03.12.49.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Mar 2022 12:49:42 -0800 (PST) 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=RvUciXSh; 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]:33970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPsOL-0007JR-Q9 for patch@linaro.org; Thu, 03 Mar 2022 15:49:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPsLa-0001a9-Mv for qemu-devel@nongnu.org; Thu, 03 Mar 2022 15:46:50 -0500 Received: from [2607:f8b0:4864:20::1033] (port=42972 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPsLX-00010G-UY for qemu-devel@nongnu.org; Thu, 03 Mar 2022 15:46:50 -0500 Received: by mail-pj1-x1033.google.com with SMTP id c16-20020a17090aa61000b001befad2bfaaso5671704pjq.1 for ; Thu, 03 Mar 2022 12:46:36 -0800 (PST) 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=ngdOSpEXdyoj/2hX4DgLlWUWJ0os8VUKvzBanI2gIUE=; b=RvUciXShU+n6we9vfK68q8jwYeM5FPj8cKsXEPCAak2pkY/q7XSdHgZfBYla+L8ngI SihCSpGK5WPORFhBk6GCxInvi9Sd1CT/PYqwcl+3c3E6WX8DuxWAKt2FRzddWh57djwd WJIEA7DLX3Xe0wUr5XdXRRry9hMJkQNU3NQGJNSozCjns/ipXrXMxveqkkU8hghuVYr3 yb6J+Hd9YBsjKdzWOzcdX7ZXvLmFU8jYAHddsKiwl6dC62Ddkb4SskNVg80AZwc6JuBk fVUrC51NIVREzSh5+7eVEMbsjEyYBgPoiUpLNuliZOVWHOduDHPhSIIMJl4DD0brhgoj 0GYA== 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=ngdOSpEXdyoj/2hX4DgLlWUWJ0os8VUKvzBanI2gIUE=; b=xffkdUmEVPnNuErKqfaaw2QSq7MutlpqMzps+RuDCBLHBluM3szobdz/A3rGmgkU1y QW3mkXaXqyQDrRuQAWn34QZv32/qTvlJhf2D/2JNt0G29Zi8WdjDIPWd8YpHNiZQJH21 wFeSXf8UDBC9hJPh0zmEylS/EtJ7t4qpqGdhWMOKiHxr0eKm/B1IQl07mtmdZtT5D25+ 2GdQz5njwVRxfiRm3JdCTky3JInCZp12lK/rWrPJaoFy/Uss7KQ8x1gGJ0JSKnuZ3YUX jmvPJdQJomL4S4ZuQVo4xiaAxtIexzzZdBbK2qJGWq13mgsGMNql3lTmJcYvWc6WuIj0 /3Gg== X-Gm-Message-State: AOAM5310T8duKQdRYyRWJNJ+n4JHHPU9whC2yXR31akQYXJD7rejusr4 LyhBq3O6iA54kV+GgnTcHuvdYsj/IB8vHg== X-Received: by 2002:a17:90a:d145:b0:1bd:5400:cba9 with SMTP id t5-20020a17090ad14500b001bd5400cba9mr7288220pjw.232.1646340396112; Thu, 03 Mar 2022 12:46:36 -0800 (PST) Received: from localhost.localdomain (2603-800c-1201-c600-119c-490c-a4ee-08e8.res6.spectrum.com. [2603:800c:1201:c600:119c:490c:a4ee:8e8]) by smtp.gmail.com with ESMTPSA id d16-20020a17090ad99000b001bcbc4247a0sm2901211pjv.57.2022.03.03.12.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 12:46:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 6/7] target/nios2: Special case ipending in rdctl and wrctl Date: Thu, 3 Mar 2022 10:46:23 -1000 Message-Id: <20220303204624.468786-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303204624.468786-1-richard.henderson@linaro.org> References: <20220303204624.468786-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It was never correct to be able to write to ipending. Until the rest of the irq code is tidied, the read of ipending will generate an "unnecessary" mask. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/nios2/translate.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 52965ba17e..a5f8d20729 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -452,6 +452,17 @@ static void rdctl(DisasContext *dc, uint32_t code, uint32_t flags) } switch (instr.imm5 + CR_BASE) { + case CR_IPENDING: + /* + * The value of the ipending register is synthetic. + * In hw, this is the AND of a set of hardware irq lines + * with the ienable register. In qemu, we re-use the space + * of CR_IPENDING to store the set of irq lines, and so we + * must perform the AND here, and anywhere else we need the + * guest value of ipending. + */ + tcg_gen_and_tl(cpu_R[instr.c], cpu_R[CR_IPENDING], cpu_R[CR_IENABLE]); + break; default: tcg_gen_mov_tl(cpu_R[instr.c], cpu_R[instr.imm5 + CR_BASE]); break; @@ -477,6 +488,9 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags) case CR_TLBMISC: gen_helper_mmu_write_tlbmisc(cpu_env, v); break; + case CR_IPENDING: + /* ipending is read only, writes ignored. */ + break; default: tcg_gen_mov_tl(cpu_R[instr.imm5 + CR_BASE], v); break;