Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp695314pxv; Thu, 8 Jul 2021 11:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzILbd1VJXP7K4g5l6ZLmu0x4tbWMupxaLe8uNSTBzoV3CN+BgfAVZsJOQv2Yw6STNZKe5z X-Received: by 2002:a17:906:8310:: with SMTP id j16mr8317041ejx.79.1625770186607; Thu, 08 Jul 2021 11:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625770186; cv=none; d=google.com; s=arc-20160816; b=kTHSZNgWjIOLo8UPm4OYPHGpwnhEPJ1pLecMmwEALowhFRWRtFeE4YOO4LTP/Twesk Hb5oNpsuRlBiWMMgipHh5CbKHequVRVrnTp6wDshm02nhqKb7BLoKQTzn4Yr//u8yJC6 YHa6P21OqV+0LibyKvX1xJ7aaYdMFozhPCpIgbb1/+JcpHcMnVo9bZu8cDYyFXNODbJ2 UgzU2nQh8oDjed9yTD5P5rHyH63YA9apIhydpKo4dSO3XrdDE8BNT5WLNXC5xbWWzrs2 TnWOtEnk67xOWe+lt2u9OM1v0lhXPtc1k1oMeC/IKyTdqEHums+Cu4QngzEuE/pZXRS7 PuLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=SldBbRL1As6HH2M61BP/ubphyI2dj2XqtlsppF+Xl4Q=; b=HAcmzrmv7mqK0O40i+0Rc8ld09KigmGkWjI9iRWaFK7/Kn9jvWmPZcGS4sP0m9r1tj FhPmfMhKIWzyUizW/1InGzxtFe8t7d3bTw9sulwaN+hSsVM8SAnrZgDCu+F4aUSUAun+ 25QlGQxAgSSmXVSO94gg3VigxgF9Pedn6XIVZ+C+oQk0avgJ6CKxkCtJv+MGRN19llr6 DI/q5kb0xM/dISAnNCksYYo0OQbztif0sT2sVhZ2zcWbEchJKepTXZH0wPZzaKe4kBNe vRkTmAqbP7wXI8PSWuS7s2dYJ/IiXcqSnnJE1pNEVFrdw7raZCsBDKH3vT0RwWAoJ4sw FPCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=05maXRbV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="SVWqV/oy"; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox26si3610933ejb.628.2021.07.08.11.49.23; Thu, 08 Jul 2021 11:49:46 -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=@linutronix.de header.s=2020 header.b=05maXRbV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="SVWqV/oy"; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbhGHSse (ORCPT + 99 others); Thu, 8 Jul 2021 14:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhGHSsd (ORCPT ); Thu, 8 Jul 2021 14:48:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C5C1C061574 for ; Thu, 8 Jul 2021 11:45:51 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1625769949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SldBbRL1As6HH2M61BP/ubphyI2dj2XqtlsppF+Xl4Q=; b=05maXRbVnoMnncjd+n3nI80cb9PMpyto6MNDRX76X4aZSwtmykUGITG3mxpqrFSIaxhde3 W/fwU2kSrLAzzE1b0dGsHgNDJYoWGstMmXBZ/c+YwT/2F3FwW3PV2HK5MdkpDQ14Bz/dGD PYnsJ+bMauWnjdlL5Ort4QLKWG6a23ekQH2eHe+a37614F16h16+5+AF5HS9K2PXOEY3b0 GPWM66Dbw2XtA570v2xwT7egqsJE4QpxBVg8cggwpBIKiITiGZexVKx+ESUbO6wFDZqsYD v/4LzoTyms5bm2ENUlaEJiwLhdq/MQsaXG13/+6JxaZwuekfd3yTosJNQEEdFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1625769949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SldBbRL1As6HH2M61BP/ubphyI2dj2XqtlsppF+Xl4Q=; b=SVWqV/oyKYTmODZ7FmPa7CtEG5lKr9FGR+ben8tsLurWtZK1DKjp8+T5Ud6ekQ1bV70Ard dLd0LV+IeSkLoCAA== To: "Raj\, Ashok" , Jason Gunthorpe Cc: "Dey\, Megha" , linux-kernel@vger.kernel.org, "Jiang\, Dave" , "Tian\, Kevin" , "Pan\, Jacob jun" , "Liu\, Yi L" , "Kumar\, Sanjay K" , "Van De Ven\, Arjan" , "Williams\, Dan J" , "Shankar\, Ravi V" , Ashok Raj Subject: Re: Programming PASID in IMS entries In-Reply-To: <20210708143657.GA70042@otc-nc-03> References: <87k0m2qzgz.ffs@nanos.tec.linutronix.de> <20210707221216.GA56594@otc-nc-03> <20210707235822.GB4459@nvidia.com> <20210708003335.GC56594@otc-nc-03> <20210708120846.GD4459@nvidia.com> <20210708143657.GA70042@otc-nc-03> Date: Thu, 08 Jul 2021 20:45:48 +0200 Message-ID: <87v95kod9f.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ashok, On Thu, Jul 08 2021 at 07:36, Ashok Raj wrote: > On Thu, Jul 08, 2021 at 09:08:46AM -0300, Jason Gunthorpe wrote: >> On Wed, Jul 07, 2021 at 05:33:35PM -0700, Raj, Ashok wrote: >> > On Wed, Jul 07, 2021 at 08:58:22PM -0300, Jason Gunthorpe wrote: >> > > > Using default PASID in struct device will work for sub-devices until the >> > > > guest needs to enable ENQCMD support. Since the guest kernel can ask for an >> > > > interrupt by specifying something in the descriptor submitted via ENQCMD. >> > > > Using the PASID in struct device won't be sufficient. >> > > >> > > Could you could store a pasid table in the struct device and index it >> > > by vector? >> > >> > Possibly... what ever Thomas things is clean. The device specific driver >> > would have this already. So providing some call to get this filled in vs >> > storing that in struct device. Someone close at heart to the driver model >> > is best to comment :-) >> > >> > IMS core owns the format of the entries right now vs device specific driver. >> > I suppose your use case requiring a vm_id might have a different format. >> > So this is yet another one the core needs to learn and adapt? >> >> All entry format stuff is device specific, it shouldn't be in "core" >> code. > > Well, this is how it started way back last year. > > https://lore.kernel.org/lkml/158751209583.36773.15917761221672315662.stgit@djiang5-desk3.ch.intel.com/ Which is wrong on so many levels as we all know. > Where the driver functions for mask/unmask/write_msg etc. So the core > needs Needs what? > So the format or layout is device specific, but core can dictate the exact > message that needs to be written. Sorry, I don't grok what you want to say here. >> It is is the same reason that the IRQ chip driver for IDXD should have >> IDXD in the name, it is not a generic "IMS core" thing. >> >> The question mark is probably the locking model, but if IDXD >> guarentees the pasid table doesn't change while the irq is active then >> maybe it works out well enough. > > I think this must be gauranteed at a min? changing things underneath when > the interrupts are unmasked would be bad usage. That's one way to look at it. OTOH, _if_ the association of some arbitrary information to interrupts becomes a common scheme, then we are surely better off to have some enforcement at the irq core level. Thanks, tglx