Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp210939pxj; Fri, 14 May 2021 01:27:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpFS2vmZGU1we/hatvGaOLZscnGhO+2s0pfkOrDvGIkPGq2UvKXzdNxImA+DELUeOZCFCR X-Received: by 2002:a17:906:bc8e:: with SMTP id lv14mr47400668ejb.418.1620980851202; Fri, 14 May 2021 01:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620980851; cv=none; d=google.com; s=arc-20160816; b=guH84hk93A7JNK8ZQVjCkau1YWlCDK2vieUYVRmsJlgO2RJvo/MeB/KPrVUQRw9+Ok 3fknR6HmJFyfsgrPIQ1A3i/OBGMEiGI8Sdu0HOwQbrWnBjI6rOFZpmjdY818OJ84enhB CbvRuEE3jOA/lG7J8DIPpFdAoH0/16KGPc6K4fM9tGq8c12dMaoRMAMgCH9VhUWYsuev PjtDXhLFlrlUKWEVo1WF/T16+pG2ODPC4FWwIHs8kFzg3bHnQOc6j4FOO/++KO+SO0fe MQWUSfLbhAubnFjpVKHwcwSiSRf+Y+oKcMh0yaMgyu8W2Y5rKlhLw9H1FLq97GTyyXKe hvqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=o3wEUqD5QhLS2UhtL5j7UqBMamQk3HhwXmumgBPx1P8=; b=xnIl1aqvLUIOkIB6SYKhMhR3ODtNB1M+dDNsWNmbrZYYcoTG475w499UBQRPzqNEXG lAghG2b9QBfH9CqtolQQesD6dLKWKBi5wKqyfgM3CzUvKk/UKEOHvudQRcOlaIt0A3l5 AWjfNuD2DroUTmKLUs+X1GVi3+Z3qv7KTCFlB8+VCyHhZTYSGrLXtqOwwTa05hUkNR1y dFQlMA6vw5sohye7NLslcmckvdJpcpeV5lRpuN7VYlVtIAuw6LJqz/LiDwxOO0CMdwhp Ybfu+7VqO+9ufEUr1w16KCAbrYwWDaKk+HREj7gl9tayTZkyxyu55mc/aQXMLar0JpSb 64YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hcN6w+By; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si5191711eje.466.2021.05.14.01.27.07; Fri, 14 May 2021 01:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hcN6w+By; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231839AbhENA6i (ORCPT + 99 others); Thu, 13 May 2021 20:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbhENA6h (ORCPT ); Thu, 13 May 2021 20:58:37 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 650A9C061574; Thu, 13 May 2021 17:57:26 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id i7so19221085ioa.12; Thu, 13 May 2021 17:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o3wEUqD5QhLS2UhtL5j7UqBMamQk3HhwXmumgBPx1P8=; b=hcN6w+BypiE5zN1KXHBF4f9O0oom+Q2j0Uo1g9Gd/LiXSvBT4gUXeolwGYSAMv61Su GmZhr+7jNEd20bCPrT+SsrfZ53U+zbwlqr9z2QTnpm8oEEZ7Nm9Qdk/PvNgh9C7+rJLt DKcHhb1MgYUN08Ued/nwzuZ/lX7vaizEBXJOhGRm7vNn5/CBzEcJTOTBbnG3UF6pQOaR EVBLUd1K9yVT/2JunLG+yac246uWjJwWcrg4XgHvPrZmIYHHSwifnwzhD4cXcJyaswir zgg/SC0mFliMPn4HB7kfRUC/QydemZzgfZpwza4MT6selUltS0uKSrMJLq61uj0CJSti +Lkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o3wEUqD5QhLS2UhtL5j7UqBMamQk3HhwXmumgBPx1P8=; b=ui9p1meNDYfPLQKwwxWFJRQ/g2Krwi77XjtAzzWj7Zc+vCjZfg32qPetOxZmSuC23J pQclTWoR9GzUYSXX8IHoclnH6a7veu1w5rBMQYU9k1Ia4A+fZxC4WnAzIPFdeS2CAPpz JeYcGqIbnk9lJ2phFvi08gdI6tjXnGa9p3X/ZDiMuAM6gCXG14SdJRz53V0gPdeBS8j7 S8pk4z+T4gpWDSp0AldfHv+PofspX1T+z82ViT9zdYJpTxLtFGcyI5vvlN7kF98ZoeHb AA2ZHVQPaVsXg/6mwi1cnRkhm2qQ1emNifC0vhadisg2caCOed7Hfn/sxjqUdh+FFMbP DBww== X-Gm-Message-State: AOAM5334sjTn+pP8qAMuru+SUWEHF3jNhw6NbhCHqR5hUwcw2LSINVPi QLElaJoOcci8sgE3kycUWstDTbqNw6MQcQ== X-Received: by 2002:a5d:89c5:: with SMTP id a5mr33586495iot.172.1620953845046; Thu, 13 May 2021 17:57:25 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id g25sm1981538ion.32.2021.05.13.17.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 17:57:24 -0700 (PDT) From: Connor Davis To: linux-kernel@vger.kernel.org Cc: Connor Davis , linux-usb@vger.kernel.org, xen-devel@lists.xenproject.org, Greg Kroah-Hartman , Lee Jones , Jann Horn , Chunfeng Yun , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Mathias Nyman , Douglas Anderson , "Eric W. Biederman" , Petr Mladek , Sumit Garg Subject: [PATCH v2 0/4] Support xen-driven USB3 debug capability Date: Thu, 13 May 2021 18:56:47 -0600 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This goal of this series is to allow the USB3 debug capability (DbC) to be safely used by xen while linux runs as dom0. The first patch prevents the early DbC driver from using an already-running DbC. The second exports xen_dbgp_reset_prep and xen_dbgp_external_startup functions when CONFIG_XEN_DOM0 is enabled so they may be used by the xHCI driver. The third ensures that xen_dbgp_reset_prep/xen_dbgp_external_startup return consistent values in failure cases. This inconsistency illustrated another issue: dbgp_reset_prep returned the value of xen_dbgp_reset_prep if it was nonzero, but callers of dbgp_reset_prep interpret nonzero as "keep using the debug port" and would eventually (needlessly) call dbgp_external_startup. Patch three _should_ fix this issue, but I don't have any EHCI hardware available to test unfortunately. The last uses the xen_dbgp_* functions to notify xen of unsafe periods (e.g. reset and D3hot transition). Thanks, Connor -- Changes since v1: - Added patch for dbgp return value fixes - Return -EPERM when !xen_initial_domain() in xen_dbgp_op - Moved #ifdef-ary out of xhci.c into xhci-dbgcap.h -- Connor Davis (4): usb: early: Avoid using DbC if already enabled xen: Export dbgp functions when CONFIG_XEN_DOM0 is enabled usb: dbgp: Fix return values for reset prep and startup usb: xhci: Notify xen when DbC is unsafe to use drivers/usb/early/ehci-dbgp.c | 9 ++++--- drivers/usb/early/xhci-dbc.c | 10 ++++++++ drivers/usb/host/xhci-dbgcap.h | 19 ++++++++++++++ drivers/usb/host/xhci.c | 47 ++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 1 + drivers/xen/dbgp.c | 4 +-- include/linux/usb/ehci-dbgp.h | 14 ++++++---- 7 files changed, 94 insertions(+), 10 deletions(-) base-commit: 88b06399c9c766c283e070b022b5ceafa4f63f19 -- 2.31.1