From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH RFC V4 4/5] xen, libxc: Request page fault injection via libxc Date: Mon, 04 Aug 2014 18:23:07 +0300 Message-ID: <53DFA55B.5090106@bitdefender.com> References: <1407151825-3843-1-git-send-email-rcojocaru@bitdefender.com> <1407151825-3843-4-git-send-email-rcojocaru@bitdefender.com> <53DFB4270200007800029147@mail.emea.novell.com> <53DFA292.1030608@bitdefender.com> <53DFC12F020000780002923D@mail.emea.novell.com> <53DFA537.70105@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53DFA537.70105@bitdefender.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 08/04/2014 06:22 PM, Razvan Cojocaru wrote: > On 08/04/2014 06:21 PM, Jan Beulich wrote: >>>>> On 04.08.14 at 17:11, wrote: >>> On 08/04/2014 05:26 PM, Jan Beulich wrote: >>>>>>> On 04.08.14 at 13:30, wrote: >>>>> +static bool_t vmx_check_pf_injection(void) >>>>> +{ >>>>> + struct vcpu *curr = current; >>>>> + struct domain *d = curr->domain; >>>>> + struct segment_register seg; >>>>> + unsigned long ev; >>>>> + uint32_t pending_event = 0; >>>>> + >>>>> + if ( likely(d->arch.hvm_domain.fault_info.virtual_address == 0 ) >>>> >>>> Bad space before ). And my question stands: Why is VA zero >>>> special? >>> >>> It's special because for our purposes (mostly Windows HVM guests, but I >>> think the same applies to Linux), that page is reserved and it's never >>> swapped out, so there would be no point in asking for a page fault >>> injection there. >>> >>> If you think that a code comment is not enough here and that in the >>> future somebody might legitimately want to use 0 as a proper value, I'll >>> add a "valid" member and use that explicitly. >> >> Perhaps in another thread I said this earlier today already: In the >> HVM code we should not be making assumptions about particular >> guest behavior, except when it comes to optimization for certain >> special cases. > OK, I'll address that as well. Thanks, Razvan Cojocaru