Skip to content

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] Backport bugfixes for QuickAssist Technology(QAT) live migration for in-tree driver#859

Merged
opsiff merged 10 commits into
deepin-community:linux-6.6.yfrom
Avenger-285714:linux-6.6.y
Jun 6, 2025
Merged

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] Backport bugfixes for QuickAssist Technology(QAT) live migration for in-tree driver#859
opsiff merged 10 commits into
deepin-community:linux-6.6.yfrom
Avenger-285714:linux-6.6.y

Conversation

@Avenger-285714
Copy link
Copy Markdown
Member

@Avenger-285714 Avenger-285714 commented Jun 6, 2025

Link: #837

Skip iommu/amd: Set the pgsize_bitmap correctly

Summary by Sourcery

Implement ahead-of-time bit setting in the IOMMUFD IOVA bitmap for live migration, backport Intel QAT migration device support into the in-tree build, and correct related bitmask, overflow, and size calculations across drivers and selftests.

Bug Fixes:

  • Fix ADF_RP_INT_SRC_SEL_F_RISE_MASK to use the correct bit range in the QAT GEN4 hardware data header
  • Correct check_add_overflow parameter order in the VFIO/QAT resume write handler
  • Make the mock_domain dirty_ops structure static in IOMMUFD selftests

Enhancements:

  • Add set_ahead_length field and processing to pre-set bits in the IOMMUFD IOVA bitmap
  • Include qat_mig_dev.o in the Intel QAT common build objects

Build:

  • Adjust QAT common Makefile to move qat_mig_dev.o into the main intel_qat-objs list

Tests:

  • Update IOMMUFD selftests to compute bitmap size in bytes using DIV_ROUND_UP and adjust FLAVORS for new buffer sizes
  • Introduce DIV_ROUND_UP macro in test utils and apply it for consistent size calculations

jpemartins and others added 10 commits June 6, 2025 22:09
[ Upstream commit 2780025 ]

IOVA bitmap is a zero-copy scheme of recording dirty bits that iterate the
different bitmap user pages at chunks of a maximum of
PAGE_SIZE/sizeof(struct page*) pages.

When the iterations are split up into 64G, the end of the range may be
broken up in a way that's aligned with a non base page PTE size. This
leads to only part of the huge page being recorded in the bitmap. Note
that in pratice this is only a problem for IOMMU dirty tracking i.e. when
the backing PTEs are in IOMMU hugepages and the bitmap is in base page
granularity. So far this not something that affects VF dirty trackers
(which reports and records at the same granularity).

To fix that, if there is a remainder of bits left to set in which the
current IOVA bitmap doesn't cover, make a copy of the bitmap structure and
iterate-and-set the rest of the bits remaining. Finally, when advancing
the iterator, skip all the bits that were set ahead.

Link: https://lore.kernel.org/r/20240202133415.23819-5-joao.m.martins@oracle.com
Reported-by: Avihai Horon <avihaih@nvidia.com>
Fixes: f35f22c ("iommu/vt-d: Access/Dirty bit support for SS domains")
Fixes: 421a511 ("iommu/amd: Access/Dirty bit support in IOPTEs")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Tested-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.9 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit cf1e515 ]

The sparse tool complains as follows:

drivers/iommu/iommufd/selftest.c:277:30: warning:
	symbol 'dirty_ops' was not declared. Should it be static?

This symbol is not used outside of selftest.c, so marks it static.

Fixes: 266ce58 ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
Link: https://patch.msgid.link/r/20240819120007.3884868-1-ruanjinjie@huawei.com
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.12 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 8541323 ]

Some kconfigs don't automatically include this symbol which results in sub
functions for some of the dirty tracking related things that are
non-functional. Thus the test suite will fail. select IOMMUFD_DRIVER in
the IOMMUFD_TEST kconfig to fix it.

Fixes: a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Link: https://lore.kernel.org/r/20240327182050.GA1363414@ziepe.ca
Tested-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.9 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 2760c51 ]

Add FAULT_INJECTION_DEBUG_FS and FAILSLAB configurations to the kconfig
fragment for the iommfd selftests. These kconfigs are needed by the
iommufd_fail_nth test.

Fixes: a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Link: https://lore.kernel.org/r/20240325090048.1423908-1-usama.anjum@collabora.com
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.9-rc4 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit ec61f82 ]

With 64k base pages, the first 128k iova length test requires less than a
byte for a bitmap, exposing a bug in the tests that assume that bitmaps are
at least a byte.

