From patchwork Tue Mar 7 23:46:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 659881 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp37286wrb; Tue, 7 Mar 2023 15:48:25 -0800 (PST) X-Google-Smtp-Source: AK7set/ermfx6qGvjWE4HtLSML2tY3rt7V3PlZEwMksNJwNpYmS7JTG/tzuKFWLWiRyb+z1EKNmr X-Received: by 2002:adf:e30d:0:b0:2c5:3cd2:b8e with SMTP id b13-20020adfe30d000000b002c53cd20b8emr10534367wrj.1.1678232905168; Tue, 07 Mar 2023 15:48:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678232905; cv=none; d=google.com; s=arc-20160816; b=tmRjh7K/25f4NEbYtVQn3lL3DVLssO3ch2ZAAtO1xNhULlfpMdd2JIKvm8O2DeFKFA fvrUdQ38r+Z3wTYN5geO2OQjUHZmGEAEPsBThzWcyWvnQ4iIMNCdbSDj2r90S4eBfrRR Df7JPdB2A6+sB/A6L1mMgzOqojr7V6b8BGaJgDCJI9HlMsc+MRPcaL8j6SJ1PB3E20xM xAMP7BM+HQ72x6ErhZpTJr+qKa6rDBtOAfP3wyf1+n1RNtmPks3jp52tZPYQ/aSb2omi tHh8FIV8Kqa3otTOwQDNtGEgsR0Q994TzURccREW5b+VVbWtGGWk4NnjwHdBCiHVrglW M7qg== 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=UexqQ8oqlDlV/fYFNmt7r3WxJQAbUfO1HiCV98NJrIs=; b=qlCZO+UI1E8rLdgKQ5YZIQJKBu836xNbOQxsN3G+l+U+EvdJoeVDJCLXIMOMOThCCW 4tN/LNV/PVs6i5+vc8gwlYZ2tN509K6KRly/VI1uc0U7VxIbX1tYhETBsBmcbVaIBKGw vO+WYGPSsoeOzc5hvNLqqCBQFzckNB/0dNMajhDulUQQamqkfvUapWKRrIgMvHlAxxQG z/KfcF/4wMytNNov1Gtil4SXTONpIKRMW8vpUACi2lMiV15QK5rKQ+TqySuAh6vn8L7O q+VkGS8Gn10Y/X6l1EA77tfSL95aZWDENhJYn+njXWI1XGL6VBMFYTDKNMGrmPIUG78z NOMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xpHqSQjC; 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 k4-20020a05600c1c8400b003e002ad5d5bsi15288948wms.122.2023.03.07.15.48.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 15:48:25 -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=xpHqSQjC; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZh23-0000q0-NR; Tue, 07 Mar 2023 18:47:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZh22-0000lI-7M for qemu-devel@nongnu.org; Tue, 07 Mar 2023 18:47:46 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZh20-0002h6-BS for qemu-devel@nongnu.org; Tue, 07 Mar 2023 18:47:45 -0500 Received: by mail-wr1-x435.google.com with SMTP id j2so13763271wrh.9 for ; Tue, 07 Mar 2023 15:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678232862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UexqQ8oqlDlV/fYFNmt7r3WxJQAbUfO1HiCV98NJrIs=; b=xpHqSQjC6XxNvGRkFLSBULrlNVEwLrfAQR4at4tDWIiLtfpspvR5jbl3QyaUZnax1Z sM3l8T9ik/gJt/mAJH/Mva11HaqEw8sr2s+/infKaLe0L0A4ETxhdf4yclSEmlY1Sq7D /F3Dwlk04isG+Zh6SOFypAohSGzKB68n5Yov4jP+0b1iOnU9+Z9O2dRDJEM4sFp1tf+0 NRU/aVDe8JZy65iWLNUwWQTmEdc/eYr2BlvXWRmFqtUUGapHCruSe/4c/g7HU6Wn7gDQ 4bG/8kvIqdKnXMBxE5DtxpUrHIw2uiHOTrxV8MdIKz/dzZ2yRaJ9VkVQ0qzCH/L85YHs /3KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678232862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UexqQ8oqlDlV/fYFNmt7r3WxJQAbUfO1HiCV98NJrIs=; b=WgzAb3Y6gJEQE1+E75R2uoaTEEWlahcPKZf1Q3xucVz5rq1OSPogOyBNvGRnrbVtyS 3qBbFHVfQaOrXtef0xtC85QsmXBDiVPNvejFA9R5zyr9IxmV4CLoQMXqR1z5u1TP4Cox vw5ZoG1AeDeJ2VSNm34ScYya89BJVTw0ByKH/M52B4rLjLx6Lbjyuz7koxLuwTDlT8m4 Ap3LefEy54QCKUuJH6tzI9I+x//HAiTr/HBsHxgPVXTARujzTUg6uI6SwaDOvBxyKC45 3oyuVoJQqSXfdK8OM1bdGg6Te0p00Sc0YH6YOKbx0dwTUJUaal/B48x9If/PQcJK1fU1 xE0w== X-Gm-Message-State: AO0yUKU8ztFdnx/2KiFbDSX1Ftma3z5mEsEvBMS82ApCGx0p29U53jMa EGBBYeBbBu5xA5eayL70SvaOVhbEpLKPYxvxaPk= X-Received: by 2002:adf:ea47:0:b0:2cb:4df5:932d with SMTP id j7-20020adfea47000000b002cb4df5932dmr9905010wrn.22.1678232862757; Tue, 07 Mar 2023 15:47:42 -0800 (PST) Received: from localhost.localdomain (57.red-88-29-179.dynamicip.rima-tde.net. [88.29.179.57]) by smtp.gmail.com with ESMTPSA id w17-20020adfd4d1000000b002c6d0462163sm13738825wrk.100.2023.03.07.15.47.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Mar 2023 15:47:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Marcin Nowakowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 05/20] target/mips: Implement CP0.Config7.WII bit support Date: Wed, 8 Mar 2023 00:46:56 +0100 Message-Id: <20230307234711.55375-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230307234711.55375-1-philmd@linaro.org> References: <20230307234711.55375-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-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.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-bounces+patch=linaro.org@nongnu.org From: Marcin Nowakowski Some pre-release 6 cores use CP0.Config7.WII bit to indicate that a disabled interrupt should wake up a sleeping CPU. Enable this bit by default for M14K(c) and P5600. There are potentially other cores that support this feature, but I do not have a complete list. Signed-off-by: Marcin Nowakowski Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230216051717.3911212-4-marcin.nowakowski@fungible.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu-defs.c.inc | 3 +++ target/mips/cpu.c | 4 +++- target/mips/cpu.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu-defs.c.inc b/target/mips/cpu-defs.c.inc index 480e60aeec..fdde04dfb9 100644 --- a/target/mips/cpu-defs.c.inc +++ b/target/mips/cpu-defs.c.inc @@ -333,6 +333,7 @@ const mips_def_t mips_defs[] = .CP0_Config1 = MIPS_CONFIG1, .CP0_Config2 = MIPS_CONFIG2, .CP0_Config3 = MIPS_CONFIG3 | (0x2 << CP0C3_ISA) | (1 << CP0C3_VInt), + .CP0_Config7 = 1 << CP0C7_WII, .CP0_LLAddr_rw_bitmask = 0, .CP0_LLAddr_shift = 4, .SYNCI_Step = 32, @@ -354,6 +355,7 @@ const mips_def_t mips_defs[] = (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA), .CP0_Config2 = MIPS_CONFIG2, .CP0_Config3 = MIPS_CONFIG3 | (0x2 << CP0C3_ISA) | (0 << CP0C3_VInt), + .CP0_Config7 = 1 << CP0C7_WII, .CP0_LLAddr_rw_bitmask = 0, .CP0_LLAddr_shift = 4, .SYNCI_Step = 32, @@ -392,6 +394,7 @@ const mips_def_t mips_defs[] = .CP0_Config5_rw_bitmask = (1 << CP0C5_K) | (1 << CP0C5_CV) | (1 << CP0C5_MSAEn) | (1 << CP0C5_UFE) | (1 << CP0C5_FRE) | (1 << CP0C5_UFR), + .CP0_Config7 = 1 << CP0C7_WII, .CP0_LLAddr_rw_bitmask = 0, .CP0_LLAddr_shift = 0, .SYNCI_Step = 32, diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 05caf54999..543da911e3 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -143,11 +143,13 @@ static bool mips_cpu_has_work(CPUState *cs) /* * Prior to MIPS Release 6 it is implementation dependent if non-enabled * interrupts wake-up the CPU, however most of the implementations only - * check for interrupts that can be taken. + * check for interrupts that can be taken. For pre-release 6 CPUs, + * check for CP0 Config7 'Wait IE ignore' bit. */ if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && cpu_mips_hw_interrupts_pending(env)) { if (cpu_mips_hw_interrupts_enabled(env) || + (env->CP0_Config7 & (1 << CP0C7_WII)) || (env->insn_flags & ISA_MIPS_R6)) { has_work = true; } diff --git a/target/mips/cpu.h b/target/mips/cpu.h index caf2b06911..142c55af47 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -980,6 +980,7 @@ typedef struct CPUArchState { #define CP0C6_DATAPREF 0 int32_t CP0_Config7; int64_t CP0_Config7_rw_bitmask; +#define CP0C7_WII 31 #define CP0C7_NAPCGEN 2 #define CP0C7_UNIMUEN 1 #define CP0C7_VFPUCGEN 0