Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1399722pxb; Fri, 1 Oct 2021 09:49:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaXs+cQROddafB8KPxE3Ainw+peLXrlOb2fX1uFFOf4GxaqvqVz/4r9CUiBtGl1SO3nQ/x X-Received: by 2002:a50:d948:: with SMTP id u8mr15648397edj.306.1633106974126; Fri, 01 Oct 2021 09:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633106974; cv=none; d=google.com; s=arc-20160816; b=ka6kMxkG91OexRXZ+B3wOPRVo7judIJ7SqVVNkjXkc49gpcEodTAlNTvuY+a3U7ltD wihgl+PKopx01C6N3B833YVBTDp3OtoCN4EypwxeA7ELIlZ6UW5QLnnVdtcSspy+/as5 iHq1b0f2upxYZ+taWVC25SO7weQT5Fldh8NEBUmIPMX6F709Y1KPxchI9MARvxkbECts 5PJxhwx83PIk3znpmFRGBb4y0zB4UhvzwasE8tK4Xw9312kdpSeBEVVlXxTpC0919/yT b5sQexSfrQ/40zr10Vb44DTq9zlxvYP84KDeZCfAy+jkCHPx/YBn1W0Hkcd3BxuqDIGI oJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5PRjkNkexUJlUzltoFTGIHVm9ljOhjCzT5Nuvd+Qmvo=; b=WZqUWKxitZJeIl+uJ/W0pWrGGMi+4AO4ofeUAShoaTkpk8dZp+2MWM8xX40kspXdhP 1xxIrYgE5PqpqlQ6arnUAkMy36dMfTcsDcPPV7anGh5CTpsQca0T7aen/Y9gFLYJ1VrX CnANiS6wrBeN9Vr5JGiU/gnJVF0vjnDqw3Y2S+1xkV5QcQ5QoPLuzICUBzFOU2f4VwEN Adrh0KoXWetrp+guqpx24sR3gmDSyaGVf+OrtdOLd0p2Q2SCRsGL3dxb2GCptkAqn/Pl PiwEiEJX7y32rSle3nFiq5Sahg4q+/sHoGkSuiB8mxTvfvRBKBnpsNGBCnwdA7GYX42O ZsXg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si8430887eju.576.2021.10.01.09.49.07; Fri, 01 Oct 2021 09:49:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232114AbhJAQrS (ORCPT + 99 others); Fri, 1 Oct 2021 12:47:18 -0400 Received: from netrider.rowland.org ([192.131.102.5]:49253 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S232094AbhJAQrS (ORCPT ); Fri, 1 Oct 2021 12:47:18 -0400 Received: (qmail 508736 invoked by uid 1000); 1 Oct 2021 12:45:33 -0400 Date: Fri, 1 Oct 2021 12:45:33 -0400 From: Alan Stern To: Dan Williams 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" , Mika Westerberg , Jonathan Corbet , Jason Wang , Andi Kleen , Kuppuswamy Sathyanarayanan , Linux Kernel Mailing List , Linux PCI , USB list , virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest Message-ID: <20211001164533.GC505557@rowland.harvard.edu> References: <20210930010511.3387967-1-sathyanarayanan.kuppuswamy@linux.intel.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) Alan Stern