Rather than dealing with bytes, have _test_mock_dirty_bitmaps() pass the
number of bits. The caller functions are adjusted to also use bits as well,
and converting to bytes when clearing, allocating and freeing the bitmap.

Link: https://lore.kernel.org/r/20240627110105.62325-2-joao.m.martins@oracle.com
Reported-by: Matt Ochs <mochs@nvidia.com>
Fixes: a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Matt Ochs <mochs@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.10 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 9560393 ]

The calculation returns 0 if it sets less than the number of bits per
byte. For calculating memory allocation from bits, lets round it up to
one byte.

Link: https://lore.kernel.org/r/20240627110105.62325-3-joao.m.martins@oracle.com
Reported-by: Matt Ochs <mochs@nvidia.com>
Fixes: a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Matt Ochs <mochs@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.10 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit ffa3c79 ]

commit a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
added tests covering edge cases in the boundaries of iova bitmap. Although
it used buffer sizes thinking in PAGE_SIZE (4K) as opposed to the
MOCK_PAGE_SIZE (2K) that is used in iommufd mock selftests. This meant that
isn't correctly exercising everything specifically the u32 and 4K bitmap
test cases. Fix selftests buffer sizes to be based on mock page size.

Link: https://lore.kernel.org/r/20240627110105.62325-5-joao.m.martins@oracle.com
Reported-by: Kevin Tian <kevin.tian@intel.com>
Closes: https://lore.kernel.org/linux-iommu/96efb6cf-a41c-420f-9673-2f0b682cac8c@oracle.com/
Fixes: a9af47e ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Matt Ochs <mochs@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ Backport from v6.10 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 694a6f5 ]

The macro `ADF_RP_INT_SRC_SEL_F_RISE_MASK` is currently set to the value
`0100b` which means "Empty Going False". This might cause an incorrect
restore of the bank state during live migration.

Fix the definition of the macro to properly represent the "Full Going
True" state which is encoded as `0011b`.

Fixes: bbfdde7 ("crypto: qat - add bank save and restore flows")
Signed-off-by: Svyatoslav Pankratov <svyatoslav.pankratov@intel.com>
Reviewed-by: Xin Zeng <xin.zeng@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ Backport from v6.11-rc5 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit a5d8922 ]

When CONFIG_PCI_IOV=n, the build of the QAT vfio pci variant driver
fails reporting the following linking errors:

    ERROR: modpost: "qat_vfmig_open" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_resume" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_save_state" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_suspend" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_load_state" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_reset" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_save_setup" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_destroy" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_close" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    ERROR: modpost: "qat_vfmig_cleanup" [drivers/vfio/pci/qat/qat_vfio_pci.ko] undefined!
    WARNING: modpost: suppressed 1 unresolved symbol warnings because there were too many)

Make live migration helpers provided by QAT PF driver always available
even if CONFIG_PCI_IOV is not selected. This does not cause any side
effect.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Closes: https://lore.kernel.org/lkml/20240607153406.60355e6c.alex.williamson@redhat.com/T/
Fixes: bb20881 ("vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices")
Signed-off-by: Xin Zeng <xin.zeng@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ Backport from v6.11 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 9283b73 ]

The unsigned variable `size_t len` is cast to the signed type `loff_t`
when passed to the function check_add_overflow(). This function considers
the type of the destination, which is of type loff_t (signed),
potentially leading to an overflow. This issue is similar to the one
described in the link below.

Remove the cast.

Note that even if check_add_overflow() is bypassed, by setting `len` to
a value that is greater than LONG_MAX (which is considered as a negative
value after the cast), the function copy_from_user(), invoked a few lines
later, will not perform any copy and return `len` as (len > INT_MAX)
causing qat_vf_resume_write() to fail with -EFAULT.

Fixes: bb20881 ("vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices")
CC: stable@vger.kernel.org # 6.10+
Link: https://lore.kernel.org/all/138bd2e2-ede8-4bcc-aa7b-f3d9de167a37@moroto.mountain
Reported-by: Zijie Zhao <zzjas98@gmail.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Xin Zeng <xin.zeng@intel.com>
Link: https://lore.kernel.org/r/20241021123843.42979-1-giovanni.cabiddu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
[ Backport from v6.12 ]
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
@Avenger-285714 Avenger-285714 requested a review from Copilot June 6, 2025 14:31
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 6, 2025

Reviewer's Guide

