mirror of
https://github.com/mbilker/vgpu_unlock-rs.git
synced 2025-10-29 12:20:11 +01:00
lib: fix NV2080_CTRL_CMD_BUS_GET_PCI_INFO handling for real
- I broke the handling in the last commit because the 0x10de is in the lower half of the integers
This commit is contained in:
@@ -601,8 +601,8 @@ pub unsafe extern "C" fn ioctl(fd: RawFd, request: c_ulong, argp: *mut c_void) -
|
||||
let orig_devid = *devid_ptr;
|
||||
let orig_subsysid = *subsysid_ptr;
|
||||
|
||||
let actual_devid = orig_devid & 0xffff;
|
||||
let actual_subsysid = orig_subsysid & 0xffff;
|
||||
let actual_devid = (orig_devid & 0xffff0000) >> 16;
|
||||
let actual_subsysid = (orig_subsysid & 0xffff0000) >> 16;
|
||||
|
||||
let (spoofed_devid, spoofed_subsysid) = match actual_devid {
|
||||
// Maxwell
|
||||
@@ -641,8 +641,8 @@ pub unsafe extern "C" fn ioctl(fd: RawFd, request: c_ulong, argp: *mut c_void) -
|
||||
_ => (actual_devid, actual_subsysid),
|
||||
};
|
||||
|
||||
*devid_ptr = (orig_devid & 0xffff0000) | spoofed_devid;
|
||||
*subsysid_ptr = (orig_subsysid & 0xffff0000) | spoofed_subsysid;
|
||||
*devid_ptr = (orig_devid & 0xffff) | (spoofed_devid << 16);
|
||||
*subsysid_ptr = (orig_subsysid & 0xffff) | (spoofed_subsysid << 16);
|
||||
}
|
||||
NV0080_CTRL_CMD_GPU_GET_VIRTUALIZATION_MODE
|
||||
if check_size!(NV0080_CTRL_CMD_GPU_GET_VIRTUALIZATION_MODE, u32) && CONFIG.unlock =>
|
||||
|
||||
Reference in New Issue
Block a user