Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3688139pxb; Mon, 24 Jan 2022 15:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAaGNQMH49j35bHcx2gPY4mKeAKpeBdxQmMt8sRZtXqHgtKB3a7cIvdyUi/xbbxeX92Ckp X-Received: by 2002:a63:8c07:: with SMTP id m7mr13364722pgd.496.1643066646107; Mon, 24 Jan 2022 15:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066646; cv=none; d=google.com; s=arc-20160816; b=PvqVD8xzeA3ARuMDDS8v24SZfr6DkcWfD9nHui97oKRWqXS5rjHJY1veoa7O2U/aZT /cVB2Ty2w1cOhnlhjzcfY9QW2UKqBa/MZAzvG/jbX2RzBq3l8Dhdi257wA5y25gT89c5 Wlv8ZhM2ojbrXOGASxQPSjciIJ4JlRkYTciWM+vnVfbYVIOpOJ7wGlZr/u+OkcM/B8do bsV+CX5EL1x1McYtOMqAJaHB/wOchzYvKMaN16WEYsttc++/csHvjZxmd4nsqHkc983I 36sIovfHsciHPc7cHbN1LEENjzuw80RWN+QEQn9hdagWm1gr0G8lZGtH+zW83eFzfKyx UDug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KwoH70bFeaj3o6dbzr/hpeT7qSC/DeF9G9bUmYQI+7s=; b=AK8QPcvQg6nJbcTuAGtrjZhrxbHfGInAig8P6OSDE6mmdglNfxIwDt3DET1a1+ChME n3W5j4RiElmuaXO6zRdwbRXxdhhQKRqzap5tv4fLL0fKbCFI9bkf/FCp1ohOaK2ahVfV qIxRkFgEcAn5xEvdbUvVT2JKyT9J96kSYb+Pnk0fXftFPo1xeI84kuHikKaFqvVcs/oK aEBPZoK0ID5xYvCmnup8VQ4Pjwpq/gG1zEXthPgQaWGTJ6lL+tATQycvAmhFVpVUsAcM KmfQ4rqatVv+TTimJSK0qiSBaTw9BZovqYfp98d29KO0cfmuzrpASoWUaV4I4S3JT40v DHzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DauwrX1v; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si4255544plf.480.2022.01.24.15.23.39; Mon, 24 Jan 2022 15:24:06 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=DauwrX1v; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1846926AbiAXXR3 (ORCPT + 99 others); Mon, 24 Jan 2022 18:17:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1453010AbiAXWRM (ORCPT ); Mon, 24 Jan 2022 17:17:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F273C04A2CA; Mon, 24 Jan 2022 12:45:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1DAFB81057; Mon, 24 Jan 2022 20:45:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6025C340E5; Mon, 24 Jan 2022 20:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057105; bh=8kdnPAkKMFZeojypize7PQeSHKNwYqoEZAm1hMECNzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DauwrX1v2antImifZPxO7z7VIZaCa84pttaaanFulOhqkhjjjpzFTw2ZlZ5Q5Vn0w rwBAAiVevKJb7n35b3PWVynnsNCEwHAHQDlqTbKakghqmikK8aSQHeFC5aDqmdhTnC cJzxDBSkXrIoAoJkKI+9MKJh3szTt9TnRPYQpQnA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi Subject: [PATCH 5.15 703/846] PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only Date: Mon, 24 Jan 2022 19:43:40 +0100 Message-Id: <20220124184125.306761037@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár commit 1c1a3b4d3e86b997a313ffb297c1129540882859 upstream. If expansion ROM is unsupported (which is the case of pci-bridge-emul.c driver) then ROM Base Address register must be implemented as read-only register that return 0 when read, same as for unused Base Address registers. Link: https://lore.kernel.org/r/20211124155944.1290-2-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pci-bridge-emul.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/pci/pci-bridge-emul.c +++ b/drivers/pci/pci-bridge-emul.c @@ -139,8 +139,13 @@ struct pci_bridge_reg_behavior pci_regs_ .ro = GENMASK(7, 0), }, + /* + * If expansion ROM is unsupported then ROM Base Address register must + * be implemented as read-only register that return 0 when read, same + * as for unused Base Address registers. + */ [PCI_ROM_ADDRESS1 / 4] = { - .rw = GENMASK(31, 11) | BIT(0), + .ro = ~0, }, /*