From patchwork Sat Jan 6 21:05:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1883270 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=k9h/Y8JK; 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 4T6tDg50Rhz1yPX for ; Sun, 7 Jan 2024 08:06:58 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrc-0005Y9-Ok; Sat, 06 Jan 2024 16:05:52 -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 1rMDrb-0005XN-7T; Sat, 06 Jan 2024 16:05:51 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrY-00017w-Mz; Sat, 06 Jan 2024 16:05:50 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50e78f1f41fso589301e87.2; Sat, 06 Jan 2024 13:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575144; x=1705179944; 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=CZ0Cdd6CyzfWhgOzDgqAtfWGGIPl4y3eiovJukLVLhQ=; b=k9h/Y8JKzeh0aUaUjEpAdyJvQBYGYRE7pGPYF6B/JeInkHZ1rW+aKdNMJPhR/tA7uu OHDTNyNf0h12YDpU2VB2ml+vBpjbKqXq1HZNOUnqUTeOleetpBpbNyJtdTxLSdvpTc8X BZ9PRWzGZwOf+AWCFtGTbkeoZf/B9kXqsSk75GZGRqEL4ZeG3jMM3c4hzyD8YrcDrBTR DIKzKADMGDWjF5rAz8DwD1dpzMiC4p2Mt/SrRXRPUOUSNCmuQWXiM1JnRvOylX+ghQ5P BkuQGa6GVT2lLDgmWWLcaHwwQxb73u9CmIJbtJG1Us+QLGWZQtOKJwUFdYFFBZrl1jof m3Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575144; x=1705179944; 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=CZ0Cdd6CyzfWhgOzDgqAtfWGGIPl4y3eiovJukLVLhQ=; b=An32I9gplFQH+z2w5ZzFx564//FudlBwYvzHnJlGnxW1Q+ZZxWAf+rvFHL8zOr1DVn uZmNwZApxkWTD29pg3qG0i8usvwzh+vo4pn6/o2jUgH+8vwQ+5MTXjQusOJw0Lkll1Jg Cpja+IVTOGQMao7ebR+au3s54ChvMhGXT6vNxPDsRdZ5Th3rm+i7IYSPzD+uVrKThMtu j1JwWKGBAUI0oiBbGPKNoLrM3HI+Ua7nkZxc+w8umCV9f+A9S+vYP1ZHVEKdox8WOmjE 4AG3NSuaSYhDCQ7pAneEglFyWXcJB/JUlosdlqkM6eR/jIKJtD6F1Pe53KbQXBIuAUTd a0Rw== X-Gm-Message-State: AOJu0Yz1hWikvRXs3bcf/i6Ppwv6x7xOHXuethhkS2TT6Hr/eVKHG2MK rXsMP4LZuI/0kwmwIHIusbJIB3BrhGM= X-Google-Smtp-Source: AGHT+IFTI2kTG7RQXuBBONQ2rseDn9uHE+FPevqrWjkDuqlK2/iyV8Y4v4IJ9B60fqO2atrwpXEgKQ== X-Received: by 2002:a05:6512:2347:b0:50e:74e9:69c9 with SMTP id p7-20020a056512234700b0050e74e969c9mr541556lfu.25.1704575144218; Sat, 06 Jan 2024 13:05:44 -0800 (PST) Received: from archlinux.. (dynamic-077-011-174-094.77.11.pool.telefonica.de. [77.11.174.94]) by smtp.gmail.com with ESMTPSA id f20-20020a056402195400b005576f4471besm624922edz.42.2024.01.06.13.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:43 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fabiano Rosas , Jiaxun Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?b?RnLDqWTDqXJp?= =?utf-8?b?YyBCYXJyYXQ=?= , John Snow , qemu-block@nongnu.org, Kevin Wolf , Thomas Huth , Richard Henderson , Nicholas Piggin , Aleksandar Rikalo , Peter Xu , BALATON Zoltan , Leonardo Bras , Paolo Bonzini , "Michael S. Tsirkin" , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , Bernhard Beschow Subject: [PATCH v4 00/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions Date: Sat, 6 Jan 2024 22:05:20 +0100 Message-ID: <20240106210531.140542-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::130; envelope-from=shentey@gmail.com; helo=mail-lf1-x130.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-3 prepare the TYPE_ISA_FDC, TYPE_ISA_PARALLEL and TYPE_ISA_SERIAL to relocate and toggle (enable/disable) themselves without breaking encapsulation of their respective device states. This is achieved by moving the MemoryRegions and PortioLists from the device states into the encapsulating ISA devices since they will be relocated and toggled. Inspired by the memory API patches 4-6 add two convenience functions to the portio_list API to toggle and relocate portio lists. Patch 5 is a preparation for that which removes some redundancies which otherwise had to be dealt with during relocation. Patches 7-9 implement toggling and relocation for types TYPE_ISA_FDC, TYPE_ISA_PARALLEL and TYPE_ISA_SERIAL. Patch 10 prepares the pegasos2 machine which would end up with all SuperI/O functions disabled if no -bios argument is given. Patch 11 finally implements the main feature which now relies on firmware to configure the SuperI/O functions accordingly (except for pegasos2). v4: * Drop incomplete SuperI/O vmstate handling (Zoltan) v3: * Rework various commit messages (Zoltan) * Drop patch "hw/char/serial: Free struct SerialState from MemoryRegion" (Zoltan) * Generalize wording in migration.rst to include portio_list API (Zoltan) v2: * Improve commit messages (Zoltan) * Split pegasos2 from vt82c686 patch (Zoltan) * Avoid poking into device internals (Zoltan) 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 (11): hw/block/fdc-isa: Move portio_list from FDCtrl to FDCtrlISABus hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus hw/char/parallel: Move portio_list from ParallelState to ISAParallelState exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio exec/ioport: Add portio_list_set_address() exec/ioport: Add portio_list_set_enabled() hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions docs/devel/migration.rst | 6 ++-- hw/block/fdc-internal.h | 4 --- include/exec/ioport.h | 4 ++- include/hw/block/fdc.h | 3 ++ include/hw/char/parallel-isa.h | 5 +++ include/hw/char/parallel.h | 2 -- include/hw/char/serial.h | 2 ++ hw/block/fdc-isa.c | 18 +++++++++- hw/block/fdc-sysbus.c | 6 ++-- hw/char/parallel-isa.c | 14 ++++++++ hw/char/parallel.c | 2 +- hw/char/serial-isa.c | 14 ++++++++ hw/isa/vt82c686.c | 66 ++++++++++++++++++++++++++++------ hw/ppc/pegasos2.c | 15 ++++++++ system/ioport.c | 41 +++++++++++++++++---- 15 files changed, 172 insertions(+), 30 deletions(-)