Skip to contentSkip to conversation

update_va_mapping_otherdomain

DISCUSSION Michael R. Hines 2 participants 6 messages Sep 8, 2007 – Sep 9, 2007

lore
Share & tools
lore
#0 lore raw

Greetings,

I have a technical question about update_va_mapping_otherdomain.......

I have two components: a C program linked against libxc and a kernel module which performs the following simple sequence of events from domain zero:

1. Pause guest (unprivileged)
2. Grabs the PTE associated with a random (but present) page within the guest's kernel's address space
(using a modified xc_translate_foreign_address)
3. Flips the present bit to zero
4. Calls HYPERVISOR_update_va_mapping otherdomain (from the kernel module)
5. Re-performs xc_translate_foreign_address on the same PTE
6. Verifies the the present bit was indeed changed to zero

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

Signature · 5 lines
/*
Michael R. Hines
http://www.cs.binghamton.edu/~mhines/
Live long and prosper...
*/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 5 lines · Michael R. Hines

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

That hypercall allows you to update a *local* va mapping to map *another* domain's memory page. So you've mapped the guest's page somewhere random in your own address space.

-- Keir

#2 lore raw

ooooh, ok. I understand now.

Thank you very much for your response. =)

- Michael

Quoted 22 lines · Keir Fraser
Quoted 5 lines · Michael R. Hines

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

That hypercall allows you to update a *local* va mapping to map *another* domain's memory page. So you've mapped the guest's page somewhere random in your own address space.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 5 lines
/*
Michael R. Hines
http://www.cs.binghamton.edu/~mhines/
Live long and prosper...
*/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

So, if I would like to use dom0 to modify a specific L1 PTE belonging to another unprivileged domain, what's the best way to go about it?

Grant references? (on L1 page tables?)

Might I be able to get a quick pointer on the right sequence of hypercalls?

Much appreciated,
- Michael

Quoted 36 lines · Michael R. Hines

ooooh, ok. I understand now.

Thank you very much for your response. =)

- Michael

Quoted 16 lines · Keir Fraser
Quoted 5 lines · Michael R. Hines

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

That hypercall allows you to update a *local* va mapping to map *another* domain's memory page. So you've mapped the guest's page somewhere random in your own address space.

-- Keir

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 5 lines
/*
Michael R. Hines
http://www.cs.binghamton.edu/~mhines/
Live long and prosper...
*/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

There is currently no way to modify active page tables of another domain.

-- Keir

Quoted 48 lines · Michael R. Hines

So, if I would like to use dom0 to modify a specific L1 PTE belonging to another unprivileged domain, what's the best way to go about it?

Grant references? (on L1 page tables?)

Might I be able to get a quick pointer on the right sequence of hypercalls?

Much appreciated,
- Michael

Quoted 36 lines · Michael R. Hines

ooooh, ok. I understand now.

Thank you very much for your response. =)

- Michael

Quoted 16 lines · Keir Fraser
Quoted 5 lines · Michael R. Hines

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

That hypercall allows you to update a *local* va mapping to map *another* domain's memory page. So you've mapped the guest's page somewhere random in your own address space.

-- Keir

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

Thank you.

- Michael

Quoted 56 lines · Keir Fraser

There is currently no way to modify active page tables of another domain.

-- Keir

Quoted 46 lines · Michael R. Hines

So, if I would like to use dom0 to modify a specific L1 PTE belonging to another unprivileged domain, what's the best way to go about it?

Grant references? (on L1 page tables?)

Might I be able to get a quick pointer on the right sequence of hypercalls?

Much appreciated,
- Michael

Quoted 35 lines · Michael R. Hines

ooooh, ok. I understand now.

Thank you very much for your response. =)

- Michael

Quoted 16 lines · Keir Fraser
Quoted 5 lines · Michael R. Hines

Upon successful return from update_va_mapping (i.e. return code == zero), my problem involves the last step mentioned above. The present bit still remains unchanged (is still one), although update_va_mapping return true.

What might cause such a strange problem to occur?

That hypercall allows you to update a *local* va mapping to map *another* domain's memory page. So you've mapped the guest's page somewhere random in your own address space.

-- Keir

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 5 lines
/*
Michael R. Hines
http://www.cs.binghamton.edu/~mhines/
Live long and prosper...
*/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel