From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575317; cv=none; d=zohomail.com; s=zohoarc; b=XDQBwbIFs5iKOxopTVNS7DUG64wIE+EbQTg0HfmKCWtBDRpBKr0149luhIAafHq0FDZBQg4EoDsErc8stoC+oy+Rj0/VzOEoqDmPO/uxEntJqGs8bo5pZiBF/lREkstYSdTpkrD7brFmx5ifgsTNLe9uiiJz7xBPPYcb/II08mg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575317; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Blu6OuTjSPsdfd3EbHeR0ttbZLV058NKotTs2DtlESs=; b=juJlFj2GpNOj91QlohK8mWZlUu8D/tvWbRcOyyfeczSfFo4w/wAsrvUSOTcJSIfDMkNPZ6fYNBKYbql2XPdFXdQCP8J+cz7JgY2pLn/JyTjtEIqRUpP16CZaKoVWbsKRVTdnegxQGR6gBXSsCjdCAFeEu6eR3KEP0VI6qPXB3V0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575317829404.26676501019233; Sat, 6 Jan 2024 13:08:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrd-0005YC-Ev; Sat, 06 Jan 2024 16:05:53 -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-0005XM-3G; Sat, 06 Jan 2024 16:05:51 -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 1rMDrZ-000180-Ai; Sat, 06 Jan 2024 16:05:50 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-555144cd330so766719a12.2; Sat, 06 Jan 2024 13:05:48 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575146; x=1705179946; darn=nongnu.org; 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=Blu6OuTjSPsdfd3EbHeR0ttbZLV058NKotTs2DtlESs=; b=D6lhQ0IwMBM6MkkvGPL7lP2DjMoGA+jtLIjImN75v+fXb+GwXpbdxZ2gw3NVLRXiB7 vO4GgkC5fGZXlGdrZdwOUR9Drb1hJdgNp6hAZJg+aetezQhvzWyTerk+WVkmsI2ax6CX tmOup6tNLOZquX8nBHx5nT0JhQ6EIEIy+4TuuF4clRGxKI9akczEc+5MqFcNyWUlwkIX 5zoU8mYT0sM6N77UlHUEa6PCm+M3/ATfmNCP0/QPCm7IJGOaeTh8MNFHUaChf73c9DRO UGWqqcry9EHNtwQUEuSn5He66i4foVBwU1dXOqsyJ/uhOWlGrF007l/jZ6axCykb7CVX AsAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575146; x=1705179946; 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=Blu6OuTjSPsdfd3EbHeR0ttbZLV058NKotTs2DtlESs=; b=oakW2a0CtM31GQjhXKdrNIu7gq1tC3WxuvQrdWCFQMpnO2sbDCfZNZoHXNXgrCgo+I 2KBqWTomtxHhZTPPHXL6eO5frzdJLBssvx6lB2P3L9nm3B/pVEhFIg7clSnOxFZBurih iJp8mt6EO0u5eOeKeYwiYfl+SM9SKxg0mjkO4jVXf4v6ZnHqpt1PdbT5kiNqlRANWKbr dhlz4EGmsjKq94G2QOGUUxr7jnqa/5arOAD3DhRlMa3kl7mfIADCGHhOqcUkh7dvwFZk v9P05XjU/DK21YeIBi9a/WLExEnL/sWfAMpxTcdcfObF5loelTofHVf357fgQc+rFv13 uIQQ== X-Gm-Message-State: AOJu0YxeHMOe4jNsJ9XkJWeFlSdaiQjewB0jeK2q+ZSEQOJ6VwZyXhRk 2HNTRkDU3SMQxvMmBhirzW3NYiyizpw= X-Google-Smtp-Source: AGHT+IFvNpxU3KqeNE3EAiRL3EZ6yzxTOCnaezhIgQ8bDM0i2lcWRih+ZI7AqEo4G/08JhHZz7XmDQ== X-Received: by 2002:a50:8a93:0:b0:557:cee:5f38 with SMTP id j19-20020a508a93000000b005570cee5f38mr774098edj.5.1704575146039; Sat, 06 Jan 2024 13:05:46 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 01/11] hw/block/fdc-isa: Move portio_list from FDCtrl to FDCtrlISABus Date: Sat, 6 Jan 2024 22:05:21 +0100 Message-ID: <20240106210531.140542-2-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575318474100001 Content-Type: text/plain; charset="utf-8" FDCtrl::portio_list isn't used inside FDCtrl context but only inside FDCtrlISABus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-isa.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/block/fdc-internal.h b/hw/block/fdc-internal.h index 036392e9fc..fef2bfbbf5 100644 --- a/hw/block/fdc-internal.h +++ b/hw/block/fdc-internal.h @@ -26,7 +26,6 @@ #define HW_BLOCK_FDC_INTERNAL_H =20 #include "exec/memory.h" -#include "exec/ioport.h" #include "hw/block/block.h" #include "hw/block/fdc.h" #include "qapi/qapi-types-block.h" @@ -140,7 +139,6 @@ struct FDCtrl { /* Timers state */ uint8_t timer0; uint8_t timer1; - PortioList portio_list; }; =20 extern const FDFormat fd_formats[]; diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index ad0921c7d3..2d8a98ce7d 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -42,6 +42,7 @@ #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" +#include "exec/ioport.h" #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -60,6 +61,7 @@ struct FDCtrlISABus { uint32_t irq; uint32_t dma; struct FDCtrl state; + PortioList portio_list; int32_t bootindexA; int32_t bootindexB; }; @@ -91,7 +93,7 @@ static void isabus_fdc_realize(DeviceState *dev, Error **= errp) FDCtrl *fdctrl =3D &isa->state; Error *err =3D NULL; =20 - isa_register_portio_list(isadev, &fdctrl->portio_list, + isa_register_portio_list(isadev, &isa->portio_list, isa->iobase, fdc_portio_list, fdctrl, "fdc"); =20 --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575216; cv=none; d=zohomail.com; s=zohoarc; b=fddioKoJd7U11KqPkcweEB1vzTiI7pOjMa1RQ+6D1iGsuUXgCcj9X3tZDxjVN1jBMg6xnpDLStkpe/+XPWObfB6X8+tngD3vQ+FFkCq9BZwNVt408SPICrd6tPpHLl0xStXb5/xION7ucSh3VTeitGQT0w35jP/w57Rbx14+3fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575216; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5+9ZapGs110KfVKNFzaiA44RoY0VoVZdYmH4JCjTMrQ=; b=nJEzBOnsrBii9wMx+1It68fdta1/xuhQPYmoF0TAH8xaratkXBl5wTqpA6d5B6MXHDKVFM/53x70AIWv23of591cyg4n622I3ppnWILgo0oI/pWIfbVytG+1yd1Il4r55uJ3vUKqksp+F90hfijdj5qb90gyd8FLMVnA3dmnOB4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575216829227.3940924152222; Sat, 6 Jan 2024 13:06:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDre-0005aG-Km; Sat, 06 Jan 2024 16:05:54 -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 1rMDrd-0005YT-CJ; Sat, 06 Jan 2024 16:05:53 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrb-00018a-Kn; Sat, 06 Jan 2024 16:05:53 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2cd17a979bcso5594581fa.0; Sat, 06 Jan 2024 13:05:50 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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=1704575148; x=1705179948; darn=nongnu.org; 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=5+9ZapGs110KfVKNFzaiA44RoY0VoVZdYmH4JCjTMrQ=; b=ibqzl6xOqzXDApHiCdM4mwO3Tlg/v1oZzfSzY+YI4UFyFkyMOA7ApCwpic3LJkByD6 msrsZMJvupHxyjlzq4ksTg3OfW+mOMkl89Fqkv6LE9hBjp7w1pLvnIt3n94wjlCx2OIQ l/7KSXNn8qyg6XfJ70QtMb3hYCWotPKX2bNyGHbT+HhUMMBg2GMTXsYXfsk0fyahuj7j M19DCmD1yEYbUbel37/1wMALyHECsu93EwdK9G4V7vPlwxcWHGM1J77vA4PyAvpIU6+i BkZtip2RyevsdJs1T3ehRz8hAy13wHSsAFtI6a7L3Ts0Vy71/7x5uHFQHI9pkQHQZncU xyDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575148; x=1705179948; 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=5+9ZapGs110KfVKNFzaiA44RoY0VoVZdYmH4JCjTMrQ=; b=aOERpy0V1v1N21Q2zqmSPQ1nnqPrrgHegTU46MlBFljOuL+Hn2+LDnHHUL1TYDEFe2 Mcoc83qhfskDXXgFTTZT76TW9/Q8ZbSVLyUAtmZf+MjUoGeIDJp6mnz8NrWE4ZglNoJ2 1fmLIXzGJWLj5YNuDPbSgQG9afzODZeKM2C822jN8FDvEqo5SuNDhmRpHryXkdSakRpc qASjF5UVtA6p7QwrfVwWHjqCHV9VbkVjJo7lN/7ZvlhUgNqnhkaVIKy/ntzGaukcW6t1 SBeCC8agNNqCfQlscT6hXXHPogvgXoZDtQRcA/uVvZ35G6nKNxFQ0iMf0x0RFXNKqGGb 5dmQ== X-Gm-Message-State: AOJu0YzTXg7Co9b+vifeRtnYMo1k/8eM7BfRxpHNuzZTqsa0GWL++4Ik krPrKPOlGajsJsrtmT/jlhImISFO0D8= X-Google-Smtp-Source: AGHT+IHzE4IeiJR+Q85AjXB2FVM0Gdzjh6JaEkHPuINONpCi1dNx01zUuHHd21CoyijjkXT5rW5Aeg== X-Received: by 2002:a05:6512:e91:b0:50e:6202:dad6 with SMTP id bi17-20020a0565120e9100b0050e6202dad6mr287912lfb.142.1704575147700; Sat, 06 Jan 2024 13:05:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 02/11] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus Date: Sat, 6 Jan 2024 22:05:22 +0100 Message-ID: <20240106210531.140542-3-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=shentey@gmail.com; helo=mail-lj1-x22b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575218399100010 Content-Type: text/plain; charset="utf-8" FDCtrl::iomem isn't used inside FDCtrl context but only inside FDCtrlSysBus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-sysbus.c | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/fdc-internal.h b/hw/block/fdc-internal.h index fef2bfbbf5..e219623dc7 100644 --- a/hw/block/fdc-internal.h +++ b/hw/block/fdc-internal.h @@ -25,7 +25,6 @@ #ifndef HW_BLOCK_FDC_INTERNAL_H #define HW_BLOCK_FDC_INTERNAL_H =20 -#include "exec/memory.h" #include "hw/block/block.h" #include "hw/block/fdc.h" #include "qapi/qapi-types-block.h" @@ -91,7 +90,6 @@ typedef struct FDrive { } FDrive; =20 struct FDCtrl { - MemoryRegion iomem; qemu_irq irq; /* Controller state */ QEMUTimer *result_timer; diff --git a/hw/block/fdc-sysbus.c b/hw/block/fdc-sysbus.c index 266bc4d145..035bc08975 100644 --- a/hw/block/fdc-sysbus.c +++ b/hw/block/fdc-sysbus.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qom/object.h" +#include "exec/memory.h" #include "hw/sysbus.h" #include "hw/block/fdc.h" #include "migration/vmstate.h" @@ -52,6 +53,7 @@ struct FDCtrlSysBus { /*< public >*/ =20 struct FDCtrl state; + MemoryRegion iomem; }; =20 static uint64_t fdctrl_read_mem(void *opaque, hwaddr reg, unsigned ize) @@ -146,11 +148,11 @@ static void sysbus_fdc_common_instance_init(Object *o= bj) =20 qdev_set_legacy_instance_id(dev, 0 /* io */, 2); /* FIXME */ =20 - memory_region_init_io(&fdctrl->iomem, obj, + memory_region_init_io(&sys->iomem, obj, sbdc->use_strict_io ? &fdctrl_mem_strict_ops : &fdctrl_mem_ops, fdctrl, "fdc", 0x08); - sysbus_init_mmio(sbd, &fdctrl->iomem); + sysbus_init_mmio(sbd, &sys->iomem); =20 sysbus_init_irq(sbd, &fdctrl->irq); qdev_init_gpio_in(dev, fdctrl_handle_tc, 1); --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575216; cv=none; d=zohomail.com; s=zohoarc; b=CSgAzQEXQYfSAlsgask686sS/Bs5rT9HmsDiKA0HsRZlCUIKvdNgL9uYMjOSWc7AxkxKHyFh2MaB3KeIC25e1fbx0S+XleIliT0ne2m4tHuEESD/XopKaDdEXrCVLDlNlf/wxtVhWUeVKSfMQ4w/s0BvCm1GxsUz/e0bHzfyuOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575216; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cBLwkrwr8Jj7XdQH7raQa9Nj1TEuOiCXih1DV9ONnp0=; b=FNU+/5n7sL67CZ1TFPEJl2HLiAPveGvGZwbBnmAX1Sa40f9EUpbQhSoW4XrbuuXvTRMXA7BAIQHXJMtDi1TGevr/VM3VU7PBn/RtIkiYgqN/A4s3/LgrhVqpFI//cee6u7EMOD/PjmCp6UnjzrWggBWd6XLB8pDeksB6WKNP+xc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575216871551.929993133014; Sat, 6 Jan 2024 13:06:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrg-0005bF-Gm; Sat, 06 Jan 2024 16:05:56 -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 1rMDre-0005aF-Fg; Sat, 06 Jan 2024 16:05:54 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrc-00018w-SR; Sat, 06 Jan 2024 16:05:54 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-55778f7662bso443992a12.1; Sat, 06 Jan 2024 13:05:51 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575150; x=1705179950; darn=nongnu.org; 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=cBLwkrwr8Jj7XdQH7raQa9Nj1TEuOiCXih1DV9ONnp0=; b=MNiJfEmSezxWQKi6ifbpvLqhZPRwT05aXo9RuVFC8WZMypV514YTtR6xjqgl2k7mXW 8DPArYBitmsFJerzVWW1cjP/S7SoJhhjqkz3VuW011UkUtamWxEQY2gx51cw14xBQYHI gNVwYAC8RVwGeYpaS0q7s+23G5zJEj3j/u0IKDk+kNTXQfjP0aMJEhH4Y7zuUGIYpKzA pqusrY8MmMhZ7wqzgPdY0hOoafqdRUsBMEQoGqzvSRtlMK8THn/drv6KvFR4vIr11adD wKtTkJfZnN7AXv8rb+uz/st41zSCNjew1rfRPpTNevpdjhSSrf4hOS6oT7lV3FcWvpgL VMPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575150; x=1705179950; 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=cBLwkrwr8Jj7XdQH7raQa9Nj1TEuOiCXih1DV9ONnp0=; b=LsqUDRX/GGhxiPh/hMbmiqHN1FRFNZPTTAPbDWiC6kST9SMxgJ4oV6pQztAPuFJ5Im VzdPlR4rESqJQZJoZgB2foypfCXA0VIPfc7Pki1KJcbPN9UH7KXaHZDcUn84YJWCscvT 05e/X3+XA/bd8SCaBxMoYrIW0Cq0XfbozhSnjip0BWmkhCrcSfYmu1D/Usv6vrRkH0wR kRSWsA1g6BXP7lbu/uSVulFv4miPUJsDeWn2eO4tarPOZljIcdzqnGTeTR+DFUPXHAW+ 0klcdJ/FIfU+i+qY8Rv9elOBrxgiPnRgYa+Pz8HXENgArvgsiI4PJQrANvPpBFr75tZ2 IbCw== X-Gm-Message-State: AOJu0Yyt0t975PSt9CRtu8JSmHh+yHk3bMDgOz6RrzAcjwZPawmH0UzS Ub9s8K3cB6bslH8L//9rPRTT6a8BNKo= X-Google-Smtp-Source: AGHT+IEPygpyBoxm/Okl0EbRqcvKq1fg2xBH35wVgGDfSoYMFXQq4sFNMTleAKNtjAaafowjmLssWg== X-Received: by 2002:a05:6402:3584:b0:557:1cde:812f with SMTP id y4-20020a056402358400b005571cde812fmr3781465edc.8.1704575149956; Sat, 06 Jan 2024 13:05:49 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 03/11] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState Date: Sat, 6 Jan 2024 22:05:23 +0100 Message-ID: <20240106210531.140542-4-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=shentey@gmail.com; helo=mail-ed1-x52f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575218397100009 Content-Type: text/plain; charset="utf-8" ParallelState::portio_list isn't used inside ParallelState context but only inside ISAParallelState context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- include/hw/char/parallel-isa.h | 2 ++ include/hw/char/parallel.h | 2 -- hw/char/parallel.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/char/parallel-isa.h b/include/hw/char/parallel-isa.h index d24ccecf05..3b783bd08d 100644 --- a/include/hw/char/parallel-isa.h +++ b/include/hw/char/parallel-isa.h @@ -12,6 +12,7 @@ =20 #include "parallel.h" =20 +#include "exec/ioport.h" #include "hw/isa/isa.h" #include "qom/object.h" =20 @@ -25,6 +26,7 @@ struct ISAParallelState { uint32_t iobase; uint32_t isairq; ParallelState state; + PortioList portio_list; }; =20 #endif /* HW_PARALLEL_ISA_H */ diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h index 7b5a309a03..cfb97cc7cc 100644 --- a/include/hw/char/parallel.h +++ b/include/hw/char/parallel.h @@ -1,7 +1,6 @@ #ifndef HW_PARALLEL_H #define HW_PARALLEL_H =20 -#include "exec/ioport.h" #include "exec/memory.h" #include "hw/isa/isa.h" #include "hw/irq.h" @@ -22,7 +21,6 @@ typedef struct ParallelState { uint32_t last_read_offset; /* For debugging */ /* Memory-mapped interface */ int it_shift; - PortioList portio_list; } ParallelState; =20 void parallel_hds_isa_init(ISABus *bus, int n); diff --git a/hw/char/parallel.c b/hw/char/parallel.c index bd488cd7f9..c394635ada 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -532,7 +532,7 @@ static void parallel_isa_realizefn(DeviceState *dev, Er= ror **errp) s->status =3D dummy; } =20 - isa_register_portio_list(isadev, &s->portio_list, base, + isa_register_portio_list(isadev, &isa->portio_list, base, (s->hw_driver ? &isa_parallel_portio_hw_list[0] : &isa_parallel_portio_sw_list[0]), --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575255; cv=none; d=zohomail.com; s=zohoarc; b=n3m27kh0p0Cv3IMojcTz9rlHwHXiWQIZkZCP8NOoAxrXqdeirmezIkFyosAZGxDxjENkn3veIAVmPKN5LOzKnzfaK/QSZ7T9zRxc6FmKxS0l62r585s/jIMruTQq3xV/QHtJ2MpSKlBe7Pa7n9eN20sAIZkrHEScsBV9/q0degI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575255; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LzCBxca0nCRHR665JCCwURJqMXPSu7RYmWln7L2TOQo=; b=SfIlH0icW6XYZAckyDyL6QEV8GHDKUXCrUqMz/8a8NCQLY8EVObrV8A4vCB9ktUp6eiTUesceyjIaGicYsufFeoNXSx6POONEPGD19wTQ+0eerk+45k0juK82rpRondXkFy1c+DLbHgYAJMx/SH3PeTyEMyE7jIUZ1JfKDF2ejg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575255227990.5585546060665; Sat, 6 Jan 2024 13:07:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDri-0005d8-Q5; Sat, 06 Jan 2024 16:05:58 -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 1rMDrg-0005bp-RS; Sat, 06 Jan 2024 16:05:56 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrf-00019M-1Y; Sat, 06 Jan 2024 16:05:56 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ccabf5a4beso5467971fa.2; Sat, 06 Jan 2024 13:05:54 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575152; x=1705179952; darn=nongnu.org; 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=LzCBxca0nCRHR665JCCwURJqMXPSu7RYmWln7L2TOQo=; b=XEIb5HsFdQquUOCJ5vytLm0aBmLn5nH+8ng6zYlv9+kASKNmHFNeTv5CptW9f0PTMW B4ECioAmBbxrWmIX4CtJlrp5+Ln4iiUIJ2gExVIdv1/WYBvs7FUCJhFcXCKYmn+LLymo Ff3aIiQHI7ZEdv2i/oTzbYFqrSF6x61o5EBL4uhluqOrjlw5bWcOPa4DAg3ET1bXf9Qn hDOuUf8oBd16IPu71FLmtTkveldI8QPzDrjH9mDihnOj/U7aW9KJFGxUnCD39FdbhTmv MF8JMv415wOUkVasPPpsdeTCrdWLLllHWXVjWf4CW9wlVpsQ4+EP3i27rfYC/AXrSxS8 LfJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575152; x=1705179952; 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=LzCBxca0nCRHR665JCCwURJqMXPSu7RYmWln7L2TOQo=; b=Q9Ys+hjXW/eKBBUpp26FtEUadoi2lzXDrXPpHJdi0aLBzp9lpWzRbfUgjtzNIN7Vo8 APEPJ4ZEDQL9nFtrfEyGokKSkL4JyMZyjyKeV6tzGCtSpnYbGfW0Aqm/UX4clpImmu/W 3R7fcMXWvJOFo9huBlGJFOvp/NX+mZKqCHnT5rl/aAIvtDoj0bu7ofBZFI1gh9HNGRRn 2tAYlVrQta062h2Ozn4XgZtCRLUrhpJNPI6HWmLwaenw6XQNvgUW1ppwOlXobvDk5Qez Kt2Kga+qvKqv8tfbgqUnggG0NXYvbjd6vinpzbsDik0ZNUS/XC8hpHJ3fmWlyhjY5G9d 2jEA== X-Gm-Message-State: AOJu0YzW7qE+5bmMISMgcsW9IdKSBsDk3/Cg26sWmbf3ijFgOPeGoKHE oPV/TCS8upNOvEQdgQHRE0SFGIr1Fto= X-Google-Smtp-Source: AGHT+IFNjD5sQIPeMGd/1cWzvaGT9Us26llRzYnA3++xOIZ5ZxXphK1jYmYK41FgbR+YQ72FxNzjjw== X-Received: by 2002:a2e:848d:0:b0:2cd:475:18f3 with SMTP id b13-20020a2e848d000000b002cd047518f3mr270134ljh.126.1704575151810; Sat, 06 Jan 2024 13:05:51 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 04/11] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio Date: Sat, 6 Jan 2024 22:05:24 +0100 Message-ID: <20240106210531.140542-5-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=shentey@gmail.com; helo=mail-lj1-x233.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575256454100003 Content-Type: text/plain; charset="utf-8" portio_list_add_1() creates a MemoryRegionPortioList instance which holds a MemoryRegion `mr` and an array of MemoryRegionPortio elements named `ports`. Each element in the array gets assigned the same value for its .base attrib= ute. The same value also ends up as the .addr attribute of `mr` due to the memory_region_add_subregion() call. This means that all .base attributes are the same as `mr.addr`. The only usages of MemoryRegionPortio::base were in portio_read() and portio_write(). Both functions get above MemoryRegionPortioList as their opaque parameter. In both cases find_portio() can only return one of the MemoryRegionPortio elements of the `ports` array. Due to above observation = any element will have the same .base value equal to `mr.addr` which is also accessible. Hence, `mrpio->mr.addr` is equivalent to `mrp->base` and MemoryRegionPortio::base is redundant and can be removed. Signed-off-by: Bernhard Beschow --- include/exec/ioport.h | 1 - system/ioport.c | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/exec/ioport.h b/include/exec/ioport.h index e34f668998..95f1dc30d0 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -35,7 +35,6 @@ typedef struct MemoryRegionPortio { unsigned size; uint32_t (*read)(void *opaque, uint32_t address); void (*write)(void *opaque, uint32_t address, uint32_t data); - uint32_t base; /* private field */ } MemoryRegionPortio; =20 #define PORTIO_END_OF_LIST() { } diff --git a/system/ioport.c b/system/ioport.c index 1824aa808c..a59e58b716 100644 --- a/system/ioport.c +++ b/system/ioport.c @@ -181,13 +181,13 @@ static uint64_t portio_read(void *opaque, hwaddr addr= , unsigned size) =20 data =3D ((uint64_t)1 << (size * 8)) - 1; if (mrp) { - data =3D mrp->read(mrpio->portio_opaque, mrp->base + addr); + data =3D mrp->read(mrpio->portio_opaque, mrpio->mr.addr + addr); } else if (size =3D=3D 2) { mrp =3D find_portio(mrpio, addr, 1, false); if (mrp) { - data =3D mrp->read(mrpio->portio_opaque, mrp->base + addr); + data =3D mrp->read(mrpio->portio_opaque, mrpio->mr.addr + addr= ); if (addr + 1 < mrp->offset + mrp->len) { - data |=3D mrp->read(mrpio->portio_opaque, mrp->base + addr= + 1) << 8; + data |=3D mrp->read(mrpio->portio_opaque, mrpio->mr.addr += addr + 1) << 8; } else { data |=3D 0xff00; } @@ -203,13 +203,13 @@ static void portio_write(void *opaque, hwaddr addr, u= int64_t data, const MemoryRegionPortio *mrp =3D find_portio(mrpio, addr, size, true); =20 if (mrp) { - mrp->write(mrpio->portio_opaque, mrp->base + addr, data); + mrp->write(mrpio->portio_opaque, mrpio->mr.addr + addr, data); } else if (size =3D=3D 2) { mrp =3D find_portio(mrpio, addr, 1, true); if (mrp) { - mrp->write(mrpio->portio_opaque, mrp->base + addr, data & 0xff= ); + mrp->write(mrpio->portio_opaque, mrpio->mr.addr + addr, data &= 0xff); if (addr + 1 < mrp->offset + mrp->len) { - mrp->write(mrpio->portio_opaque, mrp->base + addr + 1, dat= a >> 8); + mrp->write(mrpio->portio_opaque, mrpio->mr.addr + addr + 1= , data >> 8); } } } @@ -244,7 +244,6 @@ static void portio_list_add_1(PortioList *piolist, /* Adjust the offsets to all be zero-based for the region. */ for (i =3D 0; i < count; ++i) { mrpio->ports[i].offset -=3D off_low; - mrpio->ports[i].base =3D start + off_low; } =20 /* --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575262; cv=none; d=zohomail.com; s=zohoarc; b=Y5Ji/pAzW7ycdP7BrAlUVKK8A3aVelNSXkWclaJ8ux1nVmSuqfl9zvJWSO3um0mxom6/dTBeLdWWoeWy72/IF1WR4QZrImVx8PI/Q3qxO8yZMZakas+4R+1hK32UEz56T0QTPRKdfcwgTJ6s3/cdHkxAg1TOCym7a6giEqMceuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575262; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kpEcA88cRod9dP4VaT6aI75tyeAltviYyOMgF+q17FQ=; b=S0XH4Wo2ZruQqrFnZQ9J4AsgyClFjyz4XRL5Yz47COL/p/kRFh9XS7FFmrX2t6oE/F9WffvOwLMVjS3p5E5ExMDoE6MApxcJhl/7I1bqwUgjjY9pPvBDvrobUbe8Y0mJnQ+4+pr36v6f6RsQ9XQggagOB6jOO27RL0h4LrosiRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575262032193.46724667485455; Sat, 6 Jan 2024 13:07:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrk-0005e2-JE; Sat, 06 Jan 2024 16:06:00 -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 1rMDri-0005d7-Mp; Sat, 06 Jan 2024 16:05:58 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrg-00019t-Vo; Sat, 06 Jan 2024 16:05:58 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5537114380bso521018a12.3; Sat, 06 Jan 2024 13:05:55 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575154; x=1705179954; darn=nongnu.org; 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=kpEcA88cRod9dP4VaT6aI75tyeAltviYyOMgF+q17FQ=; b=kG124pNvvBBXgKdlbUVv3P9Lf23amA2OJTnuBGJK5a5o/561v+FJnJpgDaWicP3CpJ 6u15MwAx2FKlB03P2QHe9h+GzQLjFdHXN34OsyDxBCIxtIgp3B5FdNymXZVL6JKd1ueR 7fiOOpr4rJeCdt2ZJlOcKswYW2w3Gh+CMlVf0x4LlDe+lKdmOX6eLi4sxaV2hfkfBWXi E1TcU1/NU/ye5NhjVBS2tnPydZsVl9LC//LBpGVEN/x4da7VMgF9aVD4rSaumOjC9DFf RM6zVbeqkRUCDcBvTTXF/rrLGwV3yVdlsFI09g74BW+AQxC8H5up3Tk598gm5KDk4Voh CV+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575154; x=1705179954; 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=kpEcA88cRod9dP4VaT6aI75tyeAltviYyOMgF+q17FQ=; b=dbqGNJMcnQhOd0Ngm/j2Jnp/6Zlj11FuEIFd2NMfxtGpMtD1yRf3SbWuhbPNzSUvFu eSjR5u18m5YWk+ud5UcDLMe0XEgSeR03ZCVarfXhU78IKZbXNjv5d9EXKPQWJiBHIt86 sPFPoXD0hz1C7tbzohl03s5B6yhVW9riEn/zcz88n566Nrr+joGEXKp1Nu/onYDDJHuY yKQ41KTbni5XNYvgLkcJTu0wTaBTt/3aNkEJExpDBLi5raJiBJMPNL7MPBdWB0FShw1Q x4lHE4S6x3pNfeCwYghXBJPta3QTPH2J+d+wt3TEry7f0pBlaRol8YIP60G/m33nRXy4 sprw== X-Gm-Message-State: AOJu0YzGJnT8nZQzjkeRoDiDhk96Kw6uPyL3h1124leVSj2YzGK+SQY7 zbT1nJlgCBstjF167or69jaivh5R3aM= X-Google-Smtp-Source: AGHT+IENYIdxkdE1rCadPLo6XT+K1UXZvjSx71X6xdpeqC7Tk6nq9C4EpM/rJQWJE/jx/bAszQ9TcQ== X-Received: by 2002:a50:a68b:0:b0:557:1006:40a8 with SMTP id e11-20020a50a68b000000b00557100640a8mr761463edc.5.1704575153946; Sat, 06 Jan 2024 13:05:53 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 05/11] exec/ioport: Add portio_list_set_address() Date: Sat, 6 Jan 2024 22:05:25 +0100 Message-ID: <20240106210531.140542-6-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575262276100004 Content-Type: text/plain; charset="utf-8" Some SuperI/O devices such as the VIA south bridges or the PC87312 controll= er are able to relocate their SuperI/O functions. Add a convenience function f= or implementing this in the VIA south bridges. This convenience function relies on previous simplifications in exec/ioport which avoids some duplicate synchronization of I/O port base addresses. The naming of the function is inspired by its memory_region_set_address() penda= nt. Signed-off-by: Bernhard Beschow --- docs/devel/migration.rst | 5 +++-- include/exec/ioport.h | 2 ++ system/ioport.c | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index 95351ba51f..30b05f0f74 100644 --- a/docs/devel/migration.rst +++ b/docs/devel/migration.rst @@ -452,10 +452,10 @@ data doesn't match the stored device data well; it al= lows an intermediate temporary structure to be populated with migration data and then transferred to the main structure. =20 -If you use memory API functions that update memory layout outside +If you use memory or portio_list API functions that update memory layout o= utside initialization (i.e., in response to a guest action), this is a strong indication that you need to call these functions in a ``post_load`` callba= ck. -Examples of such memory API functions are: +Examples of such API functions are: =20 - memory_region_add_subregion() - memory_region_del_subregion() @@ -464,6 +464,7 @@ Examples of such memory API functions are: - memory_region_set_enabled() - memory_region_set_address() - memory_region_set_alias_offset() + - portio_list_set_address() =20 Iterative device migration -------------------------- diff --git a/include/exec/ioport.h b/include/exec/ioport.h index 95f1dc30d0..96858e5ac3 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -54,6 +54,7 @@ typedef struct PortioList { const struct MemoryRegionPortio *ports; Object *owner; struct MemoryRegion *address_space; + uint32_t addr; unsigned nr; struct MemoryRegion **regions; void *opaque; @@ -70,5 +71,6 @@ void portio_list_add(PortioList *piolist, struct MemoryRegion *address_space, uint32_t addr); void portio_list_del(PortioList *piolist); +void portio_list_set_address(PortioList *piolist, uint32_t addr); =20 #endif /* IOPORT_H */ diff --git a/system/ioport.c b/system/ioport.c index a59e58b716..000e0ee1af 100644 --- a/system/ioport.c +++ b/system/ioport.c @@ -133,6 +133,7 @@ void portio_list_init(PortioList *piolist, piolist->nr =3D 0; piolist->regions =3D g_new0(MemoryRegion *, n); piolist->address_space =3D NULL; + piolist->addr =3D 0; piolist->opaque =3D opaque; piolist->owner =3D owner; piolist->name =3D name; @@ -282,6 +283,7 @@ void portio_list_add(PortioList *piolist, unsigned int off_low, off_high, off_last, count; =20 piolist->address_space =3D address_space; + piolist->addr =3D start; =20 /* Handle the first entry specially. */ off_last =3D off_low =3D pio_start->offset; @@ -322,6 +324,23 @@ void portio_list_del(PortioList *piolist) } } =20 +void portio_list_set_address(PortioList *piolist, uint32_t addr) +{ + MemoryRegionPortioList *mrpio; + unsigned i, j; + + for (i =3D 0; i < piolist->nr; ++i) { + mrpio =3D container_of(piolist->regions[i], MemoryRegionPortioList= , mr); + memory_region_set_address(&mrpio->mr, + mrpio->mr.addr - piolist->addr + addr); + for (j =3D 0; mrpio->ports[j].size; ++j) { + mrpio->ports[j].offset +=3D addr - piolist->addr; + } + } + + piolist->addr =3D addr; +} + static void memory_region_portio_list_finalize(Object *obj) { MemoryRegionPortioList *mrpio =3D MEMORY_REGION_PORTIO_LIST(obj); --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575280; cv=none; d=zohomail.com; s=zohoarc; b=X0pORlkk5pbecPZoCtnoXH1WhFMUmN2MX0JyyKf7wL5pcD9Ov5FURSHUvY4I/EjjwNioZyIk0BgQfseLNOf7h8IIzYhyBy5qboAi8oVloUPUJtdFxXcm9ggnpAONOwdRuoL3bgfcUB6+pomrcowk6DL6pOr/bniC4dGil87PgDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575280; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yLhGyFxoalYrWwXJ5TMnYbhPZmyPAPZBcWGnzyg4yTg=; b=DvvcAtqonAbj1wkvFMi5hXWf8HkzH2wsOmkRqEiHKFmjuh2WGeLHM0bw/Ak+/8aLyY3fWIYTk9MPxQz+Ab8bp6znSpJEQ+xyGwSeEQKNI3KQEvoDFuJqtWlSA6PWLtQmzmTS+9wM4GMRS1qdF5lhuYHcSK0dC9qvdNItWFXHu68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575280793748.8977556594189; Sat, 6 Jan 2024 13:08:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrm-0005ei-QK; Sat, 06 Jan 2024 16:06:02 -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 1rMDrl-0005eI-77; Sat, 06 Jan 2024 16:06:01 -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 1rMDri-0001AI-BD; Sat, 06 Jan 2024 16:06:00 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-554fe147ddeso699716a12.3; Sat, 06 Jan 2024 13:05:57 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575155; x=1705179955; darn=nongnu.org; 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=yLhGyFxoalYrWwXJ5TMnYbhPZmyPAPZBcWGnzyg4yTg=; b=VAvM5leyQE6vhP4jRn0s/a/Z7ewPozeTUBWESN6j5dqp02wtXqDpAT5GEqM6bNoGiG d99wWchDxu13Tcq7mNE89D9zMyZ5gtw5FfOe/n22iwzSs22+iQ0mtX2LQa9f4waz3YF0 JiC4C7ku0LOFZeO1eeVR1yHwu3ifgAT0kocKzAjGQVzVaCS1Nfa0UqjUjqZDhuyv3cAW EOsNVosG/rcS9xAX2qKyYMKUBGwMl4Rv6EZLnnxFvMtXQBeRzfRguBc93MEaNvVSAogU 8ErWW4tE/1YZLbogntgG55dHEdAWHpdynk/l5+69CmwaQ2+kZrskDO14z9OSxQyDdSFr wDeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575155; x=1705179955; 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=yLhGyFxoalYrWwXJ5TMnYbhPZmyPAPZBcWGnzyg4yTg=; b=LG+lChS91Hjym7D/sZaKVAOLmwyxe+4qOSWH18aYh7WHT9x3ccJmbHXS9Doz0B5KYH er6tv14XIVaehrZKJZUY/7fVVPGM19CWj1On8L9tBZBdXgeMpWLrjDMLSpFMZRgubEqO 3RQVKyBD9jFeiL417IAXarvx+KcLBoD3DAH+Hh6LZly1jc8hPT7ay4qeKp8lsBTAgOiE UxY4k3xa1EVfyKBWZFVfZvzx6EABo+qk3+4Tgm2TeJGlJUUxCa9umz0dvAQrPZI47V8r 4/zZGgqNc9m2MtN1F7U9+Fl8DZxTp9k/4J21QJ4hYvdEAssVFp4QRcZqWu7WIQv88ecW /86g== X-Gm-Message-State: AOJu0YwmSziBswQekAFL6Gr+eRyMiQ5yzPy4w+VgRmNMHKmSmeY/ZM5v FZtR8V7502E/kLeGe9t6iy6PAG6SYIo= X-Google-Smtp-Source: AGHT+IG0QVo0nfdw4Hc/7KoEBaE/DajehiPo/GEWgPzwVaGDHw6ipDxYRpPwKdt83hwXu7V76vbYDQ== X-Received: by 2002:a50:955a:0:b0:557:2c3e:206a with SMTP id v26-20020a50955a000000b005572c3e206amr619482eda.0.1704575155608; Sat, 06 Jan 2024 13:05:55 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 06/11] exec/ioport: Add portio_list_set_enabled() Date: Sat, 6 Jan 2024 22:05:26 +0100 Message-ID: <20240106210531.140542-7-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575282518100003 Content-Type: text/plain; charset="utf-8" Some SuperI/O devices such as the VIA south bridges or the PC87312 controll= er allow to enable or disable their SuperI/O functions. Add a convenience func= tion for implementing this in the VIA south bridges. The naming of the functions is inspired by its memory_region_set_enabled() pendant. Signed-off-by: Bernhard Beschow --- docs/devel/migration.rst | 1 + include/exec/ioport.h | 1 + system/ioport.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index 30b05f0f74..1683fc6026 100644 --- a/docs/devel/migration.rst +++ b/docs/devel/migration.rst @@ -465,6 +465,7 @@ Examples of such API functions are: - memory_region_set_address() - memory_region_set_alias_offset() - portio_list_set_address() + - portio_list_set_enabled() =20 Iterative device migration -------------------------- diff --git a/include/exec/ioport.h b/include/exec/ioport.h index 96858e5ac3..4397f12f93 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -71,6 +71,7 @@ void portio_list_add(PortioList *piolist, struct MemoryRegion *address_space, uint32_t addr); void portio_list_del(PortioList *piolist); +void portio_list_set_enabled(PortioList *piolist, bool enabled); void portio_list_set_address(PortioList *piolist, uint32_t addr); =20 #endif /* IOPORT_H */ diff --git a/system/ioport.c b/system/ioport.c index 000e0ee1af..fd551d0375 100644 --- a/system/ioport.c +++ b/system/ioport.c @@ -324,6 +324,15 @@ void portio_list_del(PortioList *piolist) } } =20 +void portio_list_set_enabled(PortioList *piolist, bool enabled) +{ + unsigned i; + + for (i =3D 0; i < piolist->nr; ++i) { + memory_region_set_enabled(piolist->regions[i], enabled); + } +} + void portio_list_set_address(PortioList *piolist, uint32_t addr) { MemoryRegionPortioList *mrpio; --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575216; cv=none; d=zohomail.com; s=zohoarc; b=QvD9lZkZ7biau7W4TvE2Sno5GtYbHULhLwNxd5JAIYNGdqb/rVXSK7aIlgGXWnYkany2nDlwRKrExbWw5dSFBhC7kvyq9VL44XFWqDraCKXQG2dGQ9ithp6aPv8zVadAXn9ZlS6/9HwUY+5d9a+3ss0II0F0OGWeGg2ltIvsy2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575216; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t/DnmwsZ7xP8YAXiG+Ug2+agkl77mYRu9Wp28MfNLeE=; b=TTARKeIoIo+nuFw7/uY/d+7SOcucYuqQE+up1eH8MdKiUO0Sf0Oi0FqBUW5m8Cc5t+FA3eFDe4WziOZwZmanR8m3QaWLNK3iStv7J232lzN/Z/GY/JcdhHU1CjEPPoowo5BCc+X3y7oHfhIjZHf5kRWS+OACpYzDsbLT0MLfxgw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17045752168694.2538399957626325; Sat, 6 Jan 2024 13:06:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrq-0005gL-2j; Sat, 06 Jan 2024 16:06:06 -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 1rMDrn-0005fH-Qf; Sat, 06 Jan 2024 16:06:04 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrm-0001Af-8D; Sat, 06 Jan 2024 16:06:03 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3368abe1093so631412f8f.2; Sat, 06 Jan 2024 13:06:00 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575158; x=1705179958; darn=nongnu.org; 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=t/DnmwsZ7xP8YAXiG+Ug2+agkl77mYRu9Wp28MfNLeE=; b=OJTvaIsE03wJqP0DmNEqYo7PrFR+epFXHRFVbJJAUABbwbkg4nxgf7met5CgSAt47U dF6/9YuLwIynNT3H7nqrg0DS6OrSy8N4yFdJ9qt3PhoLS3+1nBnpxZCDLM9HxAtwKnRi bcjV8Up+9Lqj4Gy+Mwoh0GNyM+DMlEQwfZcbHypfP6Y26DQ4DcgMtyC5lFVhsFfcj4JO mEQN2DIMSDtuhgmvj2l560anQNJd3Cn4rereLwgUXCFI4Bfnl30hykLw6xMm/qEey9Zr EmK6IP1T9F4rCyx9lOaDX6V7FUWKTpYbTU+7NFv4wSNaR7kUWlRL24M1OBUBpM+H74t6 svLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575158; x=1705179958; 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=t/DnmwsZ7xP8YAXiG+Ug2+agkl77mYRu9Wp28MfNLeE=; b=o/YTnULqwX30XZTsSkX7Ke3+yfUv2Uw4ik8YoLYD76EC+LoO61rQ4kUnylHI+zI72G p3xlu3vLZ32i2kVPWvhvJZ4FQnY2aFr2gbHADTqOT9tqdRrtOI0aHcsmrsOCBLYgyyv4 2a2mHeknGhBMIvM2bkmPNkRHI5o1T/YJychBEZ8ukWCWHOd+73cQaVVMK17ibLHf2ZCB gWLx3FUXQfl3HZwXmDswJwG21KBwEbF6ql+C55JgwL69CoNX+PUv/k5dc3FTe5nYWR28 /4qxRqK2331yoa3yxU1+Hdx4TuqysmFywaJc64hno99WSDAJBP+QB98sDMiR9Ykx/+wT QPcQ== X-Gm-Message-State: AOJu0Yyh/ADlgzRlTrSL8216yNLR28ueWk1oAcqJ26J2eHXWGK4DcxjW PaJiI46lYtXX9cUTmkj9hIMGsvbJSbE= X-Google-Smtp-Source: AGHT+IHhalljsJT/0csqKr/rwDF2CMzpSFNjT0vQQ4dyeFph8JRw6xTd8IWJO/gC+R9KNpRWhxPiHg== X-Received: by 2002:adf:fe03:0:b0:336:5f08:bbe0 with SMTP id n3-20020adffe03000000b003365f08bbe0mr700600wrr.101.1704575157677; Sat, 06 Jan 2024 13:05:57 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 07/11] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC Date: Sat, 6 Jan 2024 22:05:27 +0100 Message-ID: <20240106210531.140542-8-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=shentey@gmail.com; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575218402100011 Content-Type: text/plain; charset="utf-8" The real SuperI/O chips emulated by QEMU allow for relocating and enabling = or disabling their SuperI/O functions via software. So far this is not impleme= nted. Prepare for that by adding isa_fdc_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/block/fdc.h | 3 +++ hw/block/fdc-isa.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index 35248c0837..c367c5efea 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -14,6 +14,9 @@ void fdctrl_init_sysbus(qemu_irq irq, hwaddr mmio_base, D= riveInfo **fds); void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc); =20 +void isa_fdc_set_iobase(ISADevice *fdc, hwaddr iobase); +void isa_fdc_set_enabled(ISADevice *fdc, bool enabled); + FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i); int cmos_get_fd_drive_type(FloppyDriveType fd0); =20 diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index 2d8a98ce7d..e43dc532af 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -192,6 +192,20 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType = type) return dev; } =20 +void isa_fdc_set_iobase(ISADevice *fdc, hwaddr iobase) +{ + FDCtrlISABus *isa =3D ISA_FDC(fdc); + + fdc->ioport_id =3D iobase; + isa->iobase =3D iobase; + portio_list_set_address(&isa->portio_list, isa->iobase); +} + +void isa_fdc_set_enabled(ISADevice *fdc, bool enabled) +{ + portio_list_set_enabled(&ISA_FDC(fdc)->portio_list, enabled); +} + int cmos_get_fd_drive_type(FloppyDriveType fd0) { int val; --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575260; cv=none; d=zohomail.com; s=zohoarc; b=PTy3iVZCTJvLnifgUcKKVLayomTHBNsfa8hG4qsgkCrohnK93Pq9aqso/bNgEMcW2nAQR/3JMRx/PFqhoQbNELFukKDFTFYkkJu1V93T5oPtQAdCS89C3q2I83BEnT7r8pIZHVcstLt23QNpxyQQrSz4Oyc/YRL6z765tNFWTXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575260; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=py92FQejKDlLtWW57eF8TnbqU3TrVAOsFf1Pvat3KP0=; b=BHPdfATMjxkMOFvd+1UuwtWZdFZEeJzgacJzEMHC93xtkylWruBzXcqF9+beb3cIqb1r7WDn/avjhBG2JqSVcTwFZy0zDOvqbu3cfvSevJY5jeKZeg7ypA6F3rsW9BKJEezwxM+Ex0YQFUKqhIZ4DrBNykAo9d4sE592SA+tb5M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575260730210.198576257206; Sat, 6 Jan 2024 13:07:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDro-0005fp-Op; Sat, 06 Jan 2024 16:06:04 -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 1rMDrn-0005ev-D2; Sat, 06 Jan 2024 16:06:03 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrl-0001Ai-SZ; Sat, 06 Jan 2024 16:06:03 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5576fd0ded7so412300a12.0; Sat, 06 Jan 2024 13:06:00 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:05:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575159; x=1705179959; darn=nongnu.org; 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=py92FQejKDlLtWW57eF8TnbqU3TrVAOsFf1Pvat3KP0=; b=bdpwCToRsGOSXQnrJy0laaxQgKwYM4xwd+OAo8RCCLjugKnJb+mX2XiGRZ23Qvgyrb AXJqlPElryp9cEB6lwePkteDGmp51l3qlvrmVT5XZJeV7jHw8bz/W1fisvZyYqBOzsgO UhH3gOqWEsj1kd09KJvmyWPlA7Ew3nNjpqZet9Z3uggElSjpeHJ1zZjOrmsMax6NkOQj liejEM61u9Tk2gksQ0GpknQWSUxAu6W44o/DLRPzxbC/ot2K48ppTS0EW42JGmecWmLd JWmEV2A3pFvwH2NV/nziRzUkOr9D4clMB1nZVZnn3/mvEmt//IAcQ0p25AHGxf7GarvP gTAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575159; x=1705179959; 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=py92FQejKDlLtWW57eF8TnbqU3TrVAOsFf1Pvat3KP0=; b=o3K700/VL6BXrvvhMaAoYXuVp1t+bTtKfQWGSe31bGJxSKRu2w+xzB+nH8oyjOvzRv ZNeu8yTJEa9CTBeg4pLIn2SPPK495EG0wt4CPEqyg231KdgHmHkPhr6ggutSbqCyOd7l fv4W+kNsgmrZsbu3FE4PgdDVBvNh4NrORN1udqIp26piXHmoLyT+c2pNvqdxyVg59OH1 xk4PYnB3t9HrIzu15WyIih1PWcIVmWnwnib2R5icnPohddq9ffKHnLe6onn5jJo8R8os TZQfxYEcgLbGctfaNLarruKJQDlXG0YgZIusTKDf2mt2bKi6g1T7rPKFwyt7v0jG+7lH W0uA== X-Gm-Message-State: AOJu0YwUW0ag8ymWv/h3NgOmp/YCjv7IC7g3NhTKOQS7nvpJoXGr0aEJ 62ZOjCzrlQJJlVU2aAg4n911yGkde9k= X-Google-Smtp-Source: AGHT+IELw8mPxKFc41Q8uSbl5gicbbEH8EpGDEMqaJFg+sXFiIQ7hN7Fvfa0BLQAWVt8elDR2pE5jw== X-Received: by 2002:a50:d7d7:0:b0:557:7c2:1114 with SMTP id m23-20020a50d7d7000000b0055707c21114mr524894edj.171.1704575159369; Sat, 06 Jan 2024 13:05:59 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 08/11] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL Date: Sat, 6 Jan 2024 22:05:28 +0100 Message-ID: <20240106210531.140542-9-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575262269100003 Content-Type: text/plain; charset="utf-8" The real SuperI/O chips emulated by QEMU allow for relocating and enabling = or disabling their SuperI/O functions via software. So far this is not impleme= nted. Prepare for that by adding isa_serial_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/char/serial.h | 2 ++ hw/char/serial-isa.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 8ba7eca3d6..6e14099ee7 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -112,5 +112,7 @@ SerialMM *serial_mm_init(MemoryRegion *address_space, =20 #define TYPE_ISA_SERIAL "isa-serial" void serial_hds_isa_init(ISABus *bus, int from, int to); +void isa_serial_set_iobase(ISADevice *serial, hwaddr iobase); +void isa_serial_set_enabled(ISADevice *serial, bool enabled); =20 #endif diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 1c793b20f7..329b352b9a 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -184,3 +184,17 @@ void serial_hds_isa_init(ISABus *bus, int from, int to) } } } + +void isa_serial_set_iobase(ISADevice *serial, hwaddr iobase) +{ + ISASerialState *s =3D ISA_SERIAL(serial); + + serial->ioport_id =3D iobase; + s->iobase =3D iobase; + memory_region_set_address(&s->state.io, s->iobase); +} + +void isa_serial_set_enabled(ISADevice *serial, bool enabled) +{ + memory_region_set_enabled(&ISA_SERIAL(serial)->state.io, enabled); +} --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575294; cv=none; d=zohomail.com; s=zohoarc; b=EK+2k7d9z9sfLl5cX5o/VHhV0HmkiNBLfO0IFpzZm1V76CKbl1ydPRfUCITw4qWmPeEaRlDHocQltfBSrnjYYy2H6BInmu6LQ4pPYHQcTg0SFjEAy1Z7J+rkt9KHhX3Kez+Bpxrvzy4p7prYBdwpR109tIZso+0b4yf/sRmM/Yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575294; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BO3joJYDTtGUerfBs3WaLe5gIZcBp9HzTmPOq+TE/bA=; b=PxOeE80gcmIQzsfaxwkHbYzDW3Wp6ZxIZ+KG0ofZUTTNYjwC8YOJ/cK8dhymo3abj86FkT9DpZ35JZE14LXbT/5+f7JRfuWc97sP9ZImKhD5fFRAGjTrfotlCT6tUe+Z8gECJpucxh6JWRFi5Bfu2WyEcq00+IEOwURKBGqR6nI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575294810601.084993467247; Sat, 6 Jan 2024 13:08:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrr-0005if-Up; Sat, 06 Jan 2024 16:06:07 -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 1rMDrp-0005gO-Vq; Sat, 06 Jan 2024 16:06:06 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDro-0001B7-Cb; Sat, 06 Jan 2024 16:06:05 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-554fe147ddeso699752a12.3; Sat, 06 Jan 2024 13:06:03 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575161; x=1705179961; darn=nongnu.org; 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=BO3joJYDTtGUerfBs3WaLe5gIZcBp9HzTmPOq+TE/bA=; b=dQ6Sbkj/jhYOmhqYCQ7QuApRs9soCMHda5EgaqnFOEl3fCOkE8dw4QpnAOOQbqz3ws CzV9MIwzHp9IbeUD1a8AitK9/iX9vv5nAFo1fSdfIFTt7wIeRVRdngc5YYVOlnLBnM8x U2s0kwSOGzmSqvf45lIXQ15ngRguHyJv1CSZPHVqGsK9sXkwtxiWN25A2+8Roh72kXiN gGm/n/R3DVLNaDYHyvUfWriuZOiLUf185sxiqzwSy+F2qavy9gbNbaFJgjTW4KBc9T2W lj4p9XrA3w2hBYxj4go5SAJ7mheqc3xTASG2TT2tU+6XhOmzopXRL0DMb4VCRdxBvxo2 bO3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575161; x=1705179961; 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=BO3joJYDTtGUerfBs3WaLe5gIZcBp9HzTmPOq+TE/bA=; b=D0YQeaLcjWY4hbc15x1ISqCmZEG8X7di1l5+CggMrQJVatJPuNIsgHsogySgJ57PmW 4thmDwMs0yO/Zz37aK6PzJCbIzcuDNsZHPpawytdPjjnUx3NEjypDZk3T1UB3I57wgGo g/Qy1BH0WvUhZWjKHVIs2zRPLMNiv7jjyfIMxJMpfB0cpweRSMxozBPkoKZIzKhSSisS nvmhiUh7vs63iTbjHqn4zcjkTMd+fw9WEl2QnVDGFTO1KimPwRrITvEQGff9E/JHg5iM ZtQU+5o8Svqapc54p8JDIoiIJTT5pxfq+1KwxDYM68iLIbdIcaN8MblcziuR7rOSgTe0 8Biw== X-Gm-Message-State: AOJu0YwUhxuLT2/xjat9qV/eb0rekB1C8Jk2eNegtVNXAVDWUV8TbemJ o/eQdRpOsjmEdDC0wQfweb9RePeX61k= X-Google-Smtp-Source: AGHT+IFifs91QStc18KDRYn+mCVXA1173sWpbHPJyqCQAfvLTfGDTDLiK4Jn9Dbn1N/T5MSrbigOyw== X-Received: by 2002:a50:8d4f:0:b0:54c:d9c5:f9ef with SMTP id t15-20020a508d4f000000b0054cd9c5f9efmr454637edt.8.1704575161062; Sat, 06 Jan 2024 13:06:01 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 09/11] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL Date: Sat, 6 Jan 2024 22:05:29 +0100 Message-ID: <20240106210531.140542-10-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=shentey@gmail.com; helo=mail-ed1-x536.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575296408100003 Content-Type: text/plain; charset="utf-8" The real SuperI/O chips emulated by QEMU allow for relocating and enabling = or disabling their SuperI/O functions via software. So far this is not impleme= nted. Prepare for that by adding isa_parallel_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/char/parallel-isa.h | 3 +++ hw/char/parallel-isa.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hw/char/parallel-isa.h b/include/hw/char/parallel-isa.h index 3b783bd08d..5284b2ffec 100644 --- a/include/hw/char/parallel-isa.h +++ b/include/hw/char/parallel-isa.h @@ -29,4 +29,7 @@ struct ISAParallelState { PortioList portio_list; }; =20 +void isa_parallel_set_iobase(ISADevice *parallel, hwaddr iobase); +void isa_parallel_set_enabled(ISADevice *parallel, bool enabled); + #endif /* HW_PARALLEL_ISA_H */ diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c index ab0f879998..a5ce6ee13a 100644 --- a/hw/char/parallel-isa.c +++ b/hw/char/parallel-isa.c @@ -41,3 +41,17 @@ void parallel_hds_isa_init(ISABus *bus, int n) } } } + +void isa_parallel_set_iobase(ISADevice *parallel, hwaddr iobase) +{ + ISAParallelState *s =3D ISA_PARALLEL(parallel); + + parallel->ioport_id =3D iobase; + s->iobase =3D iobase; + portio_list_set_address(&s->portio_list, s->iobase); +} + +void isa_parallel_set_enabled(ISADevice *parallel, bool enabled) +{ + portio_list_set_enabled(&ISA_PARALLEL(parallel)->portio_list, enabled); +} --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575265; cv=none; d=zohomail.com; s=zohoarc; b=OkXgKCCPBAVbtVNMuiXNJisHAcz2ac9j9Kud34IMnG29u4Cydj38QCuD4sOle2ZGn1s8WeMF4Bad6G/Tm4E8/r/CpDYT6RIOk9/EJQqrzjtmTmSHXTy4SoeUbTw+Q2S9+ZFd2V4y6e5GU9SE+u8ChnB6h4wNchsqMwHSrJ7eq28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575265; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=beCClsHMmqcMkMYgwQdfXIKn37AYMjOXEPxAk81UJRk=; b=N6gqyxRMX+vEkVCSBF34Rw9HKClYepvJZz+MroumyquvS8/U4InMAvih9ZN2xyM1I0sHFHaC7jI/MqHF/STIMr8mdBQav56ppS3cCKmubfLkCD7PueBp91ssT4ek0U52txU8MfnhKm++UUTnLZaSWarxk8+Y3j1/zY/Nss9cwp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575265018330.0436037089215; Sat, 6 Jan 2024 13:07:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDru-0005kH-4F; Sat, 06 Jan 2024 16:06: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 1rMDrr-0005hh-E4; Sat, 06 Jan 2024 16:06:07 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrp-0001BU-NZ; Sat, 06 Jan 2024 16:06:07 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-555e07761acso716881a12.0; Sat, 06 Jan 2024 13:06:04 -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.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575163; x=1705179963; darn=nongnu.org; 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=beCClsHMmqcMkMYgwQdfXIKn37AYMjOXEPxAk81UJRk=; b=DgPDNcF8drqPgAcBBrzGxS/dfz5BBaz1q9H35ny5BTx2wS283LHzK+xjX0pCRqa7Pp 0dRt9+4mSiDvWIft7HAJmIbJ3VeqOiT6XaJ7ZsRQH1s7RDnVHsLqlFhftFItELV2NqHl tkZF42/1HiKn8nwbvcxln1dvX1u0RcFHAsYARVq6/Lmld2Q0PbVywcr3bNYduhgsE8JH 3EE6CvBQRuHKm0u7KofGET4gCkWJ+BuueVoSCYnhXRoKw63z5Bri1M3tujEqn43ZlH+v YcQyGgfRJK/8U0rzdaY5uXUeR4PDuU3HUWrfWqfm6XcrELbXkmxD/bQy2lTAOah2F7lD MmsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575163; x=1705179963; 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=beCClsHMmqcMkMYgwQdfXIKn37AYMjOXEPxAk81UJRk=; b=O9sP9I5ykDPHLSez4kWQKo2bMTvjtf9H4i4EuYcIzE77GbjTV5DRIhjFNEvcnKj8HS DjlXug4NK0ks3G0z8SEwZem6jqp63wrV94rPhYgZbwu5LKWYlrjT9cZDsNMtJHoakYJ2 lkvBbNiPJLW+CwktDqQ3+OQsWKclUZ9FrMYkLBxBGxppbnu2XvIzo3cyEJl7xhaTP0tR 2vyw6NJJ1ojQEBUJHnBJFLoOfcgA/uGGkyLPsWli4z3Td69XJsaRM8yNxvxEbRCzn1J8 qCrqHGZsuBK6a6bSe/gZUvysIBz3PiBC7TSQSrlUojcGwNWn5rtX2UOgyW4HXb0QjyxE czPQ== X-Gm-Message-State: AOJu0YxNHaW+1zrZuIu5LHDWuzMVK+c0KOHR9ezqM1gJ5cVhLwbwRki+ 76XgUnRCwQOXzQn3Xx+ZrvkIymlRlSM= X-Google-Smtp-Source: AGHT+IFMwTHj4D+JHoC4lxMaM3UMO8U5yzCZNNCv0vBsKo6BEwB7nI6hVlmYOq3JaNqbyow8FiTg+A== X-Received: by 2002:a05:6402:1cab:b0:556:9ccb:33c9 with SMTP id cz11-20020a0564021cab00b005569ccb33c9mr480617edb.111.1704575163282; Sat, 06 Jan 2024 13:06:03 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions Date: Sat, 6 Jan 2024 22:05:30 +0100 Message-ID: <20240106210531.140542-11-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575266309100011 Content-Type: text/plain; charset="utf-8" This is a preparation for implementing relocation and toggling of SuperI/O functions in the VT8231 device model. Upon reset, all SuperI/O functions wi= ll be deactivated, so in case if no -bios is given, let the machine configure tho= se functions the same way Pegasos II firmware would do. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index 3203a4a728..0a40ebd542 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -285,6 +285,15 @@ static void pegasos2_pci_config_write(Pegasos2MachineS= tate *pm, int bus, pegasos2_mv_reg_write(pm, pcicfg + 4, len, val); } =20 +static void pegasos2_superio_write(Pegasos2MachineState *pm, uint32_t addr, + uint32_t val) +{ + AddressSpace *as =3D CPU(pm->cpu)->as; + + stb_phys(as, PCI1_IO_BASE + 0x3f0, addr); + stb_phys(as, PCI1_IO_BASE + 0x3f1, val); +} + static void pegasos2_machine_reset(MachineState *machine, ShutdownCause re= ason) { Pegasos2MachineState *pm =3D PEGASOS2_MACHINE(machine); @@ -310,6 +319,12 @@ static void pegasos2_machine_reset(MachineState *machi= ne, ShutdownCause reason) =20 pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | PCI_INTERRUPT_LINE, 2, 0x9); + pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | + 0x50, 1, 0x6); + pegasos2_superio_write(pm, 0xf4, 0xbe); + pegasos2_superio_write(pm, 0xf6, 0xef); + pegasos2_superio_write(pm, 0xf7, 0xfc); + pegasos2_superio_write(pm, 0xf2, 0x14); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | 0x50, 1, 0x2); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | --=20 2.43.0 From nobody Tue Nov 26 20:31:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704575272; cv=none; d=zohomail.com; s=zohoarc; b=PuQpGfusDfexHDXV0BS+X0uxcaimzYOplYTgcUV0eCJlz+n13ImgNsHxJLuzTX5Rv5+6BWNHnCDQ7jDGp3X4FNxh0TjeCabFTgsivkhjmgF2ByeEmzIBhVBU0QwnQi7EvZw+Z3vraMdITeF6GlFChvsBIpswjNZiAovZztlsbWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704575272; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SQJaG4msRC45GYACTCpBnEbUr/gM4yroph6dN8fqHqA=; b=X7BlcFWnkwCxbVqAOWHaTHKfZMvfvAJul3JQ8qSo9DAECVkwog8RUVSA2APUB/nWqwztovogxjo4H9w/BMobP+bndZs1r4CzjOUWVjcIY5PXoJoq1vPYGDzssevEP1Dexp0z3QZBFruua5ajz6dW+NAYJNXouMvODbhV9Nus5Ls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704575272816483.7514606781932; Sat, 6 Jan 2024 13:07:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMDrx-0005lo-D0; Sat, 06 Jan 2024 16:06:13 -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 1rMDrt-0005kD-KJ; Sat, 06 Jan 2024 16:06:09 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMDrr-0001Bm-K9; Sat, 06 Jan 2024 16:06:09 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-55569b59f81so712691a12.1; Sat, 06 Jan 2024 13:06:06 -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.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 13:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704575165; x=1705179965; darn=nongnu.org; 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=SQJaG4msRC45GYACTCpBnEbUr/gM4yroph6dN8fqHqA=; b=CeToJXJCVsM5A4x1ODEQdegoybpii6WhBFszdlUytzW8lU0FiFmQx8JTEC8YDaU5FN bkQGrpQZ1MnvZh2Rf7gW33Dl3cLnknXgrsB6di8O+wbsbEiNHav4FK+lwE2zCm4yKVZ/ NMi9fIPwunYieqqZYzizRUynnbqpbEsMjY2XiatIowRqLuDlT4aTDGkSSi9rAXC/bOYF ylfFsQYz90tkyeAxZh3+9pACGc9iPYHZxQ47ROO07TUBAkEx9grtQwde7iNV+phGo75V LBihRxEUOJLDn0ELz2c5KrkY6e2MHM5OswWoImevhPWCBMPswrIPZln00bDdHAbADMQc FDeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704575165; x=1705179965; 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=SQJaG4msRC45GYACTCpBnEbUr/gM4yroph6dN8fqHqA=; b=qjnlvtGTWFEXgF9FVlLFZ32s3G0V0TJ3p+K59xI0gBmImz8lIBZRE+WD1P3/dae17t 1l+VEWMptA526VwTnTM5pNO+ezcuan1KLDhTskBb6pnRj1kr642VaJINmFk7Z6/WwtJI N15TaZmwjKXdU6X7UYYnqXpQDTq7FbKmH0Ki8ws3iLGzKD1hmgktnYlyEDgKjc1MSg1s 8Y2qFJEucdeWb1Oj2OBiXRiG29RsKmPO0HOrP3ieTIwjXuRjqbfm6YCX6KFttXsGIaf1 8hHWDRnL6gZU3occaqruf0DJqnvNrs8Ngd7cITEXC6ky1GjK4u5rdCzaWrktNyc91OOV LdnA== X-Gm-Message-State: AOJu0YyPBxTErSHzmHTPFm+FbmGR5Tl7r7GQK6V0FPaoe038bFvWWAVh 2OmuuuYE3OEsYm7T8hZV9kh10uOfqeY= X-Google-Smtp-Source: AGHT+IGHvl3kLqrw8oxidii2FKoNPqAsLGE26Pd0E8SyNSaFrQB9sAIvjYn/nviADxKlgchv2NXXWQ== X-Received: by 2002:a50:9ead:0:b0:557:1a73:c91d with SMTP id a42-20020a509ead000000b005571a73c91dmr665802edf.9.1704575165074; Sat, 06 Jan 2024 13:06:05 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Artyom Tarasenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fabiano Rosas , Jiaxun Yang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Marcel Apfelbaum , Sergio Lopez , Hanna Reitz , Mark Cave-Ayland , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow Subject: [PATCH v4 11/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions Date: Sat, 6 Jan 2024 22:05:31 +0100 Message-ID: <20240106210531.140542-12-shentey@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240106210531.140542-1-shentey@gmail.com> References: <20240106210531.140542-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=shentey@gmail.com; helo=mail-ed1-x52a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704575274326100003 Content-Type: text/plain; charset="utf-8" The VIA south bridges are able to relocate and toggle (enable or disable) t= heir SuperI/O functions. So far this is hardcoded such that all functions are al= ways enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy before activating such a fun= ction and issue an error in case of a conflict. Since the functions are currently enabled on reset, conflicts are always detected. Prevent that by implementi= ng relocation and toggling of the SuperI/O functions. Note that all SuperI/O functions are now deactivated upon reset (except for VT82C686B's serial ports where Fuloong 2e's rescue-yl seems to expect them = to be enabled by default). Rely on firmware to configure the functions accordingl= y. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/isa/vt82c686.c | 66 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index d3e0f6d01f..9f62fb5964 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -15,6 +15,9 @@ =20 #include "qemu/osdep.h" #include "hw/isa/vt82c686.h" +#include "hw/block/fdc.h" +#include "hw/char/parallel-isa.h" +#include "hw/char/serial.h" #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "hw/ide/pci.h" @@ -323,6 +326,18 @@ static uint64_t via_superio_cfg_read(void *opaque, hwa= ddr addr, unsigned size) return val; } =20 +static void via_superio_devices_enable(ViaSuperIOState *s, uint8_t data) +{ + ISASuperIOClass *ic =3D ISA_SUPERIO_GET_CLASS(s); + size_t i; + + isa_parallel_set_enabled(s->superio.parallel[0], (data & 0x3) !=3D 3); + for (i =3D 0; i < ic->serial.count; i++) { + isa_serial_set_enabled(s->superio.serial[i], data & BIT(i + 2)); + } + isa_fdc_set_enabled(s->superio.floppy, data & BIT(4)); +} + static void via_superio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -368,7 +383,25 @@ static void vt82c686b_superio_cfg_write(void *opaque, = hwaddr addr, case 0xfd ... 0xff: /* ignore write to read only registers */ return; - /* case 0xe6 ... 0xe8: Should set base port of parallel and serial */ + case 0xe2: + data &=3D 0x1f; + via_superio_devices_enable(sc, data); + break; + case 0xe3: + data &=3D 0xfc; + isa_fdc_set_iobase(sc->superio.floppy, data << 2); + break; + case 0xe6: + isa_parallel_set_iobase(sc->superio.parallel[0], data << 2); + break; + case 0xe7: + data &=3D 0xfe; + isa_serial_set_iobase(sc->superio.serial[0], data << 2); + break; + case 0xe8: + data &=3D 0xfe; + isa_serial_set_iobase(sc->superio.serial[1], data << 2); + break; default: qemu_log_mask(LOG_UNIMP, "via_superio_cfg: unimplemented register 0x%x\n", id= x); @@ -395,9 +428,14 @@ static void vt82c686b_superio_reset(DeviceState *dev) /* Device ID */ vt82c686b_superio_cfg_write(s, 0, 0xe0, 1); vt82c686b_superio_cfg_write(s, 1, 0x3c, 1); - /* Function select - all disabled */ + /* + * Function select - only serial enabled + * Fuloong 2e's rescue-yl prints to the serial console w/o enabling it= . This + * suggests that the serial ports are enabled by default, so override = the + * datasheet. + */ vt82c686b_superio_cfg_write(s, 0, 0xe2, 1); - vt82c686b_superio_cfg_write(s, 1, 0x03, 1); + vt82c686b_superio_cfg_write(s, 1, 0x0f, 1); /* Floppy ctrl base addr 0x3f0-7 */ vt82c686b_superio_cfg_write(s, 0, 0xe3, 1); vt82c686b_superio_cfg_write(s, 1, 0xfc, 1); @@ -465,6 +503,21 @@ static void vt8231_superio_cfg_write(void *opaque, hwa= ddr addr, case 0xfd: /* ignore write to read only registers */ return; + case 0xf2: + data &=3D 0x17; + via_superio_devices_enable(sc, data); + break; + case 0xf4: + data &=3D 0xfe; + isa_serial_set_iobase(sc->superio.serial[0], data << 2); + break; + case 0xf6: + isa_parallel_set_iobase(sc->superio.parallel[0], data << 2); + break; + case 0xf7: + data &=3D 0xfc; + isa_fdc_set_iobase(sc->superio.floppy, data << 2); + break; default: qemu_log_mask(LOG_UNIMP, "via_superio_cfg: unimplemented register 0x%x\n", id= x); @@ -513,12 +566,6 @@ static void vt8231_superio_init(Object *obj) VIA_SUPERIO(obj)->io_ops =3D &vt8231_superio_cfg_ops; } =20 -static uint16_t vt8231_superio_serial_iobase(ISASuperIODevice *sio, - uint8_t index) -{ - return 0x2f8; /* FIXME: This should be settable via registers f2-f= 4 */ -} - static void vt8231_superio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -526,7 +573,6 @@ static void vt8231_superio_class_init(ObjectClass *klas= s, void *data) =20 dc->reset =3D vt8231_superio_reset; sc->serial.count =3D 1; - sc->serial.get_iobase =3D vt8231_superio_serial_iobase; sc->parallel.count =3D 1; sc->ide.count =3D 0; /* emulated by via-ide */ sc->floppy.count =3D 1; --=20 2.43.0