This PR backports upstream QAT live migration fixes by integrating the migration device into the QAT build and correcting mask and overflow checks, extends the IOVA bitmap with a “set ahead” mechanism for pre-pinning, and refactors selftests to unify bitmap size calculations using DIV_ROUND_UP (including marking dirty_ops static)

Sequence Diagram for IOVA Bitmap Set-Ahead Logic

sequenceDiagram
    participant Caller
    participant iova_bitmap_set() as IBS
    participant iova_bitmap_advance() as IBA
    participant iova_bitmap_set_ahead() as IBSA
    participant iova_bitmap_struct as "iova_bitmap instance"

    Caller->>IBS: Call iova_bitmap_set(bitmap, iova, length)
    IBS->>iova_bitmap_struct: Update bitmap->set_ahead_length (if conditions met)
    IBS-->>Caller: Return

    %% Later in execution flow, or in a different context
    Caller->>IBA: Call iova_bitmap_advance(bitmap)
    IBA->>iova_bitmap_struct: Read bitmap->set_ahead_length
    alt If bitmap->set_ahead_length > 0
        IBA->>IBSA: Call iova_bitmap_set_ahead(bitmap, bitmap->set_ahead_length)
        IBSA->>iova_bitmap_struct: Loop (get pages, set bits in bitmap, put pages)
        IBSA->>iova_bitmap_struct: bitmap->set_ahead_length = 0
        IBSA-->>IBA: Return (status)
    end
    IBA-->>Caller: Return (status)
Loading

Updated Class Diagram for iova_bitmap Structure

classDiagram
    class iova_bitmap {
        +unsigned long set_ahead_length
        +iova_bitmap_set_ahead(size_t set_ahead_length) : int
        +iova_bitmap_advance() : int
        +iova_bitmap_set(unsigned long iova, unsigned long length) : void
    }
Loading

File-Level Changes

Change Details Files
Support “set ahead” functionality in the IOVA bitmap
  • Add set_ahead_length field to iova_bitmap
  • Implement iova_bitmap_set_ahead() to pre-set and skip bits
  • Hook set-ahead processing into iova_bitmap_advance()
  • Record leftover range in set_ahead_length in iova_bitmap_set()
drivers/iommu/iommufd/iova_bitmap.c
Refactor bitmap sizing in IOMMU selftests
  • Introduce DIV_ROUND_UP macro for rounding
  • Calculate buffer size in bytes via DIV_ROUND_UP
  • Adjust posix_memalign and munmap size arguments
  • Rename fixture variants and update buffer_size values
tools/testing/selftests/iommu/iommufd_utils.h
tools/testing/selftests/iommu/iommufd.c
Consolidate QAT live migration build and fix macros/overflow checks
  • Include qat_mig_dev.o in common QAT objects and remove from PCI IOV build
  • Update ADF_RP_INT_SRC_SEL_F_RISE_MASK to use GENMASK(1, 0)
  • Correct check_add_overflow() argument order in VFIO QAT resume path
drivers/crypto/intel/qat/qat_common/Makefile
drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.h
drivers/vfio/pci/qat/main.c
Refine kernel selftest dirty_ops and allocation size
  • Mark dirty_ops as static const
  • Use DIV_ROUND_UP for kernel selftest bitmap_size allocation
drivers/iommu/iommufd/selftest.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Avenger-285714 Avenger-285714 requested a review from opsiff June 6, 2025 14:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports bugfixes for QuickAssist Technology (QAT) live migration and includes related adjustments to IOMMU test utilities and configurations.

  • Fixes in dirty bitmap size calculations and memory allocation in IOMMU selftests
  • Updates to IOMMU and QAT driver configurations and object files
  • Adjustments to interrupt mask definitions for QAT hardware

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/testing/selftests/iommu/iommufd_utils.h Introduces DIV_ROUND_UP macro and updates dirty bitmap calculations
tools/testing/selftests/iommu/iommufd.c Corrects bitmap size calculation and updates fixture variants for testing
tools/testing/selftests/iommu/config Adds additional configuration options for fault injection and debugging
drivers/vfio/pci/qat/main.c Modifies check_add_overflow call to use the correct length parameter
drivers/iommu/iommufd/selftest.c Adjusts bitmap size calculation using DIV_ROUND_UP for clarity
drivers/iommu/iommufd/iova_bitmap.c Adds a mechanism (set_ahead) for handling unmapped bitmap bits
drivers/iommu/iommufd/Kconfig Selects the IOMMUFD_DRIVER for enabling tests
drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.h Updates the interrupt source mask for QAT ring interrupt handling
drivers/crypto/intel/qat/qat_common/Makefile Updates the object file list to reflect QAT migration changes
Comments suppressed due to low confidence (2)

