Skip to content

Commit 106d9aa

Browse files
Iouri Tarassovchessturo
authored andcommitted
drivers: hv: dxgkrnl: Handle process ID in D3DKMTQueryStatistics
When D3DKMTQueryStatistics specifies a non-zero process ID, it needs to be translated to the host process handle before sending a message to the host. Signed-off-by: Iouri Tarassov <iourit@linux.microsoft.com> [kms: forward port to 6.6 from 6.1. No code changes made.] Signed-off-by: Kelsey Steele <kelseysteele@microsoft.com>
1 parent 023f9d3 commit 106d9aa

4 files changed

Lines changed: 111 additions & 73 deletions

File tree

drivers/hv/dxgkrnl/dxgkrnl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ struct dxgprocess {
386386
struct list_head plistentry;
387387
pid_t pid;
388388
pid_t tgid;
389+
pid_t vpid; /* pdi from the current namespace */
389390
/* how many time the process was opened */
390391
struct kref process_kref;
391392
/* protects the object memory */
@@ -981,7 +982,7 @@ int dxgvmb_send_get_stdalloc_data(struct dxgdevice *device,
981982
void *prive_alloc_data,
982983
u32 *res_priv_data_size,
983984
void *priv_res_data);
984-
int dxgvmb_send_query_statistics(struct dxgprocess *process,
985+
int dxgvmb_send_query_statistics(struct d3dkmthandle host_process_handle,
985986
struct dxgadapter *adapter,
986987
struct d3dkmt_querystatistics *args);
987988
int dxgvmb_send_async_msg(struct dxgvmbuschannel *channel,

drivers/hv/dxgkrnl/dxgprocess.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
#include "dxgkrnl.h"
15+
#include "linux/sched.h"
1516

1617
#undef dev_fmt
1718
#define dev_fmt(fmt) "dxgk: " fmt
@@ -31,6 +32,7 @@ struct dxgprocess *dxgprocess_create(void)
3132
DXG_TRACE("new dxgprocess created");
3233
process->pid = current->pid;
3334
process->tgid = current->tgid;
35+
process->vpid = task_pid_vnr(current);
3436
ret = dxgvmb_send_create_process(process);
3537
if (ret < 0) {
3638
DXG_TRACE("send_create_process failed");

0 commit comments

Comments
 (0)