From patchwork Sun Nov 20 15:05:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1706955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=j4WZTinf; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NFYmq1kbXz23lt for ; Mon, 21 Nov 2022 02:08:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owlu2-0002HR-6j; Sun, 20 Nov 2022 10:06:38 -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 1owlu0-0002Gj-8K; Sun, 20 Nov 2022 10:06:36 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owlty-0001x0-ID; Sun, 20 Nov 2022 10:06:35 -0500 Received: by mail-ed1-x532.google.com with SMTP id s12so13107363edd.5; Sun, 20 Nov 2022 07:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=iFXOKlp0SyW2/quDQLXPdvOqIsDId/um2sWE130FuUA=; b=j4WZTinfWmrq/rVZq4czb8CXWrLF7NMmg1iw+pbfl9w8aCgEAa9HKyLe9QprNVt1C3 qSGQVlig3ZUwlx2lXcE4e93CY4oGN5wSTCgRg5JiiMBqfjx9lsFCrJ75ENal90xisUQS ZWY9astIIqJsKwFt7LYv4IebBge15DcXT21mrDl559MuJWUqPG9tyEw0tbUAScbBn4zk x+mjs9VPa55oaW/wVsY4rCyLMxctoAdMMLkUVD94jna4uxelNnLj9jT4Vkc4x5twa1oO jrAJ+Rhn0S6Cqfbyq87kBjgCLmqL5iEIZRtlTUZ25+GTStUNslLorI1h6V01iDXJtlCM 6JpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=iFXOKlp0SyW2/quDQLXPdvOqIsDId/um2sWE130FuUA=; b=b5trYKmywHq/zN21EOJfmW0Vsvp1lFSaRcSjDlS0VfqZ/p1RKTgB6gr4yfpFvg9R84 s+LvpPFKxoAa+KTsr3ooH7weYoIIgiYBWq9pC3gnw8VtYVqd2zGxiNnmsXMqa3z6ZDRI DDHq/pt7VMHI4K8QJloeRp1ndScUo+q0tQQCiBewsQ9A2d3kPwOGZjpSNi3JTM4SwmR5 07vqJzmzmWWHfO6iI8moN82ocmaDOrtF00StB+7NELcekakUGg2C4/5SHmRsqHAcoUaQ vsKzZVplxf5rA5uqLlV9rBnEEnwAiWcr6fZ6RUQbzgpAP84WjzBmQlAnE/tUzrvNKnqy ucYg== X-Gm-Message-State: ANoB5pn/1zC4W5TaBbNT5is0CjryaqZIDyJ7KufHwjmtOetueU/RuX81 YgncHjSaZ9qvhmO/xw0jOFphOsWpcXQ= X-Google-Smtp-Source: AA0mqf480RWkJumJA4jfoShY0TA8yCEnh4W3mO33/50WpFCh5/tBP3dIoU1ox8T6EEesc5PsfoLM0A== X-Received: by 2002:aa7:dd04:0:b0:457:d794:f5ee with SMTP id i4-20020aa7dd04000000b00457d794f5eemr986505edv.227.1668956791699; Sun, 20 Nov 2022 07:06:31 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-067-205.77.13.pool.telefonica.de. [77.13.67.205]) by smtp.gmail.com with ESMTPSA id u10-20020a1709061daa00b007b2a3cad2cfsm4026785ejh.132.2022.11.20.07.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 07:06:31 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: John G Johnson , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Jiaxun Yang , Aurelien Jarno , Paolo Bonzini , Marcel Apfelbaum , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Elena Ufimtseva , Eduardo Habkost , Jagannathan Raman , Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow Subject: [PATCH v2 0/3] Decouple INTx-to-LNKx routing from south bridges Date: Sun, 20 Nov 2022 16:05:47 +0100 Message-Id: <20221120150550.63059-1-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=shentey@gmail.com; helo=mail-ed1-x532.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, FREEMAIL_FROM=0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org v1: === During my PIIX consolidation work [1] I've noticed that both PIIX models have quite different pci_slot_get_pirq() implementations. These functions seem to map PCI INTx pins to input pins of a programmable interrupt router which is AFAIU board-specific. IOW, board-specific assumptions are baked into the device models which prevent e.g. the whole PIIX4 south bridge to be reusable in the PC machine. This series first factors out pci_bus_map_irqs() from pci_bus_irqs() which then allowes for moving the two board-specific PIIX pci_slot_get_pirq() funtions into their respective boards. With these changes, the PIIX4 south bridge could eventually become an alternative to the PIIX3-Frankenstein solution in the PC machine. v2: === * Remove RFC tag from whole series * New patch to split pci_bus_irqs() * Remove VT82xx patch which was just a demonstration Testing done: * `make check` * `make check-avocado` * `qemu-system-mips64el -M malta -kernel vmlinux-3.2.0-4-5kc-malta -hda debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1 console=ttyS0"` * `qemu-system-x86_64 -M pc -m 2G -cdrom manjaro-kde-21.3.2-220704-linux515.iso` Thanks, Bernhard [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03941.html Bernhard Beschow (3): hw/pci/pci: Factor out pci_bus_map_irqs() from pci_bus_irqs() hw/isa/piix3: Decouple INTx-to-LNKx routing which is board-specific hw/isa/piix4: Decouple INTx-to-LNKx routing which is board-specific hw/i386/pc_piix.c | 16 ++++++++++++++++ hw/i386/pc_q35.c | 4 ++-- hw/isa/piix3.c | 17 ++--------------- hw/isa/piix4.c | 27 +-------------------------- hw/mips/malta.c | 28 ++++++++++++++++++++++++++++ hw/pci-host/raven.c | 3 ++- hw/pci-host/versatile.c | 3 ++- hw/pci/pci.c | 12 +++++++++--- hw/remote/machine.c | 3 ++- include/hw/pci/pci.h | 3 ++- 10 files changed, 66 insertions(+), 50 deletions(-) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Acked-by: Michael S. Tsirkin