From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [BUGFIX][PATCH 4/4] XEN_DOMCTL_gdbsx_guestmemio: always do the copyback. Date: Tue, 7 Jan 2014 18:33:09 -0800 Message-ID: <20140107183309.21ae078f@mantra.us.oracle.com> References: <1388857936-664-1-git-send-email-dslutz@verizon.com> <1388857936-664-5-git-send-email-dslutz@verizon.com> <20140106175349.6cbd190b@mantra.us.oracle.com> <1389088824.31766.105.camel@kazak.uk.xensource.com> <1389088937.31766.107.camel@kazak.uk.xensource.com> <52CC2A2F.7010700@terremark.com> <20140107150148.4cbf1a73@mantra.us.oracle.com> <52CCA3B1.7070602@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52CCA3B1.7070602@terremark.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: Don Slutz Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org On Tue, 07 Jan 2014 20:02:41 -0500 Don Slutz wrote: > On 01/07/14 18:01, Mukesh Rathor wrote: > > On Tue, 07 Jan 2014 11:24:15 -0500 > > Don Slutz wrote: .... > Using the info that page 1f is good and 20 is bad, a domctl request > for 1ffff for 2 bytes would call on dbg_rw_mem(), dbg_rw_guest_mem() > which calculate pagecnt == 1, get a valid mfn and return that byte. > The 2nd time pagecnt is also 1, but we get INVALID_MFN, so > dbg_rw_guest_mem(0 returns 1. dbg_rw_mem(0 also returns 1. > gdbsx_guest_mem_io() returns -EFAULT so no copyback. > > At this point of the 2 requested byte, 1 byte is valid and 1 is not. > Since copyback is not done, remain is 0. So the caller get the error > and does not have this "partial success" information. Again, the application cannot and should not rely on the validity of the field in case of failing hcall/syscall, since the failure point is not known to the application, unless the failure is EAGAIN. Hope that makes sense. Mukesh