From patchwork Sun Dec 17 14:41:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1877080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=20230601 header.b=CtIFBOZ5; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 4StQg26x93z23yg for ; Mon, 18 Dec 2023 01:43:10 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEsLK-0005Lx-9L; Sun, 17 Dec 2023 09:42:10 -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 1rEsLI-0005Lg-Hn; Sun, 17 Dec 2023 09:42:08 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEsLG-0003J9-Iw; Sun, 17 Dec 2023 09:42:08 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-54c70c70952so2600241a12.3; Sun, 17 Dec 2023 06:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702824123; x=1703428923; 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=ImRdEJ2s1CPU/zja2PDSv05N4zE1GjmhfZzXX0+BJtA=; b=CtIFBOZ516E0NY+Zj8oBM/nQHmTtqOAd3VbhWzNI9ObeH6BtKgy2l4JNExUTgIn7s/ 3OGDMWjick0Kta8j41oWE5JSyclmO1lGhSW45z534RfPPQCPILa0gedZ9VsMKo2JsLSt LWcS6f3DUTVBxgRzwooGU9bkynZ2gc3Wcj3Kl9RI41sfaiETCTHn//XgIu2reNCmDIZ3 SrGtrT1nv95HplL1b0JMGlnWs4NiH08jr6egsM7j2cHpGr8yWYpoKN1UfQKKxwmsjSTy eyhYZX3ufxdpSRg3xWeJjdO2kair43I+ubkNKmHxg+Rzz6tLNCNQ4zxAPW5H8XWt+edq U6Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702824123; x=1703428923; 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=ImRdEJ2s1CPU/zja2PDSv05N4zE1GjmhfZzXX0+BJtA=; b=b7U3+iQEno+mDQeeWoN07M4Mr4BFsylxnSVdyjAy/6CsuQMg4FcJoZrCrq0hWkijGu Tm1y5Jz5jljlouM71y6NYrsQI3+f0ofi/SJFtbnoNhGAKddsnD1aT1ZvZnJ8JM26vy++ NWNuKsVACFnjRko5qb8Emzfo+EOtTYdQXWKV1CrvnOkaTev8DGJmkjHdiMgjh5dZpT1g dTPuoXFi5/kvJk4+I8m+WskiA7aAZ6Eu7T7Qmy9QTIY/zQRXUmmeLwtXjwhT3VEtbG5o Q5FMz9R+cXrAYi+dSrZ8nRJ/kSFkA/HortuPqHORrU9mIq+/M297QWSXvImmiZi71IYh ByIA== X-Gm-Message-State: AOJu0Yy8AXXbA5ZH4lJIWOM3KVfuj7mBK29YucACoOlh8csXu2m8W3Xp FcDNq2kbiqPFiPHmInJ3Lo+Z2sy/qxo= X-Google-Smtp-Source: AGHT+IH+QUQfDdlRexe23+jgS8M62pxCiSHHNFSL4w3tCx45xctLo2lt+LHLmCojQPybR27qQ18Shw== X-Received: by 2002:a17:906:c44b:b0:a19:720c:ed71 with SMTP id ck11-20020a170906c44b00b00a19720ced71mr4508604ejb.58.1702824122862; Sun, 17 Dec 2023 06:42:02 -0800 (PST) Received: from archlinux.. (dynamic-077-011-162-117.77.11.pool.telefonica.de. [77.11.162.117]) by smtp.gmail.com with ESMTPSA id vv6-20020a170907a68600b00a1dff479037sm12996632ejc.127.2023.12.17.06.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 06:42:02 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: John Snow , qemu-block@nongnu.org, Thomas Huth , Aleksandar Rikalo , David Hildenbrand , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Kevin Wolf , Peter Xu , BALATON Zoltan , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fabiano Rosas , Paolo Bonzini , Sergio Lopez , Richard Henderson , Eduardo Habkost , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Nicholas Piggin , Juan Quintela , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Leonardo Bras , Artyom Tarasenko , Marcel Apfelbaum , Bernhard Beschow Subject: [PATCH 00/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions Date: Sun, 17 Dec 2023 15:41:36 +0100 Message-ID: <20231217144148.15511-1-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=shentey@gmail.com; helo=mail-ed1-x52b.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, T_SCC_BODY_TEXT_LINE=-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 implements relocation of the SuperI/O functions of the VIA south bridges which resolves some FIXME's. It is part of my via-apollo-pro-133t branch [1] which is an extension of bringing the VIA south bridges to the PC machine [2]. This branch is able to run some real-world X86 BIOSes in the hope that it allows us to form a better understanding of the real vt82c686b devices. Implementing relocation and toggling of the SuperI/O functions is one step to make these BIOSes run without error messages, so here we go. The series is structured as follows: Patches 1-8 export the device structs of the ISA serial and FDC devices. This is used later in the series to access the I/O regions for relocation and toggling. As part of the exposal the MAINTAINERS file gets a fix for the serial headers. Inspired by the memory API patches 9-11 add two convenience functions to the portio_list API to toggle and relocate portio lists. Patch 9 is a preparation for that which removes some redundancies which otherwise had to be dealt with during relocation. Patch 12 finally implements the main feature which required adaption of the pegasos2 sources, otherwise the machine wouldn't boot when given no bios. Testing done: * make check * make check-avocado * Run MorphOS on pegasos2 with and without pegasos2.rom * Run Linux on amigaone * Run real-world BIOSes on via-apollo-pro-133t branch * Start rescue-yl on fuloong2e [1] https://github.com/shentok/qemu/tree/via-apollo-pro-133t [2] https://github.com/shentok/qemu/tree/pc-via Bernhard Beschow (12): hw: Remove unused includes of hw/block/fdc.h hw/i386/pc: No need to include hw/block/fdc.h in header hw/block/fdc-isa: Rename header to match source file hw/block/fdc: Expose internal header hw/block/fdc: Move constant #define to where it is imposed hw/block/fdc-isa: Expose struct FDCtrlISABus MAINTAINERS: Add include/hw/char/serial*.h to the "PC Chipset" section hw/char/serial-isa: Export struct ISASerialState exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio exec/ioport: Add portio_list_set_address() exec/ioport: Add portio_list_set_enabled() hw/isa/vt82c686: Implement relocation of SuperI/O functions MAINTAINERS | 3 +- docs/devel/migration.rst | 2 + hw/block/fdc-internal.h | 158 ---------------------------------- include/exec/ioport.h | 4 +- include/hw/block/fdc-isa.h | 32 +++++++ include/hw/block/fdc.h | 161 ++++++++++++++++++++++++++++++++--- include/hw/char/serial-isa.h | 50 +++++++++++ include/hw/char/serial.h | 7 -- include/hw/i386/pc.h | 1 - hw/block/fdc-isa.c | 19 +---- hw/block/fdc-sysbus.c | 2 +- hw/block/fdc.c | 3 +- hw/char/serial-isa.c | 14 +-- hw/i386/microvm-dt.c | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 4 +- hw/isa/isa-superio.c | 3 +- hw/isa/vt82c686.c | 140 +++++++++++++++++++++++------- hw/m68k/next-cube.c | 1 - hw/mips/jazz.c | 1 + hw/ppc/pegasos2.c | 15 ++++ hw/ppc/pnv.c | 2 +- hw/ppc/prep.c | 1 - hw/sparc/sun4m.c | 2 +- hw/sparc64/sun4u.c | 2 + stubs/cmos.c | 2 +- system/ioport.c | 41 +++++++-- 27 files changed, 414 insertions(+), 260 deletions(-) delete mode 100644 hw/block/fdc-internal.h create mode 100644 include/hw/block/fdc-isa.h create mode 100644 include/hw/char/serial-isa.h