From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D6D3253F0F for ; Mon, 10 Feb 2025 22:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739227615; cv=none; b=IJDxmHqqnF/H6l/Gs/l9ydSovbONv43KiIa0eW4vfZTdDLxBfkxySmo3BSX3UUmiNARCrLfiSW00jnSWLjZrx0z94wc4dNwuERijB6T8/sX5RbLn0xqs6RnJ1FmPJuQQkCx0fYIXCBNMz0pQOP0joPQHaIlW8Zjk/UhA/eVnGj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739227615; c=relaxed/simple; bh=zn0b5FXEtro91qXSK9PMPMd8PchrIJqar6gJZ6bLBbA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h2GRQKFWv0X2yMPoIGJ1OOPCAdANjZuu1lbhMAilGuPmaOHjMeWz2abDPi4tRKzGqO6RtBQSwHVLR4vmHVXX1UNur5xXjOAxF+3CHHMDTo9Hj95u7HKKzxrqOdkZRqWcvNV1UaD1oNlWgDrd3q68z7WTtCmwBXzi8P3INM+w6e0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RgvXJblR; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RgvXJblR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739227611; 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=WObvk3zO4HetFPfsvOiJrCg4fJAx8pPDhesxtWw1PoU=; b=RgvXJblRaXIGEYwwEaFfMCnKn61Q2HqtOomvRPXwjPEh4C4vyGAtYUjIncLGk/bq9kxNoh PA6evmjmNIRwOGSJnKDsLE3Fv8vWgBp3xapT24VPTh82QCB8EUH3V4kCXAkzAIT2wOJXom zkHnWa/8EDd+yQJjDKrT6KboctK+tto= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-513-WkkOY9LuOrqdAcWTci_xIQ-1; Mon, 10 Feb 2025 17:46:48 -0500 X-MC-Unique: WkkOY9LuOrqdAcWTci_xIQ-1 X-Mimecast-MFC-AGG-ID: WkkOY9LuOrqdAcWTci_xIQ Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C1491800873; Mon, 10 Feb 2025 22:46:46 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.113]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 7316F19560A3; Mon, 10 Feb 2025 22:46:43 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 10 Feb 2025 23:46:19 +0100 (CET) Date: Mon, 10 Feb 2025 23:46:15 +0100 From: Oleg Nesterov To: David Laight Cc: Alex Williamson , bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mitchell.augustin@canonical.com, ilpo.jarvinen@linux.intel.com Subject: Re: [PATCH v2] PCI: Batch BAR sizing operations Message-ID: <20250210224615.GN32480@redhat.com> References: <20250120182202.1878581-1-alex.williamson@redhat.com> <20250209154512.GA18688@redhat.com> <20250210093641.0be242ae.alex.williamson@redhat.com> <20250210195658.GK32480@redhat.com> <20250210200819.GL32480@redhat.com> <20250210134848.78a1ab4a.alex.williamson@redhat.com> <20250210221107.60d608ba@pumpkin> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250210221107.60d608ba@pumpkin> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 02/10, David Laight wrote: > > On Mon, 10 Feb 2025 13:48:48 -0700 > Alex Williamson wrote: > > > On Mon, 10 Feb 2025 21:08:19 +0100 > > Oleg Nesterov wrote: > > > > > On 02/10, Oleg Nesterov wrote: > > > > > > > > On 02/10, Alex Williamson wrote: > > > > > > > > > > --- a/drivers/pci/probe.c > > > > > +++ b/drivers/pci/probe.c > > > > > @@ -345,7 +345,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) > > You probably need __always_inline to have any chance of a compile-time > test of howmany. Can't really comment... But note that nobody else reported this problem, so I guess the newer compilers are smart enough? Not that I am sure we can rely on it... > > > > > > > > BUILD_BUG_ON(__builtin_constant_p(howmany) && howmany > PCI_STD_NUM_BARS); > > statically_true(howmany > PCI_STD_NUM_BARS) Indeed. Oleg.