migrate on fault for device pages
Subsystems (13)
v18 cover migrate on fault for device pages
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1. hmm_range_fault() - fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pages
Or:
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) call hmm_range_fault() to fault pages in
b) call migrate_vma_*() again to migrate now present pages
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so hmm_range_fault() can find a non-present page to fault in and once again to setup the migration).
It is also tricky to code correctly. Today, drivers such as Xe implement migrate-on-fault through multiple HMM page-table walks and migrate_vma calls. This requires additional presence checks, range-size adjustments, and retries to handle non-present pages, partial migration collection, and concurrent page-table changes. The resulting complexity and repeated walks are consequences of the missing MM primitive.
This series allows faults to be resolved and pages collected for migration in a single walk, simplifying the implementation and reducing the race windows between separate operations.
One page table walk could cost over 1000 cpu cycles on x86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested. The current collector can't fault-in, so add a HMM based collector that can do the same as current one, and additionally fault in if asked.
Add a new flag to HMM APIs, HMM_PFN_REQ_MIGRATE, which asks hmm_range_fault() to prepare the pages for migration during fault handling. For the migrate_vma_setup() call paths, new flags, MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE, add fault handling to migration.
This series also avoids a problem in the current collector, where a racing MADV_DONTNEED could make the collecting arrays overflow. Collecting into an address-indexed hmm_pfns array, with stale entries rolled back on revisit, removes that class of append overruns. Fixes like "mm/migrate_device: don't collect a range twice", now in rc5, address it case by case in the old collector (that patch prevents the crash, but entries collected before the lock was dropped are not checked again - that would need rollback and re-collect). The new collector covers the cases fixed in rc5 as well, and the series has been checked with AI review (sashiko) for both the existing non-faulting flows and the new faulting ones.
An extra benefit of migrating with hmm_range_fault() path is the migrate_vma.vma gets populated by the flow, so no need to retrieve that separately.
Tested in x86-64 VM with HMM test device, passing the selftests, and verified not to have regressions for current migrate_vma_setup() callers.
For nouveau migrate-on-fault the test harness was: Fedora 44, Mesa Rusticl, and a fine-grained-system-SVM OpenCL program. Nouveau SVM is opt-in via Mesa. The OpenCL program passes a plain malloc pointer (64 pages, array of integers) to the GPU, increments each element on the GPU, and verifies the result on the CPU.
So it drives both directions of migration. With svm_migrate_on_fault=1, no migration at bind happens. The GPU used in testing was Pascal generation GP102.
LLM tools were used to identify some of the pre existing problems in current nouveau SVM implementation. This series comes with two patches, "drm/nouveau/dmem: serialize the copy channel users" and "drm/nouveau/dmem: commit migrate_to_ram() only after the copy is confirmed", which directly impacted nouveau SVM working in testing.
Quite a comprehensive HW testing was done, and with the series nouveau SVM was usable. A follow-up series will fix further pre-existing issues. Also, a follow-up fix on test_hmm.c will fix its pre existing races wrt invalidations with multiple fds, as noted by Andrew and Aveline also.
Changes in v18:
- Cover letter changes
- rebased on v7.4-rc5 (drm-tip)
- addressed all sashiko's concerns
- improved selftest robustness (patch 10)
- KSM folios are not collected (patch 06)
- added uffd checks for collect
- added guard for shadow stack areas
- split two independent nouveau dmem fixes into their own patches
(12, 13)
Sashiko's concerns in v17
https://sashiko.dev/#/patchset/20261103061629.972669-1-mpenttil%40redhat.com
Answers to sashiko's concerns:
patch 03
Q "Will this break the build when CONFIG_HMM_MIRROR=y and CONFIG_MIGRATION=n?"
A fixed in v18
Q "Can unconditionally calling memset() on range->hmm_pfns" A fixed in v18
patch 04
Q "Question about failed split and continuation after it.." A When migrating, the caller only uses the entries collected for migration, so faulting is best effort there. Since v17 the pfns are cleared on entry, so entries skipped after a failed split are reliably 0 rather than stale. v18 documents that, with HMM_PFN_REQ_MIGRATE, hmm_range_fault() may return 0 with such entries left unpopulated, and that callers check HMM_PFN_VALID/HMM_PFN_MIGRATE per entry. This mirrors migrate_vma_collect_skip().
patch 05
Q "Should the anon check happen before splitting?"
A Yes. In v18 the check moves ahead of the split at pte level. Q "Should we also reject folio_test_ksm()?"
A Yes. In v18 KSM folios are not collected, as in Chris Mason's pending fix for migrate_vma_collect_pmd(): rmap_walk_ksm() may miss a fresh KSM mapping when restoring the migration entry. When faulting, KSM pages weren't collected anyway (never PageAnonExclusive). The second mapping's stale pfn in hmm_pfns is covered by the notifier:
try_to_migrate() unmaps it with an MMU_NOTIFY_CLEAR invalidation, so the caller's mmu_interval_read_retry() fails before it maps the device from that pfn.
Q "Again question about failed split..."
A A failed split skips the rest of that pmd range, as migrate_vma_collect_skip() does today, and the walk continues with the next pmd. v18 documents that with HMM_PFN_REQ_MIGRATE faulting is best effort and that such entries are left 0 even with HMM_PFN_REQ_FAULT, so callers check HMM_PFN_VALID/HMM_PFN_MIGRATE per entry. Since the pfns are cleared on entry, the skipped entries are reliably 0 rather than stale.
patch 06
Q "Can calling folio_lock(folio) in migrate_vma_split_folio() cause an ABBA deadlock when another folio is already held locked in the walk?" A The blocking lock came from the existing migrate_vma_split_folio(), which has the same exposure. In v18 the split path only trylocks, like collection; a busy folio is not migrated and is handled like a failed split.
Q "How are PMD-mapped MEMORY_DEVICE_COHERENT folios handled here?" A v18 applies the pte-level checks at the pmd level too: a device-coherent THP needs MIGRATE_VMA_SELECT_DEVICE_COHERENT and a matching pgmap owner, and SELECT_SYSTEM no longer picks it up. Q "Should hmm_vma_handle_migrate_prepare_pmd() check folio_test_anon(folio) before collecting or splitting a PMD-mapped folio?"
A Fixed together with the pte level fix.
Q "Could hmm_vma_walk_pmd() similarly loop locally to the again label when hmm_vma_handle_migrate_prepare_pmd() splits the PMD?" A It could, as the pte level does, but returning -EBUSY is deliberate. The split sends an MMU_NOTIFY_CLEAR invalidation, so with a notifier the walk ends with -EBUSY, and the caller aborts and retries the range under its own retry policy, including its timeout. That costs one extra pass per huge pmd split, which is rare. Without a notifier, the retry loop in hmm_range_fault_locked() walks the range again as PTEs.
patch 08
Q "When hmm_range_fault_locked() aborts with -EBUSY.."
A Same as the patch 03 comment, fixed in v18.
Q "If the migration PTEs or PTE page table covering [range->start, addr) were zapped...can those earlier collected entries in range->hmm_pfns ever be revisited or rolled back, or will they leak folio locks and references?"
A No leak: entries collected below last stay marked in range->hmm_pfns, and the caller completes or aborts them through migrate_hmm_range_setup(), migrate_vma_pages() and migrate_vma_finalize(), which unlocks and puts every collected folio. If a migration pte was zapped in the meantime, remove_migration_ptes() just finds nothing, the same as when that happens between migrate_vma_setup() and migrate_vma_finalize() today. The zap also invalidates the range, so the caller's mmu_interval_read_retry() keeps it from mapping the stale entry. Rollback on revisit is only needed for entries the walk visits again.
Q "if migration PTEs or the PTE table in [start, end) vanished during that window, won't returning 0 without re-walking [start, end) skip rolling back those collected folios,..."
A In v18 the split path only trylocks, taken before the PTE lock is dropped, so there's no sleep there any more. Entries collected in [start, addr) that aren't revisited stay marked and are released by the caller's migrate_vma_pages()/migrate_vma_finalize(), even if their migration ptes vanished; rollback is only needed for entries the walk visits again. Leaving the rest of the pmd range 0 after a failed split is the documented best effort behaviour, as in migrate_vma_collect_skip().
patch 09
Q "Are MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE in enum migrate_vma_info and their handling in migrate_vma_setup() needed when there are no in-tree callers?"
A They're kept on purpose: they are the migrate-on-fault entry point for existing migrate_vma_setup() users. Without them, pages that aren't present (swapped out, or another device's private pages) are skipped, and shared pages are migrated as they are, read-only for every process mapping them. With the flags, migrate_vma_setup() faults the missing pages in (and MIGRATE_VMA_WRITE breaks the sharing first) in the same walk, instead of needing a separate hmm_range_fault() or GUP pass first. It's two flag checks on top of the hmm_range_fault() path that test_hmm and nouveau use directly. The v18 commit log explains this.
Q "Question about possible build break.."
A The build issue with CONFIG_MIGRATION=n is fixed in v18 (the pgmap_owner check goes through a migrate.h helper with a !CONFIG_MIGRATION stub). With CONFIG_MIGRATION=y and CONFIG_DEVICE_MIGRATION=n it builds and is harmless:
the collection functions in mm/hmm.c are stubs then, and migrate_hmm_range_setup()/migrate_vma_*() aren't built, so there can be no migrating caller. The helpers follow the existing migrate.h convention, where the migrate_vma API is declared under CONFIG_MIGRATION and built with CONFIG_DEVICE_MIGRATION.
Q This is the memset/-EBUSY issue a third time.
A Fixed in v18 (same as patch 03 comment).
Q "while hmm_do_fault() runs, a concurrent MADV_DONTNEED can zap migration ptes we already collected below last. The walk doesn't re-check them, so finalize finds no pte to restore and frees dst. Is that a use-after-free if the device has already mapped dst?" A No. The same window exists in mainline between migrate_vma_setup() and migrate_vma_finalize(). The zap sends an invalidation, so a driver's mmu notifier sequence check fails before it maps device memory. nouveau and test_hmm do that check. Collected entries stay collected and finalize releases them, so no rollback is needed.
Q.1 "migrate_vma_split_folio()-> folio_lock() possible deadlock?" Q.2 "when HMM_PFN_REQ_FAULT is set, a migrating walk can meet another thread's migration entry and wait on it in hmm_do_fault(), while still holding the folios it has already collected. Can that deadlock?" A.1 migrate_vma_split_folio() now takes folio_trylock.
A.2 Fixed in v18: a migrating walk never waits for another migration. Such entries are left uncollected (best effort).
Q "the pmd level has no folio_test_anon() check, so could a file or shmem THP be collected or split?"
A That's already fixed in v18 (from previous comments). hmm_vma_handle_migrate_prepare_pmd() now skips non-anonymous THPs before locking, collecting or splitting them, as the pte level does.
Q "a failed split returns 0, which leaves the rest of the pmd unwalked. After a restart, it also leaves entries collected above addr in the earlier pass unchecked and not rolled back."
A Skipping the rest is the documented best-effort behaviour. Entries collected earlier, above or below addr, stay collected and are released by the caller's finalize, so no rollback is needed for entries that aren't revisited.
Q "a writable protnone pte or pmd is collected without HMM_PFN_WRITE, so MIGRATE_PFN_WRITE is lost.."
A Valid. v18 sets HMM_PFN_WRITE from the pte or pmd write bit when collecting, as mainline did.
patch 10
Q "test_hmm retries inside dmirror_range_fault() without aborting the collected entries. Does the memset then hide our own entries, causing a self-deadlock and leaks? And does a timeout leave stale state from the previous chunk?"
A Both are fixed in v18. The migrate case returns straight to do_fault_and_migrate(), which aborts before retrying. The timeout can't fire before that single hmm_range_fault() call.
Q "if read_retry trips after migrate_vma_pages(), the dmirror mapping is skipped. The retry doesn't remap pages already committed, so the read-back in the ioctl fails with -ENOENT."
A Valid for the test. The read-back now faults in unmapped pages, as dmirror_read() does and as a real device would.
Q "can two 64-entry pfn arrays on the stack exceed -Wframe-larger-than, as happened before in test_hmm?"
A v18 allocates src_pfns/dst_pfns with kvzalloc_objs(), as dmirror_migrate_to_device() does.
patch 11
Q "Could this wording be clarified regarding what needs to be called when hmm_range_fault() returns an error?.."
A Documentation changes in v18.
patch 12
Q "dmem and TTM share ttm.chan, but dmem takes only migrate.lock while TTM takes only cli->mutex, so can they interleave pushes and corrupt fences?"
A That's pre-existing in mainline, where dmem had no lock at all. This series serializes the dmem users. Using cli->mutex would ABBA with svmm->mutex through reclaim and the mmu notifier.
The proper fix is a separate dmem channel, outside this series. Q "fence_done() now returns int, but nobody uses the result, and the commit log leaves out migrate.lock and the migrate_to_ram() rework." A Agreed on both. v18 restores the void fence_done() and describes both changes in the logs (now split into their own patches, 12 and 13).
Q "a pending replayable GPU fault stalls the copy engine. In migrate_to_ram() nobody replays, because the fault worker is blocked on our migration entry. In migrate on fault, the GPU can refault after the early replay. Does the fence poll then stall 30 s?"
A Case 1 is the same dependency as mainline, which then commits the unfinished copy, whereas we abort safely after the deadline. Case 2 follows the order that worked on HW: replay before the wait, and map only after the copy is confirmed.
A timeout there aborts and falls back to mapping in place. Q "the abort clears MIGRATE_PFN_MIGRATE but leaves dst[i] set, and __migrate_device_pages() doesn't check MIGRATE when both pages exist. Doesn't that still move the mapping, flags and memcg to the destination, corrupting the source that finalize restores?" A Yes, fixed. v18's abort clears dst[i] (unlocking the destination and keeping its reference, so it's still leaked), so migrate_vma_pages() leaves the source alone.
Q "in the fault path, the abort keeps the VRAM dst but lets finalize release the DMA-mapped system src, so isn't it pinning the wrong folio? And doesn't a leaked VRAM page hang driver teardown?" A It's the right folio. The copy engine only writes dst, and src is restored as the live page, where a stale read can't corrupt anything. The teardown point is true: it's the cost of not freeing memory a wedged engine might write, and a wedged engine needs a GPU reset anyway.
Q "a GPU write fault on a read-only device-private VRAM page owned by nouveau is reported without WRITE. Is it then mapped read-only and replayed, refaulting forever?"
A That's pre-existing. Mainline hmm_range_fault() doesn't fault the caller's own device-private pages for write, and mainline nouveau_range_fault() maps them read-only in the same way. The fix belongs in hmm_range_fault(), as a separate change.
Q "should nouveau.svm_migrate_on_fault be documented in kernel-parameters.txt?"
A No. No nouveau module parameter is listed there. They're documented through MODULE_PARM_DESC, which this one has, and it depends on the experimental SVM option.
Q "why does bind skip the migration when svm_migrate_on_fault is on? It makes an explicit bind a no-op: pages already mapped in system memory never migrate, and THPs are split."
A It's intentional. The parameter selects a simple, fully lazy policy where everything migrates on demand at GPU fault. Pages mapped in place and compound migration are things for the better policy the commit log already mentions.
Link to v17:
https://lore.kernel.org/linux-mm/[email protected]/
Mika Penttilä (14):
mm/Kconfig: changes for migrate on fault for device pages
mm: add helper to convert HMM pfn to migrate pfn
mm/hmm: preparations for HMM to participate in migration mm/hmm: do the plumbing for HMM to participate in migration mm/hmm: implement rollback for device page migration in HMM pagewalk mm/hmm: migrate collection in HMM pagewalk - pte level mm/hmm: migrate collection in HMM pagewalk - pmd level mm/hmm: add lazy MMU mode support for migration in HMM pagewalk
mm: enable device page migration from HMM pagewalk lib/test_hmm: add a new testcase for the migrate on fault Documentation/mm/hmm: document migration through hmm_range_fault() drm/nouveau/dmem: serialize the copy channel users drm/nouveau/dmem: commit migrate_to_ram() only after the copy is
confirmed
drm/nouveau/svm: add support for migrate on fault
Documentation/mm/hmm.rst | 123 +- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +- drivers/gpu/drm/drm_pagemap.c | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 467 ++++++- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 + drivers/gpu/drm/nouveau/nouveau_svm.c | 164 ++- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + include/linux/hmm.h | 32 +- include/linux/migrate.h | 75 +- include/linux/mmu_notifier.h | 3 +- lib/test_hmm.c | 217 +++- lib/test_hmm_uapi.h | 21 +- mm/Kconfig | 1 + mm/hmm.c | 1222 +++++++++++++++++- mm/migrate_device.c | 648 ++-------- tools/testing/selftests/mm/hmm-tests.c | 73 ++ 16 files changed, 2380 insertions(+), 687 deletions(-)
drm-tip
base-commit: 87312a33227c3d67b5dd786d81e093ca7a0cba56 --
2.55.0
PATCH v18 1/14 mm/Kconfig: changes for migrate on fault for device pages
From: Mika Penttilä <[email protected]>
HMM depends on MMU notifiers. With the unified HMM/migrate_device page table walk migrate_device needs HMM enabled. Enable them explicitly to avoid breaking random configs.
--- mm/Kconfig | 1 + 1 file changed, 1 insertion(+)
mm/Kconfig +1 -0
@@ -682,6 +682,7 @@ config MIGRATION config DEVICE_MIGRATION def_bool MIGRATION && ZONE_DEVICE + select HMM_MIRROR config ARCH_ENABLE_HUGEPAGE_MIGRATION bool
Signature · 1 line
2.55.0
PATCH v18 2/14 mm: add helper to convert HMM pfn to migrate pfn
In reply to [email protected]From: Mika Penttilä <[email protected]>
The unified HMM/migrate_device pagewalk does the "collecting" on the HMM side, so we need a helper to transfer pfns to the migrate_vma world.
--- include/linux/hmm.h | 29 +++++++++++++++++----- include/linux/migrate.h | 3 ++- mm/migrate_device.c | 55 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 7 deletions(-)
include/linux/hmm.h +23 -6
@@ -13,6 +13,8 @@struct mmu_interval_notifier ; +struct migrate_vma ; +/* * On output: * 0 - The page is faultable and a future call with
@@ -27,13 +29,22 @@ struct mmu_interval_notifier;* HMM_PFN_P2PDMA_BUS - Bus mapped P2P transfer * HMM_PFN_DMA_MAPPED - Flag preserved on input-to-output transformation * to mark that page is already DMA mapped +* HMM_PFN_MIGRATE - The entry is to be migrated. Note, HMM_PFN_MIGRATE +* alone without HMM_PFN_VALID denotes the +* empty page. +* This flag optionally together with HMM_PFN_COMPOUND +* are indicators for migrate_hmm_range_setup() to +* setup the migrate pfns. +* HMM_PFN_COMPOUND - The entry represents a > 0 order page * * On input: -* 0 - Return the current state of the page, do not fault it. -* HMM_PFN_REQ_FAULT - The output must have HMM_PFN_VALID or hmm_range_fault() -* will fail -* HMM_PFN_REQ_WRITE - The output must have HMM_PFN_WRITE or hmm_range_fault() -* will fail. Must be combined with HMM_PFN_REQ_FAULT. +* 0 - Return the current state of the page, do not fault it. +* HMM_PFN_REQ_FAULT - The output must have HMM_PFN_VALID or hmm_range_fault() +* will fail +* HMM_PFN_REQ_WRITE - The output must have HMM_PFN_WRITE or hmm_range_fault() +* will fail. Must be combined with HMM_PFN_REQ_FAULT. +* HMM_PFN_REQ_MIGRATE - For default_flags only, request to migrate the range, +* according to hmm_range.migrate.flags */ enum hmm_pfn_flags {/* Output fields and flags */
@@ -48,11 +59,15 @@ enum hmm_pfn_flags {HMM_PFN_P2PDMA =1UL << (BITS_PER_LONG -5 ),HMM_PFN_P2PDMA_BUS =1UL << (BITS_PER_LONG -6 ), -HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG -11 ), +/* Migrate request */ +HMM_PFN_MIGRATE =1UL << (BITS_PER_LONG -7 ), +HMM_PFN_COMPOUND =1UL << (BITS_PER_LONG -8 ), +HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG -13 ),/* Input flags */ HMM_PFN_REQ_FAULT =HMM_PFN_VALID ,HMM_PFN_REQ_WRITE =HMM_PFN_WRITE , +HMM_PFN_REQ_MIGRATE =HMM_PFN_MIGRATE , HMM_PFN_FLAGS = ~((1UL << HMM_PFN_ORDER_SHIFT) - 1), };
@@ -107,6 +122,7 @@ static inline unsigned int hmm_pfn_to_map_order(unsigned long hmm_pfn)* @default_flags: default flags for the range (write, read, ... see hmm doc) * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter * @dev_private_owner: owner of device private pages +* @migrate: structure for migrating a range of a VMA */ struct hmm_range {struct mmu_interval_notifier *notifier;
@@ -117,6 +133,7 @@ struct hmm_range {unsigned long default_flags;unsigned long pfn_flags_mask;void *dev_private_owner; +struct migrate_vma *migrate; };/*
include/linux/migrate.h +2 -1
@@ -3,6 +3,7 @@#define _LINUX_MIGRATE_H#include <linux/mm.h> +#include <linux/hmm.h> #include <linux/mempolicy.h> #include <linux/migrate_mode.h> #include <linux/hugetlb.h>
@@ -203,7 +204,7 @@ void migrate_device_pages(unsigned long *src_pfns, unsigned long *dst_pfns, unsigned long npages);void migrate_device_finalize (unsigned long *src_pfns,unsigned long *dst_pfns,unsigned long npages); - +void migrate_hmm_range_setup (struct hmm_range *range);#endif /* CONFIG_MIGRATION */ #endif /* _LINUX_MIGRATE_H */
mm/migrate_device.c +55 -0
58 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v18 3/14 mm/hmm: preparations for HMM to participate in migration
In reply to [email protected]From: Mika Penttilä <[email protected]>
For migration to happen after hmm_range_fault(), the vma has to be retrieved. Luckily, pagewalk already resolves that for us, so just have to save it for further use. For migration, mmap_lock has to be held for the whole operation, so vma stays stable. In case lock-drop behavior is requested, return an error while migrating. Also, rename some struct hmm_vma_walk fields to solve namespace collisions, and we are later introducing more xxlocked fields so be unambiguous.
Take care also of firing the mmu_notifier when migrating, and don't wait for another migration's entries while migrating. A migrating walk re-walks while holding collected folios and may have no notifier to end it (migrate_vma_setup()), so a fatal signal pending after a fault ends it with -EINTR. The vma restrictions match migrate_vma_setup(), and shadow stack vmas are refused as well, as in the pending "mm/migrate_device: refuse to migrate shadow stacks".
When migrating, requests come only from range->default_flags (pfn_flags_mask must be 0), so the input range->hmm_pfns carry nothing and are cleared at the start of hmm_range_fault(). Collected entries (HMM_PFN_VALID | HMM_PFN_MIGRATE) can then be told apart reliably during the walk and on rollback. This also means that HMM_PFN_INOUT_FLAGS such as HMM_PFN_DMA_MAPPED are not preserved across a migrating call, which is intended since the pages are being replaced.
Also, prepare for differences of how mm_struct * is retrieved in fault and migrate_vma paths.
Migration is still stubbed off here: hmm_select_migrate() returns MIGRATE_VMA_SELECT_NONE until a later patch enables it, so none of this takes effect yet. The enum migrate_vma_direction becomes migrate_vma_info, as it also carries the fault flags added later, and gets MIGRATE_VMA_SELECT_NONE. The small helpers hmm_select_migrate(), hmm_fill_migrate_vma() and hmm_range_fault_mm() live in migrate.h next to struct migrate_vma, which they use, with stubs for !CONFIG_MIGRATION.
--- include/linux/hmm.h | 7 +- include/linux/migrate.h | 66 ++++++++++++- lib/test_hmm.c | 2 +- mm/hmm.c | 208 +++++++++++++++++++++++++++++++++++----- 4 files changed, 257 insertions(+), 26 deletions(-)
include/linux/hmm.h +5 -2
@@ -40,11 +40,14 @@ struct migrate_vma;* On input: * 0 - Return the current state of the page, do not fault it. * HMM_PFN_REQ_FAULT - The output must have HMM_PFN_VALID or hmm_range_fault() -* will fail +* will fail, except when migrating, which is best +* effort (see HMM_PFN_REQ_MIGRATE) * HMM_PFN_REQ_WRITE - The output must have HMM_PFN_WRITE or hmm_range_fault() * will fail. Must be combined with HMM_PFN_REQ_FAULT. * HMM_PFN_REQ_MIGRATE - For default_flags only, request to migrate the range, -* according to hmm_range.migrate.flags +* according to hmm_range.migrate.flags. Collection, +* and faulting with it, is best effort, see +* hmm_range_fault(). */ enum hmm_pfn_flags {/* Output fields and flags */
include/linux/migrate.h +65 -1
90 lines not on this page · raw message
lib/test_hmm.c +1 -1
@@ -145,7 +145,7 @@ static bool dmirror_is_private_zone(struct dmirror_device *mdevice) HMM_DMIRROR_MEMORY_DEVICE_PRIVATE); } -static enum migrate_vma_direction +static enum migrate_vma_info dmirror_select_device (struct dmirror *dmirror) { return (dmirror->mdevice->zone_device_type ==
mm/hmm.c +186 -22
319 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v18 4/14 mm/hmm: do the plumbing for HMM to participate in migration
In reply to [email protected]From: Mika Penttilä <[email protected]>
Do the preparations in hmm_range_fault() and pagewalk callbacks to do the "collecting" part of migration, needed for migration.
These steps include locking for pmd/pte if migrating, and calling the still dummy hmm_vma_handle_migrate_prepare_pmd() and hmm_vma_handle_migrate_prepare() functions in the pagewalk.
When doing migration, have to have pmd/pte table locked for the duration of both hmm_vma_handle*() and hmm_vma_handle_migrate_prepare*() walks, and unlock when handling the faults.
Besides the locking and the stub calls, when migrating hmm_pfns_fill() marks holes in anonymous vmas with HMM_PFN_MIGRATE (and HMM_PFN_COMPOUND for a pmd sized hole with MIGRATE_VMA_SELECT_COMPOUND), as migrate_vma_collect_hole() does, and a fault is recorded by the walk callback and handled outside the walk with the page table locks dropped. The HMM_FAULT_UNLOCKED path now leaves the loop instead of returning, so every exit goes through hmm_vma_post_range_fault(). It does nothing there: that path doesn't migrate, since migration refuses mmap lock drop.
--- mm/hmm.c | 302 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 255 insertions(+), 47 deletions(-)
mm/hmm.c +255 -47
@@ -29,6 +29,7 @@#include <linux/pci-p2pdma.h> #include <linux/mmu_notifier.h> #include <linux/memory_hotplug.h> +#include <asm/tlbflush.h> #include "internal.h"
@@ -41,6 +42,16 @@ struct hmm_vma_walk {/* End of the range armed for migration, set when the vma is captured */ unsigned long end;unsigned long last; +/* +* For migration we need pte/pmd locked for the handle_* and +* prepare_* regions. While faulting we have to drop the locks +* and start again. ptelocked and pmdlocked hold the state +* and tell if need to drop locks before faulting. +* ptl is the lock held for pte or pmd. +*/ +bool ptelocked; +bool pmdlocked; +spinlock_t *ptl;/* fault and lock drop related fields */ bool *mmlocked;unsigned long fault_end;
@@ -62,6 +73,10 @@ struct hmm_vma_walk {*/ #define HMM_FAULT_UNLOCKED -ENOLCK +#define HMM_ASSERT_UNLOCKED (hmm_vma_walk) \ + WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \ + (hmm_vma_walk)->pmdlocked) +enum {HMM_NEED_FAULT =1 <<0 ,HMM_NEED_WRITE_FAULT =1 <<1 ,
@@ -75,14 +90,38 @@ enum { };static int hmm_pfns_fill (unsigned long addr,unsigned long end, -struct hmm_range *range,unsigned long cpu_flags) +struct hmm_vma_walk *hmm_vma_walk,unsigned long cpu_flags) { +struct hmm_range *range = hmm_vma_walk->range;unsigned long i = (addr - range->start) >>PAGE_SHIFT ; +enum migrate_vma_info minfo; +bool migrate = false; + + minfo =hmm_select_migrate (range); +if (cpu_flags !=HMM_PFN_ERROR ) { +if (minfo && (vma_is_anonymous (hmm_vma_walk->vma))) { + cpu_flags |=HMM_PFN_MIGRATE ; + migrate = true; + } + } + +if (migrate &&thp_migration_supported () && + (minfo &MIGRATE_VMA_SELECT_COMPOUND ) && +IS_ALIGNED (addr,HPAGE_PMD_SIZE ) && +IS_ALIGNED (end,HPAGE_PMD_SIZE ) && + end-addr ==HPAGE_PMD_SIZE ) { + range->hmm_pfns[i] &=HMM_PFN_INOUT_FLAGS ; + range->hmm_pfns[i] |= cpu_flags |HMM_PFN_COMPOUND ; + addr +=PAGE_SIZE ; + i++; + cpu_flags =0 ; + }for (; addr < end; addr +=PAGE_SIZE , i++) { range->hmm_pfns[i] &=HMM_PFN_INOUT_FLAGS ; range->hmm_pfns[i] |= cpu_flags; } +return 0 ; }
@@ -102,6 +141,7 @@ static int hmm_record_fault(unsigned long addr, unsigned long end,struct hmm_vma_walk *hmm_vma_walk = walk->private;WARN_ON_ONCE (!required_fault); +HMM_ASSERT_UNLOCKED (hmm_vma_walk); hmm_vma_walk->last = addr; hmm_vma_walk->fault_end = end; hmm_vma_walk->required_fault = required_fault;
@@ -186,11 +226,16 @@ static int hmm_vma_walk_hole(unsigned long addr, unsigned long end,if (!walk->vma) {if (required_fault ||hmm_select_migrate (range))return -EFAULT ; -return hmm_pfns_fill (addr, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (addr, end, hmm_vma_walk,HMM_PFN_ERROR ); } -if (required_fault) +if (required_fault) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); -return hmm_pfns_fill (addr, end, range,0 ); + } +return hmm_pfns_fill (addr, end, hmm_vma_walk,0 ); }static inline unsigned long hmm_pfn_flags_order (unsigned long order)
@@ -223,8 +268,13 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, cpu_flags =pmd_to_hmm_pfn_flags (range, pmd); required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages, cpu_flags); -if (required_fault) +if (required_fault) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); + } pfn =pmd_pfn (pmd) + ((addr & ~PMD_MASK ) >>PAGE_SHIFT );for (i =0 ; addr < end; addr +=PAGE_SIZE , i++, pfn++) {
@@ -311,6 +361,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,*/ if (hmm_select_migrate (range)) goto out; +HMM_ASSERT_UNLOCKED (hmm_vma_walk);pte_unmap (ptep); hmm_vma_walk->last = addr;migration_entry_wait (walk->mm, pmdp, addr);
@@ -318,7 +369,14 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, }/* Report error for everything else */ -pte_unmap (ptep); + +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + } +return -EFAULT ; }
@@ -335,7 +393,13 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,if (!vm_normal_page (walk->vma, addr, pte) && !is_zero_pfn (pte_pfn (pte))) {if (hmm_pte_need_fault (hmm_vma_walk, pfn_req_flags,0 )) { -pte_unmap (ptep); +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + } +return -EFAULT ; } new_pfn_flags =HMM_PFN_ERROR ;
@@ -348,7 +412,12 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,return 0 ; fault: -pte_unmap (ptep); +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + }/* Fault any virtual address we were asked to fault */ return hmm_record_fault (addr, end, required_fault, walk); }
@@ -392,13 +461,18 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start, required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 );if (required_fault) { -if (softleaf_is_device_private (entry)) +if (softleaf_is_device_private (entry)) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); + }else return -EFAULT ; } -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); }#else static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,
@@ -406,15 +480,58 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start, pmd_t pmd) {struct hmm_vma_walk *hmm_vma_walk = walk->private; -struct hmm_range *range = hmm_vma_walk->range;unsigned long npages = (end - start) >>PAGE_SHIFT ;if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 ))return -EFAULT ; -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); }#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ +#ifdef CONFIG_DEVICE_MIGRATION +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +/* Collection is implemented by later patches */ +return 0 ; +} + +static int hmm_vma_handle_migrate_prepare (const struct mm_walk *walk, +pmd_t *pmdp, +pte_t *ptep, +unsigned long addr, +unsigned long *hmm_pfn, +bool *unmapped) +{ +/* Collection is implemented by later patches */ +return 0 ; +} + +#else +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +return 0 ; +} + +static int hmm_vma_handle_migrate_prepare (const struct mm_walk *walk, +pmd_t *pmdp, +pte_t *ptep, +unsigned long addr, +unsigned long *hmm_pfn, +bool *unmapped) +{ +return 0 ; +} + +#endif +static int hmm_vma_capture_migrate_range (unsigned long start,unsigned long end,struct mm_walk *walk)
@@ -495,48 +612,118 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, {struct hmm_vma_walk *hmm_vma_walk = walk->private;struct hmm_range *range = hmm_vma_walk->range; -unsigned long *hmm_pfns = - &range->hmm_pfns[(start - range->start) >>PAGE_SHIFT ];unsigned long npages = (end - start) >>PAGE_SHIFT ; +struct mm_struct *mm = walk->vma->vm_mm; +unsigned long *hmm_pfns, *hmm_pfns_start; +enum migrate_vma_info minfo;unsigned long addr = start; +bool unmapped = false; +unsigned long i;pte_t *ptep;pmd_t pmd; +int r =0 ; + minfo =hmm_select_migrate (range); + hmm_pfns_start = &range->hmm_pfns[(start - range->start) >>PAGE_SHIFT ]; again: - pmd =pmdp_get_lockless (pmdp); -if (pmd_none (pmd)) -return hmm_vma_walk_hole (start, end,-1 , walk); + hmm_pfns = &range->hmm_pfns[(addr - range->start) >>PAGE_SHIFT ]; + hmm_vma_walk->ptelocked = false; + hmm_vma_walk->pmdlocked = false; + +if (minfo) { + hmm_vma_walk->ptl =pmd_lock (mm, pmdp); + hmm_vma_walk->pmdlocked = true; + pmd =pmdp_get (pmdp); + }else + pmd =pmdp_get_lockless (pmdp); + +if (pmd_none (pmd)) { + r =hmm_vma_walk_hole (start, end,-1 , walk); + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + }if (thp_migration_supported () &&pmd_is_migration_entry (pmd)) { +unsigned int required_fault = +hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ); + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +/* Someone else's migration: when migrating, don't wait (see pte level) */ -if (!hmm_select_migrate (range) && -hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 )) { +if (required_fault && !minfo) { hmm_vma_walk->last = addr;pmd_migration_entry_wait (walk->mm, pmdp);return -EBUSY ; } -return hmm_pfns_fill (start, end, range,0 ); +for (i =0 ; start < end; start +=PAGE_SIZE , i++) + hmm_pfns_start[i] &=HMM_PFN_INOUT_FLAGS ; + +return 0 ; } -if (!pmd_present (pmd)) -return hmm_vma_handle_absent_pmd (walk, start, end, hmm_pfns, - pmd); +if (pmd_trans_huge (pmd) || !pmd_present (pmd)) { +if (!pmd_present (pmd)) { + r =hmm_vma_handle_absent_pmd (walk, start, end, hmm_pfns_start, + pmd); +/* If not migrating we are done */ +if (r || !minfo) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + } + } -if (pmd_trans_huge (pmd)) { -/* -* No need to take pmd_lock here, even if some other thread -* is splitting the huge pmd we will get that event through -* mmu_notifier callback. -* -* So just read pmd value and check again it's a transparent -* huge or device mapping one and compute corresponding pfn -* values. -*/ - pmd =pmdp_get_lockless (pmdp); -if (!pmd_trans_huge (pmd)) - goto again; +if (pmd_trans_huge (pmd)) { +/* +* No need to take pmd_lock here if not migrating, +* even if some other thread is splitting the huge +* pmd we will get that event through mmu_notifier callback. +* +* So just read pmd value and check again it's a transparent +* huge or device mapping one and compute corresponding pfn +* values. +*/ + +if (!minfo) { + pmd =pmdp_get_lockless (pmdp); +if (!pmd_trans_huge (pmd)) + goto again; + } + + r =hmm_vma_handle_pmd (walk, start, end, hmm_pfns_start, pmd); + +/* If not migrating we are done */ +if (r || !minfo) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + } + } + + r =hmm_vma_handle_migrate_prepare_pmd (walk, pmdp, start, end, hmm_pfns_start); -return hmm_vma_handle_pmd (walk, addr, end, hmm_pfns, pmd); +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } + +return r; + } + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; }/*
@@ -546,24 +733,45 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,* recover. */ if (pmd_bad (pmd)) { -if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 )) +if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ))return -EFAULT ; -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); } - ptep =pte_offset_map (pmdp, addr); +if (minfo) { + ptep =pte_offset_map_lock (mm, pmdp, addr, &hmm_vma_walk->ptl); +if (ptep) + hmm_vma_walk->ptelocked = true; + }else { + ptep =pte_offset_map (pmdp, addr); + }if (!ptep) goto again; +for (; addr < end; addr +=PAGE_SIZE , ptep++, hmm_pfns++) { -int r; r =hmm_vma_handle_pte (walk, addr, end, pmdp, ptep, hmm_pfns);if (r) { -/* hmm_vma_handle_pte() did pte_unmap() */ +/* hmm_vma_handle_pte() did pte_unmap() / pte_unmap_unlock */ +if (unmapped) +flush_tlb_range (walk->vma, start, addr);return r; } + +/* Collection is added by later patches: a no-op until then */ +hmm_vma_handle_migrate_prepare (walk, pmdp, ptep, addr, hmm_pfns, &unmapped); } -pte_unmap (ptep -1 ); + +if (unmapped) +flush_tlb_range (walk->vma, start, addr); + +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep -1 , hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep -1 ); + } +return 0 ; }
@@ -710,7 +918,7 @@ static int hmm_vma_walk_test(unsigned long start, unsigned long end, (end - start) >> PAGE_SHIFT, 0))return -EFAULT ; -hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR );/* Skip this vma and continue processing the next vma. */ return 1 ;
@@ -862,9 +1070,9 @@ static int hmm_range_fault_locked(struct hmm_range *range, bool *locked)hmm_vma_migrate_disarm (&hmm_vma_walk); ret =hmm_do_fault (mm, &hmm_vma_walk);if (ret ==HMM_FAULT_UNLOCKED ) { -if (fatal_signal_pending (current)) -return -EINTR ; -return -EBUSY ; + ret =fatal_signal_pending (current) ? -EINTR : + -EBUSY ; +break ; }/* * A fault can return without making the entry present
Signature · 1 line
2.55.0
PATCH v18 5/14 mm/hmm: implement rollback for device page migration in HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
During the migration pagewalk, the PTE table could be cleared and/or changed into PMD leaf or even another PTE table while dropped locks.
In these cases the possibly inserted migration ptes are gone. We have to however undo the collecting done so far, so unlock the folios and drop reference taken.
During the pagewalk we notice such scenarios if going to recollect a pfn but have already committed to migrate the entry with HMM_PFN_MIGRATE, in which case do rollback. Rollback clears HMM_PFN_VALID, HMM_PFN_MIGRATE and HMM_PFN_COMPOUND, which is safe, as migration is entirely driven by default_flags. The marker helpers are private to mm/hmm.c.
For the revisit to happen, our own migration entries are recognized at pte and pmd level (marker plus the same page) and kept. When migrating, a fault covers only the faulting page, so that our own migration entries and caller owned device private pages later in the range are never faulted; the walk then restarts at that page. Collected entries the walk doesn't visit again stay collected and are released by finalize.
This comes before the collection itself, which the next patches add, so that collection always has rollback in place. Until then it is a no-op.
--- mm/hmm.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-)
mm/hmm.c +136 -1
@@ -89,6 +89,33 @@ enum { HMM_PFN_P2PDMA_BUS, }; +/* +* hmm_pfn_collected() - is this pfn entry prepared for migration ? +* If collected the folio's refcount is increased and the folio +* is locked. +*/ +static inline bool hmm_pfn_collected (unsigned long hmm_pfn) +{ +return (hmm_pfn & (HMM_PFN_VALID |HMM_PFN_MIGRATE )) == + (HMM_PFN_VALID |HMM_PFN_MIGRATE ); +} + +/* +* hmm_pfn_rollback_collected() - undoes the collection of hmm_pfn +* +* Note for total rollback the folio's refcount has to be put +* and folio has to be unlocked. +*/ +static inline unsigned long hmm_pfn_rollback_collected (unsigned long hmm_pfn) +{ +return hmm_pfn & ~(HMM_PFN_VALID |HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ); +} + +static void hmm_vma_handle_migrate_prepare_rollback (const struct hmm_vma_walk *hmm_vma_walk, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn); +static int hmm_pfns_fill (unsigned long addr,unsigned long end,struct hmm_vma_walk *hmm_vma_walk,unsigned long cpu_flags) {
@@ -105,6 +132,8 @@ static int hmm_pfns_fill(unsigned long addr, unsigned long end, } } +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, end, &range->hmm_pfns[i]); + if (migrate && thp_migration_supported() && (minfo & MIGRATE_VMA_SELECT_COMPOUND) && IS_ALIGNED(addr, HPAGE_PMD_SIZE) &&
@@ -233,6 +262,9 @@ static int hmm_vma_walk_hole(unsigned long addr, unsigned long end,spin_unlock (hmm_vma_walk->ptl); hmm_vma_walk->pmdlocked = false; } +/* Entries collected from a vanished page table are gone */ +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, end, + hmm_pfns);return hmm_record_fault (addr, end, required_fault, walk); }return hmm_pfns_fill (addr, end, hmm_vma_walk,0 );
@@ -268,6 +300,9 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, cpu_flags =pmd_to_hmm_pfn_flags (range, pmd); required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages, cpu_flags); +/* Entries collected from a vanished page table are gone */ +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, + end, hmm_pfns);if (required_fault) {if (hmm_vma_walk->pmdlocked) {spin_unlock (hmm_vma_walk->ptl);
@@ -325,6 +360,15 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,if (!pte_present (pte)) {const softleaf_t entry =softleaf_from_pte (pte); +/* +* Our own migration entry, collected earlier in this walk: +* keep the collected pfn, don't fault or roll it back. +*/ +if (softleaf_is_migration (entry) &&hmm_select_migrate (range) && +hmm_pfn_collected (*hmm_pfn) && +hmm_pfn_to_page (*hmm_pfn) ==softleaf_to_page (entry)) +return 0 ; +/* * Don't fault in device private pages owned by the caller, * just report the PFN.
@@ -408,6 +452,9 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, new_pfn_flags =pte_pfn (pte) | cpu_flags; out: +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, + addr +PAGE_SIZE , + hmm_pfn); *hmm_pfn = (*hmm_pfn &HMM_PFN_INOUT_FLAGS ) | new_pfn_flags;return 0 ;
@@ -418,7 +465,19 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, }else {pte_unmap (ptep); } -/* Fault any virtual address we were asked to fault */ +/* +* This pte needs a fault, so it is not our migration entry: a pfn +* collected here earlier is gone, roll it back before faulting. +*/ +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, + addr +PAGE_SIZE , hmm_pfn); +/* +* Fault any virtual address we were asked to fault. When migrating, +* only this page: later ptes may be our own migration entries or +* caller owned device private pages, which must not be faulted. +*/ +if (hmm_select_migrate (range)) + end = addr +PAGE_SIZE ;return hmm_record_fault (addr, end, required_fault, walk); }
@@ -445,6 +504,9 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,if (softleaf_is_device_private_write (entry)) cpu_flags |=HMM_PFN_WRITE ; +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, + start, end, + hmm_pfns);/* * Fully populate the PFN list though subsequent PFNs could be * inferred, because drivers which are not yet aware of large
@@ -466,6 +528,10 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,spin_unlock (hmm_vma_walk->ptl); hmm_vma_walk->pmdlocked = false; } +/* Entries collected from a vanished page table are gone */ +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, + addr, end, + hmm_pfns);return hmm_record_fault (addr, end, required_fault, walk); }else
@@ -489,6 +555,54 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ #ifdef CONFIG_DEVICE_MIGRATION +/* +* Due to dropping ptl locks for splitting for instance, would we +* overwrite already collected pfns? This could happen when pmd +* pointing to a page table has vanished and been replaced with +* a leaf pmd, or another page table. In that case unref and unlock +* the folios, the pfns of which were collected from the disappeared +* page tables. +* +* Migrate mode drives fault/migration requests only via range->default_flags. +* (HMM_PFN_VALID | HMM_PFN_MIGRATE) denotes a collected entry and can safely +* be cleared from hmm_pfn[]. +* +* Rollback is only needed for entries the walk visits again, where a stale +* marker would be mistaken for our own migration entry. Collected entries +* that are not revisited stay marked, and the caller's migrate_vma_pages() +* and migrate_vma_finalize() release them even if their migration ptes +* vanished meanwhile. +*/ +static void hmm_vma_handle_migrate_prepare_rollback (const struct hmm_vma_walk *hmm_vma_walk, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct folio *fault_folio; +enum migrate_vma_info minfo; +struct folio *folio; +unsigned long i; + + minfo =hmm_select_migrate (range); +if (!minfo) +return ; + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + +for (i =0 ; start < end; start +=PAGE_SIZE , i++) { +if (hmm_pfn_collected (hmm_pfn[i])) { + folio =page_folio (hmm_pfn_to_page (hmm_pfn[i])); +if (folio != fault_folio) +folio_unlock (folio); +folio_put (folio); + hmm_pfn[i] =hmm_pfn_rollback_collected (hmm_pfn[i]); + } + } +} + static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk, pmd_t *pmdp, unsigned long start,
@@ -511,6 +625,13 @@ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, }#else +static void hmm_vma_handle_migrate_prepare_rollback (const struct hmm_vma_walk *hmm_vma_walk, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +} + static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk, pmd_t *pmdp, unsigned long start,
@@ -650,12 +771,26 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,if (thp_migration_supported () &&pmd_is_migration_entry (pmd)) {unsigned int required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ); +/* +* Our own migration entry, collected earlier in this walk. +* Decided while the pmd lock (taken when migrating) still holds. +*/ +bool own = minfo &&hmm_pfn_collected (hmm_pfns_start[0 ]) && +hmm_pfn_to_page (hmm_pfns_start[0 ]) == +softleaf_to_page (softleaf_from_pmd (pmd));if (hmm_vma_walk->pmdlocked) {spin_unlock (hmm_vma_walk->ptl); hmm_vma_walk->pmdlocked = false; } +if (own) +return 0 ; + +/* Not ours: entries collected from a vanished page table are gone */ +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, start, end, + hmm_pfns_start); +/* Someone else's migration: when migrating, don't wait (see pte level) */ if (required_fault && !minfo) { hmm_vma_walk->last = addr;
Signature · 1 line
2.55.0
PATCH v18 6/14 mm/hmm: migrate collection in HMM pagewalk - pte level
In reply to [email protected]From: Mika Penttilä <[email protected]>
Implement the needed hmm_vma_handle_migrate_prepare() function which is mostly carried over from migrate_device.c's migrate_vma_collect_pmd() function.
Also implement hmm_migrate_split_folio(), for splitting pte mapped large folios. Compared with migrate_vma_split_folio() in migrate_device.c it takes the folio reference before dropping the page table lock, only trylocks the folio, and splits the fault folio at the fault page with split_huge_page(), so the caller's lock and reference stay on the folio holding the fault page. The old migrate_vma_collect*() code is removed once migration switches over to the HMM pagewalk, later in the series.
As in the pending "mm/migrate_device: do not migrate a uffd-protected zero page", a zero page whose uffd state would be lost is not collected. As in Chris Mason's pending fix for migrate_vma_collect_pmd(), a KSM folio is not collected: KSM maps a KSM folio before rmap walks can find the mapping, so rmap_walk_ksm() may miss the pte when restoring the migration entry, leaving a stale one behind.
With HMM pagewalk based migration, the idea is that hmm_vma_handle_*() are responsible for faulting,
and the pfn collecting part. hmm_vma_handle_migrate_prepare*() do the migration decisions (with HMM_PFN_MIGRATE), possibly split folios, and insert migration ptes/pmds.
Collected folios stay locked while hmm_range_fault() may still fault other pages of the range. This cannot deadlock: only anonymous folios are collected, so no page cache or invalidate_lock ordering is involved, and when the walk faults it collects only folios mapped by this process alone (PageAnonExclusive), besides the fault folio. A folio shared with another process (e.g. after fork) could be reached through that mapping by another faulting walk, which would sleep on our folio lock while we may sleep on its, so it is left as reported. A write fault breaks the sharing first, so only read faults leave shared folios in place; that is the price of faulting in the same walk. An exclusive folio is reachable only through our migration entry, and walks waiting on each other's migration entries can't form a cycle: a walk stops when it records a fault, so it holds only what it collected before the check that led to the fault, and a walk that finds another walk's migration entry leaves it without waiting, so every wait goes to a walk that checked later (see hmm_migrate_collectable()). Only the faulting pte is faulted, never our own entries, and when faulting a swapcache folio still referenced by other swap entries is not collected. The walk itself only trylocks folio locks, also before splitting a folio. Reclaim and direct compaction under the fault only trylock folio locks too.
When the pte lock has to be dropped to split a folio, the pmd may change under us, so the walk re-reads it and continues at the current address, as migrate_vma_setup() has always done: a changed pmd is handled for the whole range, and entries collected before that address stay collected and are released by finalize if their migration ptes are gone. When locking or splitting a folio fails, the rest of the pmd is not walked further, also as before.
HMM pagewalk based migration is enabled in later commit, for now hmm_select_migrate() returns MIGRATE_VMA_SELECT_NONE.
--- mm/hmm.c | 380 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 377 insertions(+), 3 deletions(-)
mm/hmm.c +377 -3
@@ -73,6 +73,19 @@ struct hmm_vma_walk {*/ #define HMM_FAULT_UNLOCKED -ENOLCK +/* +* Internal results of hmm_vma_handle_migrate_prepare(), consumed by +* hmm_vma_walk_pmd() and never propagated. Both mean the pte lock was +* dropped: HMM_MIGRATE_REWALK after splitting a large folio, so the pmd +* range is walked again; HMM_MIGRATE_SKIP when a large folio can't be +* locked or split, so the rest of the pmd range is skipped (best effort). +*/ +#define HMM_MIGRATE_REWALK 1 +#define HMM_MIGRATE_SKIP 2 + +#define HMM_ASSERT_PTE_LOCKED (hmm_vma_walk, locked) \ + WARN_ON_ONCE((hmm_vma_walk)->ptelocked != (locked)) +#define HMM_ASSERT_UNLOCKED (hmm_vma_walk) \ WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \ (hmm_vma_walk)->pmdlocked)
@@ -555,6 +568,75 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ #ifdef CONFIG_DEVICE_MIGRATION +/** +* __hmm_migrate_split_folio() - split a locked folio for migration +* @folio: the folio to split, locked and referenced by the caller +* @fault_page: fault page if any +* +* The fault folio is split at @fault_page, so the caller's lock and reference +* stay on the folio containing @fault_page. For any other folio our lock and +* reference are dropped, whether or not the split succeeds. +* +* Return: 0 on success, or the split_huge_page() / split_folio() error. +*/ +static int __hmm_migrate_split_folio (struct folio *folio, +struct page *fault_page) +{ +int ret; + +if (fault_page && folio ==page_folio (fault_page)) +return split_huge_page (fault_page); + +/* Found large under the page table lock and locked since: still large */ + ret =folio_test_large (folio) ?split_folio (folio) :0 ; +folio_unlock (folio); +folio_put (folio); +return ret; +} + +/** +* hmm_migrate_split_folio() - drop the pte lock and split a THP folio +* @folio: the folio to split +* @fault_page: struct page associated with the fault if any +* @hmm_vma_walk: walk in progress +* @ptep: pte_t * for unmap and unlock ptl +* +* Always drops the pte lock associated with @ptep. +* +* Return: 0 on success, -EBUSY if the folio is locked by someone else, or the +* split_huge_page() / split_folio() error. +*/ +static int hmm_migrate_split_folio (struct folio *folio, +struct page *fault_page, +struct hmm_vma_walk *hmm_vma_walk, +pte_t *ptep) +{ +struct folio *fault_folio = fault_page ?page_folio (fault_page) :NULL ; +bool locked = true; + +/* +* Take the reference while still holding the PTE lock, so the folio +* cannot be freed once the lock is dropped. As at collection, only +* trylock: other collected folios may be held locked, so sleeping +* here could deadlock. A busy folio is just not migrated. The fault +* folio is already referenced and locked by do_swap_page(). +*/ +if (folio != fault_folio) { +folio_get (folio); + locked =folio_trylock (folio); + } + +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + +if (!locked) { +folio_put (folio); +return -EBUSY ; + } + +return __hmm_migrate_split_folio (folio, fault_page); +} +/* * Due to dropping ptl locks for splitting for instance, would we * overwrite already collected pfns? This could happen when pmd
@@ -603,6 +685,29 @@ static void hmm_vma_handle_migrate_prepare_rollback(const struct hmm_vma_walk *h } } +/* +* Collected folios stay locked while hmm_range_fault() faults other pages +* of the range. When faulting, collect only the fault folio and folios +* mapped by this process alone (PageAnonExclusive): a shared folio can be +* reached by another faulting walk, which would sleep on our lock while we +* sleep on its. A write fault breaks the sharing first, so only read faults +* on still shared pages (after fork, or KSM) leave them in place: a rare, +* deliberate trade-off. +* +* An exclusive folio is reachable only through our migration entry, and +* waits on those can't form a cycle: a walk stops when it records a fault +* and leaves other walks' entries alone, so every wait goes to a walk that +* checked later. +*/ +static bool hmm_migrate_collectable (const struct hmm_range *range, +struct page *page, +struct folio *fault_folio) +{ +if (!(range->default_flags &HMM_PFN_REQ_FAULT )) +return true; +return page_folio (page) == fault_folio ||PageAnonExclusive (page); +} + static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk, pmd_t *pmdp, unsigned long start,
@@ -613,6 +718,10 @@ static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk,return 0 ; } +/* +* Install migration entries if migration requested, either from fault +* or migrate paths. +*/ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, pmd_t *pmdp, pte_t *ptep,
@@ -620,8 +729,240 @@ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk,unsigned long *hmm_pfn, bool *unmapped) { -/* Collection is implemented by later patches */ + struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct mm_struct *mm = walk->vma->vm_mm; +struct folio *fault_folio =NULL ; +enum migrate_vma_info minfo; +struct dev_pagemap *pgmap; +bool anon_exclusive; +struct folio *folio; +unsigned long pfn; +struct page *page; +softleaf_t entry; +pte_t pte, swp_pte; +bool writable = false; + +/* Do we want to migrate at all? */ + minfo =hmm_select_migrate (range); +if (!minfo) +return 0 ; + +HMM_ASSERT_PTE_LOCKED (hmm_vma_walk, true); + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + + pte =ptep_get (ptep); + +if (pte_none (pte)) { +if (vma_is_anonymous (walk->vma)) { + *hmm_pfn &=HMM_PFN_INOUT_FLAGS ; + *hmm_pfn |=HMM_PFN_MIGRATE ; + goto out; + } + } + +/* +* NUMA hinting (protnone) entries are not reported valid, but the +* page can still be migrated as is. +*/ +if (!(hmm_pfn[0 ] &HMM_PFN_VALID ) && + !(pte_present (pte) &&pte_protnone (pte))) + goto out; + +if (!pte_present (pte)) { +/* +* Only care about unaddressable device page special +* page table entry. Other special swap entries are not +* migratable, and we ignore regular swapped page. +*/ + entry =softleaf_from_pte (pte); +if (!softleaf_is_device_private (entry)) + goto out; + +if (!(minfo &MIGRATE_VMA_SELECT_DEVICE_PRIVATE )) + goto out; + + page =softleaf_to_page (entry); + folio =page_folio (page); +if (folio->pgmap->owner != migrate->pgmap_owner) + goto out; + + pfn =page_to_pfn (page); +if (softleaf_is_device_private_write (entry)) + writable = true; + }else { + pfn =pte_pfn (pte); +if (is_zero_pfn (pfn) && + (minfo &MIGRATE_VMA_SELECT_SYSTEM )) { +/* Like pte_none(): only anonymous memory can be populated */ +if (!vma_is_anonymous (walk->vma)) + goto out; +/* Nothing carries the uffd state of the zero page over */ +if (userfaultfd_protected (walk->vma) &&pte_uffd (pte)) + goto out; + *hmm_pfn &=HMM_PFN_INOUT_FLAGS ; + *hmm_pfn |=HMM_PFN_MIGRATE ; + goto out; + } + page =vm_normal_page (walk->vma, addr, pte); +if (page && !is_zone_device_page (page) && + !(minfo &MIGRATE_VMA_SELECT_SYSTEM )) { + goto out; + }else if (page &&is_device_coherent_page (page)) { + pgmap =page_pgmap (page); + +if (!(minfo & +MIGRATE_VMA_SELECT_DEVICE_COHERENT ) || + pgmap->owner != migrate->pgmap_owner) + goto out; + } + + folio = page ?page_folio (page) :NULL ; +/* +* Only anonymous memory can be migrated to device memory. +* Check before splitting. +*/ +if (!folio || !folio_test_anon (folio)) + goto out; + + writable =pte_write (pte); + } + +if (!hmm_migrate_collectable (range, page, fault_folio)) + goto out; +if (folio_test_large (folio)) { +int ret; + + ret =hmm_migrate_split_folio (folio, migrate->fault_page, + hmm_vma_walk, ptep); +if (ret) + goto out_skip; +return HMM_MIGRATE_REWALK ; + } + +/* +* By getting a reference on the folio we pin it and that blocks +* any kind of migration. Side effect is that it "freezes" the +* pte. +* +* We drop this reference after isolating the folio from the lru +* for non device folio (device folio are not on the lru and thus +* can't be dropped from it). +*/ + folio =page_folio (page); +folio_get (folio); + +/* +* We rely on folio_trylock() to avoid deadlock between +* concurrent migrations where each is waiting on the others +* folio lock. If we can't immediately lock the folio we fail this +* migration as it is only best effort anyway. +* +* If we can lock the folio it's safe to set up a migration entry +* now. In the common case where the folio is mapped once in a +* single process setting up the migration entry now is an +* optimisation to avoid walking the rmap later with +* try_to_migrate(). +*/ + +if (fault_folio == folio ||folio_trylock (folio)) { +/* +* When faulting, a swapcache folio still referenced by other +* swap entries isn't collected: faulting one of those entries +* later in the walk, with no retry allowed, would block on the +* lock we hold. It couldn't be migrated anyway (see +* __migrate_device_pages()). Without faulting the swap cache is +* left alone here and freed only when the folio is migrated. +*/ +if ((range->default_flags &HMM_PFN_REQ_FAULT ) && +folio_test_swapcache (folio) && !folio_free_swap (folio)) { +if (fault_folio != folio) +folio_unlock (folio); +folio_put (folio); + goto out; + } + +/* +* rmap_walk_ksm() may not find this pte to restore the +* migration entry later. +*/ +if (folio_test_ksm (folio)) { +if (fault_folio != folio) +folio_unlock (folio); +folio_put (folio); + goto out; + } + + anon_exclusive =folio_test_anon (folio) && +PageAnonExclusive (page); + +if (pte_present (pte)) +flush_cache_page (walk->vma, addr, pfn); + +if (anon_exclusive) { + pte =ptep_clear_flush (walk->vma, addr, ptep); + +if (folio_try_share_anon_rmap_pte (folio, page)) { +set_pte_at (mm, addr, ptep, pte); +if (fault_folio != folio) +folio_unlock (folio); +folio_put (folio); + goto out; + } + }else { + pte =ptep_get_and_clear (mm, addr, ptep); + } + +if (pte_present (pte) &&pte_dirty (pte)) +folio_mark_dirty (folio); + +/* Setup special migration page table entry */ +if (writable) + entry =make_writable_migration_entry (pfn); +else if (anon_exclusive) + entry =make_readable_exclusive_migration_entry (pfn); +else + entry =make_readable_migration_entry (pfn); + +if (pte_present (pte)) { +if (pte_young (pte)) + entry =make_migration_entry_young (entry); +if (pte_dirty (pte)) + entry =make_migration_entry_dirty (entry); + } + + swp_pte =swp_entry_to_pte (entry); +if (pte_present (pte)) { +if (pte_soft_dirty (pte)) + swp_pte =pte_swp_mksoft_dirty (swp_pte); +if (pte_uffd (pte)) + swp_pte =pte_swp_mkuffd (swp_pte); + }else { +if (pte_swp_soft_dirty (pte)) + swp_pte =pte_swp_mksoft_dirty (swp_pte); +if (pte_swp_uffd (pte)) + swp_pte =pte_swp_mkuffd (swp_pte); + } + +set_pte_at (mm, addr, ptep, swp_pte); +folio_remove_rmap_pte (folio, page, walk->vma); +folio_put (folio); + *hmm_pfn |=HMM_PFN_VALID |HMM_PFN_MIGRATE ; +if (writable) + *hmm_pfn |=HMM_PFN_WRITE ; +if (pte_present (pte)) + *unmapped = true; + }else { +folio_put (folio); + } +out:return 0 ; +out_skip: +/* Lock or split failed: the caller skips the rest of the pmd (best effort) */ +return HMM_MIGRATE_SKIP ; }#else
@@ -880,6 +1221,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, }else { ptep =pte_offset_map (pmdp, addr); } +/* The pte table is gone: re-read the pmd and continue at addr */ if (!ptep) goto again;
@@ -893,8 +1235,40 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,return r; } -/* Collection is added by later patches: a no-op until then */ -hmm_vma_handle_migrate_prepare (walk, pmdp, ptep, addr, hmm_pfns, &unmapped); + r =hmm_vma_handle_migrate_prepare (walk, pmdp, ptep, addr, hmm_pfns, &unmapped); +if (r ==HMM_MIGRATE_REWALK ) { +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) { +flush_tlb_range (walk->vma, start, addr); + unmapped = false; + } +/* +* The pte lock was dropped and the pmd may have changed: +* re-read it and continue at addr, as migrate_vma_setup() +* has always done. A changed pmd is handled for the whole +* range. Entries collected before addr are not revisited: +* if their migration ptes are gone meanwhile, finalize +* releases them (see +* hmm_vma_handle_migrate_prepare_rollback()). +*/ + goto again; + } +if (r ==HMM_MIGRATE_SKIP ) { +/* +* Locking or splitting the folio failed, and the split +* helper already dropped the PTE lock. addr keeps its +* valid pfn. The rest of the pmd range is not walked +* further, as migrate_vma_setup() has always done: +* entries there keep what an earlier pass wrote, and +* entries already collected stay collected. When +* migrating, collection and faulting are best effort +* (see hmm_range_fault()). +*/ +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) +flush_tlb_range (walk->vma, start, addr); +return 0 ; + } }if (unmapped)
Signature · 1 line
2.55.0
PATCH v18 7/14 mm/hmm: migrate collection in HMM pagewalk - pmd level
In reply to [email protected]From: Mika Penttilä <[email protected]>
Implement the needed hmm_vma_handle_migrate_prepare_pmd() function which is mostly carried over from migrate_device.c's migrate_vma_collect_huge_pmd() function.
With HMM pagewalk based migration, the idea is that hmm_vma_handle_*() are responsible for faulting, and the pfn collecting part. hmm_vma_handle_migrate_prepare*() do the migration decisions (with HMM_PFN_MIGRATE), possibly split folios, and insert migration ptes/pmds.
Locking follows the same rules as at the pte level (see the previous commit): only anonymous THPs are collected, and when faulting only ones mapped by this process alone; the folio is only trylocked, a PMD-mapped THP is collected whole behind its pmd migration entry, and when faulting a swapcache folio still referenced by other swap entries is not collected. On a trylock or split failure the valid pfns are kept and nothing is migrated.
HMM pagewalk based migration is enabled in later commit, for now hmm_select_migrate() returns MIGRATE_VMA_SELECT_NONE. The old migrate_vma_collect_huge_pmd() is removed then. A uffd-protected huge zero pmd is not collected, as at the pte level.
Also avoid the problems present in the migrate_vma_collect_huge_pmd() split fallback path this HMM path supersedes:
- extra refcount for fault_folio makes split_folio() fail
- wrong folio unlocked after split_folio()
--- mm/hmm.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 161 insertions(+), 1 deletion(-)
mm/hmm.c +161 -1
@@ -86,6 +86,9 @@ struct hmm_vma_walk {#define HMM_ASSERT_PTE_LOCKED (hmm_vma_walk, locked) \ WARN_ON_ONCE((hmm_vma_walk)->ptelocked != (locked)) +#define HMM_ASSERT_PMD_LOCKED (hmm_vma_walk, locked) \ + WARN_ON_ONCE((hmm_vma_walk)->pmdlocked != (locked)) +#define HMM_ASSERT_UNLOCKED (hmm_vma_walk) \ WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \ (hmm_vma_walk)->pmdlocked)
@@ -714,8 +717,154 @@ static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk,unsigned long end, unsigned long *hmm_pfn) { -/* Collection is implemented by later patches */ + struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct folio *fault_folio =NULL ; +enum migrate_vma_info minfo; +struct folio *folio; +unsigned long i; +pmd_t pmd; +int r; + +/* Do we want to migrate at all? */ + minfo =hmm_select_migrate (range); +if (!minfo) +return 0 ; + +HMM_ASSERT_PMD_LOCKED (hmm_vma_walk, true); + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + +/* +* The caller holds the pmd lock and found a huge or device private +* pmd; none and migration entries it handles itself. +*/ + pmd =pmdp_get (pmdp); + +/* Like at the pte level, NUMA hinting (protnone) pmds are migrated */ +if (!(hmm_pfn[0 ] &HMM_PFN_VALID ) && + !(pmd_trans_huge (pmd) &&pmd_protnone (pmd))) + goto out; + +if (pmd_trans_huge (pmd)) { + folio =pmd_folio (pmd); +/* Like at the pte level */ +if (folio_is_device_coherent (folio)) { +if (!(minfo &MIGRATE_VMA_SELECT_DEVICE_COHERENT ) || + folio->pgmap->owner != migrate->pgmap_owner) + goto out; + }else { +if (!(minfo &MIGRATE_VMA_SELECT_SYSTEM )) + goto out; +if (is_huge_zero_folio (folio)) { +/* See the pte level: keep a uffd-protected zero page */ +if (userfaultfd_protected (walk->vma) && +pmd_uffd (pmd)) + goto out; +return hmm_pfns_fill (start, end, hmm_vma_walk,0 ); + } + } +/* Only anonymous memory, as at the pte level */ +if (!folio_test_anon (folio)) + goto out; +if (!hmm_migrate_collectable (range,folio_page (folio,0 ), + fault_folio)) + goto out; + + }else if (!pmd_present (pmd)) { +const softleaf_t entry =softleaf_from_pmd (pmd); + +if (!softleaf_is_device_private (entry)) + goto out; + +if (!(minfo &MIGRATE_VMA_SELECT_DEVICE_PRIVATE )) + goto out; + + folio =softleaf_to_folio (entry); +if (folio->pgmap->owner != migrate->pgmap_owner) + goto out; +if (!hmm_migrate_collectable (range,folio_page (folio,0 ), + fault_folio)) + goto out; + }else { +VM_WARN_ON_ONCE (1 ); + goto out; + } + +folio_get (folio); + +/* Can't lock it: not migrated, the valid pfns stay as reported */ +if (folio != fault_folio &&unlikely (!folio_trylock (folio))) { +folio_put (folio); +return 0 ; + } + +/* Swapcache folio still referenced elsewhere: see the pte level */ +if ((range->default_flags &HMM_PFN_REQ_FAULT ) && +folio_test_swapcache (folio) && !folio_free_swap (folio)) { +if (folio != fault_folio) +folio_unlock (folio); +folio_put (folio); +return 0 ; + } + +if (thp_migration_supported () && + (minfo &MIGRATE_VMA_SELECT_COMPOUND ) && + (IS_ALIGNED (start,HPAGE_PMD_SIZE ) && +IS_ALIGNED (end,HPAGE_PMD_SIZE ))) { +struct page_vma_mapped_walk pvmw = { + .ptl = hmm_vma_walk->ptl, + .address = start, + .pmd = pmdp, + .vma = walk->vma, + }; +bool writable =pmd_trans_huge (pmd) &&pmd_write (pmd); + + hmm_pfn[0 ] |=HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ; + + r =set_pmd_migration_entry (&pvmw,folio_page (folio,0 )); +if (r) { + hmm_pfn[0 ] &= ~(HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ); + goto split;/* fall back to splitting the pmd */ + } +/* Collected; a protnone pmd was not reported valid before */ + hmm_pfn[0 ] |=HMM_PFN_VALID ; +if (writable) + hmm_pfn[0 ] |=HMM_PFN_WRITE ; +for (i =1 , start +=PAGE_SIZE ; start < end; start +=PAGE_SIZE , i++) + hmm_pfn[i] &=HMM_PFN_INOUT_FLAGS ; + + }else { + goto split;/* fall back to splitting the pmd */ + } + +out:return 0 ; + +split: +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + +/* +* folio_get() above took an extra reference. For the fault folio the +* caller still holds a reference and the lock, which is the +* precondition of __hmm_migrate_split_folio(), so drop the extra one. +*/ +if (folio == fault_folio) +folio_put (folio); + +/* Split failed: not migrated, the valid pfns stay as reported */ +if (__hmm_migrate_split_folio (folio, migrate->fault_page)) +return 0 ; + +/* Re-walked as PTEs from start: drop the pmd-level output */ +for (i =0 ; i < (end - start) >>PAGE_SHIFT ; i++) + hmm_pfn[i] &=HMM_PFN_INOUT_FLAGS ; + + hmm_vma_walk->last = start; +return -EBUSY ; }/*
@@ -1194,6 +1343,17 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, hmm_vma_walk->pmdlocked = false; } +/* +* hmm_vma_handle_migrate_prepare_pmd() splits the huge pmd in +* place when needed and returns -EBUSY to walk the range again +* as PTEs. Without a notifier that happens in the retry loop of +* hmm_range_fault_locked(). With a notifier, the split's +* MMU_NOTIFY_CLEAR invalidation ends the walk with -EBUSY: the +* caller aborts and retries the range under its own retry policy +* (timeout), at the cost of one extra pass per huge pmd split. +* That is every collected THP not migrated whole with +* MIGRATE_VMA_SELECT_COMPOUND. +*/ return r; }
Signature · 1 line
2.55.0
PATCH v18 8/14 mm/hmm: add lazy MMU mode support for migration in HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
Add calls to lazy_mmu_mode_enable() and lazy_mmu_mode_disable() while doing migration.
--- mm/hmm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
mm/hmm.c +8 -1
@@ -431,6 +431,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,/* Report error for everything else */ if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -454,6 +455,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, !is_zero_pfn(pte_pfn(pte))) {if (hmm_pte_need_fault (hmm_vma_walk, pfn_req_flags,0 )) {if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -476,6 +478,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, fault:if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -629,6 +632,7 @@ static int hmm_migrate_split_folio(struct folio *folio, locked =folio_trylock (folio); } +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false;
@@ -1376,8 +1380,10 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,if (minfo) { ptep =pte_offset_map_lock (mm, pmdp, addr, &hmm_vma_walk->ptl); -if (ptep) +if (ptep) { +lazy_mmu_mode_enable (); hmm_vma_walk->ptelocked = true; + } }else { ptep =pte_offset_map (pmdp, addr); }
@@ -1435,6 +1441,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,flush_tlb_range (walk->vma, start, addr);if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep -1 , hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
Signature · 1 line
2.55.0
PATCH v18 9/14 mm: enable device page migration from HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
HMM pagewalk has now the machinery to do the first phase of device page migration, collecting the pfns and installing migration ptes.
Enable migration in hmm_range_fault(), and change migrate_vma_setup() to use HMM pagewalk path. Two new flags, MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE, let migrate_vma_setup() callers fault in missing pages, for read or for write, in the same walk. Without them, pages that aren't present (swapped out, or another device's private pages) are skipped, and shared pages after fork are migrated as they are, for every process mapping them and read-only. MIGRATE_VMA_FAULT faults the missing pages in, and MIGRATE_VMA_WRITE also breaks the sharing first, so the device gets an exclusive writable copy, without a separate hmm_range_fault() or GUP pass. When faulting, shared pages are collected only after such a write fault: with MIGRATE_VMA_FAULT alone they stay in place, as the walk can't hold a folio another process can fault on while it sleeps in a fault itself (see the pte level collection commit). If a fault fails, the partial collection is undone and migrate_vma_setup() returns the error. Drivers that migrate on device fault use hmm_range_fault() with HMM_PFN_REQ_MIGRATE directly, as the test_hmm and nouveau changes later in this series do.
Only anonymous folios are collected now. The old collector also took file folios, which could only move to system memory; no in-tree user migrates those.
migrate_vma_setup() refuses shadow stack vmas up front, as in the pending "mm/migrate_device: refuse to migrate shadow stacks". It also refuses the fault flags together with a fault page: from migrate_to_ram() the fault page is locked by do_swap_page(), and nested faults must not start under it.
Without the fault flags, migrate_vma_setup() still fails only on invalid arguments or an unsupported vma. nouveau's migrate_to_ram() leaks its src/dst arrays when migrate_vma_setup() fails or collects nothing; that is pre-existing (since c32287471077) and fixed by a later patch in this series.
Also, the migrate_vma_collect*() based paths are now unused, so delete them.
--- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +- drivers/gpu/drm/drm_pagemap.c | 2 +- include/linux/migrate.h | 10 +- include/linux/mmu_notifier.h | 3 +- mm/hmm.c | 42 +- mm/migrate_device.c | 593 +++---------------- 6 files changed, 129 insertions(+), 523 deletions(-)
arch/powerpc/include/asm/book3s/64/pgtable.h +1 -1
@@ -1334,7 +1334,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,* entries. This can happen at 2 places: * - When the address space is being unmapped zap_huge_pmd(), and we * encounter non-present pmds. -* - migrate_vma_collect_huge_pmd() could calls this during migration +* - hmm_vma_handle_migrate_prepare_pmd() could call this during migration * of device-private pmd entries. */ if (!pmd_present (*pmdp)) {
drivers/gpu/drm/drm_pagemap.c +1 -1
@@ -948,7 +948,7 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,* A large source folio is always collected whole, at its head * page, PMD aligned and flagged MIGRATE_PFN_COMPOUND: anything * else is split before it reaches us, either by -* migrate_vma_collect_pmd() or, for the eviction path, by +* the migration collection in mm/hmm.c or, for the eviction path, by * migrate_device_pfns(). Both the order-0 fallback below and * drm_pagemap_migrate_populate_src_pages() rely on that, as * they index the folio from @i.
include/linux/migrate.h +8 -2
@@ -188,6 +188,8 @@ enum migrate_vma_info {MIGRATE_VMA_SELECT_DEVICE_PRIVATE =1 <<1 ,MIGRATE_VMA_SELECT_DEVICE_COHERENT =1 <<2 ,MIGRATE_VMA_SELECT_COMPOUND =1 <<3 , +MIGRATE_VMA_FAULT =1 <<4 , + MIGRATE_VMA_WRITE = 1 << 5, }; struct migrate_vma {
@@ -230,10 +232,14 @@ struct migrate_vma {* here next to struct migrate_vma, which they use, and the !CONFIG_MIGRATION * stubs above let mm/hmm.c build without #ifdefs. */ -/* Migration collection in hmm_range_fault() is enabled later in the series */ static inline enum migrate_vma_info hmm_select_migrate (struct hmm_range *range) { -return MIGRATE_VMA_SELECT_NONE ; +enum migrate_vma_info minfo; + + minfo = (range->default_flags &HMM_PFN_REQ_MIGRATE ) ? + range->migrate->flags :0 ; + +return minfo; }static inline void *hmm_migrate_pgmap_owner (struct hmm_range *range)
include/linux/mmu_notifier.h +2 -1
@@ -39,7 +39,8 @@ struct mmu_interval_notifier;* @MMU_NOTIFY_RELEASE: used during mmu_interval_notifier invalidate to signal * that the mm refcount is zero and the range is no longer accessible. * -* @MMU_NOTIFY_MIGRATE: used during migrate_vma_collect() invalidate to signal +* @MMU_NOTIFY_MIGRATE: used during migration collection (migrate_vma_setup(), +* or hmm_range_fault() with HMM_PFN_REQ_MIGRATE) invalidate to signal * a device driver to possibly ignore the invalidation if the * owner field matches the driver's device private pgmap owner. *
mm/hmm.c +40 -2
48 lines not on this page · raw message
mm/migrate_device.c +77 -516
649 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v18 10/14 lib/test_hmm: add a new testcase for the migrate on fault
In reply to [email protected]From: Mika Penttilä <[email protected]>
Enhance the hmm test driver (lib/test_hmm) with a migrate on fault
case: a single hmm_range_fault() walk with HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE faults in and collects the range, which is then migrated to device private memory and mapped into the dmirror page table. The selftest leaves the first two pages unwritten, so page 0 has to be faulted in and page 1 maps the zero page.
If mmu_interval_read_retry() trips after migrate_vma_pages(), the dmirror mapping is skipped and the -EBUSY retry re-walks. Normally the trip comes from an unmap or zap: the migration ptes are gone, migrate_vma_finalize() releases the destination pages and the retry migrates again. Pages committed to device memory without a dmirror mapping (e.g. after a huge zero pmd split in migrate_vma_insert_page()) are still consistent: that path drops the dmirror page table entries of the range, which our own MIGRATE invalidation doesn't clear, so no entry an earlier read stored can point at a freed source page, and a real device would map them on its next fault. The selftest doesn't hit that
case: the unwritten pages share a pmd with written ones, so there is no huge zero pmd.
The verification read faults such pages in, as dmirror_read() does. For that, dmirror_do_fault() now maps the backing page of the device's own device private pages, as __dmirror_migrate_map_locked() does. It used to store the device private page itself, which has no memory behind it, so dmirror_do_read() and dmirror_do_write() would access a pfn without RAM. Like the rest of the dmirror page table handling this relies on the dmirror's own invalidations, which skip this device's MIGRATE invalidations, so a concurrent CPU fault migrating the page back, or a second dmirror of the range, can leave a stale entry, as HMM_DMIRROR_MIGRATE_TO_SYS already can; the selftests do neither.
--- lib/test_hmm.c | 215 +++++++++++++++++++++++-- lib/test_hmm_uapi.h | 21 +-- tools/testing/selftests/mm/hmm-tests.c | 73 +++++++++ 3 files changed, 289 insertions(+), 20 deletions(-)
lib/test_hmm.c +205 -10
@@ -36,6 +36,7 @@#define DMIRROR_RANGE_FAULT_TIMEOUT 1000#define DEVMEM_CHUNK_SIZE (256 * 1024 * 1024U)#define DEVMEM_CHUNKS_RESERVE 16 +#define PFNS_ARRAY_SIZE 64/* * For device_private pages, dpage is just a dummy struct page
@@ -290,6 +291,23 @@ static int dmirror_do_fault(struct dmirror *dmirror, struct hmm_range *range) page =hmm_pfn_to_page (*pfns);WARN_ON (!page); +/* +* Device private pages are backed by system pages: map those. +* Like the rest of the dmirror page table handling, this relies +* on the dmirror's own invalidations, and MIGRATE invalidations +* of this device are skipped. A CPU fault migrating the page +* back concurrently, or a second dmirror of the same range, can +* therefore leave a stale entry, as HMM_DMIRROR_MIGRATE_TO_SYS +* already can. The selftests do neither. +*/ +if (is_device_private_page (page)) { +struct folio *folio =page_folio (page); +struct page *rpage =BACKING_PAGE (folio_page (folio,0 )); + + page =folio_page (page_folio (rpage), +folio_page_idx (folio, page)); + } + entry = page;if (*pfns &HMM_PFN_WRITE ) entry =xa_tag_pointer (entry,DPT_XA_TAG_WRITE );
@@ -355,15 +373,29 @@ static int dmirror_range_fault(struct dmirror *dmirror,struct mm_struct *mm = dmirror->notifier.mm;unsigned long timeout = jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +bool migrate = range->default_flags &HMM_PFN_REQ_MIGRATE ;int ret;while (true) { -if (time_after (jiffies, timeout)) { +/* +* A migrating call returns below after one walk; its caller, +* do_fault_and_migrate(), has its own retry loop and timeout. +*/ +if (!migrate &&time_after (jiffies, timeout)) { ret = -EBUSY ; goto out; } range->notifier_seq =mmu_interval_read_begin (range->notifier); + +/* +* mmap lock held for whole migrate on fault operation. A +* migrating call isn't retried here: the caller aborts the +* partial migration first. +*/ +if (migrate) +return hmm_range_fault (range); +mmap_read_lock (mm); ret =hmm_range_fault (range);mmap_read_unlock (mm);
@@ -994,8 +1026,12 @@ static int dmirror_atomic_map(unsigned long addr, struct page *page,return 0 ; } -static int dmirror_migrate_finalize_and_map (struct migrate_vma *args, -struct dmirror *dmirror) +/* +* Map the migrated pages into the device's page table. Caller must hold +* dmirror->mutex. +*/ +static int __dmirror_migrate_map_locked (struct migrate_vma *args, +struct dmirror *dmirror) {unsigned long start = args->start;unsigned long end = args->end;
@@ -1005,9 +1041,6 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,const unsigned long start_pfn = start >>PAGE_SHIFT ;const unsigned long end_pfn = end >>PAGE_SHIFT ; -/* Map the migrated pages into the device's page tables. */ -mutex_lock (&dmirror->mutex); -for (pfn = start_pfn; pfn < end_pfn; pfn++, src++, dst++) {struct page *dpage;void *entry;
@@ -1036,17 +1069,27 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,if (*dst &MIGRATE_PFN_WRITE ) entry =xa_tag_pointer (entry,DPT_XA_TAG_WRITE ); entry =xa_store (&dmirror->pt, pfn + i, entry,GFP_ATOMIC ); -if (xa_is_err (entry)) { -mutex_unlock (&dmirror->mutex); +if (xa_is_err (entry))return xa_err (entry); - } } } -mutex_unlock (&dmirror->mutex);return 0 ; } +static int dmirror_migrate_finalize_and_map (struct migrate_vma *args, +struct dmirror *dmirror) +{ +int ret; + +/* Map the migrated pages into the device's page tables. */ +mutex_lock (&dmirror->mutex); + ret =__dmirror_migrate_map_locked (args, dmirror); +mutex_unlock (&dmirror->mutex); + +return ret; +} +static int dmirror_exclusive (struct dmirror *dmirror,struct hmm_dmirror_cmd *cmd) {
@@ -1379,6 +1422,154 @@ static int dmirror_migrate_to_device(struct dmirror *dmirror,return ret; } +static int do_fault_and_migrate (struct dmirror *dmirror,struct hmm_range *range) +{ +struct migrate_vma *migrate = range->migrate; +unsigned long timeout = + jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +int ret; + +do { +mmap_read_lock (dmirror->notifier.mm); + +/* Fault-in pages for migration */ + ret =dmirror_range_fault (dmirror, range); +/* +* Set this up even on error: hmm_range_fault() may have collected +* part of the range before failing. +*/ +migrate_hmm_range_setup (range); +if (ret) { +/* +* dst[] entries are empty, so this marks every collected +* migration as failed. finalize then restores the source +* mappings and drops the associated locks/references. +*/ +migrate_vma_pages (migrate); +migrate_vma_finalize (migrate); + goto unlock; + } + +pr_debug ("Migrating from sys mem to device mem\n" ); + +dmirror_migrate_alloc_and_copy (migrate, dmirror); +migrate_vma_pages (migrate); + +mutex_lock (&dmirror->mutex); +if (mmu_interval_read_retry (&dmirror->notifier, + range->notifier_seq)) { +/* +* The migration may already be committed, and our own +* MIGRATE invalidation didn't clear the dmirror page +* table: drop entries an earlier read left pointing at +* the source pages that finalize may free. +*/ +dmirror_do_update (dmirror, range->start, range->end); + ret = -EBUSY ; + }else { + ret =__dmirror_migrate_map_locked (migrate, dmirror); + } +mutex_unlock (&dmirror->mutex); + +migrate_vma_finalize (migrate); +unlock: +mmap_read_unlock (dmirror->notifier.mm); + }while (ret == -EBUSY && !time_after (jiffies, timeout)); + +return ret; +} + +static int dmirror_fault_and_migrate_to_device (struct dmirror *dmirror, +struct hmm_dmirror_cmd *cmd) +{ +unsigned long start, size, end, next; +unsigned long *src_pfns, *dst_pfns; +struct migrate_vma migrate = {0 }; +struct hmm_range range = {0 }; +struct dmirror_bounce bounce; +int ret =0 ; + +/* Whole range */ + start = cmd->addr; + size = cmd->npages <<PAGE_SHIFT ; + end = start + size; +if (end < start) +return -EINVAL ; + +if (!mmget_not_zero (dmirror->notifier.mm)) { + ret = -EINVAL ; + goto out; + } + + src_pfns =kvzalloc_objs (*src_pfns,PFNS_ARRAY_SIZE , +GFP_KERNEL | __GFP_NOFAIL); + dst_pfns =kvzalloc_objs (*dst_pfns,PFNS_ARRAY_SIZE , +GFP_KERNEL | __GFP_NOFAIL); + + migrate.pgmap_owner = dmirror->mdevice; + migrate.src = src_pfns; + migrate.dst = dst_pfns; + migrate.flags =MIGRATE_VMA_SELECT_SYSTEM ; + + range.migrate = &migrate; + range.hmm_pfns = src_pfns; + range.pfn_flags_mask =0 ; + range.default_flags =HMM_PFN_REQ_FAULT |HMM_PFN_REQ_MIGRATE ; + range.dev_private_owner = dmirror->mdevice; + range.notifier = &dmirror->notifier; + +for (next = start; next < end; next = range.end) { + range.start = next; + range.end =min (end, next + (PFNS_ARRAY_SIZE <<PAGE_SHIFT )); + +pr_debug ("Fault and migrate range start:%#lx end:%#lx\n" , + range.start, range.end); + + ret =do_fault_and_migrate (dmirror, &range); +if (ret) + goto out_mmput; + } + +/* +* Return the migrated data for verification. +* Only for pages in device zone +*/ + ret =dmirror_bounce_init (&bounce, start, size); +if (ret) + goto out_mmput; + + next = start; +while (1 ) { +mutex_lock (&dmirror->mutex); + ret =dmirror_do_read (dmirror, next, end, &bounce); +mutex_unlock (&dmirror->mutex); +if (ret != -ENOENT ) +break ; + +/* +* Committed to device memory but not mapped after a read_retry +* trip in do_fault_and_migrate(): fault it in, as a device would. +*/ + next = start + (bounce.cpages <<PAGE_SHIFT ); + ret =dmirror_fault (dmirror, next, end, false); +if (ret) +break ; + } +if (ret ==0 && +copy_to_user (u64_to_user_ptr (cmd->ptr), bounce.ptr, bounce.size)) + ret = -EFAULT ; + + cmd->cpages = bounce.cpages; +dmirror_bounce_fini (&bounce); + +out_mmput: +kvfree (src_pfns); +kvfree (dst_pfns); +mmput (dmirror->notifier.mm); +out: +return ret; +} +static void dmirror_mkentry (struct dmirror *dmirror,struct hmm_range *range,unsigned char *perm,unsigned long entry) {
@@ -1647,6 +1838,10 @@ static long dmirror_fops_unlocked_ioctl(struct file *filp, ret =dmirror_migrate_to_device (dmirror, &cmd);break ; +case HMM_DMIRROR_MIGRATE_ON_FAULT_TO_DEV : + ret =dmirror_fault_and_migrate_to_device (dmirror, &cmd); +break ; +case HMM_DMIRROR_MIGRATE_TO_SYS : ret =dmirror_migrate_to_system (dmirror, &cmd);break ;
lib/test_hmm_uapi.h +11 -10
@@ -29,16 +29,17 @@ struct hmm_dmirror_cmd { };/* Expose the address space of the calling process through hmm device file */ -#define HMM_DMIRROR_READ _IOWR('H', 0x00, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_WRITE _IOWR('H', 0x01, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_MIGRATE_TO_DEV _IOWR('H', 0x02, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_MIGRATE_TO_SYS _IOWR('H', 0x03, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_SNAPSHOT _IOWR('H', 0x04, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_EXCLUSIVE _IOWR('H', 0x05, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_CHECK_EXCLUSIVE _IOWR('H', 0x06, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_RELEASE _IOWR('H', 0x07, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_FLAGS _IOWR('H', 0x08, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_READ_UNLOCKED _IOWR('H', 0x09, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_READ _IOWR('H', 0x00, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_WRITE _IOWR('H', 0x01, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_TO_DEV _IOWR('H', 0x02, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_TO_SYS _IOWR('H', 0x03, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_SNAPSHOT _IOWR('H', 0x04, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_EXCLUSIVE _IOWR('H', 0x05, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_CHECK_EXCLUSIVE _IOWR('H', 0x06, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_RELEASE _IOWR('H', 0x07, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_FLAGS _IOWR('H', 0x08, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_READ_UNLOCKED _IOWR('H', 0x09, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_ON_FAULT_TO_DEV _IOWR('H', 0x0a, struct hmm_dmirror_cmd)#define HMM_DMIRROR_FLAG_FAIL_ALLOC (1ULL << 0)
tools/testing/selftests/mm/hmm-tests.c +73 -0
85 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v18 11/14 Documentation/mm/hmm: document migration through hmm_range_fault()
In reply to [email protected]From: Mika Penttilä <[email protected]>
With this series migrate_vma_setup() collects through the hmm_range_fault() page table walk, and drivers can collect directly from hmm_range_fault() for migrate on fault. Update hmm.rst to match:
Describe the two new MIGRATE_VMA_FAULT / MIGRATE_VMA_WRITE flags of migrate_vma_setup(), what is collected without them, and that a failed fault aborts the whole range.
Correct the lock_page() wording: collection only trylocks the pages, and a page that can't be locked is not migrated. Note that migrate_vma_setup() now uses the hmm_range_fault() walk.
Add a section on driving the migration collection phase directly from hmm_range_fault() via HMM_PFN_REQ_MIGRATE and migrate_hmm_range_setup():
the range and notifier requirements, how collected entries and holes are marked, rollback, the mmu_interval_read_retry() duty, best effort collection (shared pages aren't collected when faulting), the rule not to hold locks across the call that the driver takes again before finalizing, and the abort contract.
--- Documentation/mm/hmm.rst | 123 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 2 deletions(-)
Documentation/mm/hmm.rst +121 -2
@@ -348,6 +348,33 @@ between device driver specific code and shared common code: Currently only anonymous private VMA ranges can be migrated to or from system memory and device private memory. + By default nothing is faulted in: present pages are collected, empty + entries of anonymous vmas are collected as holes to be filled with new + pages, and pages that are not present (swapped out, or another device's + private pages) are skipped. Two additional flags ask migrate_vma_setup() + to fault in such pages first: + + * ``MIGRATE_VMA_FAULT`` faults in missing pages with read access. + * ``MIGRATE_VMA_WRITE`` faults in missing pages with write access + (implies faulting), breaking any sharing first, so the device gets an + exclusive writable copy. + + When faulting, pages shared with other processes (e.g. after fork) are + only collected once a write fault has given this process its own copy: + with ``MIGRATE_VMA_FAULT`` alone they stay in place. Device private pages + owned by ``args->pgmap_owner`` are never faulted, so a write fault doesn't + unshare them either. The faults are those the CPU would take, so empty + anonymous entries get system pages that are then copied, instead of being + collected as holes. + + With either flag, a fault that fails aborts the whole range: the partial + collection is undone, ``args->src`` is cleared, ``args->cpages`` and + ``args->npages`` are zero, and migrate_vma_setup() returns the error + (for example ``-EFAULT`` or ``-ENOMEM``). Pages that just can't be + collected don't abort the range. The ``MMU_NOTIFY_MIGRATE`` invalidation + described below is then ended around each fault and reopened over the + rest of the range. + One of the first steps migrate_vma_setup() does is to invalidate other device's MMUs with the ``mmu_notifier_invalidate_range_start()`` and ``mmu_notifier_invalidate_range_end()`` calls around the page table
@@ -364,11 +391,14 @@ between device driver specific code and shared common code: entry results in a valid "zero" PFN stored in the ``args->src`` array. This lets the driver allocate device private memory and clear it instead of copying a page of zeros. Valid PTE entries to system memory or - device private struct pages will be locked with ``lock_page()``, isolated + device private struct pages will be locked (only trylocked: a page that + can't be locked is not migrated), isolated from the LRU (if system memory since device private pages are not on the LRU), unmapped from the process, and a special migration PTE is inserted in place of the original PTE. - migrate_vma_setup() also clears the ``args->dst`` array. + migrate_vma_setup() also clears the ``args->dst`` array. It does all of + this through the hmm_range_fault() page table walk, see "Migration + collection through hmm_range_fault()" below. 3. The device driver allocates destination pages and copies source pages to destination pages.
@@ -427,6 +457,95 @@ between device driver specific code and shared common code: The lock can now be released. +Migration collection through hmm_range_fault() +============================================== + +The collection phase of migration (steps 1 and 2 above) can also be driven by +hmm_range_fault() directly, sharing its page table walk. This lets a driver +fault in and collect a range for migration in one walk, which is useful for +migrate on fault. + +To do so, the driver sets ``HMM_PFN_REQ_MIGRATE`` in ``range->default_flags`` +and points ``range->migrate`` at a ``struct migrate_vma`` it has filled in +(``flags``, ``src``, ``dst``, ``pgmap_owner``; ``src``, ``dst`` and +``range->hmm_pfns`` have one entry per page of the range). ``range->notifier`` +must be set and ``range->notifier_seq`` must come from +mmu_interval_read_begin(); hmm_range_fault() fills in ``migrate->vma``, +``start`` and ``end``. ``migrate->flags`` needs at least one +``MIGRATE_VMA_SELECT_*`` bit. The range must lie within a single vma, otherwise +``-ERANGE`` is returned (``-EFAULT`` if it starts in a hole); vmas +migrate_vma_setup() doesn't handle (not mm backed, hugetlb, DAX, shadow stack) +get ``-EINVAL``. + +The mmap_read_lock() has to be held for the whole migration, since the vma +must stay stable. hmm_range_fault_unlocked_timeout() can't be used: it fails +without collecting anything (don't call migrate_hmm_range_setup() after it). + +Usually ``HMM_PFN_REQ_FAULT`` (and ``HMM_PFN_REQ_WRITE``) is set as well, so +missing pages are faulted in before being collected. ``MIGRATE_VMA_FAULT`` and +``MIGRATE_VMA_WRITE`` in ``migrate->flags`` have no effect here: only +migrate_vma_setup() reads them. + +Migration requests come only from ``range->default_flags``: +``range->pfn_flags_mask`` must be 0 and ``range->dev_private_owner`` must +equal ``migrate->pgmap_owner``. ``range->hmm_pfns`` is cleared at the start of +hmm_range_fault(), so per-pfn input, including ``HMM_PFN_INOUT_FLAGS`` such as +``HMM_PFN_DMA_MAPPED``, is not preserved across a migrating call. + +hmm_range_fault() collects the entries the same way migrate_vma_setup() does, +taking a folio reference, locking it and installing a migration PTE. Collected +pages are marked with ``HMM_PFN_VALID | HMM_PFN_MIGRATE`` in +``range->hmm_pfns``. When a large folio is collected whole, only its first +entry is marked, with ``HMM_PFN_COMPOUND`` added, and the following entries are +0, as with ``MIGRATE_PFN_COMPOUND`` in ``migrate->src``. An entry with +``HMM_PFN_MIGRATE`` but without ``HMM_PFN_VALID`` is a collected hole (empty or +zero page) that the driver may fill with a new page. If the page tables change +while locks are dropped, entries collected earlier are rolled back when the +walk visits them again; entries it doesn't revisit stay collected and are +released by migrate_vma_pages() and migrate_vma_finalize(). + +The ``MMU_NOTIFY_MIGRATE`` invalidation covering the collected range is ended +while hmm_range_fault() faults pages in. As with any hmm_range_fault() use, the +driver must check mmu_interval_read_retry() under its own lock before mapping +the destination pages on the device, and abort the migration if it reports a +change. + +Collection is best effort when migrating: a folio that can't be locked is left +as reported, and if a large folio can't be locked for splitting or can't be +split, the rest of its pmd range is not walked further (not faulted or +collected), as migrate_vma_setup() does, even with ``HMM_PFN_REQ_FAULT``. +Entries under another migration are left 0, since waiting for them while +holding collected folios could deadlock. For the same reason, when faulting, +only pages mapped by this process alone are collected: a page shared with other +processes (after fork, or KSM) is left as reported. A write fault gives this +process its own copy first, so this only leaves shared pages in place for read +faults. That is the price of faulting in the same walk. Drivers check +``HMM_PFN_MIGRATE`` (and ``HMM_PFN_VALID``, see above) per entry. + +Faults by other tasks on collected pages wait until the migration is finalized. +The driver must therefore not hold locks across a migrating hmm_range_fault() +call that it takes again before migrate_vma_finalize(). + +After hmm_range_fault() returns, the driver calls:: + + void migrate_hmm_range_setup(struct hmm_range *range); + +to translate ``range->hmm_pfns`` into ``migrate->src[]`` (``migrate->dst[]`` is +zeroed), initialize ``migrate->cpages`` and ``migrate->npages``, and unmap the +collected pages as migrate_vma_setup() does (migrate_vma_unmap()). From here on +the ``range->migrate`` struct is ready for the rest of the flow (steps 3 +onwards): the driver either completes the migration or aborts it as below, +and either way calls migrate_vma_pages() and migrate_vma_finalize(). + +migrate_hmm_range_setup() must be called even when hmm_range_fault() fails, +since it may have collected part of the range before failing. On any error, +including ``-EBUSY``, the driver then aborts the partial migration: it skips +step 3, so ``migrate->dst[]`` stays zeroed, and calls migrate_vma_pages() and +migrate_vma_finalize(), which restore the original PTEs and release the +collected folios. A migrating call does not resume a previous attempt, so +the previous one, completed or aborted, must be finished before calling +hmm_range_fault() again. + Exclusive access memory =======================
Signature · 1 line
2.55.0
PATCH v18 12/14 drm/nouveau/dmem: serialize the copy channel users
In reply to [email protected]From: Mika Penttilä <[email protected]>
The dmem users of the migration copy channel (CPU faults in migrate_to_ram(), bulk migration and chunk eviction) write copy and clear commands to its push buffer and emit fences without any serialization, so concurrent users can interleave their pushes.
Add drm->dmem->migrate.lock and the wrappers nouveau_dmem_copy(), nouveau_dmem_clear() and nouveau_dmem_fence_new(), which take it only around the pushes and the fence emit. It is never held across memory
allocation: migrate_to_ram() copies under svmm->mutex, and reclaim can take svmm->mutex through the mmu notifier, so the fence is allocated before taking the lock.
The channel is shared with TTM, which serializes its own use with cli->mutex. dmem and TTM stay unserialized against each other, as
before: dmem can't take cli->mutex, since TTM allocates memory under it.
--- drivers/gpu/drm/nouveau/nouveau_dmem.c | 81 ++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 10 deletions(-)
drivers/gpu/drm/nouveau/nouveau_dmem.c +71 -10
@@ -76,6 +76,22 @@ struct nouveau_dmem_migrate {nouveau_migrate_copy_t copy_func;nouveau_clear_page_t clear_func;struct nouveau_channel *chan; +/* +* Serializes the dmem users of chan (CPU faults in migrate_to_ram(), +* bulk migration, eviction): the copy and clear +* commands they write to its push buffer and the fences they emit. +* Held only around those writes, never across memory allocation +* (fences are allocated before taking it). +* +* chan is shared with TTM (drm->ttm.chan), which serializes its own +* use with cli->mutex instead. dmem and TTM are therefore not +* serialized against each other, as before this lock was added. +* dmem can't take cli->mutex: dmem copies run under svmm->mutex, +* while TTM may allocate memory under cli->mutex, and an allocation +* can enter reclaim, whose mmu notifier invalidation takes +* svmm->mutex. +*/ +struct mutex lock; };struct nouveau_dmem {
@@ -93,6 +109,51 @@ struct nouveau_dmem_dma_info {size_t size; }; +static int nouveau_dmem_copy (struct nouveau_drm *drm,u64 npages, +enum nouveau_aper dst_aper,u64 dst_addr, +enum nouveau_aper src_aper,u64 src_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.copy_func (drm, npages, dst_aper, dst_addr, + src_aper, src_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} + +static int nouveau_dmem_clear (struct nouveau_drm *drm,u32 length, +enum nouveau_aper dst_aper,u64 dst_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.clear_func (drm, length, dst_aper, dst_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} + +static int nouveau_dmem_fence_new (struct nouveau_drm *drm, +struct nouveau_fence **fence) +{ +int ret; + +/* +* nouveau_fence_new() without the allocation under migrate.lock: +* the fence is allocated first, the lock only covers the emit. +*/ + ret =nouveau_fence_create (fence, drm->dmem->migrate.chan); +if (ret) +return ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret =nouveau_fence_emit (*fence); +mutex_unlock (&drm->dmem->migrate.lock); +if (ret) +nouveau_fence_unref (fence); +return ret; +} +static struct nouveau_dmem_chunk *nouveau_page_to_chunk (struct page *page) { return container_of(page_pgmap(page), struct nouveau_dmem_chunk,
@@ -168,10 +229,10 @@ static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,if (dma_mapping_error (dev, dma_info->dma_addr))return -EIO ; -if (drm->dmem->migrate.copy_func (drm,folio_nr_pages (sfolio), -NOUVEAU_APER_HOST , dma_info->dma_addr, -NOUVEAU_APER_VRAM , -nouveau_dmem_page_addr (spage))) { +if (nouveau_dmem_copy (drm,folio_nr_pages (sfolio), +NOUVEAU_APER_HOST , dma_info->dma_addr, +NOUVEAU_APER_VRAM , +nouveau_dmem_page_addr (spage))) {dma_unmap_page (dev, dma_info->dma_addr,page_size (dpage),DMA_BIDIRECTIONAL );return -EIO ;
@@ -183,7 +244,6 @@ static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,static vm_fault_t nouveau_dmem_migrate_to_ram (struct vm_fault *vmf) {struct nouveau_drm *drm =page_to_drm (vmf->page); -struct nouveau_dmem *dmem = drm->dmem;struct nouveau_fence *fence;struct nouveau_svmm *svmm;struct page *dpage;
@@ -264,7 +324,7 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) goto done; } -nouveau_fence_new (&fence, dmem->migrate.chan); +nouveau_dmem_fence_new (drm, &fence);migrate_vma_pages (&args);nouveau_dmem_fence_done (&fence); dma_unmap_page(drm->dev->dev, dma_info.dma_addr, dma_info.size,
@@ -528,7 +588,7 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) } } -nouveau_fence_new (&fence, chunk->drm->dmem->migrate.chan); +nouveau_dmem_fence_new (chunk->drm, &fence);migrate_device_pages (src_pfns, dst_pfns, npages);nouveau_dmem_fence_done (&fence);migrate_device_finalize (src_pfns, dst_pfns, npages);
@@ -729,6 +789,7 @@ nouveau_dmem_init(struct nouveau_drm *drm)INIT_LIST_HEAD (&drm->dmem->chunks);mutex_init (&drm->dmem->mutex);spin_lock_init (&drm->dmem->lock); +mutex_init (&drm->dmem->migrate.lock);/* Initialize migration dma helpers before registering memory */ ret =nouveau_dmem_migrate_init (drm);
@@ -764,13 +825,13 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, dma_info->size =page_size (spage);if (dma_mapping_error (dev, dma_info->dma_addr)) goto out_free_page; -if (drm->dmem->migrate.copy_func (drm,folio_nr_pages (page_folio (spage)), +if (nouveau_dmem_copy (drm,folio_nr_pages (page_folio (spage)),NOUVEAU_APER_VRAM , paddr,NOUVEAU_APER_HOST , dma_info->dma_addr)) goto out_dma_unmap; }else { dma_info->dma_addr =DMA_MAPPING_ERROR ; -if (drm->dmem->migrate.clear_func (drm,page_size (dpage), +if (nouveau_dmem_clear (drm,page_size (dpage),NOUVEAU_APER_VRAM , paddr)) goto out_free_page; }
@@ -820,7 +881,7 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm, addr += (1 << order) *PAGE_SIZE ; } -nouveau_fence_new (&fence, drm->dmem->migrate.chan); +nouveau_dmem_fence_new (drm, &fence);migrate_vma_pages (args);nouveau_dmem_fence_done (&fence);nouveau_pfns_map (svmm, args->vma->vm_mm, args->start, pfns, i, order);
Signature · 1 line
2.55.0
PATCH v18 13/14 drm/nouveau/dmem: commit migrate_to_ram() only after the copy is confirmed
In reply to [email protected]From: Mika Penttilä <[email protected]>
nouveau_dmem_migrate_to_ram() ignores the nouveau_fence_new() result, commits the migration with migrate_vma_pages() before the copy has completed, and then uses the lazy, interrupt driven fence wait, whose completion interrupt can be missed. A failed fence allocation leaves the fence uninitialized, and a copy that doesn't complete in time leaves the process with a page that wasn't fully copied.
Check the fence, poll it a jiffy at a time with a deadline (a tighter interval was found to regress to the timeout on hardware), and commit the migration only once the copy is confirmed: a fence signaled with an error, as a channel kill does, doesn't count. Otherwise abort it:
finalize restores the device private pte with the data intact, and the fault returns SIGBUS (VM_FAULT_OOM if the fence couldn't be allocated). Letting the CPU fault again instead would, with a wedged copy engine, queue another copy and leak another page on every retry. The destination page and its DMA mapping may still be in use by the copy engine, so they are leaked rather than freed. That is rare, as the copy didn't complete within the deadline. The early returns after allocating the src/dst arrays now free them too.
A GPU access to the page while the copy runs faults, and the GPU fault worker waits for this migration before it can replay that fault. A copy was seen on hardware not to progress until the faulting channel was replayed, so this can hold up the copy. The deadline covers that case as well.
--- drivers/gpu/drm/nouveau/nouveau_dmem.c | 109 +++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 9 deletions(-)
drivers/gpu/drm/nouveau/nouveau_dmem.c +100 -9
@@ -40,6 +40,7 @@#include <linux/hmm.h> #include <linux/memremap.h> #include <linux/migrate.h> +#include <linux/jiffies.h> /* * FIXME: this is ugly right now we are using TTM to allocate vram and we pin
@@ -213,6 +214,70 @@ static void nouveau_dmem_fence_done(struct nouveau_fence **fence) } } +/* +* Poll the copy fence instead of the lazy (interrupt-driven) wait since +* completion IRQ is randomly missed, hitting the timeout. Poll gently, a +* jiffy at a time: a tighter interval (usleep_range()) polls the fence far +* more often and was found on hardware to regress to the timeout. A CPU +* fault on device memory thus takes at least a jiffy. The deadline is +* well beyond any copy time and only catches a copy that won't complete. +* +* A fence signaled with an error, as a channel kill does to its pending +* fences, doesn't confirm the copy. +* +* Returns 0 on completion, -EBUSY on timeout, -EIO if the fence signaled +* with an error. Consumes the fence reference. +*/ +static int nouveau_dmem_fence_poll (struct nouveau_fence **fence) +{ +unsigned long deadline = jiffies +30 *HZ ; +int ret =0 ; + +while (!nouveau_fence_done (*fence)) { +if (time_after (jiffies, deadline)) { + ret = -EBUSY ; +break ; + } +schedule_timeout_uninterruptible (msecs_to_jiffies (1 )); + } +if (!ret &&dma_fence_get_status (&(*fence)->base) <0 ) + ret = -EIO ; +nouveau_fence_unref (fence); + +return ret; +} + +/* +* The copy could not be confirmed (no fence, timeout, or a fence signaled with +* an error): don't migrate, so finalize restores the original ptes and the +* source stays valid. The copy engine may still be writing the destination, +* and there is no telling when it stops, so keep the destination folios: take +* them out of dst[], so that migrate_vma_pages() doesn't migrate those entries +* and finalize doesn't free them, and keep their allocation reference. The +* caller skips the DMA unmap. Only the destination is written by the copy; +* the source is restored and stays in use. +* +* This is rare: the copy didn't complete within the deadline, because the +* engine is wedged or held up. Leaking is the safe choice then. The leaked +* destination stays allocated with its DMA mapping; a VRAM destination keeps +* its chunk in use, so device teardown can't complete afterwards. +*/ +static void nouveau_dmem_migrate_abort (struct nouveau_drm *drm, +struct migrate_vma *args) +{ +unsigned long i; + +for (i =0 ; i < args->npages; i++) { +struct page *dpage =migrate_pfn_to_page (args->dst[i]); + +if (dpage) { +folio_unlock (page_folio (dpage)); + args->dst[i] =0 ; + } + } +NV_ERROR (drm,"svm: copy not confirmed, migration aborted, pages leaked\n" ); +} +static int nouveau_dmem_copy_folio (struct nouveau_drm *drm,struct folio *sfolio,struct folio *dfolio,struct nouveau_dmem_dma_info *dma_info)
@@ -244,11 +309,11 @@ static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,static vm_fault_t nouveau_dmem_migrate_to_ram (struct vm_fault *vmf) {struct nouveau_drm *drm =page_to_drm (vmf->page); -struct nouveau_fence *fence; +struct nouveau_fence *fence =NULL ;struct nouveau_svmm *svmm;struct page *dpage;vm_fault_t ret =0 ; -int err; +int err, fret =0 ;struct migrate_vma args = { .vma = vmf->vma, .pgmap_owner = drm->dev,
@@ -293,10 +358,12 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf)* than just one page on CPU fault. When such fault happens it is very * likely that more surrounding page will CPU fault too. */ -if (migrate_vma_setup (&args) <0 ) -return VM_FAULT_SIGBUS ; +if (migrate_vma_setup (&args) <0 ) { + ret =VM_FAULT_SIGBUS ; + goto err; + }if (!args.cpages) -return 0 ; + goto done;if (order) dpage = folio_page(vma_alloc_folio(GFP_HIGHUSER | __GFP_ZERO,
@@ -324,11 +391,35 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) goto done; } -nouveau_dmem_fence_new (drm, &fence); +/* +* Commit the migration only once the copy is confirmed. Without a +* fence the copy can't be confirmed: treat it as failed. +*/ + fret =nouveau_dmem_fence_new (drm, &fence); +/* +* A GPU access to this page while the copy runs faults, and the GPU +* fault worker waits for this migration before it can replay that +* fault. A copy was seen on hardware not to progress until the +* faulting channel was replayed, so this can hold up the copy. The +* deadline then aborts the migration instead of committing an +* unconfirmed copy. +*/ +if (!fret) + fret =nouveau_dmem_fence_poll (&fence); +if (fret) { +nouveau_dmem_migrate_abort (drm, &args); +/* +* finalize restores the device private pte and the data is +* intact, but don't let the CPU fault again: with the copy +* engine wedged, every refault would queue another copy and +* leak another destination page. +*/ + ret = fret == -ENOMEM ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; + }else { +dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, +DMA_BIDIRECTIONAL ); + }migrate_vma_pages (&args); -nouveau_dmem_fence_done (&fence); -dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, -DMA_BIDIRECTIONAL ); done:migrate_vma_finalize (&args); err:
Signature · 1 line
2.55.0
PATCH v18 14/14 drm/nouveau/svm: add support for migrate on fault
In reply to [email protected]From: Mika Penttilä <[email protected]>
Add a direct user for the new HMM_PFN_REQ_MIGRATE flag and implement migrate on fault for nouveau driver. It is gated by the svm_migrate_on_fault module parameter, default off. When enabled, the policy is fully lazy: pages are migrated to VRAM on GPU fault, and SVM_BIND no longer migrates the bound range up front.
Added nouveau_dmem_migrate_fault() that faults a range in and does migrate collecting in a single hmm_range_fault() walk.
It uses the copy channel lock, the fence poll and the abort handling added by the previous two patches.
The migrate on fault path faults a single page and doesn't use MIGRATE_VMA_SELECT_COMPOUND, so a THP covering it is split first and stays split if the migration fails. Faulting in whole THPs is left for later.
As an optimization, a migration policy - deciding which faulting ranges are worth migrating to VRAM and which are better left mirrored in system memory - would be useful. This patch establishes the migrate-on-fault mechanism as a basis for later refinement.
A GPU write fault on a read-only device private page owned by nouveau is mapped read-only and refaults, because hmm_range_fault() reports the caller's own device private pages without faulting them. This is pre-existing (nouveau_range_fault() behaves the same) and needs a fix in hmm_range_fault().
--- drivers/gpu/drm/nouveau/nouveau_dmem.c | 281 ++++++++++++++++++++++++- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 ++ drivers/gpu/drm/nouveau/nouveau_svm.c | 164 ++++++++++----- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + 4 files changed, 410 insertions(+), 52 deletions(-)
drivers/gpu/drm/nouveau/nouveau_dmem.c +277 -4
@@ -41,6 +41,7 @@#include <linux/memremap.h> #include <linux/migrate.h> #include <linux/jiffies.h> +#include <linux/mmu_notifier.h> /* * FIXME: this is ugly right now we are using TTM to allocate vram and we pin
@@ -79,7 +80,7 @@ struct nouveau_dmem_migrate {struct nouveau_channel *chan;/* * Serializes the dmem users of chan (CPU faults in migrate_to_ram(), -* bulk migration, eviction): the copy and clear +* migrate on fault, bulk migration, eviction): the copy and clear * commands they write to its push buffer and the fences they emit. * Held only around those writes, never across memory allocation * (fences are allocated before taking it).
@@ -946,11 +947,12 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm,return 0 ; } -static void nouveau_dmem_migrate_chunk (struct nouveau_drm *drm, +static unsigned long +nouveau_dmem_migrate_alloc_and_copy (struct nouveau_drm *drm,struct nouveau_svmm *svmm,struct migrate_vma *args, -struct nouveau_dmem_dma_info *dma_info,u64 *pfns) +struct nouveau_dmem_dma_info *dma_info,u64 *pfns, +unsigned long *nr_dma_out,unsigned long *order_out) { -struct nouveau_fence *fence;unsigned long addr = args->start, nr_dma =0 , i;unsigned long order =0 ;
@@ -972,6 +974,21 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm, addr += (1 << order) *PAGE_SIZE ; } + *nr_dma_out = nr_dma; + *order_out = order; +return i; +} + +static void nouveau_dmem_migrate_chunk (struct nouveau_drm *drm, +struct nouveau_svmm *svmm,struct migrate_vma *args, +struct nouveau_dmem_dma_info *dma_info,u64 *pfns) +{ +struct nouveau_fence *fence; +unsigned long nr_dma, order, i; + + i =nouveau_dmem_migrate_alloc_and_copy (drm, svmm, args, dma_info, pfns, + &nr_dma, &order); +nouveau_dmem_fence_new (drm, &fence);migrate_vma_pages (args);nouveau_dmem_fence_done (&fence);
@@ -984,6 +1001,262 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,migrate_vma_finalize (args); } +/* +* Encode an hmm_range_fault() pfn for @start into the nouveau PFNMAP format, +* shared by nouveau_hmm_convert_pfn() and the in-place map in +* nouveau_dmem_migrate_fault(). +*/ +u64 nouveau_dmem_hmm_pfn_to_map (unsigned long hmm_pfn,unsigned long start, +unsigned long *map_addr,unsigned int *page_shift) +{ +unsigned long order; +struct page *page; +u64 pfn; + + *map_addr = start; + *page_shift =PAGE_SHIFT ; + +if (!(hmm_pfn &HMM_PFN_VALID )) +return NVIF_VMM_PFNMAP_V0_NONE ; + + page =hmm_pfn_to_page (hmm_pfn); + + order =hmm_pfn_to_map_order (hmm_pfn); +if (order) { + *page_shift = order +PAGE_SHIFT ; + *map_addr = start & ~((1UL << *page_shift) -1 ); + page -= (start - *map_addr) >>PAGE_SHIFT ; + } + +if (is_device_private_page (page)) + pfn =nouveau_dmem_page_addr (page) | +NVIF_VMM_PFNMAP_V0_V |NVIF_VMM_PFNMAP_V0_VRAM ; +else + pfn =page_to_phys (page) | +NVIF_VMM_PFNMAP_V0_V |NVIF_VMM_PFNMAP_V0_HOST ; +if (hmm_pfn &HMM_PFN_WRITE ) + pfn |=NVIF_VMM_PFNMAP_V0_W ; + +return pfn; +} + +/* +* Fault a range in and migrate it to VRAM. +* Returns 0 on success, or an error (so the caller +* falls back to nouveau_range_fault()) if nothing could be mapped. +*/ +int +nouveau_dmem_migrate_fault (struct nouveau_drm *drm,struct nouveau_svmm *svmm, +struct mmu_interval_notifier *notifier, +unsigned long start,unsigned long end, +unsigned long hmm_flags, +u64 *out_pfn0,unsigned long *out_addr, +unsigned int *out_shift) +{ +unsigned long timeout = + jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +unsigned long npages = (end - start) >>PAGE_SHIFT ; +struct mm_struct *mm = notifier->mm; +struct nouveau_dmem_dma_info *dma_info; +struct nouveau_fence *fence =NULL ; +struct migrate_vma migrate = { + .start = start, + .end = end, + .pgmap_owner = drm->dev, +/* +* No MIGRATE_VMA_SELECT_COMPOUND: the fault range is a single +* page, so a THP covering it is split before migrating, and +* stays split if the migration then fails. Faulting in whole +* THPs is left for later. +*/ + .flags =MIGRATE_VMA_SELECT_SYSTEM , + }; +struct hmm_range range = { + .notifier = notifier, + .start = start, + .end = end, + .dev_private_owner = drm->dev, + .migrate = &migrate, + .default_flags = hmm_flags |HMM_PFN_REQ_MIGRATE , + }; +unsigned long nr_dma, order, n, i; +unsigned long hmm_pfn0 =0 ; +bool migrated; +u64 *pfns; +int ret, fret =0 ; + +if (!drm->dmem) +return -ENODEV ; + + migrate.src =kcalloc (npages,sizeof (*migrate.src),GFP_KERNEL ); +if (!migrate.src) +return -ENOMEM ; + migrate.dst =kcalloc (npages,sizeof (*migrate.dst),GFP_KERNEL ); +if (!migrate.dst) { + ret = -ENOMEM ; + goto out_free_src; + } + dma_info =kmalloc_objs (*dma_info, npages); +if (!dma_info) { + ret = -ENOMEM ; + goto out_free_dst; + } + pfns =nouveau_pfns_alloc (npages); +if (!pfns) { + ret = -ENOMEM ; + goto out_free_dma; + } + +/* hmm_range_fault() shares the source pfn array with migrate_vma. */ + range.hmm_pfns = migrate.src; + +do { +mmap_read_lock (mm); + range.notifier_seq =mmu_interval_read_begin (notifier); + + ret =hmm_range_fault (&range); +/* +* Snapshot the pfn before migrate_hmm_range_setup() overwrites the +* shared array; used to map in place if nothing migrates. +*/ +if (!ret) + hmm_pfn0 = range.hmm_pfns[0 ]; +migrate_hmm_range_setup (&range); +if (ret) { +migrate_vma_pages (&migrate); +migrate_vma_finalize (&migrate); + goto unlock; + } + + n =nouveau_dmem_migrate_alloc_and_copy (drm, svmm, &migrate, + dma_info, pfns, + &nr_dma, &order); + +/* Only a migrated page has an in-flight CE copy to unblock below. */ +for (i =0 , migrated = false; i < npages; i++) { +if (migrate.dst[i]) { + migrated = true; +break ; + } + } + +/* +* Track a copy fence only when a copy was enqueued; waiting on an +* empty fence would block until the fault's CTXSW_TIMEOUT. +*/ +if (migrated) + fret =nouveau_dmem_fence_new (drm, &fence); + +/* +* The fault-in path must replay the faulting channel before waiting on +* the copy fence: with the fault still unreplayed the copy does not +* make progress. GPU has no mapping so it might refault, until it +* gets the migrated or mirrored mapping; it is mapped only once the +* copy is confirmed. In practice such a refault doesn't hold up the +* copy; as a safety net, if the copy doesn't complete by the +* deadline, the migration is aborted and the fault is mapped in place. +*/ +if (drm->svm && migrated) +nouveau_svm_fault_replay (drm->svm); + +/* Without a fence (fret set) the copy can't be confirmed. */ +if (migrated && !fret) + fret =nouveau_dmem_fence_poll (&fence); + +/* Commit the migration only once the copy is confirmed. */ +if (fret) +nouveau_dmem_migrate_abort (drm, &migrate); +migrate_vma_pages (&migrate); + +/* +* Don't map destination pages that migrate_vma_pages() didn't +* migrate: finalize frees them and restores the source. +*/ +for (i =0 ; i < npages; i++) +if (!(migrate.src[i] &MIGRATE_PFN_MIGRATE )) + pfns[i] =NVIF_VMM_PFNMAP_V0_NONE ; + +mutex_lock (&svmm->mutex); +if (fret) { +/* Copy did not complete; don't map a half-copied page. */ + ret = -EIO ; + }else if (mmu_interval_read_retry (notifier, range.notifier_seq)) { + ret = -EBUSY ; + }else { +unsigned long map_addr = migrate.start; +unsigned int page_shift =PAGE_SHIFT + order; + +/* +* If nothing migrated might still be able to mirror. +* In that case use the snapshot hmm_pfn. +* npages == 1 always today. +* +* A read-only device private page of ours is reported +* without HMM_PFN_WRITE even for a write fault, because +* hmm_range_fault() doesn't fault the caller's own device +* private pages. It is then mapped read-only and the GPU +* faults again, as with nouveau_range_fault(). That is +* pre-existing and needs a fix in hmm_range_fault(). +*/ +if (npages ==1 && !(pfns[0 ] &NVIF_VMM_PFNMAP_V0_V )) + pfns[0 ] =nouveau_dmem_hmm_pfn_to_map (hmm_pfn0, + start, &map_addr, &page_shift); + +/* +* Nothing to map: leave the GPU mapping alone, the +* caller falls back to nouveau_range_fault(). +*/ +if (pfns[0 ] &NVIF_VMM_PFNMAP_V0_V ) { +/* On failure the caller falls back, then cancels */ + ret =__nouveau_pfns_map_locked (svmm, map_addr, + pfns, n, + page_shift); +if (!ret) { + *out_pfn0 = pfns[0 ]; + *out_addr = map_addr; + *out_shift = page_shift; + } + } + } +/* +* The migration may be committed without being mapped, and our +* own MIGRATE invalidation didn't clear the GPU page table: drop +* a mapping an earlier fault left to a source page that finalize +* may free. +*/ +if (ret && !fret) +nouveau_svmm_invalidate (svmm, migrate.start, migrate.end); +mutex_unlock (&svmm->mutex); + +if (fret) +NV_ERROR (drm, +"svm: migrate copy did not complete (%d) for %lx-%lx\n" , + fret, start, end); + +/* After an aborted copy the engine may still use the mappings */ +while (!fret && nr_dma--) { +dma_unmap_page (drm->dev->dev, dma_info[nr_dma].dma_addr, + dma_info[nr_dma].size,DMA_BIDIRECTIONAL ); + } +migrate_vma_finalize (&migrate); +unlock: +mmap_read_unlock (mm); + }while (ret == -EBUSY && !time_after (jiffies, timeout)); + +/* Nothing migrated or mappable in place, fallback to nouveau_range_fault(). */ +if (!ret && !(pfns[0 ] &NVIF_VMM_PFNMAP_V0_V )) + ret = -ENOENT ; + +nouveau_pfns_free (pfns); +out_free_dma: +kfree (dma_info); +out_free_dst: +kfree (migrate.dst); +out_free_src: +kfree (migrate.src); +return ret; +} + int nouveau_dmem_migrate_vma(struct nouveau_drm *drm, struct nouveau_svmm *svmm,
drivers/gpu/drm/nouveau/nouveau_dmem.h +12 -0
@@ -27,6 +27,7 @@ struct drm_file;struct nouveau_drm ;struct nouveau_svmm ;struct hmm_range ; +struct mmu_interval_notifier ;#if IS_ENABLED (CONFIG_DRM_NOUVEAU_SVM )void nouveau_dmem_init (struct nouveau_drm *);
@@ -39,7 +40,18 @@ int nouveau_dmem_migrate_vma(struct nouveau_drm *drm,struct vm_area_struct *vma, unsigned long start, unsigned long end); +int nouveau_dmem_migrate_fault (struct nouveau_drm *drm, +struct nouveau_svmm *svmm, +struct mmu_interval_notifier *notifier, +unsigned long start, +unsigned long end, +unsigned long hmm_flags, +u64 *out_pfn0, +unsigned long *out_addr, +unsigned int *out_shift);unsigned long nouveau_dmem_page_addr (struct page *page); +u64 nouveau_dmem_hmm_pfn_to_map (unsigned long hmm_pfn,unsigned long start, +unsigned long *map_addr,unsigned int *page_shift);#else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */ static inline void nouveau_dmem_init (struct nouveau_drm *drm) {}
drivers/gpu/drm/nouveau/nouveau_svm.c +116 -48
246 lines not on this page · raw message
drivers/gpu/drm/nouveau/nouveau_svm.h +5 -0
@@ -5,6 +5,7 @@struct drm_device ;struct drm_file ;struct nouveau_drm ; +struct nouveau_svm ;struct nouveau_svmm {struct mmu_notifier notifier;
@@ -35,6 +36,10 @@ void nouveau_pfns_free(u64 *pfns);void nouveau_pfns_map (struct nouveau_svmm *svmm,struct mm_struct *mm,unsigned long addr,u64 *pfns,unsigned long npages,unsigned int page_shift); +int __nouveau_pfns_map_locked (struct nouveau_svmm *svmm,unsigned long addr, +u64 *pfns,unsigned long npages, +unsigned int page_shift); +void nouveau_svm_fault_replay (struct nouveau_svm *svm);#else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */ static inline void nouveau_svm_init (struct nouveau_drm *drm) {}static inline void nouveau_svm_fini (struct nouveau_drm *drm) {}
Signature · 1 line
2.55.0
Patchwork
CI✗ CI.checkpatch: warning for Migrate on fault for device pages (rev10)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev10)
URL : https://patchwork.freedesktop.org/series/165953/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master 3009867cd31863246e4afc138520a7a8bd37bb11
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 810d0dd82c73704e54edc868593dfb2a91edff81
Author: Mika Penttilä <[email protected]> Date: Tue Dec 1 06:55:31 2026 +0200
drm/nouveau/svm: add support for migrate on fault
Add a direct user for the new HMM_PFN_REQ_MIGRATE flag and implement migrate on fault for nouveau driver. It is gated by the svm_migrate_on_fault module parameter, default off. When enabled, the policy is fully lazy: pages are migrated to VRAM on GPU fault, and SVM_BIND no longer migrates the bound range up front.
Added nouveau_dmem_migrate_fault() that faults a range in and does migrate collecting in a single hmm_range_fault() walk.
It uses the copy channel lock, the fence poll and the abort handling added by the previous two patches.
The migrate on fault path faults a single page and doesn't use MIGRATE_VMA_SELECT_COMPOUND, so a THP covering it is split first and stays split if the migration fails. Faulting in whole THPs is left for later.
As an optimization, a migration policy - deciding which faulting ranges are worth migrating to VRAM and which are better left mirrored in system memory - would be useful. This patch establishes the migrate-on-fault mechanism as a basis for later refinement.
A GPU write fault on a read-only device private page owned by nouveau is mapped read-only and refaults, because hmm_range_fault() reports the caller's own device private pages without faulting them. This is pre-existing (nouveau_range_fault() behaves the same) and needs a fix in hmm_range_fault().
+ /mt/dim checkpatch 97aca5859161fed6c75c5838e43ccc45ae7cc3d5 drm-intel 72ce0e44ff4a mm/Kconfig: changes for migrate on fault for device pages cb202139ca16 mm: add helper to convert HMM pfn to migrate pfn -:179: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #179: FILE: mm/migrate_device.c:1623:
+
+}
total: 0 errors, 0 warnings, 1 checks, 138 lines checked f4a89a78a807 mm/hmm: preparations for HMM to participate in migration 98b1d5e956a8 mm/hmm: do the plumbing for HMM to participate in migration -:65: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #65: FILE: mm/hmm.c:54:
+ spinlock_t *ptl;
-:73: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hmm_vma_walk' - possible side-effects? #73: FILE: mm/hmm.c:76:
+#define HMM_ASSERT_UNLOCKED(hmm_vma_walk) \
+ WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \
+ (hmm_vma_walk)->pmdlocked)
-:104: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV) #104: FILE: mm/hmm.c:112:
+ end-addr == HPAGE_PMD_SIZE) {
^
-:221: CHECK:BRACES: braces {} should be used on all arms of this statement #221: FILE: mm/hmm.c:464:
+ if (softleaf_is_device_private(entry)) {
[...]
else
[...]
-:325: CHECK:BRACES: braces {} should be used on all arms of this statement #325: FILE: mm/hmm.c:633:
+ if (minfo) {
[...]
+ } else
[...]
-:329: CHECK:BRACES: Unbalanced braces around else statement #329: FILE: mm/hmm.c:637:
+ } else
total: 0 errors, 0 warnings, 6 checks, 455 lines checked af929913da5d mm/hmm: implement rollback for device page migration in HMM pagewalk 04ef9f56b80f mm/hmm: migrate collection in HMM pagewalk - pte level 91e52c240f78 mm/hmm: migrate collection in HMM pagewalk - pmd level 71ae4bd26711 mm/hmm: add lazy MMU mode support for migration in HMM pagewalk ce772fbef63a mm: enable device page migration from HMM pagewalk 8c936dade656 lib/test_hmm: add a new testcase for the migrate on fault -:395: CHECK:LINE_SPACING: Please don't use multiple blank lines #395: FILE: tools/testing/selftests/mm/hmm-tests.c:947:
+
total: 0 errors, 0 warnings, 1 checks, 390 lines checked dde155435c9d Documentation/mm/hmm: document migration through hmm_range_fault() 69153ab7d5fc drm/nouveau/dmem: serialize the copy channel users -:162: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #162: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:829:
+ if (nouveau_dmem_copy(drm, folio_nr_pages(page_folio(spage)),
NOUVEAU_APER_VRAM, paddr, NOUVEAU_APER_HOST,
-:169: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #169: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:835:
+ if (nouveau_dmem_clear(drm, page_size(dpage),
NOUVEAU_APER_VRAM, paddr))
total: 0 errors, 0 warnings, 2 checks, 140 lines checkeda6ad2857e718 drm/nouveau/dmem: commit migrate_to_ram() only after the copy is confirmed 810d0dd82c73 drm/nouveau/svm: add support for migrate on fault
-:69: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #69: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:952:
+nouveau_dmem_migrate_alloc_and_copy(struct nouveau_drm *drm,
struct nouveau_svmm *svmm, struct migrate_vma *args,
-:88: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #88: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:983:
+static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,
+ struct nouveau_svmm *svmm, struct migrate_vma *args,
-:303: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #303: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:1203:
+ pfns[0] = nouveau_dmem_hmm_pfn_to_map(hmm_pfn0,
+ start, &map_addr, &page_shift);
total: 0 errors, 0 warnings, 3 checks, 601 lines checked
Patchwork
CI✓ CI.KUnit: success for Migrate on fault for device pages (rev10)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev10)
URL : https://patchwork.freedesktop.org/series/165953/
State : success
== Summary ==
+ trap cleanup EXIT
+ kunitconfigs=('/kernel/drivers/gpu/tests/.kunitconfig' '/kernel/drivers/gpu/drm/xe/.kunitconfig' '/kernel/drivers/gpu/drm/tests/.kunitconfig' '/kernel/drivers/gpu/drm/ttm/tests/.kunitconfig' '/kernel/drivers/dma-buf/.kunitconfig')
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/tests/.kunitconfig
[05:03:22] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [05:03:27] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [05:03:48] Starting KUnit Kernel (1/1)... [05:03:48] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [05:03:48] ================= gpu_buddy (15 subtests) ================== [05:03:48] [PASSED] gpu_test_buddy_alloc_limit [05:03:48] [PASSED] gpu_test_buddy_alloc_optimistic [05:03:48] [PASSED] gpu_test_buddy_alloc_pessimistic [05:03:48] [PASSED] gpu_test_buddy_alloc_pathological [05:03:48] [PASSED] gpu_test_buddy_alloc_contiguous [05:03:48] [PASSED] gpu_test_buddy_alloc_clear [05:03:48] [PASSED] gpu_test_buddy_alloc_range [05:03:48] [PASSED] gpu_test_buddy_alloc_range_bias [05:03:48] [PASSED] gpu_test_buddy_alloc_range_clear_guard [05:03:49] [PASSED] gpu_test_buddy_fragmentation_performance [05:03:50] [PASSED] gpu_test_buddy_dirty_tracker_performance [05:03:50] [PASSED] gpu_test_buddy_alloc_exceeds_max_order [05:03:50] [PASSED] gpu_test_buddy_offset_aligned_allocation [05:03:50] [PASSED] gpu_test_buddy_subtree_offset_alignment_stress [05:03:50] [PASSED] gpu_test_buddy_addr_to_block [05:03:50] ==================== [PASSED] gpu_buddy ==================== [05:03:50] ============================================================ [05:03:50] Testing complete. Ran 15 tests: passed: 15 [05:03:50] Elapsed time: 27.555s total, 5.076s configuring, 20.461s building, 1.978s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/xe/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [05:03:50] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [05:03:53] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [05:04:31] Starting KUnit Kernel (1/1)... [05:04:31] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [05:04:32] ================= xe_ggtt_iov (9 subtests) ================= [05:04:32] [PASSED] init_shared_pf [05:04:32] [PASSED] init_partial_overlap [05:04:32] [PASSED] alloc_usable_pool_low [05:04:32] [PASSED] alloc_shareable_pool_high [05:04:32] [PASSED] alloc_partial_overlap [05:04:32] [PASSED] alloc_partial_overlap_usable_full [05:04:32] [PASSED] alloc_partial_overlap_shareable_full [05:04:32] [PASSED] alloc_shareable_pool_unavailable [05:04:32] [PASSED] alloc_shareable_pool_oversized [05:04:32] =================== [PASSED] xe_ggtt_iov =================== [05:04:32] =================== xe_ggtt (3 subtests) =================== [05:04:32] [PASSED] init_native [05:04:32] [PASSED] alloc_usable_pool_native [05:04:32] [PASSED] alloc_usable_pool_oversized [05:04:32] ===================== [PASSED] xe_ggtt ===================== [05:04:32] ================== guc_buf (11 subtests) =================== [05:04:32] [PASSED] test_smallest [05:04:32] [PASSED] test_largest [05:04:32] [PASSED] test_granular [05:04:32] [PASSED] test_unique [05:04:32] [PASSED] test_overlap [05:04:32] [PASSED] test_reusable [05:04:32] [PASSED] test_too_big [05:04:32] [PASSED] test_flush [05:04:32] [PASSED] test_lookup [05:04:32] [PASSED] test_data [05:04:32] [PASSED] test_class [05:04:32] ===================== [PASSED] guc_buf ===================== [05:04:32] =================== guc_dbm (7 subtests) =================== [05:04:32] [PASSED] test_empty [05:04:32] [PASSED] test_default [05:04:32] ======================== test_size ======================== [05:04:32] [PASSED] 4 [05:04:32] [PASSED] 8 [05:04:32] [PASSED] 32 [05:04:32] [PASSED] 256 [05:04:32] ==================== [PASSED] test_size ==================== [05:04:32] ======================= test_reuse ======================== [05:04:32] [PASSED] 4 [05:04:32] [PASSED] 8 [05:04:32] [PASSED] 32 [05:04:32] [PASSED] 256 [05:04:32] =================== [PASSED] test_reuse ==================== [05:04:32] =================== test_range_overlap ==================== [05:04:32] [PASSED] 4 [05:04:32] [PASSED] 8 [05:04:32] [PASSED] 32 [05:04:32] [PASSED] 256 [05:04:32] =============== [PASSED] test_range_overlap ================ [05:04:32] =================== test_range_compact ==================== [05:04:32] [PASSED] 4 [05:04:32] [PASSED] 8 [05:04:32] [PASSED] 32 [05:04:32] [PASSED] 256 [05:04:32] =============== [PASSED] test_range_compact ================ [05:04:32] ==================== test_range_spare ===================== [05:04:32] [PASSED] 4 [05:04:32] [PASSED] 8 [05:04:32] [PASSED] 32 [05:04:32] [PASSED] 256 [05:04:32] ================ [PASSED] test_range_spare ================= [05:04:32] ===================== [PASSED] guc_dbm ===================== [05:04:32] ================== guc_idm (22 subtests) =================== [05:04:32] [PASSED] bad_init [05:04:32] [PASSED] no_init [05:04:32] [PASSED] init_fini [05:04:32] [PASSED] check_init_small [05:04:32] [PASSED] check_init_shared [05:04:32] [PASSED] check_used [05:04:32] [PASSED] check_quota [05:04:32] [PASSED] check_all [05:04:32] [PASSED] check_limits [05:04:32] [PASSED] check_overlap [05:04:32] [PASSED] check_overlap_alloc [05:04:32] [PASSED] check_overlap_release [05:04:32] [PASSED] check_overlap_partial_init [05:04:32] [PASSED] check_overlap_partial_shared_range_blocking [05:04:32] [PASSED] check_used_usable [05:04:32] [PASSED] check_used_shareable [05:04:32] [PASSED] check_used_mixed [05:04:32] [PASSED] check_release_usable_range [05:04:32] [PASSED] check_release_shareable_range [05:04:32] [PASSED] check_split_boundaries [05:04:32] [PASSED] check_shareable_spare [05:04:32] [PASSED] check_shareable_spare_fragmented_tail [05:04:32] ===================== [PASSED] guc_idm ===================== [05:04:32] ============== guc_klv_helpers (13 subtests) =============== [05:04:32] [PASSED] test_count [05:04:32] [PASSED] test_encode_u32 [05:04:32] [PASSED] test_encode_u64 [05:04:32] [PASSED] test_encode_string [05:04:32] [PASSED] test_encode_object_raw [05:04:32] [PASSED] test_encode_object_klv [05:04:32] [PASSED] test_encode_object_nested [05:04:32] [PASSED] test_encode_object_basic [05:04:32] ===================== test_decode_u16 ===================== [05:04:32] [PASSED] empty [05:04:32] [PASSED] valid [05:04:32] [PASSED] max [05:04:32] [PASSED] big [05:04:32] [PASSED] long [05:04:32] ================= [PASSED] test_decode_u16 ================= [05:04:32] ===================== test_decode_u32 ===================== [05:04:32] [PASSED] empty [05:04:32] [PASSED] valid [05:04:32] [PASSED] max [05:04:32] [PASSED] long [05:04:32] ================= [PASSED] test_decode_u32 ================= [05:04:32] ===================== test_decode_u64 ===================== [05:04:32] [PASSED] empty [05:04:32] [PASSED] short [05:04:32] [PASSED] valid [05:04:32] [PASSED] max [05:04:32] [PASSED] long [05:04:32] ================= [PASSED] test_decode_u64 ================= [05:04:32] ===================== test_decode_str ===================== [05:04:32] [PASSED] empty [05:04:32] [PASSED] one [05:04:32] [PASSED] one_trash [05:04:32] [PASSED] two [05:04:32] [PASSED] two_trash [05:04:32] [PASSED] three [05:04:32] [PASSED] dword [05:04:32] [PASSED] four [05:04:32] [PASSED] five [05:04:32] [PASSED] six [05:04:32] [PASSED] seven [05:04:32] [PASSED] qword [05:04:32] ================= [PASSED] test_decode_str ================= [05:04:32] [PASSED] test_print [05:04:32] ================= [PASSED] guc_klv_helpers ================= [05:04:32] =================== xe_log (6 subtests) ==================== [05:04:32] [PASSED] demo_cper [05:04:32] [PASSED] demo_dmesg [05:04:32] [PASSED] test_cper_null_xe [05:04:32] ======================= test_dmesg ======================== [05:04:32] [PASSED] test_fatal [05:04:32] [PASSED] test_fatal_tile [05:04:32] [PASSED] test_fatal_gt [05:04:32] [PASSED] test_fatal_comp [05:04:32] [PASSED] test_fatal_comp_tile [05:04:32] [PASSED] test_fatal_comp_gt [05:04:32] [PASSED] test_fatal_all [05:04:32] [PASSED] test_recoverable [05:04:32] [PASSED] test_recoverable_tile [05:04:32] [PASSED] test_recoverable_gt [05:04:32] [PASSED] test_recoverable_comp [05:04:32] [PASSED] test_recoverable_comp_tile [05:04:32] [PASSED] test_recoverable_comp_gt [05:04:32] [PASSED] test_recoverable_all [05:04:32] [PASSED] test_info [05:04:32] [PASSED] test_info_tile [05:04:32] [PASSED] test_info_gt [05:04:32] [PASSED] test_info_err [05:04:32] [PASSED] test_info_comp [05:04:32] [PASSED] test_info_comp_tile [05:04:32] [PASSED] test_info_comp_gt [05:04:32] [PASSED] test_info_all [05:04:32] [PASSED] test_hw_fatal [05:04:32] [PASSED] test_hw_recoverable [05:04:32] [PASSED] test_hw_corrected [05:04:32] [PASSED] test_hw_informational [05:04:32] =================== [PASSED] test_dmesg ==================== [05:04:32] ====================== test_sw_cper ======================= [05:04:32] [PASSED] sw-fatal-errno [05:04:32] [PASSED] sw-recoverable-errno [05:04:32] [PASSED] sw-corrected [05:04:32] [PASSED] sw-informational [05:04:32] [PASSED] sw-with-error-class [05:04:32] ================== [PASSED] test_sw_cper =================== [05:04:32] ====================== test_invalid ======================= [05:04:32] [SKIPPED] no-component no-location no-warn (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] reserved location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] unknown location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] nonzero-device-id location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] invalid-tile-id location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] invalid-gt-id location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] unknown component class (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] unknown system component (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] unknown hardware component (requires CONFIG_DRM_XE_DEBUG) [05:04:32] [SKIPPED] unknown component and location (requires CONFIG_DRM_XE_DEBUG) [05:04:32] ================== [SKIPPED] test_invalid ================== [05:04:32] ===================== [PASSED] xe_log ====================== [05:04:32] ================== no_relay (3 subtests) =================== [05:04:32] [PASSED] xe_drops_guc2pf_if_not_ready [05:04:32] [PASSED] xe_drops_guc2vf_if_not_ready [05:04:32] [PASSED] xe_rejects_send_if_not_ready [05:04:32] ==================== [PASSED] no_relay ===================== [05:04:32] ================== pf_relay (14 subtests) ================== [05:04:32] [PASSED] pf_rejects_guc2pf_too_short [05:04:32] [PASSED] pf_rejects_guc2pf_too_long [05:04:32] [PASSED] pf_rejects_guc2pf_no_payload [05:04:32] [PASSED] pf_fails_no_payload [05:04:32] [PASSED] pf_fails_bad_origin [05:04:32] [PASSED] pf_fails_bad_type [05:04:32] [PASSED] pf_txn_reports_error [05:04:32] [PASSED] pf_txn_sends_pf2guc [05:04:32] [PASSED] pf_sends_pf2guc [05:04:32] [SKIPPED] pf_loopback_nop (requires CONFIG_DRM_XE_DEBUG_SRIOV) [05:04:32] [SKIPPED] pf_loopback_echo (requires CONFIG_DRM_XE_DEBUG_SRIOV) [05:04:32] [SKIPPED] pf_loopback_fail (requires CONFIG_DRM_XE_DEBUG_SRIOV) [05:04:32] [SKIPPED] pf_loopback_busy (requires CONFIG_DRM_XE_DEBUG_SRIOV) [05:04:32] [SKIPPED] pf_loopback_retry (requires CONFIG_DRM_XE_DEBUG_SRIOV) [05:04:32] ==================== [PASSED] pf_relay ===================== [05:04:32] ================== vf_relay (3 subtests) =================== [05:04:32] [PASSED] vf_rejects_guc2vf_too_short [05:04:32] [PASSED] vf_rejects_guc2vf_too_long [05:04:32] [PASSED] vf_rejects_guc2vf_no_payload [05:04:32] ==================== [PASSED] vf_relay ===================== [05:04:32] ================ pf_gt_config (9 subtests) ================= [05:04:32] [PASSED] fair_contexts_1vf [05:04:32] [PASSED] fair_doorbells_1vf [05:04:32] [PASSED] fair_ggtt_1vf [05:04:32] ====================== fair_vram_1vf ====================== [05:04:32] [PASSED] 3.50 GiB [05:04:32] [PASSED] 11.5 GiB [05:04:32] [PASSED] 15.5 GiB [05:04:32] [PASSED] 31.5 GiB [05:04:32] [PASSED] 63.5 GiB [05:04:32] [PASSED] 1.91 GiB [05:04:32] ================== [PASSED] fair_vram_1vf ================== [05:04:32] ================ fair_vram_1vf_admin_only ================= [05:04:32] [PASSED] 3.50 GiB [05:04:32] [PASSED] 11.5 GiB [05:04:32] [PASSED] 15.5 GiB [05:04:32] [PASSED] 31.5 GiB [05:04:32] [PASSED] 63.5 GiB [05:04:32] [PASSED] 1.91 GiB [05:04:32] ============ [PASSED] fair_vram_1vf_admin_only ============= [05:04:32] ====================== fair_contexts ====================== [05:04:32] [PASSED] 1 VF [05:04:32] [PASSED] 2 VFs [05:04:32] [PASSED] 3 VFs [05:04:32] [PASSED] 4 VFs [05:04:32] [PASSED] 5 VFs [05:04:32] [PASSED] 6 VFs [05:04:32] [PASSED] 7 VFs [05:04:32] [PASSED] 8 VFs [05:04:32] [PASSED] 9 VFs [05:04:32] [PASSED] 10 VFs [05:04:32] [PASSED] 11 VFs [05:04:32] [PASSED] 12 VFs [05:04:32] [PASSED] 13 VFs [05:04:32] [PASSED] 14 VFs [05:04:32] [PASSED] 15 VFs [05:04:32] [PASSED] 16 VFs [05:04:32] [PASSED] 17 VFs [05:04:32] [PASSED] 18 VFs [05:04:32] [PASSED] 19 VFs [05:04:32] [PASSED] 20 VFs [05:04:32] [PASSED] 21 VFs [05:04:32] [PASSED] 22 VFs [05:04:32] [PASSED] 23 VFs [05:04:32] [PASSED] 24 VFs [05:04:32] [PASSED] 25 VFs [05:04:32] [PASSED] 26 VFs [05:04:32] [PASSED] 27 VFs [05:04:32] [PASSED] 28 VFs [05:04:32] [PASSED] 29 VFs [05:04:32] [PASSED] 30 VFs [05:04:32] [PASSED] 31 VFs [05:04:32] [PASSED] 32 VFs [05:04:32] [PASSED] 33 VFs [05:04:32] [PASSED] 34 VFs [05:04:32] [PASSED] 35 VFs [05:04:32] [PASSED] 36 VFs [05:04:32] [PASSED] 37 VFs [05:04:32] [PASSED] 38 VFs [05:04:32] [PASSED] 39 VFs [05:04:32] [PASSED] 40 VFs [05:04:32] [PASSED] 41 VFs [05:04:32] [PASSED] 42 VFs [05:04:32] [PASSED] 43 VFs [05:04:32] [PASSED] 44 VFs [05:04:32] [PASSED] 45 VFs [05:04:32] [PASSED] 46 VFs [05:04:32] [PASSED] 47 VFs [05:04:32] [PASSED] 48 VFs [05:04:32] [PASSED] 49 VFs [05:04:32] [PASSED] 50 VFs [05:04:32] [PASSED] 51 VFs [05:04:32] [PASSED] 52 VFs [05:04:32] [PASSED] 53 VFs [05:04:32] [PASSED] 54 VFs [05:04:32] [PASSED] 55 VFs [05:04:32] [PASSED] 56 VFs [05:04:32] [PASSED] 57 VFs [05:04:32] [PASSED] 58 VFs [05:04:32] [PASSED] 59 VFs [05:04:32] [PASSED] 60 VFs [05:04:32] [PASSED] 61 VFs [05:04:32] [PASSED] 62 VFs [05:04:32] [PASSED] 63 VFs [05:04:32] ================== [PASSED] fair_contexts ================== [05:04:32] ===================== fair_doorbells ====================== [05:04:32] [PASSED] 1 VF [05:04:32] [PASSED] 2 VFs [05:04:32] [PASSED] 3 VFs [05:04:32] [PASSED] 4 VFs [05:04:32] [PASSED] 5 VFs [05:04:32] [PASSED] 6 VFs [05:04:32] [PASSED] 7 VFs [05:04:32] [PASSED] 8 VFs [05:04:32] [PASSED] 9 VFs [05:04:32] [PASSED] 10 VFs [05:04:32] [PASSED] 11 VFs [05:04:32] [PASSED] 12 VFs [05:04:32] [PASSED] 13 VFs [05:04:32] [PASSED] 14 VFs [05:04:32] [PASSED] 15 VFs [05:04:32] [PASSED] 16 VFs [05:04:32] [PASSED] 17 VFs [05:04:32] [PASSED] 18 VFs [05:04:32] [PASSED] 19 VFs [05:04:32] [PASSED] 20 VFs [05:04:32] [PASSED] 21 VFs [05:04:32] [PASSED] 22 VFs [05:04:32] [PASSED] 23 VFs [05:04:32] [PASSED] 24 VFs [05:04:32] [PASSED] 25 VFs [05:04:32] [PASSED] 26 VFs [05:04:32] [PASSED] 27 VFs [05:04:32] [PASSED] 28 VFs [05:04:32] [PASSED] 29 VFs [05:04:32] [PASSED] 30 VFs [05:04:32] [PASSED] 31 VFs [05:04:32] [PASSED] 32 VFs [05:04:32] [PASSED] 33 VFs [05:04:32] [PASSED] 34 VFs [05:04:32] [PASSED] 35 VFs [05:04:32] [PASSED] 36 VFs [05:04:32] [PASSED] 37 VFs [05:04:32] [PASSED] 38 VFs [05:04:32] [PASSED] 39 VFs [05:04:32] [PASSED] 40 VFs [05:04:32] [PASSED] 41 VFs [05:04:32] [PASSED] 42 VFs [05:04:32] [PASSED] 43 VFs [05:04:32] [PASSED] 44 VFs [05:04:32] [PASSED] 45 VFs [05:04:32] [PASSED] 46 VFs [05:04:32] [PASSED] 47 VFs [05:04:32] [PASSED] 48 VFs [05:04:32] [PASSED] 49 VFs [05:04:32] [PASSED] 50 VFs [05:04:32] [PASSED] 51 VFs [05:04:32] [PASSED] 52 VFs [05:04:32] [PASSED] 53 VFs [05:04:32] [PASSED] 54 VFs [05:04:32] [PASSED] 55 VFs [05:04:32] [PASSED] 56 VFs [05:04:32] [PASSED] 57 VFs [05:04:32] [PASSED] 58 VFs [05:04:32] [PASSED] 59 VFs [05:04:32] [PASSED] 60 VFs [05:04:32] [PASSED] 61 VFs [05:04:32] [PASSED] 62 VFs [05:04:32] [PASSED] 63 VFs [05:04:32] ================= [PASSED] fair_doorbells ================== [05:04:32] ======================== fair_ggtt ======================== [05:04:32] [PASSED] 1 VF [05:04:32] [PASSED] 2 VFs [05:04:32] [PASSED] 3 VFs [05:04:32] [PASSED] 4 VFs [05:04:32] [PASSED] 5 VFs [05:04:32] [PASSED] 6 VFs [05:04:32] [PASSED] 7 VFs [05:04:32] [PASSED] 8 VFs [05:04:32] [PASSED] 9 VFs [05:04:32] [PASSED] 10 VFs [05:04:32] [PASSED] 11 VFs [05:04:32] [PASSED] 12 VFs [05:04:32] [PASSED] 13 VFs [05:04:32] [PASSED] 14 VFs [05:04:32] [PASSED] 15 VFs [05:04:32] [PASSED] 16 VFs [05:04:32] [PASSED] 17 VFs [05:04:32] [PASSED] 18 VFs [05:04:32] [PASSED] 19 VFs [05:04:32] [PASSED] 20 VFs [05:04:32] [PASSED] 21 VFs [05:04:32] [PASSED] 22 VFs [05:04:32] [PASSED] 23 VFs [05:04:32] [PASSED] 24 VFs [05:04:32] [PASSED] 25 VFs [05:04:32] [PASSED] 26 VFs [05:04:32] [PASSED] 27 VFs [05:04:32] [PASSED] 28 VFs [05:04:32] [PASSED] 29 VFs [05:04:32] [PASSED] 30 VFs [05:04:32] [PASSED] 31 VFs [05:04:32] [PASSED] 32 VFs [05:04:32] [PASSED] 33 VFs [05:04:32] [PASSED] 34 VFs [05:04:32] [PASSED] 35 VFs [05:04:32] [PASSED] 36 VFs [05:04:32] [PASSED] 37 VFs [05:04:32] [PASSED] 38 VFs [05:04:32] [PASSED] 39 VFs [05:04:32] [PASSED] 40 VFs [05:04:32] [PASSED] 41 VFs [05:04:32] [PASSED] 42 VFs [05:04:32] [PASSED] 43 VFs [05:04:32] [PASSED] 44 VFs [05:04:32] [PASSED] 45 VFs [05:04:32] [PASSED] 46 VFs [05:04:32] [PASSED] 47 VFs [05:04:32] [PASSED] 48 VFs [05:04:32] [PASSED] 49 VFs [05:04:32] [PASSED] 50 VFs [05:04:32] [PASSED] 51 VFs [05:04:32] [PASSED] 52 VFs [05:04:32] [PASSED] 53 VFs [05:04:32] [PASSED] 54 VFs [05:04:32] [PASSED] 55 VFs [05:04:32] [PASSED] 56 VFs [05:04:32] [PASSED] 57 VFs [05:04:32] [PASSED] 58 VFs [05:04:32] [PASSED] 59 VFs [05:04:32] [PASSED] 60 VFs [05:04:32] [PASSED] 61 VFs [05:04:32] [PASSED] 62 VFs [05:04:32] [PASSED] 63 VFs [05:04:32] ==================== [PASSED] fair_ggtt ==================== [05:04:32] ======================== fair_vram ======================== [05:04:32] [PASSED] 1 VF [05:04:32] [PASSED] 2 VFs [05:04:32] [PASSED] 3 VFs [05:04:32] [PASSED] 4 VFs [05:04:32] [PASSED] 5 VFs [05:04:32] [PASSED] 6 VFs [05:04:32] [PASSED] 7 VFs [05:04:32] [PASSED] 8 VFs [05:04:32] [PASSED] 9 VFs [05:04:32] [PASSED] 10 VFs [05:04:32] [PASSED] 11 VFs [05:04:32] [PASSED] 12 VFs [05:04:32] [PASSED] 13 VFs [05:04:32] [PASSED] 14 VFs [05:04:32] [PASSED] 15 VFs [05:04:32] [PASSED] 16 VFs [05:04:32] [PASSED] 17 VFs [05:04:32] [PASSED] 18 VFs [05:04:32] [PASSED] 19 VFs [05:04:32] [PASSED] 20 VFs [05:04:32] [PASSED] 21 VFs [05:04:32] [PASSED] 22 VFs [05:04:32] [PASSED] 23 VFs [05:04:32] [PASSED] 24 VFs [05:04:32] [PASSED] 25 VFs [05:04:32] [PASSED] 26 VFs [05:04:32] [PASSED] 27 VFs [05:04:32] [PASSED] 28 VFs [05:04:32] [PASSED] 29 VFs [05:04:32] [PASSED] 30 VFs [05:04:32] [PASSED] 31 VFs [05:04:32] [PASSED] 32 VFs [05:04:32] [PASSED] 33 VFs [05:04:32] [PASSED] 34 VFs [05:04:32] [PASSED] 35 VFs [05:04:32] [PASSED] 36 VFs [05:04:32] [PASSED] 37 VFs [05:04:32] [PASSED] 38 VFs [05:04:32] [PASSED] 39 VFs [05:04:32] [PASSED] 40 VFs [05:04:32] [PASSED] 41 VFs [05:04:32] [PASSED] 42 VFs [05:04:32] [PASSED] 43 VFs [05:04:32] [PASSED] 44 VFs [05:04:32] [PASSED] 45 VFs [05:04:32] [PASSED] 46 VFs [05:04:32] [PASSED] 47 VFs [05:04:32] [PASSED] 48 VFs [05:04:32] [PASSED] 49 VFs [05:04:32] [PASSED] 50 VFs [05:04:32] [PASSED] 51 VFs [05:04:32] [PASSED] 52 VFs [05:04:32] [PASSED] 53 VFs [05:04:32] [PASSED] 54 VFs [05:04:32] [PASSED] 55 VFs [05:04:32] [PASSED] 56 VFs [05:04:32] [PASSED] 57 VFs [05:04:32] [PASSED] 58 VFs [05:04:32] [PASSED] 59 VFs [05:04:32] [PASSED] 60 VFs [05:04:32] [PASSED] 61 VFs [05:04:32] [PASSED] 62 VFs [05:04:32] [PASSED] 63 VFs [05:04:32] ==================== [PASSED] fair_vram ==================== [05:04:32] ================== [PASSED] pf_gt_config =================== [05:04:32] ===================== lmtt (1 subtest) ===================== [05:04:32] ======================== test_ops ========================= [05:04:32] [PASSED] 2-level [05:04:32] [PASSED] multi-level [05:04:32] ==================== [PASSED] test_ops ===================== [05:04:32] ====================== [PASSED] lmtt ======================= [05:04:32] ================= sriov_packet (1 subtest) ================= [05:04:32] [PASSED] test_descriptor_init [05:04:32] ================== [PASSED] sriov_packet =================== [05:04:32] ================= pf_service (11 subtests) ================= [05:04:32] [PASSED] pf_negotiate_any [05:04:32] [PASSED] pf_negotiate_base_match [05:04:32] [PASSED] pf_negotiate_base_newer [05:04:32] [PASSED] pf_negotiate_base_next [05:04:32] [SKIPPED] pf_negotiate_base_older (no older minor) [05:04:32] [PASSED] pf_negotiate_base_prev [05:04:32] [PASSED] pf_negotiate_latest_match [05:04:32] [PASSED] pf_negotiate_latest_newer [05:04:32] [PASSED] pf_negotiate_latest_next [05:04:32] [SKIPPED] pf_negotiate_latest_older (no older minor) [05:04:32] [SKIPPED] pf_negotiate_latest_prev (no prev major) [05:04:32] =================== [PASSED] pf_service ==================== [05:04:32] ================= xe_guc_g2g (2 subtests) ================== [05:04:32] ============== xe_live_guc_g2g_kunit_default ============== [05:04:32] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ========== [05:04:32] ============== xe_live_guc_g2g_kunit_allmem =============== [05:04:32] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ========== [05:04:32] =================== [SKIPPED] xe_guc_g2g =================== [05:04:32] =================== xe_mocs (2 subtests) =================== [05:04:32] ================ xe_live_mocs_kernel_kunit ================ [05:04:32] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============ [05:04:32] ================ xe_live_mocs_reset_kunit ================= [05:04:32] ============ [SKIPPED] xe_live_mocs_reset_kunit ============ [05:04:32] ==================== [SKIPPED] xe_mocs ===================== [05:04:32] ================= xe_migrate (3 subtests) ================== [05:04:32] ================= xe_migrate_sanity_kunit ================= [05:04:32] ============ [SKIPPED] xe_migrate_sanity_kunit ============= [05:04:32] ================== xe_validate_ccs_kunit ================== [05:04:32] ============= [SKIPPED] xe_validate_ccs_kunit ============== [05:04:32] ============= xe_migrate_access_memory_kunit ============== [05:04:32] ========= [SKIPPED] xe_migrate_access_memory_kunit ========= [05:04:32] =================== [SKIPPED] xe_migrate =================== [05:04:32] ================== xe_dma_buf (1 subtest) ================== [05:04:32] ==================== xe_dma_buf_kunit ===================== [05:04:32] ================ [SKIPPED] xe_dma_buf_kunit ================ [05:04:32] =================== [SKIPPED] xe_dma_buf =================== [05:04:32] ================= xe_bo_shrink (1 subtest) ================= [05:04:32] =================== xe_bo_shrink_kunit ==================== [05:04:32] =============== [SKIPPED] xe_bo_shrink_kunit =============== [05:04:32] ================== [SKIPPED] xe_bo_shrink ================== [05:04:32] ==================== xe_bo (2 subtests) ==================== [05:04:32] ================== xe_ccs_migrate_kunit =================== [05:04:32] ============== [SKIPPED] xe_ccs_migrate_kunit ============== [05:04:32] ==================== xe_bo_evict_kunit ==================== [05:04:32] =============== [SKIPPED] xe_bo_evict_kunit ================ [05:04:32] ===================== [SKIPPED] xe_bo ====================== [05:04:32] =================== xe_any (9 subtests) ==================== [05:04:32] [PASSED] test_to_xe [05:04:32] [PASSED] test_to_dev [05:04:32] [PASSED] test_to_pdev [05:04:32] [PASSED] test_to_drm [05:04:32] [PASSED] test_if_pdev [05:04:32] [PASSED] test_if_xe [05:04:32] [PASSED] test_if_tile [05:04:32] [PASSED] test_if_gt [05:04:32] [PASSED] test_to_id [05:04:32] ===================== [PASSED] xe_any ====================== [05:04:32] ==================== args (13 subtests) ==================== [05:04:32] [PASSED] count_args_test [05:04:32] [PASSED] call_args_example [05:04:32] [PASSED] call_args_test [05:04:32] [PASSED] drop_first_arg_example [05:04:32] [PASSED] drop_first_arg_test [05:04:32] [PASSED] first_arg_example [05:04:32] [PASSED] first_arg_test [05:04:32] [PASSED] last_arg_example [05:04:32] [PASSED] last_arg_test [05:04:32] [PASSED] pick_arg_example [05:04:32] [PASSED] if_args_example [05:04:32] [PASSED] if_args_test [05:04:32] [PASSED] sep_comma_example [05:04:32] ====================== [PASSED] args ======================= [05:04:32] =================== xe_pci (3 subtests) ==================== [05:04:32] ==================== check_graphics_ip ==================== [05:04:32] [PASSED] 12.00 Xe_LP [05:04:32] [PASSED] 12.10 Xe_LP+ [05:04:32] [PASSED] 12.55 Xe_HPG [05:04:32] [PASSED] 12.60 Xe_HPC [05:04:32] [PASSED] 12.70 Xe_LPG [05:04:32] [PASSED] 12.71 Xe_LPG [05:04:32] [PASSED] 12.74 Xe_LPG+ [05:04:32] [PASSED] 20.01 Xe2_HPG [05:04:32] [PASSED] 20.02 Xe2_HPG [05:04:32] [PASSED] 20.04 Xe2_LPG [05:04:32] [PASSED] 30.00 Xe3_LPG [05:04:32] [PASSED] 30.01 Xe3_LPG [05:04:32] [PASSED] 30.03 Xe3_LPG [05:04:32] [PASSED] 30.04 Xe3_LPG [05:04:32] [PASSED] 30.05 Xe3_LPG [05:04:32] [PASSED] 35.10 Xe3p_LPG [05:04:32] [PASSED] 35.11 Xe3p_XPC [05:04:32] ================ [PASSED] check_graphics_ip ================ [05:04:32] ===================== check_media_ip ====================== [05:04:32] [PASSED] 12.00 Xe_M [05:04:32] [PASSED] 12.55 Xe_HPM [05:04:32] [PASSED] 13.00 Xe_LPM+ [05:04:32] [PASSED] 13.01 Xe2_HPM [05:04:32] [PASSED] 20.00 Xe2_LPM [05:04:32] [PASSED] 30.00 Xe3_LPM [05:04:32] [PASSED] 30.02 Xe3_LPM [05:04:32] [PASSED] 35.00 Xe3p_LPM [05:04:32] [PASSED] 35.03 Xe3p_HPM [05:04:32] ================= [PASSED] check_media_ip ================== [05:04:32] =================== check_platform_desc =================== [05:04:32] [PASSED] 0x9A60 (TIGERLAKE) [05:04:32] [PASSED] 0x9A68 (TIGERLAKE) [05:04:32] [PASSED] 0x9A70 (TIGERLAKE) [05:04:32] [PASSED] 0x9A40 (TIGERLAKE) [05:04:32] [PASSED] 0x9A49 (TIGERLAKE) [05:04:32] [PASSED] 0x9A59 (TIGERLAKE) [05:04:32] [PASSED] 0x9A78 (TIGERLAKE) [05:04:32] [PASSED] 0x9AC0 (TIGERLAKE) [05:04:32] [PASSED] 0x9AC9 (TIGERLAKE) [05:04:32] [PASSED] 0x9AD9 (TIGERLAKE) [05:04:32] [PASSED] 0x9AF8 (TIGERLAKE) [05:04:32] [PASSED] 0x4C80 (ROCKETLAKE) [05:04:32] [PASSED] 0x4C8A (ROCKETLAKE) [05:04:32] [PASSED] 0x4C8B (ROCKETLAKE) [05:04:32] [PASSED] 0x4C8C (ROCKETLAKE) [05:04:32] [PASSED] 0x4C90 (ROCKETLAKE) [05:04:32] [PASSED] 0x4C9A (ROCKETLAKE) [05:04:32] [PASSED] 0x4680 (ALDERLAKE_S) [05:04:32] [PASSED] 0x4682 (ALDERLAKE_S) [05:04:32] [PASSED] 0x4688 (ALDERLAKE_S) [05:04:32] [PASSED] 0x468A (ALDERLAKE_S) [05:04:32] [PASSED] 0x468B (ALDERLAKE_S) [05:04:32] [PASSED] 0x4690 (ALDERLAKE_S) [05:04:32] [PASSED] 0x4692 (ALDERLAKE_S) [05:04:32] [PASSED] 0x4693 (ALDERLAKE_S) [05:04:32] [PASSED] 0x46A0 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46A1 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46A2 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46A3 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46A6 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46A8 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46AA (ALDERLAKE_P) [05:04:32] [PASSED] 0x462A (ALDERLAKE_P) [05:04:32] [PASSED] 0x4626 (ALDERLAKE_P) [05:04:32] [PASSED] 0x4628 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46B0 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46B1 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46B2 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46B3 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46C0 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46C1 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46C2 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46C3 (ALDERLAKE_P) [05:04:32] [PASSED] 0x46D0 (ALDERLAKE_N) [05:04:32] [PASSED] 0x46D1 (ALDERLAKE_N) [05:04:32] [PASSED] 0x46D2 (ALDERLAKE_N) [05:04:32] [PASSED] 0x46D3 (ALDERLAKE_N) [05:04:32] [PASSED] 0x46D4 (ALDERLAKE_N) [05:04:32] [PASSED] 0xA721 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7A1 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7A9 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7AC (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7AD (ALDERLAKE_P) [05:04:32] [PASSED] 0xA720 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7A0 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7A8 (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7AA (ALDERLAKE_P) [05:04:32] [PASSED] 0xA7AB (ALDERLAKE_P) [05:04:32] [PASSED] 0xA780 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA781 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA782 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA783 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA788 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA789 (ALDERLAKE_S) [05:04:32] [PASSED] 0xA78A (ALDERLAKE_S) [05:04:32] [PASSED] 0xA78B (ALDERLAKE_S) [05:04:32] [PASSED] 0x4905 (DG1) [05:04:32] [PASSED] 0x4906 (DG1) [05:04:32] [PASSED] 0x4907 (DG1) [05:04:32] [PASSED] 0x4908 (DG1) [05:04:32] [PASSED] 0x4909 (DG1) [05:04:32] [PASSED] 0x56C0 (DG2) [05:04:32] [PASSED] 0x56C2 (DG2) [05:04:32] [PASSED] 0x56C1 (DG2) [05:04:32] [PASSED] 0x7D51 (METEORLAKE) [05:04:32] [PASSED] 0x7DD1 (METEORLAKE) [05:04:32] [PASSED] 0x7D41 (METEORLAKE) [05:04:32] [PASSED] 0x7D67 (METEORLAKE) [05:04:32] [PASSED] 0xB640 (METEORLAKE) [05:04:32] [PASSED] 0x56A0 (DG2) [05:04:32] [PASSED] 0x56A1 (DG2) [05:04:32] [PASSED] 0x56A2 (DG2) [05:04:32] [PASSED] 0x56BE (DG2) [05:04:32] [PASSED] 0x56BF (DG2) [05:04:32] [PASSED] 0x5690 (DG2) [05:04:32] [PASSED] 0x5691 (DG2) [05:04:32] [PASSED] 0x5692 (DG2) [05:04:32] [PASSED] 0x56A5 (DG2) [05:04:32] [PASSED] 0x56A6 (DG2) [05:04:32] [PASSED] 0x56B0 (DG2) [05:04:32] [PASSED] 0x56B1 (DG2) [05:04:32] [PASSED] 0x56BA (DG2) [05:04:32] [PASSED] 0x56BB (DG2) [05:04:32] [PASSED] 0x56BC (DG2) [05:04:32] [PASSED] 0x56BD (DG2) [05:04:32] [PASSED] 0x5693 (DG2) [05:04:32] [PASSED] 0x5694 (DG2) [05:04:32] [PASSED] 0x5695 (DG2) [05:04:32] [PASSED] 0x56A3 (DG2) [05:04:32] [PASSED] 0x56A4 (DG2) [05:04:32] [PASSED] 0x56B2 (DG2) [05:04:32] [PASSED] 0x56B3 (DG2) [05:04:32] [PASSED] 0x5696 (DG2) [05:04:32] [PASSED] 0x5697 (DG2) [05:04:32] [PASSED] 0xB69 (PVC) [05:04:32] [PASSED] 0xB6E (PVC) [05:04:32] [PASSED] 0xBD4 (PVC) [05:04:32] [PASSED] 0xBD5 (PVC) [05:04:32] [PASSED] 0xBD6 (PVC) [05:04:32] [PASSED] 0xBD7 (PVC) [05:04:32] [PASSED] 0xBD8 (PVC) [05:04:32] [PASSED] 0xBD9 (PVC) [05:04:32] [PASSED] 0xBDA (PVC) [05:04:32] [PASSED] 0xBDB (PVC) [05:04:32] [PASSED] 0xBE0 (PVC) [05:04:32] [PASSED] 0xBE1 (PVC) [05:04:32] [PASSED] 0xBE5 (PVC) [05:04:32] [PASSED] 0x7D40 (METEORLAKE) [05:04:32] [PASSED] 0x7D45 (METEORLAKE) [05:04:32] [PASSED] 0x7D55 (METEORLAKE) [05:04:32] [PASSED] 0x7D60 (METEORLAKE) [05:04:32] [PASSED] 0x7DD5 (METEORLAKE) [05:04:32] [PASSED] 0x6420 (LUNARLAKE) [05:04:32] [PASSED] 0x64A0 (LUNARLAKE) [05:04:32] [PASSED] 0x64B0 (LUNARLAKE) [05:04:32] [PASSED] 0xE202 (BATTLEMAGE) [05:04:32] [PASSED] 0xE209 (BATTLEMAGE) [05:04:32] [PASSED] 0xE20B (BATTLEMAGE) [05:04:32] [PASSED] 0xE20C (BATTLEMAGE) [05:04:32] [PASSED] 0xE20D (BATTLEMAGE) [05:04:32] [PASSED] 0xE210 (BATTLEMAGE) [05:04:32] [PASSED] 0xE211 (BATTLEMAGE) [05:04:32] [PASSED] 0xE212 (BATTLEMAGE) [05:04:32] [PASSED] 0xE216 (BATTLEMAGE) [05:04:32] [PASSED] 0xE220 (BATTLEMAGE) [05:04:32] [PASSED] 0xE221 (BATTLEMAGE) [05:04:32] [PASSED] 0xE222 (BATTLEMAGE) [05:04:32] [PASSED] 0xE223 (BATTLEMAGE) [05:04:32] [PASSED] 0xB080 (PANTHERLAKE) [05:04:32] [PASSED] 0xB081 (PANTHERLAKE) [05:04:32] [PASSED] 0xB082 (PANTHERLAKE) [05:04:32] [PASSED] 0xB083 (PANTHERLAKE) [05:04:32] [PASSED] 0xB084 (PANTHERLAKE) [05:04:32] [PASSED] 0xB085 (PANTHERLAKE) [05:04:32] [PASSED] 0xB086 (PANTHERLAKE) [05:04:32] [PASSED] 0xB087 (PANTHERLAKE) [05:04:32] [PASSED] 0xB08F (PANTHERLAKE) [05:04:32] [PASSED] 0xB090 (PANTHERLAKE) [05:04:32] [PASSED] 0xB0A0 (PANTHERLAKE) [05:04:32] [PASSED] 0xB0A1 (PANTHERLAKE) [05:04:32] [PASSED] 0xB0B0 (PANTHERLAKE) [05:04:32] [PASSED] 0xFD80 (PANTHERLAKE) [05:04:32] [PASSED] 0xFD81 (PANTHERLAKE) [05:04:32] [PASSED] 0xD740 (NOVALAKE_S) [05:04:32] [PASSED] 0xD741 (NOVALAKE_S) [05:04:32] [PASSED] 0xD742 (NOVALAKE_S) [05:04:32] [PASSED] 0xD743 (NOVALAKE_S) [05:04:32] [PASSED] 0xD745 (NOVALAKE_S) [05:04:32] [PASSED] 0xD74A (NOVALAKE_S) [05:04:32] [PASSED] 0xD74B (NOVALAKE_S) [05:04:32] [PASSED] 0x674C (CRESCENTISLAND) [05:04:32] [PASSED] 0x674D (CRESCENTISLAND) [05:04:32] [PASSED] 0x674E (CRESCENTISLAND) [05:04:32] [PASSED] 0x674F (CRESCENTISLAND) [05:04:32] [PASSED] 0x6750 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6751 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6752 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6753 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6754 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6755 (CRESCENTISLAND) [05:04:32] [PASSED] 0x6756 (CRESCENTISLAND) [05:04:32] [PASSED] 0xD750 (NOVALAKE_P) [05:04:32] [PASSED] 0xD751 (NOVALAKE_P) [05:04:32] [PASSED] 0xD752 (NOVALAKE_P) [05:04:32] [PASSED] 0xD753 (NOVALAKE_P) [05:04:32] [PASSED] 0xD754 (NOVALAKE_P) [05:04:32] [PASSED] 0xD755 (NOVALAKE_P) [05:04:32] [PASSED] 0xD756 (NOVALAKE_P) [05:04:32] [PASSED] 0xD757 (NOVALAKE_P) [05:04:32] [PASSED] 0xD75F (NOVALAKE_P) [05:04:32] =============== [PASSED] check_platform_desc =============== [05:04:32] ===================== [PASSED] xe_pci ====================== [05:04:32] ============= xe_rtp_tables_test (5 subtests) ============== [05:04:32] ================== xe_rtp_table_gt_test =================== [05:04:32] [PASSED] gt_was/14011060649 [05:04:32] [PASSED] gt_was/14011059788 [05:04:32] [PASSED] gt_was/14015795083 [05:04:32] [PASSED] gt_was/16021867713 [05:04:32] [PASSED] gt_was/14019449301 [05:04:32] [PASSED] gt_was/16028005424 [05:04:32] [PASSED] gt_was/14026578760 [05:04:32] [PASSED] gt_was/1409420604 [05:04:32] [PASSED] gt_was/1408615072 [05:04:32] [PASSED] gt_was/22010523718 [05:04:32] [PASSED] gt_was/14011006942 [05:04:32] [PASSED] gt_was/14014830051 [05:04:32] [PASSED] gt_was/18018781329 [05:04:32] [PASSED] gt_was/1509235366 [05:04:32] [PASSED] gt_was/18018781329 [05:04:32] [PASSED] gt_was/16016694945 [05:04:32] [PASSED] gt_was/14018575942 [05:04:32] [PASSED] gt_was/22016670082 [05:04:32] [PASSED] gt_was/22016670082 [05:04:32] [PASSED] gt_was/14017421178 [05:04:32] [PASSED] gt_was/16025250150 [05:04:32] [PASSED] gt_was/14021871409 [05:04:32] [PASSED] gt_was/16021865536 [05:04:32] [PASSED] gt_was/14021486841 [05:04:32] [PASSED] gt_was/14025160223 [05:04:32] [PASSED] gt_was/14026144927, 16029437861, 14026127056 [05:04:32] [PASSED] gt_was/14025635424 [05:04:32] [PASSED] gt_was/16028005424 [05:04:32] ============== [PASSED] xe_rtp_table_gt_test =============== [05:04:32] ================== xe_rtp_table_gt_test =================== [05:04:32] [PASSED] gt_tunings/Tuning: Blend Fill Caching Optimization Disable [05:04:32] [PASSED] gt_tunings/Tuning: 32B Access Enable [05:04:32] [PASSED] gt_tunings/Tuning: L3 cache [05:04:32] [PASSED] gt_tunings/Tuning: L3 cache - media [05:04:32] [PASSED] gt_tunings/Tuning: Compression Overfetch [05:04:32] [PASSED] gt_tunings/Tuning: Compression Overfetch - media [05:04:32] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 [05:04:32] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 - media [05:04:32] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only [05:04:32] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only - media [05:04:32] [PASSED] gt_tunings/Tuning: Stateless compression control [05:04:32] [PASSED] gt_tunings/Tuning: Stateless compression control - media [05:04:32] [PASSED] gt_tunings/Tuning: L3 RW flush all Cache [05:04:32] [PASSED] gt_tunings/Tuning: L3 RW flush all cache - media [05:04:32] [PASSED] gt_tunings/Tuning: Set STLB Bank Hash Mode to 4KB [05:04:32] [PASSED] gt_tunings/Tuning: Force All Non-Compressible Memory Reads to be 256B Overfetches [05:04:32] ============== [PASSED] xe_rtp_table_gt_test =============== [05:04:32] ================== xe_rtp_table_oob_test ================== [05:04:32] [PASSED] oob_was/1607983814 [05:04:32] [PASSED] oob_was/16010904313 [05:04:32] [PASSED] oob_was/18022495364 [05:04:32] [PASSED] oob_was/22012773006 [05:04:32] [PASSED] oob_was/14014475959 [05:04:32] [PASSED] oob_was/22011391025 [05:04:32] [PASSED] oob_was/22012727170 [05:04:32] [PASSED] oob_was/22012727685 [05:04:32] [PASSED] oob_was/22016596838 [05:04:32] [PASSED] oob_was/18020744125 [05:04:32] [PASSED] oob_was/1409600907 [05:04:32] [PASSED] oob_was/22014953428 [05:04:32] [PASSED] oob_was/16017236439 [05:04:32] [PASSED] oob_was/14019821291 [05:04:32] [PASSED] oob_was/14015076503 [05:04:32] [PASSED] oob_was/22016122933 [05:04:32] [PASSED] oob_was/14018913170 [05:04:32] [PASSED] oob_was/14018094691 [05:04:32] [PASSED] oob_was/18024947630 [05:04:32] [PASSED] oob_was/16022287689 [05:04:32] [PASSED] oob_was/13011645652 [05:04:32] [PASSED] oob_was/14022293748 [05:04:32] [PASSED] oob_was/22019794406 [05:04:32] [PASSED] oob_was/22019338487 [05:04:32] [PASSED] oob_was/16023588340 [05:04:32] [PASSED] oob_was/14019789679 [05:04:32] [PASSED] oob_was/14022866841 [05:04:32] [PASSED] oob_was/16021333562 [05:04:32] [PASSED] oob_was/14016712196 [05:04:32] [PASSED] oob_was/14015568240 [05:04:32] [PASSED] oob_was/18013179988 [05:04:32] [PASSED] oob_was/1508761755 [05:04:32] [PASSED] oob_was/16023105232 [05:04:32] [PASSED] oob_was/16026508708 [05:04:32] [PASSED] oob_was/14020001231 [05:04:32] [PASSED] oob_was/16023683509 [05:04:32] [PASSED] oob_was/14025515070 [05:04:32] [PASSED] oob_was/15015404425_disable [05:04:32] [PASSED] oob_was/16026007364 [05:04:32] [PASSED] oob_was/14020316580 [05:04:32] [PASSED] oob_was/14025883347 [05:04:32] [PASSED] oob_was/16029380221 [05:04:32] [PASSED] oob_was/22022079272 [05:04:32] [PASSED] oob_was/16029897822 [05:04:32] [PASSED] oob_was/14026539277 [05:04:32] [PASSED] oob_was/14027054324 [05:04:32] [PASSED] oob_was/14025941587 [05:04:32] [PASSED] oob_was/16030224309 [05:04:32] [PASSED] oob_was/14028709524 [05:04:32] [PASSED] oob_was/14028250015 [05:04:32] [PASSED] oob_was/16031259911 [05:04:32] ============== [PASSED] xe_rtp_table_oob_test ============== [05:04:32] ================ xe_rtp_table_dev_oob_test ================ [05:04:32] [PASSED] device_oob_was/22010954014 [05:04:32] [PASSED] device_oob_was/15015404425 [05:04:32] [PASSED] device_oob_was/22019338487_display [05:04:32] [PASSED] device_oob_was/14022085890 [05:04:32] [PASSED] device_oob_was/14026633728 [05:04:32] [PASSED] device_oob_was/14026746987 [05:04:32] [PASSED] device_oob_was/14026779378 [05:04:32] [PASSED] device_oob_was/14028586678 [05:04:32] [PASSED] device_oob_was/14028434957 [05:04:32] ============ [PASSED] xe_rtp_table_dev_oob_test ============ [05:04:32] ========== xe_rtp_table_missing_upper_bound_test ========== [05:04:32] [PASSED] register_whitelist/WaAllowPMDepthAndInvocationCountAccessFromUMD, 1408556865 [05:04:32] [PASSED] register_whitelist/1508744258, 14012131227, 1808121037 [05:04:32] [PASSED] register_whitelist/1806527549 [05:04:32] [PASSED] register_whitelist/allow_read_ctx_timestamp [05:04:32] [PASSED] register_whitelist/allow_read_queue_timestamp [05:04:32] [PASSED] register_whitelist/16014440446 [05:04:32] [PASSED] register_whitelist/16017236439 [05:04:32] [PASSED] register_whitelist/16020183090 [05:04:32] [PASSED] register_whitelist/14024997852 [05:04:32] [PASSED] register_whitelist/14024997852 [05:04:32] ====== [PASSED] xe_rtp_table_missing_upper_bound_test ====== [05:04:32] =============== [PASSED] xe_rtp_tables_test ================ [05:04:32] =================== xe_rtp (3 subtests) ==================== [05:04:32] =================== xe_rtp_rules_tests ==================== [05:04:32] [PASSED] no [05:04:32] [PASSED] yes [05:04:32] [PASSED] no-and-no [05:04:32] [PASSED] no-and-yes [05:04:32] [PASSED] yes-and-no [05:04:32] [PASSED] yes-and-yes [05:04:32] [PASSED] no-or-no [05:04:32] [PASSED] no-or-yes [05:04:32] [PASSED] yes-or-no [05:04:32] [PASSED] yes-or-yes [05:04:32] [PASSED] no-yes-or-yes-no [05:04:32] [PASSED] no-yes-or-yes-yes [05:04:32] [PASSED] yes-yes-or-no-yes [05:04:32] [PASSED] yes-yes-or-yes-yes [05:04:32] [PASSED] no-no-or-yes-or-no [05:04:32] [PASSED] or [05:04:32] [PASSED] or-yes [05:04:32] [PASSED] or-no [05:04:32] [PASSED] yes-or [05:04:32] [PASSED] no-or [05:04:32] [PASSED] no-or-or-yes [05:04:32] [PASSED] yes-or-or-no [05:04:32] [PASSED] no-or-or-no [05:04:32] [PASSED] missing-context-engine-class [05:04:32] [PASSED] missing-context-engine-class-or-yes [05:04:32] [PASSED] missing-context-engine-class-or-or-yes [05:04:32] =============== [PASSED] xe_rtp_rules_tests ================ [05:04:32] =============== xe_rtp_process_to_sr_tests ================ [05:04:32] [PASSED] coalesce-same-reg [05:04:32] [PASSED] coalesce-same-reg-literal-and-func [05:04:32] [PASSED] no-match-no-add [05:04:32] [PASSED] two-regs-two-entries [05:04:32] [PASSED] clr-one-set-other [05:04:32] [PASSED] set-field [05:04:32] [PASSED] conflict-duplicate [05:04:32] [PASSED] conflict-not-disjoint [05:04:32] [PASSED] conflict-not-disjoint-literal-and-func [05:04:32] [PASSED] conflict-reg-type [05:04:32] [PASSED] bad-mcr-reg-forced-to-regular [05:04:32] [PASSED] bad-regular-reg-forced-to-mcr [05:04:32] =========== [PASSED] xe_rtp_process_to_sr_tests ============ [05:04:32] ================== xe_rtp_process_tests =================== [05:04:32] [PASSED] active1 [05:04:32] [PASSED] active2 [05:04:32] [PASSED] active-inactive [05:04:32] [PASSED] inactive-active [05:04:32] [PASSED] inactive-active-inactive [05:04:32] [PASSED] inactive-inactive-inactive [05:04:32] ============== [PASSED] xe_rtp_process_tests =============== [05:04:32] ===================== [PASSED] xe_rtp ====================== [05:04:32] ==================== xe_wa (1 subtest) ===================== [05:04:32] ======================== xe_wa_gt ========================= [05:04:32] [PASSED] TIGERLAKE B0 [05:04:32] [PASSED] DG1 A0 [05:04:32] [PASSED] DG1 B0 [05:04:32] [PASSED] ALDERLAKE_S A0 [05:04:32] [PASSED] ALDERLAKE_S B0 [05:04:32] [PASSED] ALDERLAKE_S C0 [05:04:32] [PASSED] ALDERLAKE_S D0 [05:04:32] [PASSED] ALDERLAKE_P A0 [05:04:32] [PASSED] ALDERLAKE_P B0 [05:04:32] [PASSED] ALDERLAKE_P C0 [05:04:32] [PASSED] ALDERLAKE_S RPLS D0 [05:04:32] [PASSED] ALDERLAKE_P RPLU E0 [05:04:32] [PASSED] DG2 G10 C0 [05:04:32] [PASSED] DG2 G11 B1 [05:04:32] [PASSED] DG2 G12 A1 [05:04:32] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0 [05:04:32] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0 [05:04:32] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0 [05:04:32] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0 [05:04:32] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0 [05:04:32] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1 [05:04:32] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0 [05:04:32] ==================== [PASSED] xe_wa_gt ===================== [05:04:32] ====================== [PASSED] xe_wa ====================== [05:04:32] ============================================================ [05:04:32] Testing complete. Ran 866 tests: passed: 837, skipped: 29 [05:04:32] Elapsed time: 42.172s total, 2.529s configuring, 38.827s building, 0.763s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [05:04:32] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [05:04:35] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [05:05:00] Starting KUnit Kernel (1/1)... [05:05:00] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [05:05:01] ============ drm_test_pick_cmdline (2 subtests) ============ [05:05:01] [PASSED] drm_test_pick_cmdline_res_1920_1080_60 [05:05:01] =============== drm_test_pick_cmdline_named =============== [05:05:01] [PASSED] NTSC [05:05:01] [PASSED] NTSC-J [05:05:01] [PASSED] PAL [05:05:01] [PASSED] PAL-M [05:05:01] =========== [PASSED] drm_test_pick_cmdline_named =========== [05:05:01] ============== [PASSED] drm_test_pick_cmdline ============== [05:05:01] == drm_test_atomic_get_connector_for_encoder (1 subtest) === [05:05:01] [PASSED] drm_test_drm_atomic_get_connector_for_encoder [05:05:01] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ==== [05:05:01] =========== drm_validate_clone_mode (2 subtests) =========== [05:05:01] ============== drm_test_check_in_clone_mode =============== [05:05:01] [PASSED] in_clone_mode [05:05:01] [PASSED] not_in_clone_mode [05:05:01] ========== [PASSED] drm_test_check_in_clone_mode =========== [05:05:01] =============== drm_test_check_valid_clones =============== [05:05:01] [PASSED] not_in_clone_mode [05:05:01] [PASSED] valid_clone [05:05:01] [PASSED] invalid_clone [05:05:01] =========== [PASSED] drm_test_check_valid_clones =========== [05:05:01] ============= [PASSED] drm_validate_clone_mode ============= [05:05:01] ============= drm_validate_modeset (1 subtest) ============= [05:05:01] [PASSED] drm_test_check_connector_changed_modeset [05:05:01] ============== [PASSED] drm_validate_modeset =============== [05:05:01] ====== drm_test_bridge_get_current_state (1 subtest) ======= [05:05:01] [PASSED] drm_test_drm_bridge_get_current_state_atomic [05:05:01] ======== [PASSED] drm_test_bridge_get_current_state ======== [05:05:01] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ====== [05:05:01] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic [05:05:01] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled [05:05:01] [PASSED] drm_test_drm_bridge_helper_hdmi_output_bus_fmts [05:05:01] ======== [PASSED] drm_test_bridge_helper_reset_crtc ======== [05:05:01] ============== drm_bridge_alloc (2 subtests) =============== [05:05:01] [PASSED] drm_test_drm_bridge_alloc_basic [05:05:01] [PASSED] drm_test_drm_bridge_alloc_get_put [05:05:01] ================ [PASSED] drm_bridge_alloc ================= [05:05:01] ============= drm_bridge_bus_fmt (5 subtests) ============== [05:05:01] [PASSED] drm_test_bridge_rgb_yuv_rgb [05:05:01] [PASSED] drm_test_bridge_must_convert_to_yuv444 [05:05:01] [PASSED] drm_test_bridge_hdmi_auto_rgb [05:05:01] [PASSED] drm_test_bridge_auto_first [05:05:01] [PASSED] drm_test_bridge_rgb_yuv_no_path [05:05:01] =============== [PASSED] drm_bridge_bus_fmt ================ [05:05:01] ============= drm_cmdline_parser (40 subtests) ============= [05:05:01] [PASSED] drm_test_cmdline_force_d_only [05:05:01] [PASSED] drm_test_cmdline_force_D_only_dvi [05:05:01] [PASSED] drm_test_cmdline_force_D_only_hdmi [05:05:01] [PASSED] drm_test_cmdline_force_D_only_not_digital [05:05:01] [PASSED] drm_test_cmdline_force_e_only [05:05:01] [PASSED] drm_test_cmdline_res [05:05:01] [PASSED] drm_test_cmdline_res_vesa [05:05:01] [PASSED] drm_test_cmdline_res_vesa_rblank [05:05:01] [PASSED] drm_test_cmdline_res_rblank [05:05:01] [PASSED] drm_test_cmdline_res_bpp [05:05:01] [PASSED] drm_test_cmdline_res_refresh [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_margins [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital [05:05:01] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on [05:05:01] [PASSED] drm_test_cmdline_res_margins_force_on [05:05:01] [PASSED] drm_test_cmdline_res_vesa_margins [05:05:01] [PASSED] drm_test_cmdline_name [05:05:01] [PASSED] drm_test_cmdline_name_bpp [05:05:01] [PASSED] drm_test_cmdline_name_option [05:05:01] [PASSED] drm_test_cmdline_name_bpp_option [05:05:01] [PASSED] drm_test_cmdline_rotate_0 [05:05:01] [PASSED] drm_test_cmdline_rotate_90 [05:05:01] [PASSED] drm_test_cmdline_rotate_180 [05:05:01] [PASSED] drm_test_cmdline_rotate_270 [05:05:01] [PASSED] drm_test_cmdline_hmirror [05:05:01] [PASSED] drm_test_cmdline_vmirror [05:05:01] [PASSED] drm_test_cmdline_margin_options [05:05:01] [PASSED] drm_test_cmdline_multiple_options [05:05:01] [PASSED] drm_test_cmdline_bpp_extra_and_option [05:05:01] [PASSED] drm_test_cmdline_extra_and_option [05:05:01] [PASSED] drm_test_cmdline_freestanding_options [05:05:01] [PASSED] drm_test_cmdline_freestanding_force_e_and_options [05:05:01] [PASSED] drm_test_cmdline_panel_orientation [05:05:01] ================ drm_test_cmdline_invalid ================= [05:05:01] [PASSED] margin_only [05:05:01] [PASSED] interlace_only [05:05:01] [PASSED] res_missing_x [05:05:01] [PASSED] res_missing_y [05:05:01] [PASSED] res_bad_y [05:05:01] [PASSED] res_missing_y_bpp [05:05:01] [PASSED] res_bad_bpp [05:05:01] [PASSED] res_bad_refresh [05:05:01] [PASSED] res_bpp_refresh_force_on_off [05:05:01] [PASSED] res_invalid_mode [05:05:01] [PASSED] res_bpp_wrong_place_mode [05:05:01] [PASSED] name_bpp_refresh [05:05:01] [PASSED] name_refresh [05:05:01] [PASSED] name_refresh_wrong_mode [05:05:01] [PASSED] name_refresh_invalid_mode [05:05:01] [PASSED] rotate_multiple [05:05:01] [PASSED] rotate_invalid_val [05:05:01] [PASSED] rotate_truncated [05:05:01] [PASSED] invalid_option [05:05:01] [PASSED] invalid_tv_option [05:05:01] [PASSED] truncated_tv_option [05:05:01] ============ [PASSED] drm_test_cmdline_invalid ============= [05:05:01] =============== drm_test_cmdline_tv_options =============== [05:05:01] [PASSED] NTSC [05:05:01] [PASSED] NTSC_443 [05:05:01] [PASSED] NTSC_J [05:05:01] [PASSED] PAL [05:05:01] [PASSED] PAL_M [05:05:01] [PASSED] PAL_N [05:05:01] [PASSED] SECAM [05:05:01] [PASSED] MONO_525 [05:05:01] [PASSED] MONO_625 [05:05:01] =========== [PASSED] drm_test_cmdline_tv_options =========== [05:05:01] =============== [PASSED] drm_cmdline_parser ================ [05:05:01] ========== drmm_connector_hdmi_init (20 subtests) ========== [05:05:01] [PASSED] drm_test_connector_hdmi_init_valid [05:05:01] [PASSED] drm_test_connector_hdmi_init_bpc_8 [05:05:01] [PASSED] drm_test_connector_hdmi_init_bpc_10 [05:05:01] [PASSED] drm_test_connector_hdmi_init_bpc_12 [05:05:01] [PASSED] drm_test_connector_hdmi_init_bpc_invalid [05:05:01] [PASSED] drm_test_connector_hdmi_init_bpc_null [05:05:01] [PASSED] drm_test_connector_hdmi_init_formats_empty [05:05:01] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb [05:05:01] === drm_test_connector_hdmi_init_formats_yuv420_allowed === [05:05:01] [PASSED] supported_formats=0x9 yuv420_allowed=1 [05:05:01] [PASSED] supported_formats=0x9 yuv420_allowed=0 [05:05:01] [PASSED] supported_formats=0x5 yuv420_allowed=1 [05:05:01] [PASSED] supported_formats=0x5 yuv420_allowed=0 [05:05:01] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed === [05:05:01] [PASSED] drm_test_connector_hdmi_init_null_ddc [05:05:01] [PASSED] drm_test_connector_hdmi_init_null_product [05:05:01] [PASSED] drm_test_connector_hdmi_init_null_vendor [05:05:01] [PASSED] drm_test_connector_hdmi_init_product_length_exact [05:05:01] [PASSED] drm_test_connector_hdmi_init_product_length_too_long [05:05:01] [PASSED] drm_test_connector_hdmi_init_product_valid [05:05:01] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact [05:05:01] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long [05:05:01] [PASSED] drm_test_connector_hdmi_init_vendor_valid [05:05:01] ========= drm_test_connector_hdmi_init_type_valid ========= [05:05:01] [PASSED] HDMI-A [05:05:01] [PASSED] HDMI-B [05:05:01] ===== [PASSED] drm_test_connector_hdmi_init_type_valid ===== [05:05:01] ======== drm_test_connector_hdmi_init_type_invalid ======== [05:05:01] [PASSED] Unknown [05:05:01] [PASSED] VGA [05:05:01] [PASSED] DVI-I [05:05:01] [PASSED] DVI-D [05:05:01] [PASSED] DVI-A [05:05:01] [PASSED] Composite [05:05:01] [PASSED] SVIDEO [05:05:01] [PASSED] LVDS [05:05:01] [PASSED] Component [05:05:01] [PASSED] DIN [05:05:01] [PASSED] DP [05:05:01] [PASSED] TV [05:05:01] [PASSED] eDP [05:05:01] [PASSED] Virtual [05:05:01] [PASSED] DSI [05:05:01] [PASSED] DPI [05:05:01] [PASSED] Writeback [05:05:01] [PASSED] SPI [05:05:01] [PASSED] USB [05:05:01] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ==== [05:05:01] ============ [PASSED] drmm_connector_hdmi_init ============= [05:05:01] ============= drmm_connector_init (3 subtests) ============= [05:05:01] [PASSED] drm_test_drmm_connector_init [05:05:01] [PASSED] drm_test_drmm_connector_init_null_ddc [05:05:01] ========= drm_test_drmm_connector_init_type_valid ========= [05:05:01] [PASSED] Unknown [05:05:01] [PASSED] VGA [05:05:01] [PASSED] DVI-I [05:05:01] [PASSED] DVI-D [05:05:01] [PASSED] DVI-A [05:05:01] [PASSED] Composite [05:05:01] [PASSED] SVIDEO [05:05:01] [PASSED] LVDS [05:05:01] [PASSED] Component [05:05:01] [PASSED] DIN [05:05:01] [PASSED] DP [05:05:01] [PASSED] HDMI-A [05:05:01] [PASSED] HDMI-B [05:05:01] [PASSED] TV [05:05:01] [PASSED] eDP [05:05:01] [PASSED] Virtual [05:05:01] [PASSED] DSI [05:05:01] [PASSED] DPI [05:05:01] [PASSED] Writeback [05:05:01] [PASSED] SPI [05:05:01] [PASSED] USB [05:05:01] ===== [PASSED] drm_test_drmm_connector_init_type_valid ===== [05:05:01] =============== [PASSED] drmm_connector_init =============== [05:05:01] ========= drm_connector_dynamic_init (6 subtests) ========== [05:05:01] [PASSED] drm_test_drm_connector_dynamic_init [05:05:01] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc [05:05:01] [PASSED] drm_test_drm_connector_dynamic_init_not_added [05:05:01] [PASSED] drm_test_drm_connector_dynamic_init_properties [05:05:01] ===== drm_test_drm_connector_dynamic_init_type_valid ====== [05:05:01] [PASSED] Unknown [05:05:01] [PASSED] VGA [05:05:01] [PASSED] DVI-I [05:05:01] [PASSED] DVI-D [05:05:01] [PASSED] DVI-A [05:05:01] [PASSED] Composite [05:05:01] [PASSED] SVIDEO [05:05:01] [PASSED] LVDS [05:05:01] [PASSED] Component [05:05:01] [PASSED] DIN [05:05:01] [PASSED] DP [05:05:01] [PASSED] HDMI-A [05:05:01] [PASSED] HDMI-B [05:05:01] [PASSED] TV [05:05:01] [PASSED] eDP [05:05:01] [PASSED] Virtual [05:05:01] [PASSED] DSI [05:05:01] [PASSED] DPI [05:05:01] [PASSED] Writeback [05:05:01] [PASSED] SPI [05:05:01] [PASSED] USB [05:05:01] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid == [05:05:01] ======== drm_test_drm_connector_dynamic_init_name ========= [05:05:01] [PASSED] Unknown [05:05:01] [PASSED] VGA [05:05:01] [PASSED] DVI-I [05:05:01] [PASSED] DVI-D [05:05:01] [PASSED] DVI-A [05:05:01] [PASSED] Composite [05:05:01] [PASSED] SVIDEO [05:05:01] [PASSED] LVDS [05:05:01] [PASSED] Component [05:05:01] [PASSED] DIN [05:05:01] [PASSED] DP [05:05:01] [PASSED] HDMI-A [05:05:01] [PASSED] HDMI-B [05:05:01] [PASSED] TV [05:05:01] [PASSED] eDP [05:05:01] [PASSED] Virtual [05:05:01] [PASSED] DSI [05:05:01] [PASSED] DPI [05:05:01] [PASSED] Writeback [05:05:01] [PASSED] SPI [05:05:01] [PASSED] USB [05:05:01] ==== [PASSED] drm_test_drm_connector_dynamic_init_name ===== [05:05:01] =========== [PASSED] drm_connector_dynamic_init ============ [05:05:01] ==== drm_connector_dynamic_register_early (4 subtests) ===== [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_early_defer [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object [05:05:01] ====== [PASSED] drm_connector_dynamic_register_early ======= [05:05:01] ======= drm_connector_dynamic_register (7 subtests) ======== [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_on_list [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_no_defer [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_no_init [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_mode_object [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_sysfs [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name [05:05:01] [PASSED] drm_test_drm_connector_dynamic_register_debugfs [05:05:01] ========= [PASSED] drm_connector_dynamic_register ========== [05:05:01] = drm_connector_attach_broadcast_rgb_property (2 subtests) = [05:05:01] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property [05:05:01] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector [05:05:01] === [PASSED] drm_connector_attach_broadcast_rgb_property === [05:05:01] ========== drm_get_tv_mode_from_name (2 subtests) ========== [05:05:01] ========== drm_test_get_tv_mode_from_name_valid =========== [05:05:01] [PASSED] NTSC [05:05:01] [PASSED] NTSC-443 [05:05:01] [PASSED] NTSC-J [05:05:01] [PASSED] PAL [05:05:01] [PASSED] PAL-M [05:05:01] [PASSED] PAL-N [05:05:01] [PASSED] SECAM [05:05:01] [PASSED] Mono [05:05:01] ====== [PASSED] drm_test_get_tv_mode_from_name_valid ======= [05:05:01] [PASSED] drm_test_get_tv_mode_from_name_truncated [05:05:01] ============ [PASSED] drm_get_tv_mode_from_name ============ [05:05:01] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) = [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1 [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1 [05:05:01] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double [05:05:01] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid = [05:05:01] [PASSED] VIC 96 [05:05:01] [PASSED] VIC 97 [05:05:01] [PASSED] VIC 101 [05:05:01] [PASSED] VIC 102 [05:05:01] [PASSED] VIC 106 [05:05:01] [PASSED] VIC 107 [05:05:01] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid === [05:05:01] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc [05:05:01] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc [05:05:01] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc [05:05:01] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc [05:05:01] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc [05:05:01] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ==== [05:05:01] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) == [05:05:01] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name ==== [05:05:01] [PASSED] Automatic [05:05:01] [PASSED] Full [05:05:01] [PASSED] Limited 16:235 [05:05:01] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name === [05:05:01] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid [05:05:01] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ==== [05:05:01] == drm_hdmi_connector_get_output_format_name (2 subtests) == [05:05:01] === drm_test_drm_hdmi_connector_get_output_format_name ==== [05:05:01] [PASSED] RGB [05:05:01] [PASSED] YUV 4:2:0 [05:05:01] [PASSED] YUV 4:2:2 [05:05:01] [PASSED] YUV 4:4:4 [05:05:01] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name === [05:05:01] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid [05:05:01] ==== [PASSED] drm_hdmi_connector_get_output_format_name ==== [05:05:01] ============= drm_damage_helper (21 subtests) ============== [05:05:01] [PASSED] drm_test_damage_iter_no_damage [05:05:01] [PASSED] drm_test_damage_iter_no_damage_fractional_src [05:05:01] [PASSED] drm_test_damage_iter_no_damage_src_moved [05:05:01] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved [05:05:01] [PASSED] drm_test_damage_iter_no_damage_not_visible [05:05:01] [PASSED] drm_test_damage_iter_no_damage_no_crtc [05:05:01] [PASSED] drm_test_damage_iter_no_damage_no_fb [05:05:01] [PASSED] drm_test_damage_iter_simple_damage [05:05:01] [PASSED] drm_test_damage_iter_single_damage [05:05:01] [PASSED] drm_test_damage_iter_single_damage_intersect_src [05:05:01] [PASSED] drm_test_damage_iter_single_damage_outside_src [05:05:01] [PASSED] drm_test_damage_iter_single_damage_fractional_src [05:05:01] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src [05:05:01] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src [05:05:01] [PASSED] drm_test_damage_iter_single_damage_src_moved [05:05:01] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved [05:05:01] [PASSED] drm_test_damage_iter_damage [05:05:01] [PASSED] drm_test_damage_iter_damage_one_intersect [05:05:01] [PASSED] drm_test_damage_iter_damage_one_outside [05:05:01] [PASSED] drm_test_damage_iter_damage_src_moved [05:05:01] [PASSED] drm_test_damage_iter_damage_not_visible [05:05:01] ================ [PASSED] drm_damage_helper ================ [05:05:01] ============== drm_dp_mst_helper (3 subtests) ============== [05:05:01] ============== drm_test_dp_mst_calc_pbn_mode ============== [05:05:01] [PASSED] Clock 154000 BPP 30 DSC disabled [05:05:01] [PASSED] Clock 234000 BPP 30 DSC disabled [05:05:01] [PASSED] Clock 297000 BPP 24 DSC disabled [05:05:01] [PASSED] Clock 332880 BPP 24 DSC enabled [05:05:01] [PASSED] Clock 324540 BPP 24 DSC enabled [05:05:01] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ========== [05:05:01] ============== drm_test_dp_mst_calc_pbn_div =============== [05:05:01] [PASSED] Link rate 2000000 lane count 4 [05:05:01] [PASSED] Link rate 2000000 lane count 2 [05:05:01] [PASSED] Link rate 2000000 lane count 1 [05:05:01] [PASSED] Link rate 1350000 lane count 4 [05:05:01] [PASSED] Link rate 1350000 lane count 2 [05:05:01] [PASSED] Link rate 1350000 lane count 1 [05:05:01] [PASSED] Link rate 1000000 lane count 4 [05:05:01] [PASSED] Link rate 1000000 lane count 2 [05:05:01] [PASSED] Link rate 1000000 lane count 1 [05:05:01] [PASSED] Link rate 810000 lane count 4 [05:05:01] [PASSED] Link rate 810000 lane count 2 [05:05:01] [PASSED] Link rate 810000 lane count 1 [05:05:01] [PASSED] Link rate 540000 lane count 4 [05:05:01] [PASSED] Link rate 540000 lane count 2 [05:05:01] [PASSED] Link rate 540000 lane count 1 [05:05:01] [PASSED] Link rate 270000 lane count 4 [05:05:01] [PASSED] Link rate 270000 lane count 2 [05:05:01] [PASSED] Link rate 270000 lane count 1 [05:05:01] [PASSED] Link rate 162000 lane count 4 [05:05:01] [PASSED] Link rate 162000 lane count 2 [05:05:01] [PASSED] Link rate 162000 lane count 1 [05:05:01] ========== [PASSED] drm_test_dp_mst_calc_pbn_div =========== [05:05:01] ========= drm_test_dp_mst_sideband_msg_req_decode ========= [05:05:01] [PASSED] DP_ENUM_PATH_RESOURCES with port number [05:05:01] [PASSED] DP_POWER_UP_PHY with port number [05:05:01] [PASSED] DP_POWER_DOWN_PHY with port number [05:05:01] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks [05:05:01] [PASSED] DP_ALLOCATE_PAYLOAD with port number [05:05:01] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI [05:05:01] [PASSED] DP_ALLOCATE_PAYLOAD with PBN [05:05:01] [PASSED] DP_QUERY_PAYLOAD with port number [05:05:01] [PASSED] DP_QUERY_PAYLOAD with VCPI [05:05:01] [PASSED] DP_REMOTE_DPCD_READ with port number [05:05:01] [PASSED] DP_REMOTE_DPCD_READ with DPCD address [05:05:01] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes [05:05:01] [PASSED] DP_REMOTE_DPCD_WRITE with port number [05:05:01] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address [05:05:01] [PASSED] DP_REMOTE_DPCD_WRITE with data array [05:05:01] [PASSED] DP_REMOTE_I2C_READ with port number [05:05:01] [PASSED] DP_REMOTE_I2C_READ with I2C device ID [05:05:01] [PASSED] DP_REMOTE_I2C_READ with transactions array [05:05:01] [PASSED] DP_REMOTE_I2C_WRITE with port number [05:05:01] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID [05:05:01] [PASSED] DP_REMOTE_I2C_WRITE with data array [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior [05:05:01] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior [05:05:01] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode ===== [05:05:01] ================ [PASSED] drm_dp_mst_helper ================ [05:05:01] ================== drm_exec (7 subtests) =================== [05:05:01] [PASSED] sanitycheck [05:05:01] [PASSED] test_lock [05:05:01] [PASSED] test_lock_unlock [05:05:01] [PASSED] test_duplicates [05:05:01] [PASSED] test_prepare [05:05:01] [PASSED] test_prepare_array [05:05:01] [PASSED] test_multiple_loops [05:05:01] ==================== [PASSED] drm_exec ===================== [05:05:01] =========== drm_format_helper_test (17 subtests) =========== [05:05:01] ============== drm_test_fb_xrgb8888_to_gray8 ============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ========== [05:05:01] ============= drm_test_fb_xrgb8888_to_rgb332 ============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ========== [05:05:01] ============= drm_test_fb_xrgb8888_to_rgb565 ============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ========== [05:05:01] ============ drm_test_fb_xrgb8888_to_xrgb1555 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 ========= [05:05:01] ============ drm_test_fb_xrgb8888_to_argb1555 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 ========= [05:05:01] ============ drm_test_fb_xrgb8888_to_rgba5551 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 ========= [05:05:01] ============= drm_test_fb_xrgb8888_to_rgb888 ============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ========== [05:05:01] ============= drm_test_fb_xrgb8888_to_bgr888 ============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ========== [05:05:01] ============ drm_test_fb_xrgb8888_to_argb8888 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 ========= [05:05:01] =========== drm_test_fb_xrgb8888_to_xrgb2101010 =========== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 ======= [05:05:01] =========== drm_test_fb_xrgb8888_to_argb2101010 =========== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 ======= [05:05:01] ============== drm_test_fb_xrgb8888_to_mono =============== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ========== [PASSED] drm_test_fb_xrgb8888_to_mono =========== [05:05:01] ==================== drm_test_fb_swab ===================== [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ================ [PASSED] drm_test_fb_swab ================= [05:05:01] ============ drm_test_fb_xrgb8888_to_xbgr8888 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 ========= [05:05:01] ============ drm_test_fb_xrgb8888_to_abgr8888 ============= [05:05:01] [PASSED] single_pixel_source_buffer [05:05:01] [PASSED] single_pixel_clip_rectangle [05:05:01] [PASSED] well_known_colors [05:05:01] [PASSED] destination_pitch [05:05:01] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 ========= [05:05:01] ================= drm_test_fb_clip_offset ================= [05:05:01] [PASSED] pass through [05:05:01] [PASSED] horizontal offset [05:05:01] [PASSED] vertical offset [05:05:01] [PASSED] horizontal and vertical offset [05:05:01] [PASSED] horizontal offset (custom pitch) [05:05:01] [PASSED] vertical offset (custom pitch) [05:05:01] [PASSED] horizontal and vertical offset (custom pitch) [05:05:01] ============= [PASSED] drm_test_fb_clip_offset ============= [05:05:01] =================== drm_test_fb_memcpy ==================== [05:05:01] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258) [05:05:01] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258) [05:05:01] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559) [05:05:01] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258) [05:05:01] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258) [05:05:01] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559) [05:05:01] [PASSED] well_known_colors: XB24 little-endian (0x34324258) [05:05:01] [PASSED] well_known_colors: XRA8 little-endian (0x38415258) [05:05:01] [PASSED] well_known_colors: YU24 little-endian (0x34325559) [05:05:01] [PASSED] destination_pitch: XB24 little-endian (0x34324258) [05:05:01] [PASSED] destination_pitch: XRA8 little-endian (0x38415258) [05:05:01] [PASSED] destination_pitch: YU24 little-endian (0x34325559) [05:05:01] =============== [PASSED] drm_test_fb_memcpy ================ [05:05:01] ============= [PASSED] drm_format_helper_test ============== [05:05:01] ================= drm_format (18 subtests) ================= [05:05:01] [PASSED] drm_test_format_block_width_invalid [05:05:01] [PASSED] drm_test_format_block_width_one_plane [05:05:01] [PASSED] drm_test_format_block_width_two_plane [05:05:01] [PASSED] drm_test_format_block_width_three_plane [05:05:01] [PASSED] drm_test_format_block_width_tiled [05:05:01] [PASSED] drm_test_format_block_height_invalid [05:05:01] [PASSED] drm_test_format_block_height_one_plane [05:05:01] [PASSED] drm_test_format_block_height_two_plane [05:05:01] [PASSED] drm_test_format_block_height_three_plane [05:05:01] [PASSED] drm_test_format_block_height_tiled [05:05:01] [PASSED] drm_test_format_min_pitch_invalid [05:05:01] [PASSED] drm_test_format_min_pitch_one_plane_8bpp [05:05:01] [PASSED] drm_test_format_min_pitch_one_plane_16bpp [05:05:01] [PASSED] drm_test_format_min_pitch_one_plane_24bpp [05:05:01] [PASSED] drm_test_format_min_pitch_one_plane_32bpp [05:05:01] [PASSED] drm_test_format_min_pitch_two_plane [05:05:01] [PASSED] drm_test_format_min_pitch_three_plane_8bpp [05:05:01] [PASSED] drm_test_format_min_pitch_tiled [05:05:01] =================== [PASSED] drm_format ==================== [05:05:01] ============== drm_framebuffer (10 subtests) =============== [05:05:01] ========== drm_test_framebuffer_check_src_coords ========== [05:05:01] [PASSED] Success: source fits into fb [05:05:01] [PASSED] Fail: overflowing fb with x-axis coordinate [05:05:01] [PASSED] Fail: overflowing fb with y-axis coordinate [05:05:01] [PASSED] Fail: overflowing fb with source width [05:05:01] [PASSED] Fail: overflowing fb with source height [05:05:01] ====== [PASSED] drm_test_framebuffer_check_src_coords ====== [05:05:01] [PASSED] drm_test_framebuffer_cleanup [05:05:01] =============== drm_test_framebuffer_create =============== [05:05:01] [PASSED] ABGR8888 normal sizes [05:05:01] [PASSED] ABGR8888 max sizes [05:05:01] [PASSED] ABGR8888 pitch greater than min required [05:05:01] [PASSED] ABGR8888 pitch less than min required [05:05:01] [PASSED] ABGR8888 Invalid width [05:05:01] [PASSED] ABGR8888 Invalid buffer handle [05:05:01] [PASSED] No pixel format [05:05:01] [PASSED] ABGR8888 Width 0 [05:05:01] [PASSED] ABGR8888 Height 0 [05:05:01] [PASSED] ABGR8888 Out of bound height * pitch combination [05:05:01] [PASSED] ABGR8888 Large buffer offset [05:05:01] [PASSED] ABGR8888 Buffer offset for inexistent plane [05:05:01] [PASSED] ABGR8888 Invalid flag [05:05:01] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers [05:05:01] [PASSED] ABGR8888 Valid buffer modifier [05:05:01] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE) [05:05:01] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] NV12 Normal sizes [05:05:01] [PASSED] NV12 Max sizes [05:05:01] [PASSED] NV12 Invalid pitch [05:05:01] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag [05:05:01] [PASSED] NV12 different modifier per-plane [05:05:01] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE [05:05:01] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] NV12 Modifier for inexistent plane [05:05:01] [PASSED] NV12 Handle for inexistent plane [05:05:01] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier [05:05:01] [PASSED] YVU420 Normal sizes [05:05:01] [PASSED] YVU420 Max sizes [05:05:01] [PASSED] YVU420 Invalid pitch [05:05:01] [PASSED] YVU420 Different pitches [05:05:01] [PASSED] YVU420 Different buffer offsets/pitches [05:05:01] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS [05:05:01] [PASSED] YVU420 Valid modifier [05:05:01] [PASSED] YVU420 Different modifiers per plane [05:05:01] [PASSED] YVU420 Modifier for inexistent plane [05:05:01] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR) [05:05:01] [PASSED] X0L2 Normal sizes [05:05:01] [PASSED] X0L2 Max sizes [05:05:01] [PASSED] X0L2 Invalid pitch [05:05:01] [PASSED] X0L2 Pitch greater than minimum required [05:05:01] [PASSED] X0L2 Handle for inexistent plane [05:05:01] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set [05:05:01] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set [05:05:01] [PASSED] X0L2 Valid modifier [05:05:01] [PASSED] X0L2 Modifier for inexistent plane [05:05:01] =========== [PASSED] drm_test_framebuffer_create =========== [05:05:01] [PASSED] drm_test_framebuffer_free [05:05:01] [PASSED] drm_test_framebuffer_init [05:05:01] [PASSED] drm_test_framebuffer_init_bad_format [05:05:01] [PASSED] drm_test_framebuffer_init_dev_mismatch [05:05:01] [PASSED] drm_test_framebuffer_lookup [05:05:01] [PASSED] drm_test_framebuffer_lookup_inexistent [05:05:01] [PASSED] drm_test_framebuffer_modifiers_not_supported [05:05:01] ================= [PASSED] drm_framebuffer ================= [05:05:01] ================ drm_gem_shmem (8 subtests) ================ [05:05:01] [PASSED] drm_gem_shmem_test_obj_create [05:05:01] [PASSED] drm_gem_shmem_test_obj_create_private [05:05:01] [PASSED] drm_gem_shmem_test_pin_pages [05:05:01] [PASSED] drm_gem_shmem_test_vmap [05:05:01] [PASSED] drm_gem_shmem_test_get_sg_table [05:05:01] [PASSED] drm_gem_shmem_test_get_pages_sgt [05:05:01] [PASSED] drm_gem_shmem_test_madvise [05:05:01] [PASSED] drm_gem_shmem_test_purge [05:05:01] ================== [PASSED] drm_gem_shmem ================== [05:05:01] === drm_atomic_helper_connector_hdmi_check (29 subtests) === [05:05:01] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode [05:05:01] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1 [05:05:01] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode [05:05:01] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1 [05:05:01] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode [05:05:01] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1 [05:05:01] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420 ======= [05:05:01] [PASSED] Automatic [05:05:01] [PASSED] Full [05:05:01] [PASSED] Limited 16:235 [05:05:01] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 === [05:05:01] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed [05:05:01] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed [05:05:01] [PASSED] drm_test_check_disable_connector [05:05:01] [PASSED] drm_test_check_hdmi_funcs_reject_rate [05:05:01] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb [05:05:01] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420 [05:05:01] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422 [05:05:01] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420 [05:05:01] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420 [05:05:01] [PASSED] drm_test_check_output_bpc_crtc_mode_changed [05:05:01] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed [05:05:01] [PASSED] drm_test_check_output_bpc_dvi [05:05:01] [PASSED] drm_test_check_output_bpc_format_vic_1 [05:05:01] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only [05:05:01] [PASSED] drm_test_check_output_bpc_format_display_rgb_only [05:05:01] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only [05:05:01] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only [05:05:01] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc [05:05:01] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc [05:05:01] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc [05:05:01] ============ drm_test_check_hdmi_color_format ============= [05:05:01] [PASSED] AUTO -> RGB [05:05:01] [PASSED] YCBCR422 -> YUV422 [05:05:01] [PASSED] YCBCR420 -> YUV420 [05:05:01] [PASSED] YCBCR444 -> YUV444 [05:05:01] [PASSED] RGB -> RGB [05:05:01] ======== [PASSED] drm_test_check_hdmi_color_format ========= [05:05:01] ======== drm_test_check_hdmi_color_format_420_only ======== [05:05:01] [PASSED] RGB should fail [05:05:01] [PASSED] YUV444 should fail [05:05:01] [PASSED] YUV422 should fail [05:05:01] [PASSED] YUV420 should work [05:05:01] ==== [PASSED] drm_test_check_hdmi_color_format_420_only ==== [05:05:01] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ====== [05:05:01] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ==== [05:05:01] [PASSED] drm_test_check_broadcast_rgb_value [05:05:01] [PASSED] drm_test_check_bpc_8_value [05:05:01] [PASSED] drm_test_check_bpc_10_value [05:05:01] [PASSED] drm_test_check_bpc_12_value [05:05:01] [PASSED] drm_test_check_format_value [05:05:01] [PASSED] drm_test_check_tmds_char_value [05:05:01] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ====== [05:05:01] = drm_atomic_helper_connector_hdmi_mode_valid (7 subtests) = [05:05:01] [PASSED] drm_test_check_mode_valid [05:05:01] [PASSED] drm_test_check_mode_valid_reject [05:05:01] [PASSED] drm_test_check_mode_valid_reject_rate [05:05:01] [PASSED] drm_test_check_mode_valid_reject_max_clock [05:05:01] [PASSED] drm_test_check_mode_valid_yuv420_only_max_clock [05:05:01] [PASSED] drm_test_check_mode_valid_reject_yuv420_only_connector [05:05:01] [PASSED] drm_test_check_mode_valid_accept_yuv420_also_connector_rgb [05:05:01] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid === [05:05:01] = drm_atomic_helper_connector_hdmi_infoframes (5 subtests) = [05:05:01] [PASSED] drm_test_check_infoframes [05:05:01] [PASSED] drm_test_check_reject_avi_infoframe [05:05:01] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_8 [05:05:01] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_10 [05:05:01] [PASSED] drm_test_check_reject_audio_infoframe [05:05:01] === [PASSED] drm_atomic_helper_connector_hdmi_infoframes === [05:05:01] ================= drm_managed (2 subtests) ================= [05:05:01] [PASSED] drm_test_managed_release_action [05:05:01] [PASSED] drm_test_managed_run_action [05:05:01] =================== [PASSED] drm_managed =================== [05:05:01] =================== drm_mm (6 subtests) ==================== [05:05:01] [PASSED] drm_test_mm_init [05:05:01] [PASSED] drm_test_mm_debug [05:05:01] [PASSED] drm_test_mm_align32 [05:05:01] [PASSED] drm_test_mm_align64 [05:05:01] [PASSED] drm_test_mm_lowest [05:05:01] [PASSED] drm_test_mm_highest [05:05:01] ===================== [PASSED] drm_mm ====================== [05:05:01] ============= drm_modes_analog_tv (5 subtests) ============= [05:05:01] [PASSED] drm_test_modes_analog_tv_mono_576i [05:05:01] [PASSED] drm_test_modes_analog_tv_ntsc_480i [05:05:01] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined [05:05:01] [PASSED] drm_test_modes_analog_tv_pal_576i [05:05:01] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined [05:05:01] =============== [PASSED] drm_modes_analog_tv =============== [05:05:01] ============== drm_panic_helper (3 subtests) =============== [05:05:01] ============= drm_test_panic_screen_user_map ============== [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] ========= [PASSED] drm_test_panic_screen_user_map ========== [05:05:01] ============= drm_test_panic_screen_user_page ============= [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] ========= [PASSED] drm_test_panic_screen_user_page ========= [05:05:01] ========== drm_test_panic_screen_user_set_pixel =========== [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [05:05:01] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [05:05:01] ====== [PASSED] drm_test_panic_screen_user_set_pixel ======= [05:05:01] ================ [PASSED] drm_panic_helper ================= [05:05:01] ============== drm_plane_helper (2 subtests) =============== [05:05:01] =============== drm_test_check_plane_state ================ [05:05:01] [PASSED] clipping_simple [05:05:01] [PASSED] clipping_rotate_reflect [05:05:01] [PASSED] positioning_simple [05:05:01] [PASSED] upscaling [05:05:01] [PASSED] downscaling [05:05:01] [PASSED] rounding1 [05:05:01] [PASSED] rounding2 [05:05:01] [PASSED] rounding3 [05:05:01] [PASSED] rounding4 [05:05:01] =========== [PASSED] drm_test_check_plane_state ============ [05:05:01] =========== drm_test_check_invalid_plane_state ============ [05:05:01] [PASSED] positioning_invalid [05:05:01] [PASSED] upscaling_invalid [05:05:01] [PASSED] downscaling_invalid [05:05:01] ======= [PASSED] drm_test_check_invalid_plane_state ======== [05:05:01] ================ [PASSED] drm_plane_helper ================= [05:05:01] ====== drm_connector_helper_tv_get_modes (1 subtest) ======= [05:05:01] ====== drm_test_connector_helper_tv_get_modes_check ======= [05:05:01] [PASSED] None [05:05:01] [PASSED] PAL [05:05:01] [PASSED] NTSC [05:05:01] [PASSED] Both, NTSC Default [05:05:01] [PASSED] Both, PAL Default [05:05:01] [PASSED] Both, NTSC Default, with PAL on command-line [05:05:01] [PASSED] Both, PAL Default, with NTSC on command-line [05:05:01] == [PASSED] drm_test_connector_helper_tv_get_modes_check === [05:05:01] ======== [PASSED] drm_connector_helper_tv_get_modes ======== [05:05:01] ================== drm_rect (9 subtests) =================== [05:05:01] [PASSED] drm_test_rect_clip_scaled_div_by_zero [05:05:01] [PASSED] drm_test_rect_clip_scaled_not_clipped [05:05:01] [PASSED] drm_test_rect_clip_scaled_clipped [05:05:01] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned [05:05:01] ================= drm_test_rect_intersect ================= [05:05:01] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0 [05:05:01] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1 [05:05:01] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0 [05:05:01] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1 [05:05:01] [PASSED] right x left: 2x1+0+0 x 3x1+1+0 [05:05:01] [PASSED] left x right: 3x1+1+0 x 2x1+0+0 [05:05:01] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1 [05:05:01] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0 [05:05:01] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1 [05:05:01] [PASSED] touching side: 1x1+0+0 x 1x1+1+0 [05:05:01] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0 [05:05:01] [PASSED] inside another: 2x2+0+0 x 1x1+1+1 [05:05:01] [PASSED] far away: 1x1+0+0 x 1x1+3+6 [05:05:01] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10 [05:05:01] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10 [05:05:01] ============= [PASSED] drm_test_rect_intersect ============= [05:05:01] ================ drm_test_rect_calc_hscale ================ [05:05:01] [PASSED] normal use [05:05:01] [PASSED] out of max range [05:05:01] [PASSED] out of min range [05:05:01] [PASSED] zero dst [05:05:01] [PASSED] negative src [05:05:01] [PASSED] negative dst [05:05:01] ============ [PASSED] drm_test_rect_calc_hscale ============ [05:05:01] ================ drm_test_rect_calc_vscale ================ [05:05:01] [PASSED] normal use [05:05:01] [PASSED] out of max range [05:05:01] [PASSED] out of min range [05:05:01] [PASSED] zero dst [05:05:01] [PASSED] negative src [05:05:01] [PASSED] negative dst [05:05:01] ============ [PASSED] drm_test_rect_calc_vscale ============ [05:05:01] ================== drm_test_rect_rotate =================== [05:05:01] [PASSED] reflect-x [05:05:01] [PASSED] reflect-y [05:05:01] [PASSED] rotate-0 [05:05:01] [PASSED] rotate-90 [05:05:01] [PASSED] rotate-180 [05:05:01] [PASSED] rotate-270 [05:05:01] ============== [PASSED] drm_test_rect_rotate =============== [05:05:01] ================ drm_test_rect_rotate_inv ================= [05:05:01] [PASSED] reflect-x [05:05:01] [PASSED] reflect-y [05:05:01] [PASSED] rotate-0 [05:05:01] [PASSED] rotate-90 [05:05:01] [PASSED] rotate-180 [05:05:01] [PASSED] rotate-270 [05:05:01] ============ [PASSED] drm_test_rect_rotate_inv ============= [05:05:01] ==================== [PASSED] drm_rect ===================== [05:05:01] ============ drm_sysfb_modeset_test (1 subtest) ============ [05:05:01] ============ drm_test_sysfb_build_fourcc_list ============= [05:05:01] [PASSED] no native formats [05:05:01] [PASSED] XRGB8888 as native format [05:05:01] [PASSED] remove duplicates [05:05:01] [PASSED] convert alpha formats [05:05:01] [PASSED] random formats [05:05:01] ======== [PASSED] drm_test_sysfb_build_fourcc_list ========= [05:05:01] ============= [PASSED] drm_sysfb_modeset_test ============== [05:05:01] ================== drm_fixp (2 subtests) =================== [05:05:01] [PASSED] drm_test_int2fixp [05:05:01] [PASSED] drm_test_sm2fixp [05:05:01] ==================== [PASSED] drm_fixp ===================== [05:05:01] ============================================================ [05:05:01] Testing complete. Ran 667 tests: passed: 667 [05:05:01] Elapsed time: 28.454s total, 2.545s configuring, 25.543s building, 0.337s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [05:05:01] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [05:05:03] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [05:05:14] Starting KUnit Kernel (1/1)... [05:05:14] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [05:05:14] ================= ttm_device (5 subtests) ================== [05:05:14] [PASSED] ttm_device_init_basic [05:05:14] [PASSED] ttm_device_init_multiple [05:05:14] [PASSED] ttm_device_fini_basic [05:05:14] [PASSED] ttm_device_init_no_vma_man [05:05:14] ================== ttm_device_init_pools ================== [05:05:14] [PASSED] No DMA allocations, no DMA32 required [05:05:14] [PASSED] DMA allocations, DMA32 required [05:05:14] [PASSED] No DMA allocations, DMA32 required [05:05:14] [PASSED] DMA allocations, no DMA32 required [05:05:14] ============== [PASSED] ttm_device_init_pools ============== [05:05:14] =================== [PASSED] ttm_device ==================== [05:05:14] ================== ttm_pool (8 subtests) =================== [05:05:14] ================== ttm_pool_alloc_basic =================== [05:05:14] [PASSED] One page [05:05:14] [PASSED] More than one page [05:05:14] [PASSED] Above the allocation limit [05:05:14] [PASSED] One page, with coherent DMA mappings enabled [05:05:14] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [05:05:14] ============== [PASSED] ttm_pool_alloc_basic =============== [05:05:14] ============== ttm_pool_alloc_basic_dma_addr ============== [05:05:14] [PASSED] One page [05:05:14] [PASSED] More than one page [05:05:14] [PASSED] Above the allocation limit [05:05:14] [PASSED] One page, with coherent DMA mappings enabled [05:05:14] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [05:05:14] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ========== [05:05:14] [PASSED] ttm_pool_alloc_order_caching_match [05:05:14] [PASSED] ttm_pool_alloc_caching_mismatch [05:05:14] [PASSED] ttm_pool_alloc_order_mismatch [05:05:14] [PASSED] ttm_pool_free_dma_alloc [05:05:14] [PASSED] ttm_pool_free_no_dma_alloc [05:05:14] [PASSED] ttm_pool_fini_basic [05:05:14] ==================== [PASSED] ttm_pool ===================== [05:05:14] ================ ttm_resource (8 subtests) ================= [05:05:14] ================= ttm_resource_init_basic ================= [05:05:14] [PASSED] Init resource in TTM_PL_SYSTEM [05:05:14] [PASSED] Init resource in TTM_PL_VRAM [05:05:14] [PASSED] Init resource in a private placement [05:05:14] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags [05:05:14] ============= [PASSED] ttm_resource_init_basic ============= [05:05:14] [PASSED] ttm_resource_init_pinned [05:05:14] [PASSED] ttm_resource_fini_basic [05:05:14] [PASSED] ttm_resource_manager_init_basic [05:05:14] [PASSED] ttm_resource_manager_usage_basic [05:05:14] [PASSED] ttm_resource_manager_set_used_basic [05:05:14] [PASSED] ttm_sys_man_alloc_basic [05:05:14] [PASSED] ttm_sys_man_free_basic [05:05:14] ================== [PASSED] ttm_resource =================== [05:05:14] =================== ttm_tt (15 subtests) =================== [05:05:14] ==================== ttm_tt_init_basic ==================== [05:05:14] [PASSED] Page-aligned size [05:05:14] [PASSED] Extra pages requested [05:05:14] ================ [PASSED] ttm_tt_init_basic ================ [05:05:14] [PASSED] ttm_tt_init_misaligned [05:05:14] [PASSED] ttm_tt_fini_basic [05:05:14] [PASSED] ttm_tt_fini_sg [05:05:14] [PASSED] ttm_tt_fini_shmem [05:05:14] [PASSED] ttm_tt_create_basic [05:05:14] [PASSED] ttm_tt_create_invalid_bo_type [05:05:14] [PASSED] ttm_tt_create_ttm_exists [05:05:14] [PASSED] ttm_tt_create_failed [05:05:14] [PASSED] ttm_tt_destroy_basic [05:05:14] [PASSED] ttm_tt_populate_null_ttm [05:05:14] [PASSED] ttm_tt_populate_populated_ttm [05:05:14] [PASSED] ttm_tt_unpopulate_basic [05:05:14] [PASSED] ttm_tt_unpopulate_empty_ttm [05:05:14] [PASSED] ttm_tt_swapin_basic [05:05:14] ===================== [PASSED] ttm_tt ====================== [05:05:14] =================== ttm_bo (14 subtests) =================== [05:05:14] =========== ttm_bo_reserve_optimistic_no_ticket =========== [05:05:14] [PASSED] Cannot be interrupted and sleeps [05:05:14] [PASSED] Cannot be interrupted, locks straight away [05:05:14] [PASSED] Can be interrupted, sleeps [05:05:14] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket ======= [05:05:14] [PASSED] ttm_bo_reserve_locked_no_sleep [05:05:14] [PASSED] ttm_bo_reserve_no_wait_ticket [05:05:14] [PASSED] ttm_bo_reserve_double_resv [05:05:14] [PASSED] ttm_bo_reserve_interrupted [05:05:14] [PASSED] ttm_bo_reserve_deadlock [05:05:14] [PASSED] ttm_bo_unreserve_basic [05:05:14] [PASSED] ttm_bo_unreserve_pinned [05:05:14] [PASSED] ttm_bo_unreserve_bulk [05:05:14] [PASSED] ttm_bo_fini_basic [05:05:14] [PASSED] ttm_bo_fini_shared_resv [05:05:14] [PASSED] ttm_bo_pin_basic [05:05:14] [PASSED] ttm_bo_pin_unpin_resource [05:05:14] [PASSED] ttm_bo_multiple_pin_one_unpin [05:05:14] ===================== [PASSED] ttm_bo ====================== [05:05:14] ============== ttm_bo_validate (22 subtests) =============== [05:05:14] ============== ttm_bo_init_reserved_sys_man =============== [05:05:14] [PASSED] Buffer object for userspace [05:05:14] [PASSED] Kernel buffer object [05:05:14] [PASSED] Shared buffer object [05:05:14] ========== [PASSED] ttm_bo_init_reserved_sys_man =========== [05:05:14] ============== ttm_bo_init_reserved_mock_man ============== [05:05:14] [PASSED] Buffer object for userspace [05:05:14] [PASSED] Kernel buffer object [05:05:14] [PASSED] Shared buffer object [05:05:14] ========== [PASSED] ttm_bo_init_reserved_mock_man ========== [05:05:14] [PASSED] ttm_bo_init_reserved_resv [05:05:14] ================== ttm_bo_validate_basic ================== [05:05:14] [PASSED] Buffer object for userspace [05:05:14] [PASSED] Kernel buffer object [05:05:14] [PASSED] Shared buffer object [05:05:14] ============== [PASSED] ttm_bo_validate_basic ============== [05:05:14] [PASSED] ttm_bo_validate_invalid_placement [05:05:14] ============= ttm_bo_validate_same_placement ============== [05:05:14] [PASSED] System manager [05:05:14] [PASSED] VRAM manager [05:05:14] ========= [PASSED] ttm_bo_validate_same_placement ========== [05:05:14] [PASSED] ttm_bo_validate_failed_alloc [05:05:14] [PASSED] ttm_bo_validate_pinned [05:05:14] [PASSED] ttm_bo_validate_busy_placement [05:05:14] ================ ttm_bo_validate_multihop ================= [05:05:14] [PASSED] Buffer object for userspace [05:05:14] [PASSED] Kernel buffer object [05:05:14] [PASSED] Shared buffer object [05:05:14] ============ [PASSED] ttm_bo_validate_multihop ============= [05:05:14] ========== ttm_bo_validate_no_placement_signaled ========== [05:05:14] [PASSED] Buffer object in system domain, no page vector [05:05:14] [PASSED] Buffer object in system domain with an existing page vector [05:05:14] ====== [PASSED] ttm_bo_validate_no_placement_signaled ====== [05:05:14] ======== ttm_bo_validate_no_placement_not_signaled ======== [05:05:14] [PASSED] Buffer object for userspace [05:05:14] [PASSED] Kernel buffer object [05:05:14] [PASSED] Shared buffer object [05:05:14] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ==== [05:05:14] [PASSED] ttm_bo_validate_move_fence_signaled [05:05:14] ========= ttm_bo_validate_move_fence_not_signaled ========= [05:05:14] [PASSED] Waits for GPU [05:05:14] [PASSED] Tries to lock straight away [05:05:14] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled ===== [05:05:14] [PASSED] ttm_bo_validate_swapout [05:05:14] [PASSED] ttm_bo_validate_happy_evict [05:05:14] [PASSED] ttm_bo_validate_all_pinned_evict [05:05:14] [PASSED] ttm_bo_validate_allowed_only_evict [05:05:14] [PASSED] ttm_bo_validate_deleted_evict [05:05:14] [PASSED] ttm_bo_validate_busy_domain_evict [05:05:14] [PASSED] ttm_bo_validate_evict_gutting [05:05:14] [PASSED] ttm_bo_validate_recursive_evict [05:05:14] ================= [PASSED] ttm_bo_validate ================= [05:05:14] ============================================================ [05:05:14] Testing complete. Ran 102 tests: passed: 102 [05:05:14] Elapsed time: 12.859s total, 2.509s configuring, 10.135s building, 0.184s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/dma-buf/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/dma-buf/.kunitconfig [05:05:14] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [05:05:16] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [05:05:25] Starting KUnit Kernel (1/1)... [05:05:25] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [05:05:26] =============== dma-buf-fence (12 subtests) ================ [05:05:26] [PASSED] test_sanitycheck [05:05:26] [PASSED] test_signaling [05:05:26] [PASSED] test_add_callback [05:05:26] [PASSED] test_late_add_callback [05:05:26] [PASSED] test_rm_callback [05:05:26] [PASSED] test_late_rm_callback [05:05:26] [PASSED] test_status [05:05:26] [PASSED] test_error [05:05:26] [PASSED] test_wait [05:05:26] [PASSED] test_wait_timeout [05:05:26] [PASSED] test_stub [05:05:26] [SKIPPED] test_race_signal_callback (requires at least 2 CPUs) [05:05:26] ================== [PASSED] dma-buf-fence ================== [05:05:26] ============ dma-buf-fence-chain (11 subtests) ============= [05:05:26] [PASSED] test_sanitycheck [05:05:26] [PASSED] test_find_seqno [05:05:26] [PASSED] test_find_signaled [05:05:26] [PASSED] test_find_out_of_order [05:05:31] [PASSED] test_find_gap [05:05:31] [PASSED] test_find_race [05:05:31] [PASSED] test_signal_forward [05:05:31] [PASSED] test_signal_backward [05:05:31] [PASSED] test_wait_forward [05:05:31] [PASSED] test_wait_backward [05:05:31] [PASSED] test_wait_random [05:05:31] =============== [PASSED] dma-buf-fence-chain =============== [05:05:31] ============ dma-buf-fence-unwrap (11 subtests) ============ [05:05:31] [PASSED] test_sanitycheck [05:05:31] [PASSED] test_unwrap_array [05:05:31] [PASSED] test_unwrap_chain [05:05:31] [PASSED] test_unwrap_chain_array [05:05:31] [PASSED] test_unwrap_merge [05:05:31] [PASSED] test_unwrap_merge_duplicate [05:05:31] [PASSED] test_unwrap_merge_seqno [05:05:31] [PASSED] test_unwrap_merge_order [05:05:31] [PASSED] test_unwrap_merge_complex [05:05:31] [PASSED] test_unwrap_merge_complex_seqno [05:05:31] [PASSED] test_dedup_empty [05:05:31] ============== [PASSED] dma-buf-fence-unwrap =============== [05:05:31] ================ dma-buf-resv (5 subtests) ================= [05:05:31] [PASSED] test_sanitycheck [05:05:31] ===================== test_signaling ====================== [05:05:31] [PASSED] kernel [05:05:31] [PASSED] write [05:05:31] [PASSED] read [05:05:31] [PASSED] bookkeep [05:05:31] ================= [PASSED] test_signaling ================== [05:05:31] ====================== test_for_each ====================== [05:05:31] [PASSED] kernel [05:05:31] [PASSED] write [05:05:31] [PASSED] read [05:05:31] [PASSED] bookkeep [05:05:31] ================== [PASSED] test_for_each ================== [05:05:31] ================= test_for_each_unlocked ================== [05:05:31] [PASSED] kernel [05:05:31] [PASSED] write [05:05:31] [PASSED] read [05:05:31] [PASSED] bookkeep [05:05:31] ============= [PASSED] test_for_each_unlocked ============== [05:05:31] ===================== test_get_fences ===================== [05:05:31] [PASSED] kernel [05:05:31] [PASSED] write [05:05:31] [PASSED] read [05:05:31] [PASSED] bookkeep [05:05:31] ================= [PASSED] test_get_fences ================= [05:05:31] ================== [PASSED] dma-buf-resv =================== [05:05:31] ============================================================ [05:05:31] Testing complete. Ran 51 tests: passed: 50, skipped: 1 [05:05:31] Elapsed time: 16.878s total, 2.554s configuring, 8.952s building, 5.335s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel