Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3310729pxb; Sun, 3 Oct 2021 22:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwts9hkHj2rAXx1W32ccDvBw3CKkf0wxpHfO0/K75DZZzCGnwdNVTRBsnL2O1ik8cn97d0r X-Received: by 2002:aa7:d1c2:: with SMTP id g2mr15486398edp.248.1633325181906; Sun, 03 Oct 2021 22:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633325181; cv=none; d=google.com; s=arc-20160816; b=MxymTPL4/OepS9l88SqCVdqRmlztBGB8U7ye6HONmMIkqBdu7Up+krYtuYbjvSXtLf HfXp0zkEiKeYltXAMEl5lKWHDc8BK1QYzndWyeZZX1MradfB18RGFE2kHUj/oIBasF/Y Lv/3yG/nT5K9+FuvKE56yBiHSNP5JvU15KONSATYPaB3kkuLnpomUqdDeyHVC0qIXvaW +uEVI1lmP8UpWD7NEPLxou/HkMoND9NFukJK26L4vDuttYcgRqz0B2xNvH1/r8oTL6eb m4hnlmKiwOF20xcDHUwf1SQ8KUlHXRnQYTPK4J2t6yWsW+IZ3JD94Fl7vjaKjraUrcn/ +xuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=XwHhRbtbYNqq7eDMFQ8yK0yY4DLHglmgTbMFk+dkmUM=; b=echs96atzhEeZUXNXwcKHpPeU8DPupb+Ov9NLjNHiFfZipYrxmr6S9K5JDgPOnUOxG daz0nNuq1aRU8gpWeVgv68n+7Z1U41mnLpaFNK/vmMTJmr/7D6FgdjZ3Pnevk67atW5H W8Lr4VVGpWMjZUSYXETTf4jLlRKdKFiCqiV5iM3YNXiqfTuaFzW8cRakrbO36sTb8UUO wyVH/l2mAQWbyaklrZWA5RLi/64+6r2R1iI1kmOjNsYkhEpNSV2sF2UYls8pYVTCqN88 6M/b1+CGQ0xuezgdCRzOaYWh6ow3GuM4uosKhl2diCWCH9XkcNq8qxJLHY/ZDigKGz1g CFHw== 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; 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 6si15147292ejc.421.2021.10.03.22.25.36; Sun, 03 Oct 2021 22:26:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbhJDFSe (ORCPT + 99 others); Mon, 4 Oct 2021 01:18:34 -0400 Received: from mga17.intel.com ([192.55.52.151]:17601 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232388AbhJDFSd (ORCPT ); Mon, 4 Oct 2021 01:18:33 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="206099171" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="206099171" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:16:45 -0700 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="566826043" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:16:39 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 04 Oct 2021 08:16:36 +0300 Date: Mon, 4 Oct 2021 08:16:36 +0300 From: Mika Westerberg To: Dan Williams Cc: Alan Stern , 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 Subject: Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest Message-ID: References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Oct 01, 2021 at 12:57:18PM -0700, Dan Williams wrote: > > > 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? In Thunderbolt "authorization" actually means whether there is a PCIe tunnel to the device or not. There is no driver bind/unbind happening when authorization toggles (well on Thunderbolt bus, there can be on PCI bus after the tunnel is established) so I'm not entirely sure how we could use the bus ->probe() or ->remove for that to be honest.