On Sun, Aug 01, 2010 at 06:16:59PM +0300, Nadav Har'El wrote: > On Tue, Jun 15, 2010, Gleb Natapov wrote about "Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures": > > > +/* > > > + * Decode the memory-address operand of a vmx instruction, according to the > > > + * Intel spec. > > > + */ > >... > > > +static gva_t get_vmx_mem_address(struct kvm_vcpu *vcpu, > > > + unsigned long exit_qualification, > > > + u32 vmx_instruction_info) > > > +{ > >... > > > + if (is_reg) { > > > + kvm_queue_exception(vcpu, UD_VECTOR); > > > + return 0; > > Isn't zero a legitimate address for vmx operation? > > Thanks. Please excuse my naivity, but is address 0 actually considered a > usable guest virtual address? If it is, do we have any possible value which is > considered invalid? Perhaps -1ull? I see that -1ull is used in a few places > in vmx.c, for example. > 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. 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. > If all gva_t turn out to actually be valid addresses, I'll need to move to a > more complex (and uglier) success flag approach :( > > -- > Nadav Har'El | Sunday, Aug 1 2010, 22 Av 5770 > nyh@xxxxxxxxxxxxxxxxxxx |----------------------------------------- > Phone +972-523-790466, ICQ 13349191 |The only "intuitive" interface is the > http://nadav.harel.org.il |nipple. After that, it's all learned. -- Gleb. -- 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