From patchwork Sat Apr 22 15:07:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1772299 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=20221208 header.b=M5K58iXw; 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 4Q3ZZN065Sz23td for ; Sun, 23 Apr 2023 01:10:04 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqEq5-0001uq-GL; Sat, 22 Apr 2023 11:07:49 -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 1pqEq0-0001oo-Gz; Sat, 22 Apr 2023 11:07:44 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqEpv-00058s-0g; Sat, 22 Apr 2023 11:07:44 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-94f3cd32799so485125366b.0; Sat, 22 Apr 2023 08:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682176055; x=1684768055; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WlA15ayo3r3fbHLf5MCSjbAV34CSEzPd/ms7AQxrE+c=; b=M5K58iXw8FOysu7XqnEqIAnBRQGZrQr+dQB9YW3YSMq7TAFyzA//isSIv6Ws8Tlw0r W5Z4FPNDW7e0J34X3MkNiT1e33pK3n1/t7/RIIUCgBaOQTijPMElL1YedO562axvUTSj kk+eeUqydHLJfVn/jJ1G+UU1kjwTuS49nB3ybxhx6aLcRNf9K5fRcu8BsPo2c7MP0KkH dOMHx3Yj+AbLpzq/PQDVlCeE1GHc7l0g2WP5VkDVHLQcXV9N4CgGMV5lwDISsr62IHHy VD02OBMKNvhcWhNHHiDCdL1gaJF5CyKfDAhATrKBuyGepQpWGqOwYk6joPyK8c7az4AK kG8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682176055; x=1684768055; 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=WlA15ayo3r3fbHLf5MCSjbAV34CSEzPd/ms7AQxrE+c=; b=PHyapSkyiuaIk8fpI3W09aV/F8ACl/exocb89SmSdgf2JLE713ZDxstin4msCy1626 aqaKL1cP7MaDOXgU2WRuKRJvlWTMq83FdObQEHmPgFplWYyODUlnfxT3201R6wQVMvUj GeHDwNUpAFJDyaXkWegvtA0jDrUWFzDU9AEzl3H9cBFrWiZVRXb6DrWpAt1mGhO86AqE lxFrCh2oL+CRGpTVRRWJyl2lzl3tS7CeRJCaRXbM5IX+v85XihBmlPmhv6DrDgPOoTSJ a+UCy0fCsKNgixI9gIIToy23568YWIfrMGq3FxBWcQof2LwoZbDwbnoWSw+I44jsfrsZ rtGA== X-Gm-Message-State: AAQBX9dYpcffBDYusZo7VK6Mwa0ykBbiFXUtz3P4NNcYIkoE+QPazRoU Nz4rTMKx3SaBFnRY+Qs1ePdv79zggrM= X-Google-Smtp-Source: AKy350a4coTNKSmHHNImijHgPNyOergR8kjkd0cl605uTCjli7urgwMzLI7hOmiNWU7D0Abby5i8oA== X-Received: by 2002:a17:906:2e9b:b0:94f:a309:67b7 with SMTP id o27-20020a1709062e9b00b0094fa30967b7mr5588473eji.56.1682176055341; Sat, 22 Apr 2023 08:07:35 -0700 (PDT) Received: from Provence.localdomain (dynamic-077-191-017-015.77.191.pool.telefonica.de. [77.191.17.15]) by smtp.gmail.com with ESMTPSA id e7-20020a170906844700b0094f7b713e40sm3300108ejy.126.2023.04.22.08.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Apr 2023 08:07:34 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Jiaxun Yang , BALATON Zoltan , John Snow , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Bernhard Beschow Subject: [PATCH 00/13] Clean up PCI IDE device models Date: Sat, 22 Apr 2023 17:07:15 +0200 Message-Id: <20230422150728.176512-1-shentey@gmail.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 This series is yet another attempt to clean up the PCI IDE models. It is mainly inspired the Mark's invaluable input from previous discussions. In particular, this series attempts to follow the "PCI IDE controller specification" closer. As a side effect, it also resolves usage of the isabus global in PIIX. Last but not least it fixes the VIA IDE controller to not depend on its south bridge which fixes a circular dependency. The series is structured as follows: The first three commits resolve a circular dependency between the VIA IDE controller and its south bridge, thereby implementing legacy PCI IDE interrupt routing which was missing so far. The next five patches factor out common code into the PCI IDE base class. The next two patches resolve usage of the isabus global in PIIX by reusing now common code from the base class. The same is then done for the SIL3112 controller. Finally, a small convenience function is introduced which should hide some implementation details in the PCI IDE base class. Testing done: * `make check` * `make check-avocado` * `qemu-system-ppc -machine pegasos2 -rtc base=localtime -device \ ati-vga,guest_hwcursor=true,romfile="" -cdrom morphos-3.17.iso -kernel morphos-3.17/boot.img` The machine booted successfully and a startup sound was hearable * `qemu-system-ppc -machine pegasos2 -rtc base=localtime -device \ ati-vga,guest_hwcursor=true,romfile="" -cdrom morphos-3.17.iso -kernel morphos-3.17/boot.img` The machine booted successfully and applications could be started. * qemu-system-x86_64 was used for hours during work Bernhard Beschow (13): hw/ide/pci: Expose legacy interrupts as GPIOs hw/ide/via: Implement ISA IRQ routing hw/isa/vt82c686: Remove via_isa_set_irq() hw/ide: Extract IDEBus assignment into bmdma_init() hw/ide: Extract pci_ide_class_init() hw/ide: Extract bmdma_init_ops() hw/ide: Extract pci_ide_{cmd,data}_le_ops initialization into base class constructor hw/ide: Rename PCIIDEState::*_bar attributes hw/ide/piix: Disuse isa_get_irq() hw/ide/piix: Reuse PCIIDEState::{cmd,data}_ops hw/ide/sii3112: Reuse PCIIDEState::{cmd,data}_ops hw/ide/sii3112: Reuse PCIIDEState::bmdma_ops hw/ide: Extract bmdma_clear_status() include/hw/ide/pci.h | 12 ++- include/hw/isa/vt82c686.h | 2 - hw/ide/cmd646.c | 59 ++------------- hw/ide/pci.c | 73 ++++++++++++++++++- hw/ide/piix.c | 88 ++++++++-------------- hw/ide/sii3112.c | 150 +++++++++++++++++++------------------- hw/ide/via.c | 64 +++------------- hw/isa/vt82c686.c | 23 ++++-- hw/ide/trace-events | 7 +- 9 files changed, 221 insertions(+), 257 deletions(-)