Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E2D1C25B10 for ; Mon, 13 May 2024 11:46:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6U8V-0001yq-1Y; Mon, 13 May 2024 07:46:31 -0400 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 1s6U8Q-0001yQ-U9 for qemu-riscv@nongnu.org; Mon, 13 May 2024 07:46:26 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6U8M-0003sb-8D for qemu-riscv@nongnu.org; Mon, 13 May 2024 07:46:25 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34e0d8b737eso3071449f8f.1 for ; Mon, 13 May 2024 04:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715600780; x=1716205580; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=amBqxkPPFqRY9jRiXGlmTGX1uICfdcFTqDqTkXr7Swc=; b=UrhgW6oakUCd//dd+Jg4LGfxKCytylBCEm/kau3cq/J5QFPTLarxdEqctvkyqxQ2IV h2pyQglSEVbyvgJsEOtH1f8ElkHYoTtRNAwVczCsqKtgqdUJ4AgqxOjLxztfAS2+s3x5 bMoMvL6yaSX+vM5hgqiq00v4R3m0+naQBR0jIYnJSbab1TREEWIlebeDdxf/Zt8fQp3s YuD4Ou6h7Tg/bNTRVdDEEQ0aOOWmRI8u+0VXoMUnTCYXH9RErFHC9B/MMTww2uQsQCRB Cx0B90QAUB4SYdq4SXM45oOOW83Taw/Sub0OGMvPvCIyDtFQZftWiY1CGBH5Z5HhjnJ7 SFgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715600780; x=1716205580; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=amBqxkPPFqRY9jRiXGlmTGX1uICfdcFTqDqTkXr7Swc=; b=FrWAXAKxLH+MhxeRHYHHTZpgwmOkydrMRpeTV/FscsnKG4MRi5H6/VD8TnS6JY9YKU CgjHdPqWV8xRzuMOL5pH8Wu+biu/SZkmhsYWAaJR5WzxKyemV4SyMiT3aXN9n7iWU1aW Oo3mG+iovXiJh9nCPJfMeuiWgN1BzoQ4luIKkq9oiRUTVF27qE55bEHqobMqvb9rc+zi 2ojPrLDdDsW4LZJqc0hZ06XAYo/MC0Kl07xzqvc3nkxNx7Tz0aRhVmIdHYmOuSQHcR1C 6khGiMs+9R3I7ZdL0Gk8i/nnzGjCBLy1YRMuulrACOTo0zyNRZDsK1TDASWno0gA8KQc rh4A== X-Gm-Message-State: AOJu0Yx2LJrSWRbrYdHWRHJeqvoxoiDuaBLruWJlNk/KtHug+VVoZdmZ ViqMNGgnE772IayirZrKmo86ojBtrKYCgqimcc2F/EpPapidOH5VlJOY+kK3pXCGptuJ5wWUf2n NLy0= X-Google-Smtp-Source: AGHT+IGx8cgmZKwD3vwNweKzY+bza2zH71MGWSGYKFcTLEVK2sqtWKgsJ3JqnY1NgOyE7O+SnjCqbA== X-Received: by 2002:a5d:4892:0:b0:34d:af19:2373 with SMTP id ffacd0b85a97d-350498a4c57mr7968620f8f.16.1715600779936; Mon, 13 May 2024 04:46:19 -0700 (PDT) Received: from rkanwal-XPS-15-9520.Home ([2a02:c7c:7527:ee00:45f9:e636:91a8:bb8e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502baacf47sm10907636f8f.78.2024.05.13.04.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 04:46:19 -0700 (PDT) From: Rajnesh Kanwal To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org Cc: alistair.francis@wdc.com, bin.meng@windriver.com, liweiwei@iscas.ac.cn, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, atishp@rivosinc.com, apatel@ventanamicro.com, rkanwal@rivosinc.com Subject: [PATCH 0/2] Minor fixes and improvements for Virtual IRQs Date: Mon, 13 May 2024 12:46:00 +0100 Message-Id: <20240513114602.72098-1-rkanwal@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=rkanwal@rivosinc.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@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-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org This series contains few miscellaneous fixes related to Virtual IRQs and related code. The first patch changes CSR mask widths to 64bit as AIA introduces half CSRs in case of 32bit systems. Second patch fixes guest and core local IRQ overlap. Qemu creates a single IRQ range which is shared between core local interrupts and guests in riscv_cpu_init(). Even though, in the current state there is no device generating interrupts in the 13:63 range, and virtual IRQ logic in Qemu also doesn't go through riscv_cpu_set_irq() path, it's better to keep local and guest range separate to avoid confusion and any future issues. Patches can be found here on github: https://github.com/rajnesh-kanwal/qemu/tree/dev/rkanwal/irq_fixes Signed-off-by: Rajnesh Kanwal --- Rajnesh Kanwal (2): target/riscv: Extend virtual irq csrs masks to be 64 bit wide. target/riscv: Move Guest irqs out of the core local irqs range. target/riscv/cpu_bits.h | 3 ++- target/riscv/csr.c | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) --- base-commit: 09d8c49f23e9a130593984d5c8cf048bdd76f73e -- Regards, Rajnesh Kanwal