From nobody Tue Nov 26 22:14:48 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