On Sun, Aug 01, 2010, Gleb Natapov wrote about "Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures": > Guest can use any valid virtual address. There is UNMAPPED_GVA (~(gpa_t)0) which > at least cannot be valid if address that your function returns have to be > page aligned. Thanks. Unfortunately, I also use this function to decode non-page-aligned addresses (such as an address given to VMWRITE to take a value from), so I cannot use this nice trick. > And not all virtual addresses are valid BTW. For 32 bit > guest virt address cannot be bigger then 32 bit and for 64 bit guest > virtual address should be in canonical form. I guess this means that I can easily find a gva_t which is always invalid - e.g., 1<<63 isn't a legal 32-bit address (of course), and also isn't a legal canonical-form 64 (or rather 48)-bit address - so I could use that as a flag. But I decided that to make things clearer, I'll change the function to return a success flag, and return the gva_t itself into a given pointer: static int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification, u32 vmx_instruction_info, gva_t *ret) -- Nadav Har'El | Monday, Aug 2 2010, 22 Av 5770 nyh@xxxxxxxxxxxxxxxxxxx |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Can Microsoft make a product that doesn't http://nadav.harel.org.il |suck? Yes, a vacuum cleaner! -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html