hyperv: Add missing field to hv_output_map_device_interrupt
Subsystems (2)
PATCH 1/1 hyperv: Add missing field to hv_output_map_device_interrupt
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)
include/hyperv/hvhdk_mini.h +1 -0
@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ]; } __packed;/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */
Signature · 1 line
2.34.1
From: Nuno Das Neves <[email protected]> Sent: Wednesday, August 13, 2025 11:21 AM
Quoted 15 lines
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
Signed-off-by Nuno Das Neves <[email protected]>--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)include/hyperv/hvhdk_mini.h +0
-0
include/hyperv/hvhdk_mini.h struct hv_input_map_device_interrupt { · line 304
Quoted 4 lines
include/hyperv/hvhdk_mini.h +1
-0@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ];
Your email identifying the problem said that without this change, struct hv_output_map_device_interrupt is 0x10 bytes in size, which matches what I calculate from the definition. This change adds 0x28 bytes, making the struct size now 0x38 bytes. But your other email said Hyper-V expects the size to be 0x58 bytes. Is array size "5" correct, or is there some other cause of the discrepancy?
Michael
Quoted 5 lines
include/hyperv/hvhdk_mini.h +0
-1} __packed;/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */ --2.34.1
Wei Liu
maintainerQuoted 21 lines · Michael Kelley
From: Nuno Das Neves <[email protected]> Sent: Wednesday, August 13, 2025 11:21 AM
Quoted 15 lines
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
Signed-off-by Nuno Das Neves <[email protected]>--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)include/hyperv/hvhdk_mini.h +0
-0include/hyperv/hvhdk_mini.h struct hv_input_map_device_interrupt { · line 304
Quoted 4 lines
include/hyperv/hvhdk_mini.h +1
-0@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ];
Quoted 8 lines
Your email identifying the problem said that without this change, struct
hv_output_map_device_interruptis0x10bytes in size, which matches what I calculate from the definition. This change adds0x28bytes, making the struct size now0x38bytes. But your other email said Hyper-V expects the size to be0x58bytes. Is array size "5" correct, or is there some other cause of the discrepancy?
FWIW the array size 5 here is correct.
Wei
Quoted 9 lines
Michael
Quoted 5 lines
include/hyperv/hvhdk_mini.h +0
-1} __packed;/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */ --2.34.1
Quoted 22 lines · Wei Liu
Quoted 21 lines · Michael Kelley
From: Nuno Das Neves <[email protected]> Sent: Wednesday, August 13, 2025 11:21 AM
Quoted 19 lines
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
Signed-off-by Nuno Das Neves <[email protected]>--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)include/hyperv/hvhdk_mini.h +1
-0@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ];
Quoted 8 lines
Quoted 8 lines
Your email identifying the problem said that without this change, struct
hv_output_map_device_interruptis0x10bytes in size, which matches what I calculate from the definition. This change adds0x28bytes, making the struct size now0x38bytes. But your other email said Hyper-V expects the size to be0x58bytes. Is array size "5" correct, or is there some other cause of the discrepancy?
Ah, it looks like the *input* struct size (0x50) plus the size of 1 cpu bank is 0x58. The output struct size should indeed be 0x38.
I got them mixed up somehow when writing the email.
Quoted 14 lines
FWIW the array size 5 here is correct.
Wei
Quoted 9 lines
Michael
Quoted 5 lines
include/hyperv/hvhdk_mini.h +0
-1} __packed;/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */ --2.34.1
Michael Kelley
Reviewed-byFrom: Nuno Das Neves <[email protected]> Sent: Friday, August 15, 2025 10:11 AM
Quoted 33 lines · Wei Liu
Quoted 22 lines · Michael Kelley
Quoted 21 lines
From: Nuno Das Neves <[email protected]> Sent: Wednesday, August 13, 2025 11:21 AM
Quoted 19 lines
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
Signed-off-by Nuno Das Neves <[email protected]>--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)include/hyperv/hvhdk_mini.h +1
-0@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ];Quoted 8 lines
Quoted 8 lines
Your email identifying the problem said that without this change, struct
hv_output_map_device_interruptis0x10bytes in size, which matches what I calculate from the definition. This change adds0x28bytes, making the struct size now0x38bytes. But your other email said Hyper-V expects the size to be0x58bytes. Is array size "5" correct, or is there some other cause of the discrepancy?
Quoted 7 lines
Ah, it looks like the *input* struct size (
0x50) plus the size of 1 cpu bank is0x58. The output struct size should indeed be0x38.I got them mixed up somehow when writing the email.
Quoted 3 lines
FWIW the array size 5 here is correct.
OK -- thanks. Just wanted to be sure everything was right.
FWIW,
Quoted 5 lines · Nuno Das Neves
This field is unused, but the correct structure size is needed when computing the amount of space for the output argument to reside, so that it does not cross a page boundary.
Signed-off-by Nuno Das Neves <[email protected]>
There doesn't seem to be a need to rush this through hyperv-fixes.
Queued into hyperv-next before Michael's patches.
Quoted 19 lines
--- include/hyperv/hvhdk_mini.h | 1 + 1 file changed, 1 insertion(+)include/hyperv/hvhdk_mini.h +1
-0@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */ struct hv_output_map_device_interrupt {struct hv_interrupt_entry interrupt_entry; +u64 ext_status_deprecated[5 ]; } __packed;/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */ Signature · 1 line
2.34.1