From acd94a9c7c589e36db013c026b5910d24af26bab Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 6 Jun 2017 08:59:17 +1000 Subject: pci: Add bitmap to know if a pci device has cfg reg filters This avoids doing a search through the list of all devices on every config space access to every device under a PHB. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Stewart Smith --- hw/phb3.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'hw') diff --git a/hw/phb3.c b/hw/phb3.c index b33ed7b..c99f1de 100644 --- a/hw/phb3.c +++ b/hw/phb3.c @@ -236,13 +236,8 @@ static void phb3_pcicfg_filter(struct phb *phb, uint32_t bdfn, return; } - /* FIXME: It harms the performance to search the PCI - * device which doesn't have any filters at all. So - * it's worthy to maintain a table in PHB to indicate - * the PCI devices who have filters. However, bitmap - * seems not supported by skiboot yet. To implement - * it after bitmap is supported. - */ + if (!pci_device_has_cfg_reg_filters(phb, bdfn)) + return; pd = pci_find_dev(phb, bdfn); pcrf = pd ? pci_find_cfg_reg_filter(pd, offset, len) : NULL; if (!pcrf || !pcrf->func) -- cgit v1.1