From patchwork Tue Mar 5 13:42:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 778020 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp439980wrs; Tue, 5 Mar 2024 05:47:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXoEJvlcl1gtzMA9H1JxnX5wtExqfqrVDBvCF5bk+HZoqErdq9B6/sGnIFtIC/HhD4lX8iYB7AWpJF2VnfBmZx6 X-Google-Smtp-Source: AGHT+IGchLMsJ7piT4IGAT5VwWGsFLVXCPAtZBxbTp/G0L1rLqJQuErlwsgBklbDsIFryDTetS7v X-Received: by 2002:a05:6214:1870:b0:690:1e55:6df7 with SMTP id eh16-20020a056214187000b006901e556df7mr1952096qvb.25.1709646443082; Tue, 05 Mar 2024 05:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709646443; cv=none; d=google.com; s=arc-20160816; b=ZDtY+R5mprFy130lvfwjyCmzgWuMjmb4bEXo5VudvYXBrWSndm191zr+c2xd00r1BY ElPQiSmq/4K9nEZndjb5GVcEG310uh+/7XO+zFal0i3sXNJQKI+UzuX1/blaepD3FamP 9x6lmciRttgFDZ8rWpNV2peMgNqOAyqrBhTi5g/ldzp3VXTbFgH7y3ezy+kGaSdxlHxZ Ux31dvGrxZUhwbtfEGlHxhUQRIh8AOGagLII3F4lgVPQoy9pKmenCgoauarSB2OTq0GG 4/Zkb2LDFAQfxf54fK6lYhlInq1LsZanjPLE+Z3+Jk7z5jGC5P7vWV4uu67gHS10V9Xy 1Y9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dfW77RB2c7k3ZDXHGh05HNMU3UcmTeaypC3Kdgt/4jc=; fh=FNfxLoT4pSSq5+cU1rLLwo41UEEAj6PvLoQV64MLsZQ=; b=QDHKhXbj/mZFq8ESlv9UgpuEeh8cFrbALOzpHRWdGShMr03TLRZDDYOOIjLPnTLwCG JspO7dsmyGeS+KzCu2/KBq7Xthrn/hS2yKY6wCHxleF7xDhKTCLqOHl3qfWcwuTK5NTU +2NGQ+aY/0vcBwIMjerMr3QRGVjH1kivpkl5IdB93LFks52NtoBZJjVQ3SiaYcuGen5N ZFkSSK/YzXwHMyuFJcqv03J6ggOYCeBB3Ad9WTAN36hI4F6O3HOWG3yg8VzzSXrqMZrr pVvm/B9PDrMAx/b3T8FQS9meRZDMPiDuMNT6hWz30gIN5dOqTrpN5ooOoUMMsHTaMlCM xVjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xvYCr4Hs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fv14-20020a056214240e00b0068f36249382si12014905qvb.334.2024.03.05.05.47.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2024 05:47:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xvYCr4Hs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhV4N-0002LO-6k; Tue, 05 Mar 2024 08:42:59 -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 1rhV4L-0002Iz-6U for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:42:57 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhV4I-0003xq-Bl for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:42:56 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a4515f8e13cso300481366b.3 for ; Tue, 05 Mar 2024 05:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709646172; x=1710250972; 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=dfW77RB2c7k3ZDXHGh05HNMU3UcmTeaypC3Kdgt/4jc=; b=xvYCr4HsxxUrkL8jBRws5q9gtDMENVYTIP7o8/kYbxcNx2obmsU1OXyrI5g1RpOM4h ZV3o/pC1U7TeCnY2CV/SWkJmrZlE3zdpwJe1lxLkLpOjXXAyWmB8yQb5kGp3/AIFIubN 7xNoPfg+II1OHSgQSUdYWLC5v8FTKvm9KlTdHOaQ7pp8hPZ7Nd6nNByPAPomCajdTk0x G/gFcm8gctnXZitVCCDNlcZcOa5FJ83ndk9MpGCrJ0new4H40oqKQD3qtAeDRo5rMJ/W KtyaNC9YCOdzs/Hky06EjVFAbQM54tVfXJZZ3TnR2CssvZNZjgLWZ3XbCCSi4pLwrwFL hKow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709646172; x=1710250972; 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=dfW77RB2c7k3ZDXHGh05HNMU3UcmTeaypC3Kdgt/4jc=; b=URusT0XYOCLhrH8WX0OazFw7R9YnxnvuzEZ8NOP4AXytvSQS7nZjH+T597xubKpYOQ 6IXHDLwiim53QkRr04AfkhDjqCj9sE3AhUOJKo7FFQ6Cw0kc+osHjzMEMk7HhI9J+ID/ fZK5KcHz5W24Kj/dskE5kZprJBarxidB7ytjYhZN+dsAk/YWtz5QE97ytP1iDGlqDJYN cwBXyomD7cMBDPMIlWnCrESBW3wHmGIkprDKyyyWAzfCZiyRZ+ajuBBlpm+ZfrMR40h/ HapStmnzYoGClsGRe21K8gwirRDr9CkhHpB5f0H8ttL3C/F8Jm034sg6zGQbx/OifbTt 5H9g== X-Gm-Message-State: AOJu0YxHvrgVKMfZCZ64in4/S0nwGj91DtP6akqYgbWf00J80Xj4F09C Htn+z8qSuAgs/HPBjpC3T85jaFD+VywcKecpSWbN5ggFWU5u1cxiWu1ssKuLhWnqaRbn46ozj7P Q X-Received: by 2002:a17:906:378b:b0:a44:90b3:aa3b with SMTP id n11-20020a170906378b00b00a4490b3aa3bmr8825793ejc.11.1709646172215; Tue, 05 Mar 2024 05:42:52 -0800 (PST) Received: from m1x-phil.lan ([176.176.177.70]) by smtp.gmail.com with ESMTPSA id tj10-20020a170907c24a00b00a4452ed413asm5859830ejc.16.2024.03.05.05.42.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Mar 2024 05:42:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: Igor Mammedov , Richard Henderson , kvm@vger.kernel.org, Marcelo Tosatti , devel@lists.libvirt.org, David Hildenbrand , Ani Sinha , Paolo Bonzini , Marcel Apfelbaum , "Michael S. Tsirkin" , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 04/18] hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST flag Date: Tue, 5 Mar 2024 14:42:06 +0100 Message-ID: <20240305134221.30924-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240305134221.30924-1-philmd@linaro.org> References: <20240305134221.30924-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org XHCI_FLAG_SS_FIRST was only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplify various functions in hcd-xhci.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/usb/hcd-xhci.h | 1 - hw/usb/hcd-xhci-nec.c | 2 -- hw/usb/hcd-xhci-pci.c | 1 - hw/usb/hcd-xhci.c | 42 ++++++++---------------------------------- 4 files changed, 8 insertions(+), 38 deletions(-) diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 7dcab8b8db..051ea43261 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -36,7 +36,6 @@ typedef struct XHCIStreamContext XHCIStreamContext; typedef struct XHCIEPContext XHCIEPContext; enum xhci_flags { - XHCI_FLAG_SS_FIRST = 1, XHCI_FLAG_ENABLE_STREAMS = 3, }; diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c index 5d5b069cf9..0c063b3697 100644 --- a/hw/usb/hcd-xhci-nec.c +++ b/hw/usb/hcd-xhci-nec.c @@ -41,8 +41,6 @@ struct XHCINecState { static Property nec_xhci_properties[] = { DEFINE_PROP_ON_OFF_AUTO("msi", XHCIPciState, msi, ON_OFF_AUTO_AUTO), DEFINE_PROP_ON_OFF_AUTO("msix", XHCIPciState, msix, ON_OFF_AUTO_AUTO), - DEFINE_PROP_BIT("superspeed-ports-first", XHCINecState, flags, - XHCI_FLAG_SS_FIRST, true), DEFINE_PROP_UINT32("intrs", XHCINecState, intrs, XHCI_MAXINTRS), DEFINE_PROP_UINT32("slots", XHCINecState, slots, XHCI_MAXSLOTS), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index cbad96f393..264d7ebb77 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -242,7 +242,6 @@ static void qemu_xhci_instance_init(Object *obj) s->msix = ON_OFF_AUTO_AUTO; xhci->numintrs = XHCI_MAXINTRS; xhci->numslots = XHCI_MAXSLOTS; - xhci_set_flag(xhci, XHCI_FLAG_SS_FIRST); } static const TypeInfo qemu_xhci_info = { diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index ad40232eb6..b6411f0bda 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -541,18 +541,10 @@ static XHCIPort *xhci_lookup_port(XHCIState *xhci, struct USBPort *uport) case USB_SPEED_LOW: case USB_SPEED_FULL: case USB_SPEED_HIGH: - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - index = uport->index + xhci->numports_3; - } else { - index = uport->index; - } + index = uport->index + xhci->numports_3; break; case USB_SPEED_SUPER: - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - index = uport->index; - } else { - index = uport->index + xhci->numports_2; - } + index = uport->index; break; default: return NULL; @@ -2779,11 +2771,7 @@ static uint64_t xhci_cap_read(void *ptr, hwaddr reg, unsigned size) ret = 0x20425355; /* "USB " */ break; case 0x28: /* Supported Protocol:08 */ - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - ret = (xhci->numports_2<<8) | (xhci->numports_3+1); - } else { - ret = (xhci->numports_2<<8) | 1; - } + ret = (xhci->numports_2 << 8) | (xhci->numports_3 + 1); break; case 0x2c: /* Supported Protocol:0c */ ret = 0x00000000; /* reserved */ @@ -2795,11 +2783,7 @@ static uint64_t xhci_cap_read(void *ptr, hwaddr reg, unsigned size) ret = 0x20425355; /* "USB " */ break; case 0x38: /* Supported Protocol:08 */ - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - ret = (xhci->numports_3<<8) | 1; - } else { - ret = (xhci->numports_3<<8) | (xhci->numports_2+1); - } + ret = (xhci->numports_3 << 8) | 1; break; case 0x3c: /* Supported Protocol:0c */ ret = 0x00000000; /* reserved */ @@ -3349,13 +3333,8 @@ static void usb_xhci_init(XHCIState *xhci) for (i = 0; i < usbports; i++) { speedmask = 0; if (i < xhci->numports_2) { - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - port = &xhci->ports[i + xhci->numports_3]; - port->portnr = i + 1 + xhci->numports_3; - } else { - port = &xhci->ports[i]; - port->portnr = i + 1; - } + port = &xhci->ports[i + xhci->numports_3]; + port->portnr = i + 1 + xhci->numports_3; port->uport = &xhci->uports[i]; port->speedmask = USB_SPEED_MASK_LOW | @@ -3366,13 +3345,8 @@ static void usb_xhci_init(XHCIState *xhci) speedmask |= port->speedmask; } if (i < xhci->numports_3) { - if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { - port = &xhci->ports[i]; - port->portnr = i + 1; - } else { - port = &xhci->ports[i + xhci->numports_2]; - port->portnr = i + 1 + xhci->numports_2; - } + port = &xhci->ports[i]; + port->portnr = i + 1; port->uport = &xhci->uports[i]; port->speedmask = USB_SPEED_MASK_SUPER; assert(i < XHCI_MAXPORTS);