From patchwork Fri Feb 10 16:37:36 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: 652347 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1060001wrr; Fri, 10 Feb 2023 08:39:47 -0800 (PST) X-Google-Smtp-Source: AK7set8fXhFGzNVNS/9A9jtzQlQqd1BkXuaHhbOEVcYWi7DAJLaQkioJ8UJF0AML9PpIdGx542v1 X-Received: by 2002:a05:6214:411a:b0:56a:bccd:3703 with SMTP id kc26-20020a056214411a00b0056abccd3703mr26870467qvb.16.1676047187118; Fri, 10 Feb 2023 08:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047187; cv=none; d=google.com; s=arc-20160816; b=INTAjnYznkHDhxetFHvXpmb8K1mpPi0N8/WvkrZ6pBpGZY/sKNhAxxO0C2i3vrmhB0 s5JdaMYdIf+xtfRha+8jEj5QgaMBnWVilEZBZj9D66Bnl1aYjs7HJyyJ63da6bXczlRT JrIsW4q+CSIiqTvEPKRmnEOcT11/D+GLsyobdV5KK6gg0CFnKt2LKO9K38WEWljt6v3f 8aNkBhuFEeIx5pyOxyONy6BHvRU+JgBbjolW4OlgMhdHrJo3t/GVn33K8R6XRm3ROw6R eV8VvGLjRADAhK1xIvau/8DT6aUWrYfKvxhKGfvyoXnvzvi+B4i73WI9Z0EFSZ73yqJs 6vxA== 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=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=KIuZ6maoVTPcpUl/mP1BEi9SCotsHciyQe/SX5YJH/CA/zf8cHlQXjYEo7QRoSryVf 2dG0jLMIeqrJJ/oWjxWyE6cIkRTVf2i7M0PHxlV7Ur8voE5QkdkHbKsBDRxW7IK8rKQD xepCyjRR+/q0LNfNOi8YC8jpa3nagd3lxHDRuDmQwmEg4cXN86IZxTOV3Wg8qDHVqpsN pRkgGMrxbFgvp2ybAqDqyuBaBn2tpFgRTz/63xYTzsgo5XbCkn3GzBKX8IzN6ar1jmFk k/lQU7UtHl3ODf8J+dd68Q/91/EfXkzwJBijNLY8qlTGNT9EJ3ULbW/FiIqsHySmGTpp kbYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u9nXTa6m; 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 h20-20020a0cf414000000b0053c64c47019si4012701qvl.55.2023.02.10.08.39.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:47 -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=u9nXTa6m; 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 1pQWPY-0000TE-6I; Fri, 10 Feb 2023 11:38:08 -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 1pQWPV-0000Ss-Qw for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:06 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPT-0000Em-Ht for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:05 -0500 Received: by mail-wm1-x32b.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so5666027wmp.1 for ; Fri, 10 Feb 2023 08:38:03 -0800 (PST) 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:subject:date :message-id:reply-to; bh=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=u9nXTa6mcNBWa1ZNMJ3Io03hGIfjuQdBPU/OS7at8pCfnBCn03BYXbv+fvkwtFEgpi TQIkVF3rwcyU3FCDBB301p5z16i/W6wQ5bWCLTO8K0UBulc/jjZK8kTTC8qOuPHFUON5 OObA+gqBzNWmykBvIGywMWRv1Xvicvl/U+iV6yVwmP9zTej6hnZ+q4nQ/3dEGrPosEFm Olu8jI8zND7DaSB+ddvjINv8nWMm34H7yHGFhVgsGERj+XbpKEDPEycPiZ5J1vTnJHCT Od2xGw+nx9lF0W1Mx29MkOdBsMrurxWC7N4xO5slwujcFfZN/kr4S++HU++ElcQOdfKt IxWg== 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 :subject:date:message-id:reply-to; bh=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=shuBDieX3VLlXTTn8d0PtcipAxCv+JkyCave5i4Vi6uMIPE8xD5U5P3uVZ7IG+/MEz C5qxXtpsdkBIRag+2uucoCUrYcSrAbqJdNIuuIr/xL8l368ghSOyFvgLh4Rg4V9s7jjh P6sYVGygQmK8KHutduBjJ8+ilmhpzMc+sWvi3lB+BGOGFk1h2QV0LOllIrTgxFNV5oyr YJsTIX51QUelKn/+iAGxzjRu3biGtRN+asWhZrBbSmj6e5o/giQMYsm73xvOsCQn59dW ciHErHIsM28JsLehNKQooxjE/YQVh8PGSFa2CRjbUCdVIst3Pz5rJxZdsqNH6cj49aRW 4paw== X-Gm-Message-State: AO0yUKUp7MKYQusynrMGcLgXYzayvqUOCRwyR3u4FbwlNejFd/fbCZCT bUi96I/0c+thTI5K5FPUZTGuSF2IKm7/6dRE X-Received: by 2002:a05:600c:4910:b0:3dc:440f:8e9d with SMTP id f16-20020a05600c491000b003dc440f8e9dmr13754005wmp.0.1676047082115; Fri, 10 Feb 2023 08:38:02 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l4-20020a7bc444000000b003d9fba3c7a4sm8034390wmi.16.2023.02.10.08.38.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv=C3=A9?= =?utf-8?q?_Poussineau?= Subject: [PATCH 03/11] hw/isa/i82378: Remove intermediate IRQ forwarder Date: Fri, 10 Feb 2023 17:37:36 +0100 Message-Id: <20230210163744.32182-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: Philippe Mathieu-Daudé When the i82378 model was added in commit a04ff940974 ("prep: Add i82378 PCI-to-ISA bridge emulation") the i8259 model was not yet QOM'ified. This happened later in commit 747c70af78f ("i8259: Convert to qdev"). Directly dispatch ISA IRQs to 'cpu_intr' output IRQ by removing the intermediate i82378_request_out0_irq() handler. Rename ISA IRQs array as 'isa_irqs_in' to emphasize these are input IRQs. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/i82378.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 84ce761f5f..d32653369d 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -33,7 +33,7 @@ struct I82378State { PCIDevice parent_obj; qemu_irq cpu_intr; - qemu_irq *i8259; + qemu_irq *isa_irqs_in; MemoryRegion io; }; @@ -47,18 +47,12 @@ static const VMStateDescription vmstate_i82378 = { }, }; -static void i82378_request_out0_irq(void *opaque, int irq, int level) -{ - I82378State *s = opaque; - qemu_set_irq(s->cpu_intr, level); -} - static void i82378_request_pic_irq(void *opaque, int irq, int level) { DeviceState *dev = opaque; I82378State *s = I82378(dev); - qemu_set_irq(s->i8259[irq], level); + qemu_set_irq(s->isa_irqs_in[irq], level); } static void i82378_realize(PCIDevice *pci, Error **errp) @@ -94,9 +88,8 @@ static void i82378_realize(PCIDevice *pci, Error **errp) */ /* 2 82C59 (irq) */ - s->i8259 = i8259_init(isabus, - qemu_allocate_irq(i82378_request_out0_irq, s, 0)); - isa_bus_irqs(isabus, s->i8259); + s->isa_irqs_in = i8259_init(isabus, s->cpu_intr); + isa_bus_irqs(isabus, s->isa_irqs_in); /* 1 82C54 (pit) */ pit = i8254_pit_init(isabus, 0x40, 0, NULL);