From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC87C63797 for ; Thu, 22 Jul 2021 13:46:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72F2761358 for ; Thu, 22 Jul 2021 13:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232172AbhGVNFy (ORCPT ); Thu, 22 Jul 2021 09:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbhGVNFw (ORCPT ); Thu, 22 Jul 2021 09:05:52 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8C8360FF2; Thu, 22 Jul 2021 13:46:27 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m6Z1u-000H9Q-34; Thu, 22 Jul 2021 14:46:26 +0100 Date: Thu, 22 Jul 2021 14:46:25 +0100 Message-ID: <8735s631hq.wl-maz@kernel.org> From: Marc Zyngier To: Thomas Gleixner Cc: "Raj, Ashok" , LKML , Alex Williamson , Bjorn Helgaas , linux-pci@vger.kernel.org, "David S. Miller" , Kevin Tian , Ingo Molnar , x86@kernel.org Subject: Re: [patch 2/8] PCI/MSI: Mask all unused MSI-X entries In-Reply-To: <87zgufnuks.ffs@nanos.tec.linutronix.de> References: <20210721191126.274946280@linutronix.de> <20210721192650.268814107@linutronix.de> <20210721222313.GC676232@otc-nc-03> <87zgufnuks.ffs@nanos.tec.linutronix.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: tglx@linutronix.de, ashok.raj@intel.com, linux-kernel@vger.kernel.org, alex.williamson@redhat.com, bhelgaas@google.com, linux-pci@vger.kernel.org, davem@davemloft.net, kevin.tian@intel.com, mingo@kernel.org, x86@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Jul 2021 23:57:55 +0100, Thomas Gleixner wrote: > > Ashok, > > On Wed, Jul 21 2021 at 15:23, Ashok Raj wrote: > > On Wed, Jul 21, 2021 at 09:11:28PM +0200, Thomas Gleixner wrote: > >> > >> + addr = pci_msix_desc_addr(entry); > >> + if (addr) > >> + entry->masked = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL); > > > > Silly question: > > Do we have to read what the HW has to set this entry->masked? Shouldn't > > this be all masked before we start the setup? > > msix_mask_all() is invoked before the msi descriptors are > allocated. msi_desc::masked is actually a misnomer because it's not like > the name suggests a boolean representing the masked state. It's caching > the content of the PCI_MSIX_ENTRY_VECTOR_CTRL part of the corresponding > table entry. Right now this is just using bit 0 (the mask bit), but is > that true forever? So we actually should rename that member to > vector_ctrl or such. To follow-up with this forward looking statement, should we only keep bit 0 when reading PCI_MSIX_ENTRY_VECTOR_CTRL? I.e.: entry->masked = (readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL) & PCI_MSIX_ENTRY_CTRL_MASKBIT); Or do we want to cache the whole register? In which case I'm all for the suggesting renaming (though 'masked' is shared with the old-school multi-MSI). Otherwise: Reviewed-by: Marc Zyngier Thanks, M. -- Without deviation from the norm, progress is not possible.