From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lengyel, Tamas" Subject: Re: [PATCH v4 15/15] tools/xen-access: altp2m testcases Date: Thu, 9 Jul 2015 21:35:51 -0400 Message-ID: References: <1436489553-6300-1-git-send-email-edmund.h.white@intel.com> <1436489553-6300-16-git-send-email-edmund.h.white@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5275023885820052882==" Return-path: In-Reply-To: <1436489553-6300-16-git-send-email-edmund.h.white@intel.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: Ed White Cc: Ravi Sahita , Wei Liu , George Dunlap , Ian Jackson , Tim Deegan , Xen-devel , Jan Beulich , Andrew Cooper , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org --===============5275023885820052882== Content-Type: multipart/alternative; boundary=f46d043bdf2a8f2433051a7b657d --f46d043bdf2a8f2433051a7b657d Content-Type: text/plain; charset=ISO-8859-1 > @@ -546,6 +652,23 @@ int main(int argc, char *argv[]) > } > > break; > + case VM_EVENT_REASON_SINGLESTEP: > + printf("Singlestep: rip=%016"PRIx64", vcpu %d\n", > + req.regs.x86.rip, > + req.vcpu_id); > + > + if ( altp2m ) > + { > + printf("\tSwitching altp2m to view %u!\n", > altp2m_view_id); > + > + rsp.reason = VM_EVENT_REASON_MEM_ACCESS; > So this was a workaround for v3 of the series that is no longer necessary - it's probably cleaner to have the same reason set for the response as the request was. It's not against any rule, so the code is still correct and works, it's just not best practice. So in case there is another round on the series, it could be fixed then. Tamas --f46d043bdf2a8f2433051a7b657d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

=
@@ -546,6 +652,23 @@ int main(int argc, char *argv[])
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
+=A0 =A0 =A0 =A0 =A0 =A0 case VM_EVENT_REASON_SINGLESTEP:
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("Singlestep: rip=3D%016"P= RIx64", vcpu %d\n",
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0req.regs.x86.rip,
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0req.vcpu_id);
+
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ( altp2m )
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("\tSwitching altp2m to= view %u!\n", altp2m_view_id);
+
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rsp.reason =3D VM_EVENT_REASON_MEM= _ACCESS;

So this was a workaround for v= 3 of the series that is no longer necessary - it's probably cleaner to = have the same reason set for the response as the request was. It's not = against any rule, so the code is still correct and works, it's just not= best practice. So in case there is another round on the series, it could b= e fixed then.

Tamas
--f46d043bdf2a8f2433051a7b657d-- --===============5275023885820052882== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5275023885820052882==--