Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9145144rwb; Thu, 24 Nov 2022 08:38:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf4DfVwGqtRHhmrMRe47grj46kDFehiZvtWb0Q/sZ3GOHD4Tyb0MqkOZFovRd6wmOBy3wxkJ X-Received: by 2002:a17:90a:ac07:b0:206:238e:1379 with SMTP id o7-20020a17090aac0700b00206238e1379mr35686089pjq.180.1669307892257; Thu, 24 Nov 2022 08:38:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669307892; cv=none; d=google.com; s=arc-20160816; b=ndUiy4FgYaLW5P2G1JKQ+tE4x2mlcqzjd1OTB7NWC+8vvqtflIOlxUeEnX7JahLVMZ 0NrTs60sgOaUGW3EsykPLLtmSRPPbLv++P9ec9ShF+cz40AehJHPWp4LD2ROfXyDrb6D WMgrPTZt9FR4ZtC4V50wWpT+mCabI1NBu49iDem53BN+8wu2ECGmyUJtgNJ5fNX42T1h 3FpwDPRddrZl8gw9pvTlGFL3sTR8fzxnKiUnk5OKWEGi4kkdEO2RcQqHr8n4p/Y2nt4q QrKU2ymSMneueoclePMpt5QAEvfhHhbRaO6v4mZy6wH1p0A2LJcdYox/V3O6Nu8GBWir nlOw== 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=oW1vFoGkG1gZqHKm6cJJxeAutc3pzwTc7EeCCgEOa6U=; b=AUZPJPBAQYejc/zH601vC/DSc1hKw8FLTzmaOBnxLMWTZt58ePaLdGkX4CkgrkNxXD 2vGSfrpgChECAb0w3/SsC0gIyOu4adnGc+yo/DWCd8V3sNpcCCrPRdUvfHmUCxY3I12O O4BcJnZLTa09ukS1e6cJmfn+5YwlxGdGOGxXUq0imnuXJOkAWBaKQMCJ4es2riIXN+Pc A8F6AcwJY5xYSAzvsRFyY+tEIjvtcL4cVDBVLaV1oYoBKiidFdbGHVCiJ1g6EXASFaO7 dLE/rZOBOguV/8Ej22SO4V9OmIRAv1DV5rvRHqePwlC9eb72Kbjhl6zAyn5fE+qH9nzj ypDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0STs4hhj; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4Rss4Eqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x36-20020a634a24000000b0046fabcda4easi1483603pga.555.2022.11.24.08.38.00; Thu, 24 Nov 2022 08:38:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0STs4hhj; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4Rss4Eqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229610AbiKXPzW (ORCPT + 87 others); Thu, 24 Nov 2022 10:55:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiKXPzV (ORCPT ); Thu, 24 Nov 2022 10:55:21 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B404F16E8D8; Thu, 24 Nov 2022 07:55:20 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669305319; 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=oW1vFoGkG1gZqHKm6cJJxeAutc3pzwTc7EeCCgEOa6U=; b=0STs4hhjniVU1gnUtiCn2+QbL9DvDE6kplZCXTj4CQQPcUinLqK2Z5vDrQreia+8ijFfLR e4mKYpcJSGAfu8auOR5DLm/uttM+VvKD+6er6Nka6+O1fDe6kwyhxHC2Vz+GoFC5amNLG9 XZCyv8KeAIR0t3UrVu+0zDh8gfZvPkSKC5Drq/qfJ/j3fp1KvUWLrWdaC7gPQyei2L9S9W LfrNLxpO45JAHHhQS4jRef1P16FsdBY3PWvnM+E/0mpxhnKtaVIcXjGX2kFRUb7adg6GEl JjwXPKT1VphSef6tbprMD8+AX7/4zwhTXOGd9Z7AjjokyC6bMZvXR7TkvlURlg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669305319; 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=oW1vFoGkG1gZqHKm6cJJxeAutc3pzwTc7EeCCgEOa6U=; b=4Rss4EqtqqINndCFCf02V6OverlUL7auZMseRap9WhFAA1bfi3K6qgHJwtdqUBMXD5cybT KimBj3JaMip9fTCw== To: Marc Zyngier Cc: LKML , x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe Subject: Re: [patch V2 09/21] genirq/msi: Make MSI descriptor iterators device domain aware In-Reply-To: <86r0xsmk3o.wl-maz@kernel.org> References: <20221121083210.309161925@linutronix.de> <20221121083326.002153609@linutronix.de> <86r0xsmk3o.wl-maz@kernel.org> Date: Thu, 24 Nov 2022 16:55:17 +0100 Message-ID: <87zgcgbb4q.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 24 2022 at 15:46, Marc Zyngier wrote: > On Mon, 21 Nov 2022 14:36:29 +0000, > Thomas Gleixner wrote: >> +static int msi_get_domain_base_index(struct device *dev, unsigned int domid) >> +{ >> + lockdep_assert_held(&dev->msi.data->mutex); >> + >> + if (WARN_ON_ONCE(domid >= MSI_MAX_DEVICE_IRQDOMAINS)) >> + return -ENODEV; >> + >> + if (WARN_ON_ONCE(!dev->msi.data->__irqdomains[domid])) >> + return -ENODEV; >> + >> + return domid * MSI_XA_DOMAIN_SIZE; >> +} > > So what I understand of this is that we split the index space into > segments, one per msi_domain_ids, MSI_XA_DOMAIN_SIZE apart. > > Why didn't you decide to go all the way and have one xarray per > irqdomain? It's not that big a structure, and it would make the whole > thing a bit more straightforward. > > Or do you anticipate cases where you'd walk the __store xarray across > irqdomains? Not really. I just found it conveniant to deal with one, but yes we could do the same thing with two xarrays. But at the very end it does not make a huge difference. Fine with me either way. Thanks, tglx