From nobody Sun Feb 8 12:32:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634556838572344.0968353577043; Mon, 18 Oct 2021 04:33:58 -0700 (PDT) Received: from localhost ([::1]:53788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcQtw-0002Wz-P4 for importer@patchew.org; Mon, 18 Oct 2021 07:33:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcQt0-0001qP-LM for qemu-devel@nongnu.org; Mon, 18 Oct 2021 07:32:58 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:30269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcQsx-00023b-Lq for qemu-devel@nongnu.org; Mon, 18 Oct 2021 07:32:57 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 28DD07463B7; Mon, 18 Oct 2021 13:32:51 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 08F2E746399; Mon, 18 Oct 2021 13:32:51 +0200 (CEST) From: BALATON Zoltan Subject: [PATCH] usb/uhci: Disallow user creating a vt82c686-uhci-pci device Date: Mon, 18 Oct 2021 13:29:29 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org Message-Id: <20211018113251.08F2E746399@zero.eik.bme.hu> X-Spam-Probability: 8% 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=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Huacai Chen , Gerd Hoffmann , Philippe M-D Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634556840689100001 Content-Type: text/plain; charset="utf-8" Because this device only works as part of VIA superio chips set user creatable to false. Since the class init method is common for UHCI variants introduce a flag in UHCIInfo for this. Signed-off-by: BALATON Zoltan Reviewed-by: Gerd Hoffmann --- This should come before the other patches changing to use via_isa_set_irq hw/usb/hcd-uhci.c | 3 +++ hw/usb/hcd-uhci.h | 1 + hw/usb/vt82c686-uhci-pci.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 7201cd0ae7..d1b5657d72 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1284,6 +1284,9 @@ void uhci_data_class_init(ObjectClass *klass, void *d= ata) } else { device_class_set_props(dc, uhci_properties_standalone); } + if (info->notuser) { + dc->user_creatable =3D false; + } u->info =3D *info; } =20 diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h index 1f8ee04186..c85ab7868e 100644 --- a/hw/usb/hcd-uhci.h +++ b/hw/usb/hcd-uhci.h @@ -85,6 +85,7 @@ typedef struct UHCIInfo { uint8_t irq_pin; void (*realize)(PCIDevice *dev, Error **errp); bool unplug; + bool notuser; /* disallow user_creatable */ } UHCIInfo; =20 void uhci_data_class_init(ObjectClass *klass, void *data); diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c index e70e739409..90c84912a8 100644 --- a/hw/usb/vt82c686-uhci-pci.c +++ b/hw/usb/vt82c686-uhci-pci.c @@ -37,6 +37,8 @@ static UHCIInfo uhci_info[] =3D { .irq_pin =3D 3, .realize =3D usb_uhci_vt82c686b_realize, .unplug =3D true, + /* Reason: only works as USB function of VT82xx superio chips */ + .notuser =3D true, } }; =20 --=20 2.21.4