Skip to content

Commit 28e87e5

Browse files
author
CKI KWF Bot
committed
Merge: [RHEL9.8] Recent upstream fixes for iommufd
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7642 JIRA: https://issues.redhat.com/browse/RHEL-131315 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7479 Recent upstream fixes: ``` cb30dfa ("iommufd: Don't overflow during division for dirty tracking") b07bf25 ("iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning") ac84ff4 ("iommufd/driver: Fix counter initialization for counted_by annotation") ``` Signed-off-by: Eder Zulian <ezulian@redhat.com> Approved-by: Jerry Snitselaar <jsnitsel@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: Donald Dutile <ddutile@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 5c83be1 + a158944 commit 28e87e5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

drivers/iommu/iommufd/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu,
161161
vevent = &veventq->lost_events_header;
162162
goto out_set_header;
163163
}
164-
memcpy(vevent->event_data, event_data, data_len);
165164
vevent->data_len = data_len;
165+
memcpy(vevent->event_data, event_data, data_len);
166166
veventq->num_events++;
167167

168168
out_set_header:

drivers/iommu/iommufd/iommufd_private.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,16 @@ struct iommufd_veventq {
614614
struct iommufd_eventq common;
615615
struct iommufd_viommu *viommu;
616616
struct list_head node; /* for iommufd_viommu::veventqs */
617-
struct iommufd_vevent lost_events_header;
618617

619618
enum iommu_veventq_type type;
620619
unsigned int depth;
621620

622621
/* Use common.lock for protection */
623622
u32 num_events;
624623
u32 sequence;
624+
625+
/* Must be last as it ends in a flexible-array member. */
626+
struct iommufd_vevent lost_events_header;
625627
};
626628

627629
static inline struct iommufd_veventq *

drivers/iommu/iommufd/iova_bitmap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ struct iova_bitmap {
130130
static unsigned long iova_bitmap_offset_to_index(struct iova_bitmap *bitmap,
131131
unsigned long iova)
132132
{
133-
unsigned long pgsize = 1UL << bitmap->mapped.pgshift;
134-
135-
return iova / (BITS_PER_TYPE(*bitmap->bitmap) * pgsize);
133+
return (iova >> bitmap->mapped.pgshift) /
134+
BITS_PER_TYPE(*bitmap->bitmap);
136135
}
137136

138137
/*

0 commit comments

Comments
 (0)