git: ede14736fd6d - main - ivrs_drv: Fix IVHDs with duplicated BaseAddress
Ka Ho Ng
khng at FreeBSD.org
Mon Mar 22 09:34:06 UTC 2021
The branch main has been updated by khng:
URL: https://cgit.FreeBSD.org/src/commit/?id=ede14736fd6d74db0374f4a233491ad5dc0e9b1d
commit ede14736fd6d74db0374f4a233491ad5dc0e9b1d
Author: Ka Ho Ng <khng at FreeBSD.org>
AuthorDate: 2021-03-22 09:33:43 +0000
Commit: Ka Ho Ng <khng at FreeBSD.org>
CommitDate: 2021-03-22 09:33:43 +0000
ivrs_drv: Fix IVHDs with duplicated BaseAddress
Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28945
---
sys/amd64/vmm/amd/ivrs_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c
index da3e0e17d140..d33229623a96 100644
--- a/sys/amd64/vmm/amd/ivrs_drv.c
+++ b/sys/amd64/vmm/amd/ivrs_drv.c
@@ -366,10 +366,11 @@ ivhd_identify(driver_t *driver, device_t parent)
for (i = ivhd_count - 1 ; i > 0 ; i--){
if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header,
&ivhd_hdrs[i]->Header)) {
- ivhd_hdrs[i-1] = ivhd_hdrs[i];
+ memmove(&ivhd_hdrs[i-1], &ivhd_hdrs[i],
+ sizeof(void *) * (ivhd_count - i));
ivhd_count--;
}
- }
+ }
ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF,
M_WAITOK | M_ZERO);
More information about the dev-commits-src-all
mailing list