From nobody Wed May 15 09:29:05 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=1652006452; cv=none; d=zohomail.com; s=zohoarc; b=atGgBI5XUzykl/YfRt6CY9PP+HHM8cnPGTFAa/MW5pVwyg3EqdJl1qKJrQ8pEi8FvOVdIFqnOL8uCAvMLJAClqbGqQq9dBTWmHEG13HPEimGqQunLxfZXNUDtrHzqZkpSvKroGlSaXIsfrpS2gJYTkik4mI3PZ4BgKQXmnNGqmE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652006452; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eZESDsRAqJr62NbjfLmlIhWx0VhIvAD6ZfdFOEz5AGM=; b=Je9NdeRplrISm7jfiUzLxdGG1YPmGNd+8yEWfJ6Tz2jgXd03bZ+ahaKkjFV7/JVyJrapttYivTfAm6oPEgdg4dzA7MK1PGCMhaWv05grsO6XM9+nznLYiS3iHWCPRgcuKCBJ7oyTsHipSrECryWlSJKtzmPLpH8wh/ker196GAk= 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 1652006452809803.7470766865765; Sun, 8 May 2022 03:40:52 -0700 (PDT) Received: from localhost ([::1]:47314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nneLL-0001ko-DN for importer@patchew.org; Sun, 08 May 2022 06:40:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nneFr-0007D2-PV; Sun, 08 May 2022 06:35:11 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:45029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nneFp-0000HE-R4; Sun, 08 May 2022 06:35:11 -0400 Received: by mail-ej1-x62d.google.com with SMTP id i19so21826754eja.11; Sun, 08 May 2022 03:35:06 -0700 (PDT) Received: from localhost.localdomain (dynamic-077-183-246-161.77.183.pool.telefonica.de. [77.183.246.161]) by smtp.gmail.com with ESMTPSA id ci18-20020a170907267200b006f388f6f927sm3901948ejc.1.2022.05.08.03.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 03:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eZESDsRAqJr62NbjfLmlIhWx0VhIvAD6ZfdFOEz5AGM=; b=Lhjll1RHi/Zb27lY0LdfC2NU0MTspGZ1g1IhCbSkCed92FikO2gusIN5/2mOnoS8ts 3qfKOVB0ea3OYubzBcAI9dJysvzbq1FLfBfMZVrHqbZzjz7LxeNGS5qhIDeqUExvfDXw JGZ3M2DkWsZ1ndlmaCtghQDAhf6vcIvS0E+NRiwt69aS1OCgkp5CoyhYlBfM7Yd/HznJ sjz+HBiO+WVNOOMvzaJMvt8Z34fUqJP9Fehci0Kg8oiZxEUzpduv/3JXwizp+pvA3dUi cPxtBCqj3cetBfERSL+QjG4166uDWnNHy/pYxcavOEJcA0L616xIENxW3lEYR5HOVTHt AIyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eZESDsRAqJr62NbjfLmlIhWx0VhIvAD6ZfdFOEz5AGM=; b=0D3el+3xM8FxuhYmSVEMp7t+iE8JzoF2jnioYJADjZL/83OIF/+PeyL9hV01sXdPoM OaJBxJYOB66bZ/WAEvhEnRp5o6N5TV/cMBeNVimEUw/ui2ygGKZR3IgfTYvvH/Zrws+U CYa0KqdVy899si5Lc8uMpzERe/c9gvZyJ099oQ768vDU9rTAibTq5axUChk45kTuPQRy 7gStoYezhj/3PyZCJ7kOvA5x5XGAcWxFCwCxHif4sHwKSq5KQtM3HEXnRocIJvGnjXOW tooRj9juW02FAC9+aGToKSeay1ijHV6m5DBEB1ZsqR8IoAOKir8x7KYMD1nNeflVLSs5 5Fwg== X-Gm-Message-State: AOAM532ndA5BvLFk99cFHXFeg214s0yCL0L+2iJmVjNCGyQ5Mf0E+0zB wmh4GeHfgaX6f776EehvNYzgG0X9z5ngaw== X-Google-Smtp-Source: ABdhPJxpuoUCVG1Of7nUDSnSqtIVgca7LxruEMKeb6HMzXsxsDKU6VJS9VNAAgpHZB/iksxQp35r6w== X-Received: by 2002:a17:907:4c8:b0:6f3:beac:260c with SMTP id vz8-20020a17090704c800b006f3beac260cmr10182629ejb.321.1652006104817; Sun, 08 May 2022 03:35:04 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Bernhard Beschow , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , John Snow , qemu-block@nongnu.org (open list:IDE) Subject: [PATCH 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class Date: Sun, 8 May 2022 12:34:30 +0200 Message-Id: <20220508103432.14874-2-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220508103432.14874-1-shentey@gmail.com> References: <20220508103432.14874-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::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, 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" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652006453257100001 Content-Type: text/plain; charset="utf-8" Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci generic class init function' already resolved redundant code which in turn rendered piix3-ide-xen redundant. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 +-- hw/ide/piix.c | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 4c185c72d0..27dfde4917 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -244,8 +244,7 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PCIDevice *dev; =20 - dev =3D pci_create_simple(pci_bus, piix3_devfn + 1, - xen_enabled() ? "piix3-ide-xen" : "piix3-i= de"); + dev =3D pci_create_simple(pci_bus, piix3_devfn + 1, "piix3-ide"); pci_ide_create_devs(dev); idebus[0] =3D qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] =3D qdev_get_child_bus(&dev->qdev, "ide.1"); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index ce89fd0aa3..2345fe9e1d 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -241,12 +241,6 @@ static const TypeInfo piix3_ide_info =3D { .class_init =3D piix3_ide_class_init, }; =20 -static const TypeInfo piix3_ide_xen_info =3D { - .name =3D "piix3-ide-xen", - .parent =3D TYPE_PCI_IDE, - .class_init =3D piix3_ide_class_init, -}; - /* NOTE: for the PIIX4, the IRQs and IOports are hardcoded */ static void piix4_ide_class_init(ObjectClass *klass, void *data) { @@ -272,7 +266,6 @@ static const TypeInfo piix4_ide_info =3D { static void piix_ide_register_types(void) { type_register_static(&piix3_ide_info); - type_register_static(&piix3_ide_xen_info); type_register_static(&piix4_ide_info); } =20 --=20 2.36.1 From nobody Wed May 15 09:29:05 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=1652006682; cv=none; d=zohomail.com; s=zohoarc; b=n60/04q9w8qILwfJB6RPEUYHtlnzvbkb+VMzqMRJAiCQWexmy12Um6VDA012H3509qrnpxHPq5SKTzjt5bRh4oQ6NLI9HZlCOB/1nbqs97r0eNjBY8H/xoEH5yZQxZtii12ycSvZPKHWi0ARoQEdfUx38f6arwp8AJOsXodHwyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652006682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Hp6j9E0komHwkQmjVaaJwGXlUmBw15qUD+2uycCxKRo=; b=a/Mu9EiOZwbdFsLJTdFjBRl1vH0RTDZBjJqX/PG6EoiyNL1u6OeBehHmQVwdo/iAXxpBx8N3sn2/z8+hkCTkFQgpl5HLfdnG61XGGFj1zKC0A5NaID6LUDIf9FmSt/CL5ab/vTOwUmJbq8pw8eleMQZk/bb3nOiWIQGJ3HRIALI= 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 1652006682283124.84961541844314; Sun, 8 May 2022 03:44:42 -0700 (PDT) Received: from localhost ([::1]:55548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nneP3-0007MQ-8q for importer@patchew.org; Sun, 08 May 2022 06:44:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nneFr-0007DV-W9; Sun, 08 May 2022 06:35:12 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:45031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nneFp-0000HM-RF; Sun, 08 May 2022 06:35:11 -0400 Received: by mail-ej1-x62f.google.com with SMTP id i19so21826795eja.11; Sun, 08 May 2022 03:35:07 -0700 (PDT) Received: from localhost.localdomain (dynamic-077-183-246-161.77.183.pool.telefonica.de. [77.183.246.161]) by smtp.gmail.com with ESMTPSA id ci18-20020a170907267200b006f388f6f927sm3901948ejc.1.2022.05.08.03.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 03:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hp6j9E0komHwkQmjVaaJwGXlUmBw15qUD+2uycCxKRo=; b=YiwVSoCOQ6oEgvl1Yg+Ntj8QFTrWKGSY7FVACIswIb0AZM9Hwa0KXpn+LHga+sgHmk E2FWbKBau+ACjD4BP1cK5SpwJAzyocn0xnVzmGoy2OBvkGAQ+e1ZVmBApBMK4KyKxa7I gv59ow4WVTv6cpyxwy94qfuxqN+1X8ddNmNJPcR225UcN0g7JBO4hd1WEAriXcBAaihf EbTqA+bKF8vsOgUqbzO4YcIkriKvDOluwid+hN8F8UC2nIatT6LDQibHNonBDhp+XPNU zuIFWFgO8njP+lRoUomtw8SmC8np5E9NHsFv1VM1/eBwNpR9vfNti9WRBk31jXjfIg/w 3qTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hp6j9E0komHwkQmjVaaJwGXlUmBw15qUD+2uycCxKRo=; b=SK6gvYFq3LnWSfr7O6Pu9ZXnSoR0NizOCvRdIYk2uu5hch5HZIiVKkXAEvDbFvRD5L ZjsyapBSZfdZBWw9ZUS9nFYP13EFBn5C5TZmYjJzhMfuiPAl6geaDuh+ayegTOM+BJ5T mjb0mnkzaz3wsDV+9ejVRpERDCg9iHvW/CnYz7PABLFWlH7N9ZQaZJiOaQUEfPHppALy 4MP3GvdbQXl3iicLi4UJCIz2IOll4JT0M/ApDeIOjeHfDcpUB25TOpUersx+OPwidggD du+wcMY2Ha1WUW98t0Ws5LukSpM3rBQuc+8N4nVnJIx2SKx3pZRjI/WEKvVTXfBGY51n qp7A== X-Gm-Message-State: AOAM533RqLB5BPchnMmWz7eSBGI2lP8Yhq/suzsJSHmA/8iZDaUZDtXU 4EuWlbySOyOuHWwRAEb3POqjbvHbtyNnFw== X-Google-Smtp-Source: ABdhPJys94+U3JPR6mQ+w/noafajrUFU8ZVBUI1BrO1Sg3ACmjAldGMYUy8xBZJxjI9UsxQdk/LgPw== X-Received: by 2002:a17:907:3e0f:b0:6f4:5cfd:e6bb with SMTP id hp15-20020a1709073e0f00b006f45cfde6bbmr10330510ejc.38.1652006106150; Sun, 08 May 2022 03:35:06 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Bernhard Beschow , John Snow , qemu-block@nongnu.org (open list:IDE) Subject: [PATCH 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug() Date: Sun, 8 May 2022 12:34:31 +0200 Message-Id: <20220508103432.14874-3-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220508103432.14874-1-shentey@gmail.com> References: <20220508103432.14874-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::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652006683961100001 Content-Type: text/plain; charset="utf-8" The comment is based on commit message ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk unplug option'. Since it seems to describe design decisions and limitations that still apply it seems worth having. Signed-off-by: Bernhard Beschow --- hw/ide/piix.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 2345fe9e1d..bc1b37512a 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -173,6 +173,17 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) } } =20 +/* + * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to + * request unplug of 'aux' disks (which is stated to mean all IDE disks, + * except the primary master). + * + * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks + * is simultaneously requested is not clear. The implementation assu= mes + * that an 'all' request overrides an 'aux' request. + * + * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc + */ int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) { PCIIDEState *pci_ide; --=20 2.36.1 From nobody Wed May 15 09:29:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1652006153; cv=none; d=zohomail.com; s=zohoarc; b=MGkXcFooill34gM1J8XhVkdwQozyY8hZ/hM5GRsXHiMzrxs2wq8SlCe36et8JI3cnUQmfYP5Liq48iPCyvhdRUmdqQEgHEqJzHoxlsVuCDIVYAxaSFZyLg9jX0r7VXuPrhZnwPSz56+tcDJjfWZ/kWJ/IkDujXB0adPVBz6E/1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652006153; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ij5oGJCJI6PW/a2beKsWQ2NZIiZzUBei2wkeohldNg0=; b=h+I5z/XBaq7r1ORuJiGTJVZnPwVkJM8hc0iFEWAm/xNbs2uq86zcN0SU3Bpiowq7OtrHKDJLbgvhXKt3UEB23LWEaHDEfmW81xdG3HxYmrH7cpMhRJ2Pu0tUMbNdhFc7kn/qnWaSYJeyLdhkheXldMXKHCyDYn4HzQyZ7wUjAsE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 165200615336019.417976170635825; Sun, 8 May 2022 03:35:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.323995.545880 (Exim 4.92) (envelope-from ) id 1nneFs-000419-KI; Sun, 08 May 2022 10:35:12 +0000 Received: by outflank-mailman (output) from mailman id 323995.545880; Sun, 08 May 2022 10:35:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nneFs-000412-Gd; Sun, 08 May 2022 10:35:12 +0000 Received: by outflank-mailman (input) for mailman id 323995; Sun, 08 May 2022 10:35:12 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nneFr-00040w-Ov for xen-devel@lists.xenproject.org; Sun, 08 May 2022 10:35:11 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 87ed232b-ceba-11ec-a406-831a346695d4; Sun, 08 May 2022 12:35:09 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id l18so21820494ejc.7 for ; Sun, 08 May 2022 03:35:08 -0700 (PDT) Received: from localhost.localdomain (dynamic-077-183-246-161.77.183.pool.telefonica.de. [77.183.246.161]) by smtp.gmail.com with ESMTPSA id ci18-20020a170907267200b006f388f6f927sm3901948ejc.1.2022.05.08.03.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 03:35:07 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 87ed232b-ceba-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ij5oGJCJI6PW/a2beKsWQ2NZIiZzUBei2wkeohldNg0=; b=qy1+i0Nrp7bat4BckqAb7DFru/UJobFqUCSHUm86RtfvAfhDDeVdEUFGwgyJcMBNMd ysRMszci8ba/1p6p4KzMGdnlcGqn9uukof7N0Zd3IaK7gq2jLk+XzRgIc/QPdH+DYeAN BitjM5O/pasuYw7o+1OD+1BPYa5jcqWsxOJo1wHXzm1xNTSXOK9rU6mWBWmNF9sEJpRD 6PSzw4TDbbxM9wK1WvAjg+poctNAhSV1ZMdliQMnSGMuC79VgWYQ3C5rljxjljJg0TcP BQcsXHoC5WJJjYEoCmlczUgj84ZX5S+0gj2QwAAlNBftxigkqrhBA1fE06FuEoorMg8C 3sEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ij5oGJCJI6PW/a2beKsWQ2NZIiZzUBei2wkeohldNg0=; b=vnw3xO2nXZ21YA9d+YVZXN81N+ippJT+Mzh6bszzr7BNhngfxNp9ysRYVYtbqv2iDX 3pEz/cAwpK2SqZqc2G8FL6xte3XDnDRaCPr5p+2cD0dlTsbFDqDkdoPwZKuAj0+cp/mW I2Mn3eKe7lXbMFKuG2JSXSrSoS6u0M5vHQjESwF9EBWI4szza1NlG2QWcjaUrv1yOZL3 vR8xFkW/Ot1DcxXie/D32/mnns6TNYANAZg5G/CqRlgqhGksGjnnuW7E3NXPIiksGuye jKRs7DD242GaLU7V3cAGOtz5UuWd5khAO88ZTJzDGcxT63wXNDcDkFF1zSRm6DntqEiq F29w== X-Gm-Message-State: AOAM533OyQGSOZu66B84/sXepdA17pt+tle+Oi3+BYNwX/ch6c3OUnm6 SeH00D/KEnEdpCe7THtBAyvxSOvWPyM3Yw== X-Google-Smtp-Source: ABdhPJz2AmiXieVCbzTsOl+b158iSqM9IPIh52EIWcA9jlMcRkM1lrjwbjNUt1QadDAhCun39mirMQ== X-Received: by 2002:a17:907:7f14:b0:6f4:2a57:e1df with SMTP id qf20-20020a1709077f1400b006f42a57e1dfmr10348828ejc.18.1652006107890; Sun, 08 May 2022 03:35:07 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Bernhard Beschow , Stefano Stabellini , Anthony Perard , Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , John Snow , xen-devel@lists.xenproject.org (open list:X86 Xen CPUs), qemu-block@nongnu.org (open list:IDE) Subject: [PATCH 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug() Date: Sun, 8 May 2022 12:34:32 +0200 Message-Id: <20220508103432.14874-4-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220508103432.14874-1-shentey@gmail.com> References: <20220508103432.14874-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652006154672100001 Content-Type: text/plain; charset="utf-8" This function was declared in a generic and public header, implemented in a device-specific source file but only used in xen_platform. Given its 'aux' parameter, this function is more xen-specific than piix-specific. Also, the hardcoded magic constants seem to be generic and related to PCIIDEState and IDEBus rather than piix. Therefore, move this function to xen_platform, unexport it, and drop the "piix3" in the function name as well. Signed-off-by: Bernhard Beschow Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 49 +++++++++++++++++++++++++++++++++++++- hw/ide/piix.c | 46 ----------------------------------- include/hw/ide.h | 3 --- 3 files changed, 48 insertions(+), 50 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 72028449ba..124ffeae35 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/ide.h" +#include "hw/ide/pci.h" #include "hw/pci/pci.h" #include "hw/xen/xen_common.h" #include "migration/vmstate.h" @@ -134,6 +135,52 @@ static void pci_unplug_nics(PCIBus *bus) pci_for_each_device(bus, 0, unplug_nic, NULL); } =20 +/* + * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to + * request unplug of 'aux' disks (which is stated to mean all IDE disks, + * except the primary master). + * + * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks + * is simultaneously requested is not clear. The implementation assu= mes + * that an 'all' request overrides an 'aux' request. + * + * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc + */ +static int pci_xen_ide_unplug(DeviceState *dev, bool aux) +{ + PCIIDEState *pci_ide; + int i; + IDEDevice *idedev; + IDEBus *idebus; + BlockBackend *blk; + + pci_ide =3D PCI_IDE(dev); + + for (i =3D aux ? 1 : 0; i < 4; i++) { + idebus =3D &pci_ide->bus[i / 2]; + blk =3D idebus->ifs[i % 2].blk; + + if (blk && idebus->ifs[i % 2].drive_kind !=3D IDE_CD) { + if (!(i % 2)) { + idedev =3D idebus->master; + } else { + idedev =3D idebus->slave; + } + + blk_drain(blk); + blk_flush(blk); + + blk_detach_dev(blk, DEVICE(idedev)); + idebus->ifs[i % 2].blk =3D NULL; + idedev->conf.blk =3D NULL; + monitor_remove_blk(blk); + blk_unref(blk); + } + } + qdev_reset_all(dev); + return 0; +} + static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) { uint32_t flags =3D *(uint32_t *)opaque; @@ -147,7 +194,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void = *opaque) =20 switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) { case PCI_CLASS_STORAGE_IDE: - pci_piix3_xen_ide_unplug(DEVICE(d), aux); + pci_xen_ide_unplug(DEVICE(d), aux); break; =20 case PCI_CLASS_STORAGE_SCSI: diff --git a/hw/ide/piix.c b/hw/ide/piix.c index bc1b37512a..9a9b28078e 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -173,52 +173,6 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) } } =20 -/* - * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to - * request unplug of 'aux' disks (which is stated to mean all IDE disks, - * except the primary master). - * - * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks - * is simultaneously requested is not clear. The implementation assu= mes - * that an 'all' request overrides an 'aux' request. - * - * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc - */ -int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) -{ - PCIIDEState *pci_ide; - int i; - IDEDevice *idedev; - IDEBus *idebus; - BlockBackend *blk; - - pci_ide =3D PCI_IDE(dev); - - for (i =3D aux ? 1 : 0; i < 4; i++) { - idebus =3D &pci_ide->bus[i / 2]; - blk =3D idebus->ifs[i % 2].blk; - - if (blk && idebus->ifs[i % 2].drive_kind !=3D IDE_CD) { - if (!(i % 2)) { - idedev =3D idebus->master; - } else { - idedev =3D idebus->slave; - } - - blk_drain(blk); - blk_flush(blk); - - blk_detach_dev(blk, DEVICE(idedev)); - idebus->ifs[i % 2].blk =3D NULL; - idedev->conf.blk =3D NULL; - monitor_remove_blk(blk); - blk_unref(blk); - } - } - qdev_reset_all(dev); - return 0; -} - static void pci_piix_ide_exitfn(PCIDevice *dev) { PCIIDEState *d =3D PCI_IDE(dev); diff --git a/include/hw/ide.h b/include/hw/ide.h index c5ce5da4f4..60f1f4f714 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -8,9 +8,6 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq, DriveInfo *hd0, DriveInfo *hd1); =20 -/* ide-pci.c */ -int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux); - /* ide-mmio.c */ void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1= ); =20 --=20 2.36.1