From nobody Thu Oct 2 18:06:25 2025 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 745EB27D771 for ; Fri, 12 Sep 2025 23:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718596; cv=none; b=WMw2plzI4kss7RPDpW4d1EFUBBQ0jIv3aqxCqR+Anr3UIiRoP+gw6un8pLcgSf+gHiUIMU5/+RvBZkz2FtUPfhYef9DUDOK4P7N9JOzYhW9H9XBhUQpz+Oop5QJmKHsEPIjw2iVvm9eK5R4ZEdHfWIiUQ4dOQd4vCjS+wVyWMpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718596; c=relaxed/simple; bh=sXvBWDb9hTBPsLaRegbOtBiO673LvoBjYekcWqme0qY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KFt1tI1tY4tNiCjqjen7I0A1LNDc0lObLR0r5LKIITR31QAAQ47UEFY5+Zj1HJYjdvSNnxW9khvoBbG86R274Bi2CC6LskihYJK5/osrMxsFQOdQdE0kbjoHjr0eng6PlKZ/TBBoY0duIr6kFSu4X0Rrf7i4Oegb+wvvatTos3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=A5EqVE9p; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A5EqVE9p" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-76e4f2e4c40so2220337b3a.2 for ; Fri, 12 Sep 2025 16:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1757718594; x=1758323394; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3dwNY0wU9h+Jp/qHmj3QCzMa4YfF1MmR36mm3/7OnW8=; b=A5EqVE9pmugzFbDWRw9h5yEqB1aD+F0NpX/kb+FCZLiOR8ng8+zTLThkd6E99KifsL oGgKnE62y6iDS+uoxPXQTFMLKbajfOcFmT/qg6H3cIj349iifoNMkK+dVjdrx//e6/Wu gbsBm1UaHa3qcZuVb5w8WUXEYHhW+FpMGu0tI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757718594; x=1758323394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3dwNY0wU9h+Jp/qHmj3QCzMa4YfF1MmR36mm3/7OnW8=; b=Y9iaLpyFijAZ9ER9Nc09rRzP6DlhXBjPy/JcL29R4FRYBVzB4SKJLvgyWSdwHd8pNe nHc+MC0As3hj+dpL2ajMZYfeN2nGZ5r2UDd77b3ZSoVXpy5chbdd5bVu1/D+xD3ngG5d d7uj/mKcJ37eImOBtyvX1qOKRiFe2t70TYV96YX+efj4qaMfoBk9Jcpt81cnHJl87ntI EMVkZ7seY0kl8wMlvY8XgEmZju1aPRLVaN+E+Co9L5rtd6FpxUmgtmSM156CEXRy//Kj BGlZynYa6BGSyapnwQI6ouLD3nGoWSgKdCngAmAAogNbND6EQmpGMf47K8vOOnErpJMT CQbQ== X-Forwarded-Encrypted: i=1; AJvYcCUedRwvBQzhZBSML5jQsAwETtg6vh5GEzVWaGp5lPS75uMwSqTPC8H92j7K1isqnxRzQoiVrmSiwZzOSzM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywuew1QJsTQEwW9fimJz83r9s11bUm0yhFFXrivAImdtVLSOb2s dAEfLkXvXsjzuJ6rPSJCBNgHKUcq5x3+H/hAPrqm3N8wPz8exaKYhcU5Ht+VlVkQ3w== X-Gm-Gg: ASbGncvMfHxCKeMOn6Jhllaq2VJ2qEurRr4XvcS15eZSSxF+Rsu4+mKSRRgX9Wwvp1D ApQatVKuC47gJ9HbaMhVedksiI2fzCZJEWak/G55z9YcHtvH/fNhrBjkkyUaBw7T61fkgtfrBD7 uv9MI1gysp/gyy6YSBuIaGQnzTwVNJ2jt4eVjPeIGu14ekmJcOFI5Qqp8XEyWr+xSqovqA4osrc U4zZwtfJ2QTQ2WqeTB/Mz0VahkxOf1MKswU4//mY3C1bRPiXj1vsJbZ5/M8bP+dnlS5desZiwxg UcZQ2kLJ8fr+hpMsRGkjgzIAGztS5/sn4qW2heKegLxdFQzESzNxG9RHmL6qFwdx6F4cUC2KuDk /xmHDS+yP/tDbCTX+dIOMpRXDMAleJF4rnqSIdGRyq8M50J2Qf3x1llq8JQQ= X-Google-Smtp-Source: AGHT+IFFuttMHqLS1NzNjjaUsptJHeOjOLiy3J4IGiKbJXBfuhvPakuAU9nJRFZCTzUYWTGc4g8XAg== X-Received: by 2002:a05:6a21:339c:b0:244:21:b477 with SMTP id adf61e73a8af0-2602a59371fmr5525527637.16.1757718593795; Fri, 12 Sep 2025 16:09:53 -0700 (PDT) Received: from localhost ([2a00:79e0:2e14:7:e464:c3f:39d8:1bab]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-77607c473b9sm6643028b3a.93.2025.09.12.16.09.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 16:09:53 -0700 (PDT) From: Brian Norris To: Bjorn Helgaas , Luis Chamberlain , Petr Pavlu , Daniel Gomez Cc: linux-pci@vger.kernel.org, David Gow , Rae Moar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Johannes Berg , Sami Tolvanen , Richard Weinberger , Wei Liu , Brendan Higgins , kunit-dev@googlegroups.com, Anton Ivanov , linux-um@lists.infradead.org, Brian Norris Subject: [PATCH 1/4] PCI: Support FIXUP quirks in modules Date: Fri, 12 Sep 2025 15:59:32 -0700 Message-ID: <20250912230208.967129-2-briannorris@chromium.org> X-Mailer: git-send-email 2.51.0.384.g4c02a37b29-goog In-Reply-To: <20250912230208.967129-1-briannorris@chromium.org> References: <20250912230208.967129-1-briannorris@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PCI framework supports "quirks" for PCI devices via several DECLARE_PCI_FIXUP_*() macros. These macros allow arch or driver code to match device IDs to provide customizations or workarounds for broken devices. This mechanism is generally used in code that can only be built into the kernel, but there are a few occasions where this mechanism is used in drivers that can be modules. For example, see commit 574f29036fce ("PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in"). The PCI fixup mechanism only works for built-in code, however, because pci_fixup_device() only scans the ".pci_fixup_*" linker sections found in the main kernel; it never touches modules. Extend the fixup approach to modules. I don't attempt to be clever here; the algorithm here scales with the number of modules in the system. Signed-off-by: Brian Norris --- drivers/pci/quirks.c | 62 ++++++++++++++++++++++++++++++++++++++++++ include/linux/module.h | 18 ++++++++++++ kernel/module/main.c | 26 ++++++++++++++++++ 3 files changed, 106 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index d97335a40193..db5e0ac82ed7 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -207,6 +207,62 @@ extern struct pci_fixup __end_pci_fixups_suspend_late[= ]; =20 static bool pci_apply_fixup_final_quirks; =20 +struct pci_fixup_arg { + struct pci_dev *dev; + enum pci_fixup_pass pass; +}; + +static int pci_module_fixup(struct module *mod, void *parm) +{ + struct pci_fixup_arg *arg =3D parm; + void *start; + unsigned int size; + + switch (arg->pass) { + case pci_fixup_early: + start =3D mod->pci_fixup_early; + size =3D mod->pci_fixup_early_size; + break; + case pci_fixup_header: + start =3D mod->pci_fixup_header; + size =3D mod->pci_fixup_header_size; + break; + case pci_fixup_final: + start =3D mod->pci_fixup_final; + size =3D mod->pci_fixup_final_size; + break; + case pci_fixup_enable: + start =3D mod->pci_fixup_enable; + size =3D mod->pci_fixup_enable_size; + break; + case pci_fixup_resume: + start =3D mod->pci_fixup_resume; + size =3D mod->pci_fixup_resume_size; + break; + case pci_fixup_suspend: + start =3D mod->pci_fixup_suspend; + size =3D mod->pci_fixup_suspend_size; + break; + case pci_fixup_resume_early: + start =3D mod->pci_fixup_resume_early; + size =3D mod->pci_fixup_resume_early_size; + break; + case pci_fixup_suspend_late: + start =3D mod->pci_fixup_suspend_late; + size =3D mod->pci_fixup_suspend_late_size; + break; + default: + return 0; + } + + if (!size) + return 0; + + pci_do_fixups(arg->dev, start, start + size); + + return 0; +} + void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) { struct pci_fixup *start, *end; @@ -259,6 +315,12 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct= pci_dev *dev) return; } pci_do_fixups(dev, start, end); + + struct pci_fixup_arg arg =3D { + .dev =3D dev, + .pass =3D pass, + }; + module_for_each_mod(pci_module_fixup, &arg); } EXPORT_SYMBOL(pci_fixup_device); =20 diff --git a/include/linux/module.h b/include/linux/module.h index 3319a5269d28..7faa8987b9eb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -539,6 +539,24 @@ struct module { int num_kunit_suites; struct kunit_suite **kunit_suites; #endif +#ifdef CONFIG_PCI_QUIRKS + void *pci_fixup_early; + unsigned int pci_fixup_early_size; + void *pci_fixup_header; + unsigned int pci_fixup_header_size; + void *pci_fixup_final; + unsigned int pci_fixup_final_size; + void *pci_fixup_enable; + unsigned int pci_fixup_enable_size; + void *pci_fixup_resume; + unsigned int pci_fixup_resume_size; + void *pci_fixup_suspend; + unsigned int pci_fixup_suspend_size; + void *pci_fixup_resume_early; + unsigned int pci_fixup_resume_early_size; + void *pci_fixup_suspend_late; + unsigned int pci_fixup_suspend_late_size; +#endif =20 =20 #ifdef CONFIG_LIVEPATCH diff --git a/kernel/module/main.c b/kernel/module/main.c index c66b26184936..50a80c875adc 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2702,6 +2702,32 @@ static int find_module_sections(struct module *mod, = struct load_info *info) sizeof(*mod->kunit_init_suites), &mod->num_kunit_init_suites); #endif +#ifdef CONFIG_PCI_QUIRKS + mod->pci_fixup_early =3D section_objs(info, ".pci_fixup_early", + sizeof(*mod->pci_fixup_early), + &mod->pci_fixup_early_size); + mod->pci_fixup_header =3D section_objs(info, ".pci_fixup_header", + sizeof(*mod->pci_fixup_header), + &mod->pci_fixup_header_size); + mod->pci_fixup_final =3D section_objs(info, ".pci_fixup_final", + sizeof(*mod->pci_fixup_final), + &mod->pci_fixup_final_size); + mod->pci_fixup_enable =3D section_objs(info, ".pci_fixup_enable", + sizeof(*mod->pci_fixup_enable), + &mod->pci_fixup_enable_size); + mod->pci_fixup_resume =3D section_objs(info, ".pci_fixup_resume", + sizeof(*mod->pci_fixup_resume), + &mod->pci_fixup_resume_size); + mod->pci_fixup_suspend =3D section_objs(info, ".pci_fixup_suspend", + sizeof(*mod->pci_fixup_suspend), + &mod->pci_fixup_suspend_size); + mod->pci_fixup_resume_early =3D section_objs(info, ".pci_fixup_resume_ear= ly", + sizeof(*mod->pci_fixup_resume_early), + &mod->pci_fixup_resume_early_size); + mod->pci_fixup_suspend_late =3D section_objs(info, ".pci_fixup_suspend_la= te", + sizeof(*mod->pci_fixup_suspend_late), + &mod->pci_fixup_suspend_late_size); +#endif =20 mod->extable =3D section_objs(info, "__ex_table", sizeof(*mod->extable), &mod->num_exentries); --=20 2.51.0.384.g4c02a37b29-goog From nobody Thu Oct 2 18:06:25 2025 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FCDA284681 for ; Fri, 12 Sep 2025 23:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718598; cv=none; b=Pf/f6gqvcuhHSerbIcy+d+CoZQk/93eSE9kUcd1WkpHXcaQkswshuz1rjRktXgC9gVvTJXfWRIxysfq2ml5IzGpO1/ppzc+ldyun5m/b6X38gXgJ5A6VWrjApCJ893+D0kAJeelyT+1O9khypOihLRZ2FPCE+nADiug72/FyGNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718598; c=relaxed/simple; bh=Lo3tg8ldYjfkigGNAQI4TicSETLTyzsBXIoJKJfX1qY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d91gSH9/bA5PITVrvzBBavVqUPVFXoCC2wKSalZugNCWuPDn62Wm9sQ1/DXvHatD+OTHeZPhvz1WvVZZsMsenqw1Tc4CqO80x/vSbdrt1GYS9tvxMZxVVLCV+LK0oyCDS4CWON/n/cKtUK8+jTB3+AHy4JU/RctfijNv6HFB8oY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dXJcsp0H; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dXJcsp0H" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7725de6b57dso3140904b3a.0 for ; Fri, 12 Sep 2025 16:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1757718595; x=1758323395; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lfbdyh7LZJFSoGiMjoTbUql5vPlkYLJxEsX0Qs2RYRI=; b=dXJcsp0HhDMR23kBYaemQHXeDWH4iQgIyLD7rthJseylpgSAaYE2ZsnEDGEudbrN1r iOL9vSd1l1pZKGJ3PR/Jj1E1yv6ccsP8534pMCra9PEAtctuZN7pSb2Z9QtUczvp45kt Ru/GJyeT9Z33CGKZ0UWtpmEg77vAsDRN7kBQI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757718595; x=1758323395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lfbdyh7LZJFSoGiMjoTbUql5vPlkYLJxEsX0Qs2RYRI=; b=KKj65ywGJiktllgT8ls9k6u876QeenhLxTJT9VTeOE1VJHn7GkwE1fZnjn20CdsAOj wxYwqFjZNe4lkQ15FGBFN0zM7M8Q+Lo8YlRt2bqnrkHAx/ZQoxFVtHL+ZOaG4e3l7jly 1OOKJAJi/A3gZ7mQv6NZirkMiDHXtJwVctL67fjw1pzrY9q5dy6Ipqnqa9pCHhl2XXZw uN5fLdRVqvcDXb1NtasSjMSPlQvCQ4vy1mAjsjJEMIWp0ldq43w41GNAv40xjR0JFj04 edracILOTpMVSKiBucfJKlMBv7L8RCK1LReExtHEkjucw2tba48XOkUhDHDIkGocKkc0 NyMQ== X-Forwarded-Encrypted: i=1; AJvYcCVEP8rZb6FRdRyktgj1LtOu/yabuO3bfQ2rHGdnwQmoaM/cBRJ7Oo09GEo9dS6i34FX8WiNZYPwtCoAImQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0oviTbUaYVoMYXH2c2n2uv3shGBDUWyOyJx+3D8p2ZLSzcKMR Cjqf7ai4SEf6+xv0UlZoi+mAel9lv0S+84t3BtQP931n2tsR0zGG65J4JDeN4kkaWw== X-Gm-Gg: ASbGncut0+5XetU/CY78wvzNxLLXsKZ4/aoW8bP4kj1jWhWjjREELYn4uy84Hq9n1iK jLaEk5HiBBHoVkaVkJy1Trre2VYsY94qsXiOaSlaEY8XVU1JUg86hC+gz+wxtujF8t2iS819JqH GcsM5aEv+63aAo0DaPQkNPAFoVQgS6Jdx2rKr6LqnJl6//SQ51psM5j8S3oN6YGBMWA1eYpndc8 j8cxUW0P78UwBoZVLQW6GToAhU+wgyrKMDfnlt2zEOoeTZ13Dcj5IcHld3YuUi4VEThi59tYmi5 Wfc8nMMfcVOqfROA3L/+ISFQlkmtvcyoCMGO16sOG/5vP8pEOY9rC+C1XBts+VareEdMZQafivl BUXEetMiVCkR0itjMagn95bl1T5GbIOn4R8w4lcTTeNyHja25fnK94P0qKRbJPIJ3b5D7cQ== X-Google-Smtp-Source: AGHT+IGftUvGS13nUHO5sPbO5aRdKW/iBhC0or62cpjUOnYlYwK3legDnb+L5xeL8qmZu3rVdhxD6Q== X-Received: by 2002:a05:6a20:3ca8:b0:24c:48f3:3fd2 with SMTP id adf61e73a8af0-2602a792dccmr5869556637.24.1757718595630; Fri, 12 Sep 2025 16:09:55 -0700 (PDT) Received: from localhost ([2a00:79e0:2e14:7:e464:c3f:39d8:1bab]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-b54a35b7b53sm5716718a12.7.2025.09.12.16.09.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 16:09:55 -0700 (PDT) From: Brian Norris To: Bjorn Helgaas , Luis Chamberlain , Petr Pavlu , Daniel Gomez Cc: linux-pci@vger.kernel.org, David Gow , Rae Moar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Johannes Berg , Sami Tolvanen , Richard Weinberger , Wei Liu , Brendan Higgins , kunit-dev@googlegroups.com, Anton Ivanov , linux-um@lists.infradead.org, Brian Norris Subject: [PATCH 2/4] PCI: Add KUnit tests for FIXUP quirks Date: Fri, 12 Sep 2025 15:59:33 -0700 Message-ID: <20250912230208.967129-3-briannorris@chromium.org> X-Mailer: git-send-email 2.51.0.384.g4c02a37b29-goog In-Reply-To: <20250912230208.967129-1-briannorris@chromium.org> References: <20250912230208.967129-1-briannorris@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PCI framework supports device quirks via a series of macros and linker sections. This support previously did not work when used in modules. Add a basic set of tests for matching/non-matching devices. Example run: $ ./tools/testing/kunit/kunit.py run 'pci_fixup*' [...] [15:31:30] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D pci_fixup_test_cases (2 s= ubtests) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [15:31:30] [PASSED] pci_fixup_match_test [15:31:30] [PASSED] pci_fixup_nomatch_test [15:31:30] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [PASSED] pci_fixup_= test_cases =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [15:31:30] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [15:31:30] Testing complete. Ran 2 tests: passed: 2 [15:31:30] Elapsed time: 11.197s total, 0.001s configuring, 9.870s buildi= ng, 1.299s running Signed-off-by: Brian Norris --- drivers/pci/Kconfig | 11 +++ drivers/pci/Makefile | 1 + drivers/pci/fixup-test.c | 197 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 drivers/pci/fixup-test.c diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 9a249c65aedc..a4fa9be797e7 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -68,6 +68,17 @@ config PCI_QUIRKS Disable this only if your target machine is unaffected by PCI quirks. =20 +config PCI_FIXUP_KUNIT_TEST + tristate "KUnit tests for PCI fixup code" if !KUNIT_ALL_TESTS + depends on KUNIT + depends on PCI_DOMAINS_GENERIC + default KUNIT_ALL_TESTS + help + This builds unit tests for the PCI quirk/fixup framework. Recommended + only for kernel developers. + + When in doubt, say N. + config PCI_DEBUG bool "PCI Debugging" depends on DEBUG_KERNEL diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 67647f1880fb..ade400250ceb 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -20,6 +20,7 @@ endif =20 obj-$(CONFIG_OF) +=3D of.o obj-$(CONFIG_PCI_QUIRKS) +=3D quirks.o +obj-$(CONFIG_PCI_FIXUP_KUNIT_TEST) +=3D fixup-test.o obj-$(CONFIG_HOTPLUG_PCI) +=3D hotplug/ obj-$(CONFIG_PCI_ATS) +=3D ats.o obj-$(CONFIG_PCI_IOV) +=3D iov.o diff --git a/drivers/pci/fixup-test.c b/drivers/pci/fixup-test.c new file mode 100644 index 000000000000..54b895fc8f3e --- /dev/null +++ b/drivers/pci/fixup-test.c @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2025 Google, Inc. + */ + +#include +#include +#include +#include + +#define DEVICE_NAME "pci_fixup_test_device" +#define TEST_VENDOR_ID 0xdead +#define TEST_DEVICE_ID 0xbeef + +#define TEST_CONF_SIZE 4096 +static u8 *test_conf_space; + +#define test_readb(addr) (*(u8 *)(addr)) +#define test_readw(addr) le16_to_cpu(*((__force __le16 *)(addr))) +#define test_readl(addr) le32_to_cpu(*((__force __le32 *)(addr))) +#define test_writeb(addr, v) (*(u8 *)(addr) =3D (v)) +#define test_writew(addr, v) (*((__force __le16 *)(addr)) =3D cpu_to_le16(= v)) +#define test_writel(addr, v) (*((__force __le32 *)(addr)) =3D cpu_to_le32(= v)) + +static int test_config_read(struct pci_bus *bus, unsigned int devfn, int w= here, + int size, u32 *val) +{ + if (PCI_SLOT(devfn) > 0) + return PCIBIOS_DEVICE_NOT_FOUND; + + if (where + size > TEST_CONF_SIZE) + return PCIBIOS_BUFFER_TOO_SMALL; + + if (size =3D=3D 1) + *val =3D test_readb(test_conf_space + where); + else if (size =3D=3D 2) + *val =3D test_readw(test_conf_space + where); + else if (size =3D=3D 4) + *val =3D test_readl(test_conf_space + where); + + return PCIBIOS_SUCCESSFUL; +} + +static int test_config_write(struct pci_bus *bus, unsigned int devfn, int = where, + int size, u32 val) +{ + if (PCI_SLOT(devfn) > 0) + return PCIBIOS_DEVICE_NOT_FOUND; + + if (where + size > TEST_CONF_SIZE) + return PCIBIOS_BUFFER_TOO_SMALL; + + if (size =3D=3D 1) + test_writeb(test_conf_space + where, val); + else if (size =3D=3D 2) + test_writew(test_conf_space + where, val); + else if (size =3D=3D 4) + test_writel(test_conf_space + where, val); + + return PCIBIOS_SUCCESSFUL; +} + +static struct pci_ops test_ops =3D { + .read =3D test_config_read, + .write =3D test_config_write, +}; + +static struct pci_dev *hook_device_early; +static struct pci_dev *hook_device_header; +static struct pci_dev *hook_device_final; +static struct pci_dev *hook_device_enable; + +static void pci_fixup_early_hook(struct pci_dev *pdev) +{ + hook_device_early =3D pdev; +} +DECLARE_PCI_FIXUP_EARLY(TEST_VENDOR_ID, TEST_DEVICE_ID, pci_fixup_early_ho= ok); + +static void pci_fixup_header_hook(struct pci_dev *pdev) +{ + hook_device_header =3D pdev; +} +DECLARE_PCI_FIXUP_HEADER(TEST_VENDOR_ID, TEST_DEVICE_ID, pci_fixup_header_= hook); + +static void pci_fixup_final_hook(struct pci_dev *pdev) +{ + hook_device_final =3D pdev; +} +DECLARE_PCI_FIXUP_FINAL(TEST_VENDOR_ID, TEST_DEVICE_ID, pci_fixup_final_ho= ok); + +static void pci_fixup_enable_hook(struct pci_dev *pdev) +{ + hook_device_enable =3D pdev; +} +DECLARE_PCI_FIXUP_ENABLE(TEST_VENDOR_ID, TEST_DEVICE_ID, pci_fixup_enable_= hook); + +static int pci_fixup_test_init(struct kunit *test) +{ + hook_device_early =3D NULL; + hook_device_header =3D NULL; + hook_device_final =3D NULL; + hook_device_enable =3D NULL; + + return 0; +} + +static void pci_fixup_match_test(struct kunit *test) +{ + struct device *dev =3D kunit_device_register(test, DEVICE_NAME); + + KUNIT_ASSERT_PTR_NE(test, NULL, dev); + + test_conf_space =3D kunit_kzalloc(test, TEST_CONF_SIZE, GFP_KERNEL); + KUNIT_ASSERT_PTR_NE(test, NULL, test_conf_space); + + /* Minimal configuration space: a stub vendor and device ID */ + test_writew(test_conf_space + PCI_VENDOR_ID, TEST_VENDOR_ID); + test_writew(test_conf_space + PCI_DEVICE_ID, TEST_DEVICE_ID); + + struct pci_host_bridge *bridge =3D devm_pci_alloc_host_bridge(dev, 0); + + KUNIT_ASSERT_PTR_NE(test, NULL, bridge); + bridge->ops =3D &test_ops; + + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_early); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_header); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_final); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_enable); + + KUNIT_EXPECT_EQ(test, 0, pci_host_probe(bridge)); + + struct pci_dev *pdev __free(pci_dev_put) =3D + pci_get_slot(bridge->bus, PCI_DEVFN(0, 0)); + KUNIT_ASSERT_PTR_NE(test, NULL, pdev); + + KUNIT_EXPECT_PTR_EQ(test, pdev, hook_device_early); + KUNIT_EXPECT_PTR_EQ(test, pdev, hook_device_header); + KUNIT_EXPECT_PTR_EQ(test, pdev, hook_device_final); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_enable); + + KUNIT_EXPECT_EQ(test, 0, pci_enable_device(pdev)); + KUNIT_EXPECT_PTR_EQ(test, pdev, hook_device_enable); +} + +static void pci_fixup_nomatch_test(struct kunit *test) +{ + struct device *dev =3D kunit_device_register(test, DEVICE_NAME); + + KUNIT_ASSERT_PTR_NE(test, NULL, dev); + + test_conf_space =3D kunit_kzalloc(test, TEST_CONF_SIZE, GFP_KERNEL); + KUNIT_ASSERT_PTR_NE(test, NULL, test_conf_space); + + /* Minimal configuration space: a stub vendor and device ID */ + test_writew(test_conf_space + PCI_VENDOR_ID, TEST_VENDOR_ID + 1); + test_writew(test_conf_space + PCI_DEVICE_ID, TEST_DEVICE_ID); + + struct pci_host_bridge *bridge =3D devm_pci_alloc_host_bridge(dev, 0); + + KUNIT_ASSERT_PTR_NE(test, NULL, bridge); + bridge->ops =3D &test_ops; + + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_early); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_header); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_final); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_enable); + + KUNIT_EXPECT_EQ(test, 0, pci_host_probe(bridge)); + + struct pci_dev *pdev __free(pci_dev_put) =3D + pci_get_slot(bridge->bus, PCI_DEVFN(0, 0)); + KUNIT_ASSERT_PTR_NE(test, NULL, pdev); + + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_early); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_header); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_final); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_enable); + + KUNIT_EXPECT_EQ(test, 0, pci_enable_device(pdev)); + KUNIT_EXPECT_PTR_EQ(test, NULL, hook_device_enable); +} + +static struct kunit_case pci_fixup_test_cases[] =3D { + KUNIT_CASE(pci_fixup_match_test), + KUNIT_CASE(pci_fixup_nomatch_test), + {} +}; + +static struct kunit_suite pci_fixup_test_suite =3D { + .name =3D "pci_fixup_test_cases", + .test_cases =3D pci_fixup_test_cases, + .init =3D pci_fixup_test_init, +}; + +kunit_test_suite(pci_fixup_test_suite); +MODULE_DESCRIPTION("PCI fixups unit test suite"); +MODULE_LICENSE("GPL"); --=20 2.51.0.384.g4c02a37b29-goog From nobody Thu Oct 2 18:06:25 2025 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D3D7286413 for ; Fri, 12 Sep 2025 23:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718599; cv=none; b=gHeOkjnFaEpTcYoVc+9N1r+xE74SasVvHVbyU/wbVyBRwJk4GW7PGr4R2NZNE38AcBXpZCeg7ho2cnjqnV+VVobvP6JH4t3v2//aELCnGYOQk2PVoRUiwQKzWrwSgbf/3L8kcfnKSErK8b1YF35MWG6WkozOabx9QIF5xPwi+PY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718599; c=relaxed/simple; bh=wk+cDFX3JYEG9AqRvbMYfzyBlK7TsevKhe8uR7IxhbI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPObGMJU4KC6xEz+ueReBcN75NDPDhFv+frE5IS3YZa7nSONXYB5+DSKHGmAwtP8ypQb3w+sGV1MPGtAc15WdxzL2W0YUsMOZnzXkNurOGR26AT0Dq9e9B2s8BryRYv5FYrD4QCP3wgTUO8G2C6aKmViNyESc3FpPpp6yL/j20o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=oSfxH+7I; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oSfxH+7I" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-32b8919e7c7so2945364a91.2 for ; Fri, 12 Sep 2025 16:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1757718597; x=1758323397; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8EcyIGZa+6ToxzyxPuYk0yjX8tMoF6H8xGiBH9NLpZE=; b=oSfxH+7IGNGd4n6yensMZUHuSbXJ85ZRxqQ6AIN4hRhTUgIhz3PWx6rIbKq8FlOwB0 3VWJmMPXWDRI1BumxDz7UkuPKrdNol6M3Psrloco6IzdRdHGtbh6SSD+cRFp9SaK2ejq q/Yl9ueMaqDzQbOVM/wBXwa88RixXeI0ZAGJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757718597; x=1758323397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8EcyIGZa+6ToxzyxPuYk0yjX8tMoF6H8xGiBH9NLpZE=; b=r2z5Ezg7itN8NwZFBRQrNJtjXwhbBj+AViZLWAqZsPTFUqXFBmAn86TZIeFQqICWAA mHI0qfaGMUAHH/QPEtZhqZzy+ntAmAg9fihrMP7q57iudhiCLG5qWttKbOx4FGMbHJu+ 6cXV+bHTsIaTrAil4t98ND/HblH/pYvKGU8i2dTWkWN82UuudGRAVkTM96VMiHS8Bztg 9A59eNv8Oo+4hVZZE13ADw2naUMCJ+CRCqMMpCJNtjjvQ5uGN/IRn+GdX1kGtdOwxWmH cvNTYESootc7uRAVpkQuSzHnnelbTtnUpF2S0csd4DTYX5XGzU8L9GEUIj2ize4iG15G hfAg== X-Forwarded-Encrypted: i=1; AJvYcCXfWmqWaBMl0FK6SDfnuHsc3X8HjEuS2XfDeP/ZrYp0WDmi4Tt7cuvP/3GIIE0wC9e6NE1wUPjqYsFUjRQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxK4BgHwaeDrS4fnTXm+19xOQg76YC7ZO+SoiCvxYuhnV3aYkOl UD3pCaFkqrP5hh/Lnffe9UWM2qvFTQzM34NCbXtqZkjs/FyTeGgganvwdTFdE0N+n5WnTvB5LgL VVn0= X-Gm-Gg: ASbGnctDMo4RW/MeEZgLjrf5MJp2w+yxIA2VMnFO/5YLmsa2DAIyoiTIAWsAFkJPR06 tDKdIUteVdizMXjXfSJChZ821ELiNnx7WdTeaaEnP/PhqVXk1W6GC/iftcN3Ep9uusl0YVFgqkk uwPUvFOj998j3rhRrQJ6Yy69dTp4OqZeHxUw1BP+iQ9E53QTPNkiCMiO9/K4p5fwA9WlHsXbZio Ji//1Wv9BbCU6f4AfEU13i8NPVd0FKwpwzdqGYOSdX+s7GF9+oXtejVeEJ2z5Uxfdr0LyI30fgR dmDv/qDiamn2Lu5epKWzBWT9WgauQcvizPuhughifPjmaDCNquEu6zwk5qqnTxiU4MfZhwL2xab TbbS09zKBslD4K5WXRtMdVwYMJGZEJ1ub+6rV2TUE0gSE3zEPNJ1rwUeSXD8= X-Google-Smtp-Source: AGHT+IF2cmiYrFQ1xKWdEqefxU7NdVKHQQ304cYE/Le3s9iB7z7uuIXrlH2bNcZ2AM03GLoo+rEoOg== X-Received: by 2002:a17:90a:fc4d:b0:329:e729:b2a1 with SMTP id 98e67ed59e1d1-32de4fa1c8bmr5042000a91.35.1757718597437; Fri, 12 Sep 2025 16:09:57 -0700 (PDT) Received: from localhost ([2a00:79e0:2e14:7:e464:c3f:39d8:1bab]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-32dea223ddasm1310790a91.2.2025.09.12.16.09.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 16:09:56 -0700 (PDT) From: Brian Norris To: Bjorn Helgaas , Luis Chamberlain , Petr Pavlu , Daniel Gomez Cc: linux-pci@vger.kernel.org, David Gow , Rae Moar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Johannes Berg , Sami Tolvanen , Richard Weinberger , Wei Liu , Brendan Higgins , kunit-dev@googlegroups.com, Anton Ivanov , linux-um@lists.infradead.org, Brian Norris Subject: [PATCH 3/4] um: Select PCI_DOMAINS_GENERIC Date: Fri, 12 Sep 2025 15:59:34 -0700 Message-ID: <20250912230208.967129-4-briannorris@chromium.org> X-Mailer: git-send-email 2.51.0.384.g4c02a37b29-goog In-Reply-To: <20250912230208.967129-1-briannorris@chromium.org> References: <20250912230208.967129-1-briannorris@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is useful especially for KUnit tests, where we may want to dynamically add/remove PCI domains. Signed-off-by: Brian Norris --- arch/um/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 9083bfdb7735..7fccd63c3229 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig @@ -38,6 +38,7 @@ config UML select HAVE_ARCH_TRACEHOOK select HAVE_SYSCALL_TRACEPOINTS select THREAD_INFO_IN_TASK + select PCI_DOMAINS_GENERIC if PCI =20 config MMU bool --=20 2.51.0.384.g4c02a37b29-goog From nobody Thu Oct 2 18:06:25 2025 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC34F28726D for ; Fri, 12 Sep 2025 23:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718601; cv=none; b=WGX9K7ind/z3ouCfGxPE95As0Vj+Qkm6x4NIM2wN7y9/WMi3NAl9617zsaCzH6t6idxCEKRebFlBwDfZKnS/4I9AOsNpQl5Nn/icM4hmv7ZiZc5+FqXXbeLjjHfK+p0rCa7GLrarKI/U0QDanEoqBhwgGNRf9n7zqqfM7fSoaGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757718601; c=relaxed/simple; bh=YEh//s+EtsJjGeLO13TxNSxxYq8mSsN2ket2o0T8fSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZFNHfEcMAdzEb8SR0i9XzqTEwG/ZZRxwDMyfSZsQaPxBJusF4FeagvtxzjRse4PUgyMRhVZZkGjtXv5huGiGrOlfGOXYokXjlu21UuKihFVY3Prw71+nVIFQB0VQSFu58Iymjn4Dkblus1tGfJwpQReX7tOhivm8JXWy6lvNm5I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KQRUMNRz; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KQRUMNRz" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-32df682cba2so545153a91.0 for ; Fri, 12 Sep 2025 16:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1757718599; x=1758323399; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1aqQsfYpqczFMN6xd995B9cIuPxzc6IeMNO1DIuGzJc=; b=KQRUMNRzLQIwOB9SGgCZ1b7r6/r4gdYltSkJpKKYpVE0gy/yOkd/lgR2sxXv0RsNZs bb1tIWazv+Bj/yXnD8NLciEBJU/5oUttJVhftH88p4beIUfOkrE+fCxcM1ez6l63Qa0y NgQA7SH+iE4cEOkAMfz/iB2jsQ9aTcB8BQbYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757718599; x=1758323399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1aqQsfYpqczFMN6xd995B9cIuPxzc6IeMNO1DIuGzJc=; b=cOueFUjdqlCVw27/NYsAsqRuhiAYc0VqyIb265Ris0Gd/ES1qiFZtjW5hhkW10bCWr 6W3xfygIHl+AbKZL/Wvlw21mAdIwVj4EpW4zD/Au97cnJdfjJn19LCodUAvEZyIavY4Z 2z+6V+z70eRioV9ZJDwqH0w/O+R1pcYo0rbtSDwzBRs2ATpDK9ANimzzdQ3dh6O9umUN IMFszEvpccsUNVVxNiKN3qaDAroT+6TptKIFsLQpzb2GvsDG7lyFvPfbbOTZ2HkEi54Y qDPBp+KR0RZu2SJQHW4A0sU2vsEGgCgpqJNaNghvzCXps1ScwWfFurK5/8D3tA1M3iVk LyAQ== X-Forwarded-Encrypted: i=1; AJvYcCUd3aXw9AS0woUmemvbwyrL6hS4rHS0vAAEvkjXpOjTtSxgZuSW1Q3dVXa1Y6v+VNPslzXEqlXMnyVM79E=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/YBQnRLeheVNuWOEptxyu7+p3n/j5adwngVGgHnmoPnxI+V4P 9vN0y3ikX1fs5l8JqeGOBmKNuOR6mGDgnsnLhHGGah3pjMqkfobf/vC/XK2tJVk5Ig== X-Gm-Gg: ASbGncvbaCfaTq8CnjuA4Rj0FpJlKF+Ugfq88Les021vr4LxPkBIsaCR7gp3lGmzuM/ NverJiM+UPUBpuC7UHLBKX0REhOVu70+Kxdtdwyom856yd8R+alHajENVB+q6Z2hSpYyDTygMkz JwKtf0BJUPoneLc41hdMVkmrIV24ygheht0DmD9gkvQc7KDzQttlpnCrIf7C/3WKXLAVlmUbpzZ WJBAI2nosHptd/8Qh1amzhPnbccW69a9g6o4/RtvUcBHFDd/O+RysLLlK7Gj7h9LTkj/ybkyxxM gRZ9fyJdUuKXh2Jv+nV73+VkqTPaxTmUsfLTQWNL25OoLbieehNtdKpxlenc8AveIqMV12TRpt+ 3XCJTpGM5xZLUadFR/f2oafDNv4DrUJ9+lTIMJ2K70ohGPmqyInCbLllyHu0= X-Google-Smtp-Source: AGHT+IHahHShoB5Ii1WzvFIbd2LUrSYt+MXYAQPhHq31+WasztFuE5rlFSFzEb7dWV7UvuA2EIiQ1Q== X-Received: by 2002:a17:90b:4d0e:b0:327:53f0:6368 with SMTP id 98e67ed59e1d1-32de4b88595mr5567635a91.2.1757718599221; Fri, 12 Sep 2025 16:09:59 -0700 (PDT) Received: from localhost ([2a00:79e0:2e14:7:e464:c3f:39d8:1bab]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-b54a35b7e31sm5643608a12.11.2025.09.12.16.09.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 16:09:58 -0700 (PDT) From: Brian Norris To: Bjorn Helgaas , Luis Chamberlain , Petr Pavlu , Daniel Gomez Cc: linux-pci@vger.kernel.org, David Gow , Rae Moar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Johannes Berg , Sami Tolvanen , Richard Weinberger , Wei Liu , Brendan Higgins , kunit-dev@googlegroups.com, Anton Ivanov , linux-um@lists.infradead.org, Brian Norris Subject: [PATCH 4/4] kunit: qemu_configs: Add PCI to arm, arm64 Date: Fri, 12 Sep 2025 15:59:35 -0700 Message-ID: <20250912230208.967129-5-briannorris@chromium.org> X-Mailer: git-send-email 2.51.0.384.g4c02a37b29-goog In-Reply-To: <20250912230208.967129-1-briannorris@chromium.org> References: <20250912230208.967129-1-briannorris@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To get some more test coverage on PCI tests. Signed-off-by: Brian Norris --- tools/testing/kunit/qemu_configs/arm.py | 1 + tools/testing/kunit/qemu_configs/arm64.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/testing/kunit/qemu_configs/arm.py b/tools/testing/kunit/= qemu_configs/arm.py index db2160200566..101d67e5157c 100644 --- a/tools/testing/kunit/qemu_configs/arm.py +++ b/tools/testing/kunit/qemu_configs/arm.py @@ -3,6 +3,7 @@ from ..qemu_config import QemuArchParams QEMU_ARCH =3D QemuArchParams(linux_arch=3D'arm', kconfig=3D''' CONFIG_ARCH_VIRT=3Dy +CONFIG_PCI=3Dy CONFIG_SERIAL_AMBA_PL010=3Dy CONFIG_SERIAL_AMBA_PL010_CONSOLE=3Dy CONFIG_SERIAL_AMBA_PL011=3Dy diff --git a/tools/testing/kunit/qemu_configs/arm64.py b/tools/testing/kuni= t/qemu_configs/arm64.py index 5c44d3a87e6d..ba2b4e660ba7 100644 --- a/tools/testing/kunit/qemu_configs/arm64.py +++ b/tools/testing/kunit/qemu_configs/arm64.py @@ -2,6 +2,7 @@ from ..qemu_config import QemuArchParams =20 QEMU_ARCH =3D QemuArchParams(linux_arch=3D'arm64', kconfig=3D''' +CONFIG_PCI=3Dy CONFIG_SERIAL_AMBA_PL010=3Dy CONFIG_SERIAL_AMBA_PL010_CONSOLE=3Dy CONFIG_SERIAL_AMBA_PL011=3Dy --=20 2.51.0.384.g4c02a37b29-goog