From nobody Sat Apr 20 02:43:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1652466547; cv=none; d=zohomail.com; s=zohoarc; b=AsIkhDeI9QRglRpb0X1ezGKvWPcWuYG93U0kb3kQNrhs9TG1G/sQAPrVD0+x/fz60GLGD5RXTIprotwe+Gz7nxPPv9qrZ4dHvRNq6vHrtJbPgQEViWD5LpgtAWvxnQ0v14HrMoWFEdfeUHHa3vKdj4aVR7XHXgiElVsv9G3+JHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652466547; 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=x/cQH/1Zw9GFUPtTbC8zhxsJeeQwE0nxDRipyyaTmMk=; b=DBI4OQKxE0SfnerNwBK0w74VvX33q7ZThaahafKG8Q+vlaRB8+c5GzY+g2ytTluU2b0YaMvUlE8l06OMBwURKi0rAE7DuYhQ/MTaYZzmwEDRQEcyTqAfmn59j0a1iMHQzm+lPELxWpC9OTbuWR6f0Y8+aAz/+OwKUSh0CbshXa4= 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+importer2=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 1652466547384791.978825106237; Fri, 13 May 2022 11:29:07 -0700 (PDT) Received: from localhost ([::1]:51222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npa2E-0000db-8i for importer2@patchew.org; Fri, 13 May 2022 14:29:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npZk0-0004au-NF; Fri, 13 May 2022 14:10:16 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:45940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npZjw-0007L5-6a; Fri, 13 May 2022 14:10:13 -0400 Received: by mail-ej1-x62b.google.com with SMTP id ch13so17667801ejb.12; Fri, 13 May 2022 11:10:09 -0700 (PDT) Received: from Provence.localdomain (dynamic-089-014-181-123.89.14.pool.telefonica.de. [89.14.181.123]) by smtp.gmail.com with ESMTPSA id e11-20020a170906648b00b006fa84a0af2asm1040008ejm.16.2022.05.13.11.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 11:10:08 -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=x/cQH/1Zw9GFUPtTbC8zhxsJeeQwE0nxDRipyyaTmMk=; b=nJbHxWaET9J2XSZE+M5dxA8DbQG9coK769SMpj9GQeA6B5MYfqK0lpTZcTTjHsEoB2 YsduPUN8KjpCjR1DlXYGnacXqjJvn7IpxP4QJwwabsXwlB2JehTlehcQWwm8++WmkHfw zMKKJEq7lkxDz9bynvEtBKYjR8DZFnZ0q1rIZLCNHjl5MEiaHmg2/Pua8eTz0e5i/K0s O35/MwMsvzGnN1SNER3JYxYIq1A0gTWG/4Mf4U0UOVAfyKazUT1wcSm0RnH/KlFTIpPO ezpSVliTQlXlbntvSNatMSPlv39fsevETfJV20FcGkLi7qNZ1UwkQcUejQEj+ufSI0cT RTuA== 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=x/cQH/1Zw9GFUPtTbC8zhxsJeeQwE0nxDRipyyaTmMk=; b=2Ezdu8BCcVYa5Co13ch80MPDyGgKeLHAkx2FtYUnZYr8ZMvggG+SGwsEBSoBOxKWEl Zx+snoWsGVypl8C35Kp7HNaJpSJ4jX8AeIzfmGuNaiG1ZfXSyyWM5AkmLby+69b+Jgx9 3SNCTZHWsDjmq6bRuGAFyHKPxS1CMETTt5euiMlDCnHJqpftfQVG7VhgdJGsIoepoyj3 nDsNzjy+vyOrEyPGQpDrQ1Ao49m9xEC8J35DYmz4wS5gxzW5NewzXftEPgBKJsWizhon 20jdf7oYWdlIloVkFcOAF8fkU8FODUdKjBogeJC0BDTJ3D1FRyYXU1NtNk2PfA7UvytH Rmvg== X-Gm-Message-State: AOAM530Oeqn+kGkyK+G/gYMqT5XqpYCZEjGc/q5PnIMWby4jwK2+80Qz 6NKoPF8BeTvbPom8KoL9ACxMADk9UUw= X-Google-Smtp-Source: ABdhPJzCkBRWOB3k5QAtg0VncyWPkLbOceUIGxvuo0vGktR8YMH06iLzsWamhF0MqDhovZ65RgZoVQ== X-Received: by 2002:a17:907:2064:b0:6f4:3f07:c76e with SMTP id qp4-20020a170907206400b006f43f07c76emr5383734ejb.462.1652465408332; Fri, 13 May 2022 11:10:08 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com, paul@xen.org, xen-devel@lists.xenproject.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 v2 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class Date: Fri, 13 May 2022 20:09:55 +0200 Message-Id: <20220513180957.90514-2-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513180957.90514-1-shentey@gmail.com> References: <20220513180957.90514-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652466548541100001 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 Reviewed-by: Anthony PERARD --- 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 f843dd906f..c2bf33d2f1 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 Sat Apr 20 02:43:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1652466127; cv=none; d=zohomail.com; s=zohoarc; b=mdda4CRHhKZtJfwyuvyOW0dsZ9Z9xu5blss2ohKxEQIinGXAv/x1YqNSSUFc9brhemJnf6SzrD6IcRo1dU+U6oWYPnNH6TgmWqj9ee+V3XFMzsP1awRSAmvyfqb1D+iuxeKsQlzEyi3wQlXJK6j6f6f4IwsUgD9W9XH8R8MOu0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652466127; 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=NtMuuCuwd6YMvSZNApoWHmx31wT9NxU1H+n5n+UceKUVEajcM0LbZFobNeepzNpGQIkH0sijHtrW+b3Imd72WFR5rhAS+D8WgY7Ck020zrg6nbNYItbnOAZgJKgisX4ltWA91IG/f1qWnhfvuBuQFtRNMBmC7jWxWnx+3vjq/EE= 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+importer2=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 1652466127269695.5806504501811; Fri, 13 May 2022 11:22:07 -0700 (PDT) Received: from localhost ([::1]:33642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npZvS-0005Sg-8F for importer2@patchew.org; Fri, 13 May 2022 14:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npZk0-0004ap-Mk; Fri, 13 May 2022 14:10:16 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:40621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npZjw-0007LE-P2; Fri, 13 May 2022 14:10:15 -0400 Received: by mail-ej1-x62b.google.com with SMTP id l18so17704985ejc.7; Fri, 13 May 2022 11:10:10 -0700 (PDT) Received: from Provence.localdomain (dynamic-089-014-181-123.89.14.pool.telefonica.de. [89.14.181.123]) by smtp.gmail.com with ESMTPSA id e11-20020a170906648b00b006fa84a0af2asm1040008ejm.16.2022.05.13.11.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 11:10:09 -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=F6ECj1KowlkuN7ndNLG4RXVONt3ugmk+q9Hi/xtsP3eiZ8ZL0nuSrxMOKrM5piAaMn oZVcacYQpx5jhTeQ451SnkGgZgcC+2FArUYvOOba7IXnLkpiLCmSjrJfH4140JrGfdaA DDKaBGot+x4QfZLJkUdcSRyMZy0355YA3JjyVQvKWKDVe9Oc+c0902kRxqJK47A9Owbz Wo23wbWOu/V3dS/MJkCO1+CxAj1a90WzQguDmjmui18vahU9ZuOVJyd1wrOW8CmmC5TW z1SN7HYd8RGG1I4E7qL0Om7lIq4IW5FH2ooK04osvFfWLUC7kJYdyWSiUU5whYG7aJw1 CYYg== 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=KNYxYFDTxKU1O7P3e2Al+Yp7Uq5peOatKdU3+4r910QXaYGX79jrSiqiP17IWgWVz1 VpYfuhWKwEfL284yAS+V7EwZ7c+qawmCDnBRUug3oyfmR6Z8yGslynv5zNqwYHn46CUm 3GEGzg42Pa3cFT/y2ZB6pfBWGn8/zi60Xn74hFpIO0+wAkelqb6R8ifNIC4/8YrWE7PG 5EMRxQ06y3a9YSjE1j2EOuyQCk6+tsDYP8hyZGRelBU8jLwSfF8APTYrjPA+F0SEThcv YrftnJOoOSvWdy94lIusmmjAeYdZhL51AbvfHH2HW+ip+8aAq55znlmFnNhKAg3slhdU gtAg== X-Gm-Message-State: AOAM530uOZ1jzKi1trq41Q0N7K60XYyBaO+7KvwN4TjNac0vUTLAArMp yC42rFGyMXlyN0SOs7sbjbvWOU7DW60= X-Google-Smtp-Source: ABdhPJwgEkBcZJqTIki5Kg8REFF/cfX7eSZw1juY5Lx09Lc2VuiwHYjI+5INyzSwkKmlGUFfLJt8Rw== X-Received: by 2002:a17:906:4fd5:b0:6f8:5784:fddb with SMTP id i21-20020a1709064fd500b006f85784fddbmr5572529ejw.161.1652465409259; Fri, 13 May 2022 11:10:09 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com, paul@xen.org, xen-devel@lists.xenproject.org, Bernhard Beschow , John Snow , qemu-block@nongnu.org (open list:IDE) Subject: [PATCH v2 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug() Date: Fri, 13 May 2022 20:09:56 +0200 Message-Id: <20220513180957.90514-3-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513180957.90514-1-shentey@gmail.com> References: <20220513180957.90514-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652466128060100001 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 Reviewed-by: Anthony PERARD --- 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 Sat Apr 20 02:43:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1652466403; cv=none; d=zohomail.com; s=zohoarc; b=fLIZ2EM6zcQJ5z0hXNE/YB0pwIXT0cZYnj+CIcSbA9O+WHyr1vxPTwlwz9Mfl3/qUHdhxWpwjDI9+9oxmCm7Eca1vKkht1PrBmgP1A5QO3a+7kA2qz+jIR4+xXicob2hlYAsBS3JdM45m4NypikWMuyLckr+A1OHv7A+G+tCtlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652466403; 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=CBXAkFrCGs28BI30AzYWmYh3sIrQDSjFAmvH5xdAdFk=; b=NWtVPe74z9NxrX4fBQlv/RD0H3bEssuBJIypsdxii3cnu1BeXq84tFSrmz1L/1wNGJSLC4P4NKolmIWTQQq2wfVGKEd0VDMuITjWj95GBK7iRnVfL8s3q2dWZKnh5IkIn/8xOXX17pQ1gSpiXc5h88pvbOKl1bGCjuDwT/rq+dw= 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+importer2=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 1652466403670598.1287924379615; Fri, 13 May 2022 11:26:43 -0700 (PDT) Received: from localhost ([::1]:43758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npZzu-0003qr-3S for importer2@patchew.org; Fri, 13 May 2022 14:26:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npZk0-0004an-MM; Fri, 13 May 2022 14:10:16 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:40627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npZjx-0007LO-5U; Fri, 13 May 2022 14:10:15 -0400 Received: by mail-ej1-x631.google.com with SMTP id l18so17705060ejc.7; Fri, 13 May 2022 11:10:11 -0700 (PDT) Received: from Provence.localdomain (dynamic-089-014-181-123.89.14.pool.telefonica.de. [89.14.181.123]) by smtp.gmail.com with ESMTPSA id e11-20020a170906648b00b006fa84a0af2asm1040008ejm.16.2022.05.13.11.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 11:10:10 -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=CBXAkFrCGs28BI30AzYWmYh3sIrQDSjFAmvH5xdAdFk=; b=Bgcy7jIh1t61wlZnBAq+JZld3nOesqYuWWAdJJQ0sl5bxUB9nsHbDiHngRu1OutYbW OG4VHmgNSqmhme8qgcCXmbEvIbIkbJDxxYz0+LuY/SJhWJjQ3/CYEQ9XFbgPX1dsLuxf XIGJ53kceKKUz2qVjgUC/cWmwF3HbLDV5msbnHnu8HPlavKmPUxicAXfXl2G0GqjwW32 mYHwZUV1bTyn8D8pLeBFHjF+NFVyzw1boC9HcP8y/EX8ZZ4I4r3zhkHORo6RIDVJjr/l ESmOonSf3nBPpEBH/WkgN4DFFIGJVy2vYJJOgtj8wUkMscuLJRjrQ4/xw3nRhil/1CJL xNKg== 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=CBXAkFrCGs28BI30AzYWmYh3sIrQDSjFAmvH5xdAdFk=; b=ZuSKiO1nYPICvkKHxQwcoHmk9JnbkjfmdkOVQCBGlHXPBjmisWORyTHJqHdum4LuqJ fcKfIPeRWVsPZZqZOu9YhX5rzXwer+IHwWYm0bfnZcf7jayJAS2CbFOb7RyDd+XROaR/ hToIM3GioeLcxaNY0TmJY0lz0wXDBZaLnUCkYVvUJn1wL6tFyqvxFkkuYDMGzQ2/UgTF EpvQeNebmD+RzjLADS90ctXVBDGzW0MI1l2MCB8qM4odq/BM0vEIUrRlXS5rNDpnsuge ZIyPmsS4bw7dko6z9ADCqltr1Rdc2rvdE7GIa/Ajid96iLcLFAdVvlkmrRelvl3vz5Q4 JbKg== X-Gm-Message-State: AOAM530BwePA//QBNimOq1kf9U2weQvTNgeZHLRLObzclzTQBxcG6M4U bIHg6eqwtecewAoOv5ctSZ1EQjIL6L0= X-Google-Smtp-Source: ABdhPJzd1ozMHGZZFnRvVPDcf7J6MJFx90w5pAiPDrPJQobwuWQ40761pwClkT/3oeGExjerubnvSw== X-Received: by 2002:a17:907:97c4:b0:6f8:5ec5:61e2 with SMTP id js4-20020a17090797c400b006f85ec561e2mr5456098ejc.559.1652465410414; Fri, 13 May 2022 11:10:10 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com, paul@xen.org, xen-devel@lists.xenproject.org, Bernhard Beschow , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , John Snow , qemu-block@nongnu.org (open list:IDE) Subject: [PATCH v2 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug() Date: Fri, 13 May 2022 20:09:57 +0200 Message-Id: <20220513180957.90514-4-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513180957.90514-1-shentey@gmail.com> References: <20220513180957.90514-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1652466406002100001 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 Acked-by: Anthony PERARD Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/xen/xen_platform.c | 48 +++++++++++++++++++++++++++++++++++++- hw/ide/piix.c | 46 ------------------------------------ include/hw/ide.h | 3 --- 3 files changed, 47 insertions(+), 50 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 72028449ba..a64265cca0 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,51 @@ 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 void 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); +} + static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) { uint32_t flags =3D *(uint32_t *)opaque; @@ -147,7 +193,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