Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1579887pxb; Fri, 1 Oct 2021 13:59:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtzJf7ibgxuC+8OaTxp9AUyHLI7WU+51xo8jOwII6EgeAxNff/0AbwV6C/3PiaG4YQot0a X-Received: by 2002:a05:6402:142d:: with SMTP id c13mr232331edx.390.1633121983885; Fri, 01 Oct 2021 13:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633121983; cv=none; d=google.com; s=arc-20160816; b=ZqOX/Ia6yyjhrGKTJ1XruAA5pu8l8ugx/1feS1oaW0bIN35zqkjLbbQ1kzEyORIQwm Ps/mULyBRWC8WB+jnT6/lr8i90nQiqd4sETcZAubeBP5TewH5d1VT5lXcmzupyjiQp/X wRdsZglBEMsxcAsar/yaQJpgUfh4S8fI4zCCQzqLWeTyh2kXBbDDMJDEjhdjEx9EOjrz ew/6XsvZJ4IqBm3eKBRJRVig5rjTUfLU17fSMEzLlXoCwP7bR2RKO2lrXqkDXHrJNvjh KdnMBGycJBuigjQKTKxOS7K3t86z9civeEePCT9hK30EtEqDsOI/tnb2UKEers54Uv0t q9Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=j2fdDN3PiozWbni44hrcUM4tELJqdxqZaFoTlKL68Vs=; b=pZF0q4KbrTB5gcHTjHsnxUuQCkOXyN9XruPxNzsXFiNMBo+1JV635q4x4Sg6f7iVE0 AVDyJ+HB0oGQY5coZQiqm/clfU3GAJHIl4Q2LKg4EGWN6i9qAqNUxmF/2sYQPlbXmR5C HemeIT5b6qqelzxW4ypQBs2Hf1p5SQbhonSLtH/U/1iEprLnmNx1BYEZfI/SPZAD2VNR mc35eXVq4d5fgNs3im3lHeKXg6nqxQorX4MK4gmb79GbbgeaTFbqjjrxUhAQlCv0rmfe wAmozA43L0DtzsiKTAUXRpSp8m4+isKmkOKNCuCwohMpScLrwNc1vXOlZH4N5UtStYwF RfyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=0JGuFckD; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si4576124ejk.767.2021.10.01.13.59.18; Fri, 01 Oct 2021 13:59:43 -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=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=0JGuFckD; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbhJAT7O (ORCPT + 99 others); Fri, 1 Oct 2021 15:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbhJAT7N (ORCPT ); Fri, 1 Oct 2021 15:59:13 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A65C06177F for ; Fri, 1 Oct 2021 12:57:29 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id t11so6980087plq.11 for ; Fri, 01 Oct 2021 12:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j2fdDN3PiozWbni44hrcUM4tELJqdxqZaFoTlKL68Vs=; b=0JGuFckDuefx1bCUOQQTKROf8SkvsfTfm2aQYr6hDdqwzPH2hVDfwY5YXCRic8Cq91 ELgl97w/iPOpc3I3dFiz4HMaQyqK86awMgz33OjajUmsBCByhP3QlKPUsuZZth75UuNf AxjeZK9xRw5esr+uKx2BHs/U1paJi146gE1L2rwzir/8YRTP3fppWIc/OsukJNfCjcnt UT1hznJk+ffLu6SvWVFfdLFXYl0JpOEvJcEx/qJCgT/AXRX7xYTyoX/NicL2Hg8ObdVN SCpQrUtUbqFWISWbd7KHBrB0fvBmA1iK40S5N/F/NGKMFompoWkiIFxXYIY8KECPScj6 oabw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j2fdDN3PiozWbni44hrcUM4tELJqdxqZaFoTlKL68Vs=; b=B9JxIxUg3s0muGyr5wiyArXBC8ppz8lDoD03SIQe+3Sy8kfz5lPtWAyaJYnzg2NP0t gatUah+Wq2PCl75Tcg+BLlgCTQ/EAW1QIa3vN4rPxmDnYFw9Qd59AkJDUk+GCSASgcPG HcH/XTwLDsfXjiK+HQ8o6jY9cxr+opN94CmbuY4Fyp7vK5qHoiq/JHHDKzkou/mfHJh3 g+64W2uz+t5aeLs6zH4kszvwAwxarkCToDdSgAXv/4ZQk978fBY7/fKENcX/+0PhIHMq 2ZGCPgYGXfNaPQL8/6a708ZM66MghD45Yx/Z07kfACqsl4H0WTBO0fp8x/xyAnMnP35g So0Q== X-Gm-Message-State: AOAM532vVfkFYmg88numGanZN0M+HzQuRDi6niZaqzNVM79c4AUp6UWq LMLEdImQ51yNM8lfMVTgmH2R9wZrua9uTwJCZbFP0g== X-Received: by 2002:a17:90b:3b84:: with SMTP id pc4mr15214648pjb.220.1633118248489; Fri, 01 Oct 2021 12:57:28 -0700 (PDT) MIME-Version: 1.0 References: <20210930010511.3387967-5-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930065953-mutt-send-email-mst@kernel.org> <6d1e2701-5095-d110-3b0a-2697abd0c489@linux.intel.com> <1cfdce51-6bb4-f7af-a86b-5854b6737253@linux.intel.com> <20211001164533.GC505557@rowland.harvard.edu> <20211001190048.GA512418@rowland.harvard.edu> In-Reply-To: <20211001190048.GA512418@rowland.harvard.edu> From: Dan Williams Date: Fri, 1 Oct 2021 12:57:18 -0700 Message-ID: Subject: Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest To: Alan Stern , Mika Westerberg Cc: Greg Kroah-Hartman , "Kuppuswamy, Sathyanarayanan" , "Michael S. Tsirkin" , Borislav Petkov , X86 ML , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Andreas Noever , Michael Jamet , Yehezkel Bernat , "Rafael J . Wysocki" , Jonathan Corbet , Jason Wang , Andi Kleen , Kuppuswamy Sathyanarayanan , Linux Kernel Mailing List , Linux PCI , USB list , virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 1, 2021 at 12:02 PM Alan Stern wrote: > > On Fri, Oct 01, 2021 at 11:09:52AM -0700, Dan Williams wrote: > > On Fri, Oct 1, 2021 at 9:47 AM Alan Stern wrote: > > > > > > On Fri, Oct 01, 2021 at 09:13:54AM -0700, Dan Williams wrote: > > > > Bear with me, and perhaps it's a lack of imagination on my part, but I > > > > don't see how to get to a globally generic "authorized" sysfs ABI > > > > given that USB and Thunderbolt want to do bus specific actions on > > > > authorization toggle events. Certainly a default generic authorized > > > > attribute can be defined for all the other buses that don't have > > > > legacy here, but Thunderbolt will still require support for '2' as an > > > > authorized value, and USB will still want to base probe decisions on > > > > the authorization state of both the usb_device and the usb_interface. > > > > > > The USB part isn't really accurate (I can't speak for Thunderbolt). > > > When a usb_device is deauthorized, the device will be unconfigured, > > > deleting all its interfaces and removing the need for any probe > > > decisions about them. In other words, the probe decision for a > > > usb_device or usb_interface depends only on the device's/interface's > > > own authorization state. > > > > > > True, the interface binding code does contain a test of the device's > > > authorization setting. That test is redundant and can be removed. > > > > > > The actions that USB wants to take on authorization toggle events for > > > usb_devices are: for authorize, select and install a configuration; > > > for deauthorize, unconfigure the device. Each of these could be > > > handled simply enough just by binding/unbinding the device. (There > > > is some special code for handling wireless USB devices, but wireless > > > USB is now defunct.) > > > > Ah, so are you saying that it would be sufficient for USB if the > > generic authorized implementation did something like: > > > > dev->authorized = 1; > > device_attach(dev); > > > > ...for the authorize case, and: > > > > dev->authorize = 0; > > device_release_driver(dev); > > > > ...for the deauthorize case? > > Yes, I think so. But I haven't tried making this change to test and > see what really happens. Sounds like a useful path for this effort to explore. Especially as Greg seems to want the proposed "has_probe_authorization" flag in the bus_type to disappear and make this all generic. It just seems that Thunderbolt would need deeper surgery to move what it does in the authorization toggle path into the probe and remove paths. Mika, do you see a path for Thunderbolt to align its authorization paths behind bus ->probe() ->remove() events similar to what USB might be able to support for a generic authorization path?