tools/testing/selftests/iommu/iommufd_utils.h:283

  • [nitpick] The local variable name 'bitmap_size' may be confused with previous usage in the function signature. Consider renaming it (e.g. to 'alloc_size') for clarity.
unsigned long bitmap_size = DIV_ROUND_UP(nbits, BITS_PER_BYTE);

drivers/iommu/iommufd/iova_bitmap.c:470

  • [nitpick] Consider adding a comment explaining the purpose and expected range of 'set_ahead_length' to improve maintainability and ease future code reviews.
bitmap->set_ahead_length = ((last_bit - cur_bit + 1) << bitmap->mapped.pgshift);

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. Makefile中添加了qat_mig_dev.o对象文件,需要确认这个文件是否存在并且是必要的。如果这个文件不是必需的,应该移除它以避免不必要的编译。

  2. adf_gen4_hw_data.h文件中,ADF_RP_INT_SRC_SEL_F_RISE_MASK宏的定义从BIT(2)更改为GENMASK(1, 0),这可能会改变原有的功能。需要确认这个更改是否正确,并且不会引入任何问题。

  3. iova_bitmap.c文件中,新增了一个iova_bitmap_set_ahead函数,这个函数看起来是为了预分配IOVA范围。但是,这个函数的实现可能会影响现有的iova_bitmap_advance函数的行为,需要确保这两个函数的集成不会导致问题。

  4. selftest.c文件中,iommufd_test_dirty函数中的bitmap_size计算方式从直接除以BITS_PER_BYTE更改为使用DIV_ROUND_UP宏,这可能会改变原有的行为。需要确认这个更改是否正确,并且不会引入任何问题。

  5. main.c文件中,qat_vf_resume_write函数中的check_add_overflow调用可能存在错误,因为len*offs的类型不同。应该确保len的类型与*offs的类型相匹配,或者进行适当的类型转换。

  6. iommufd.c文件中,iommufd_dirty_tracking测试套件的FIXTURE_SETUP函数中,self->bitmap_size的计算方式从直接除以BITS_PER_BYTE更改为使用DIV_ROUND_UP宏,这可能会改变原有的行为。需要确认这个更改是否正确,并且不会引入任何问题。

  7. iommufd.c文件中,iommufd_dirty_tracking测试套件的FIXTURE_TEARDOWN函数中,munmap函数的参数应该与FIXTURE_SETUP函数中的计算方式一致,否则可能会导致内存泄漏。

  8. iommufd_utils.h文件中,新增了一个DIV_ROUND_UP宏,这个宏的定义是正确的,但是应该确保这个宏在所有需要的地方都被正确使用,以避免潜在的整数除法问题。

总的来说,这些更改看起来都是合理的,但是需要确保它们不会引入任何问题,并且与现有的代码库兼容。

@deepin-ci-robot deepin-ci-robot requested a review from BLumia June 6, 2025 14:31
@Avenger-285714 Avenger-285714 changed the title Merged [Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] Backport bugfixes for QuickAssist Technology(QAT) live migration for in-tree driver [Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] Backport bugfixes for QuickAssist Technology(QAT) live migration for in-tree driver Jun 6, 2025
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Avenger-285714 - I've reviewed your changes - here's some feedback:

  • Ensure that the new set_ahead_length field is explicitly initialized (e.g., in iova_bitmap_create) to zero to prevent accidental use of stale values before any set_ahead calls.
  • Since DIV_ROUND_UP is added in the test utils, wrap it in #ifndef or give it a unique prefix to avoid macro collisions with other headers.
  • Double-check that moving qat_mig_dev.o into the main intel_qat-objs list doesn’t pull migration code into builds where it’s not needed—consider guarding it behind a CONFIG_QAT_MIGRATION option if appropriate.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.


if (*offs < 0 ||
check_add_overflow((loff_t)len, *offs, &end))
check_add_overflow(len, *offs, &end))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Removed cast to loff_t may cause incorrect overflow checks

Casting len to loff_t is important for correct signed overflow detection. Using size_t may result in missed or incorrect overflow checks. Please ensure both operands are cast to a consistent type.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opsiff

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@opsiff opsiff merged commit c1f9b66 into deepin-community:linux-6.6.y Jun 6, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants