From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar Cavilla Subject: Re: [PATCH RFC v2 03/12] xen/mem_event: Relax error condition on debug builds Date: Wed, 27 Aug 2014 10:02:40 -0700 Message-ID: References: <1409148400-14810-1-git-send-email-tklengyel@sec.in.tum.de> <1409148400-14810-4-git-send-email-tklengyel@sec.in.tum.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0158398640680903326==" Return-path: In-Reply-To: <1409148400-14810-4-git-send-email-tklengyel@sec.in.tum.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tamas K Lengyel Cc: Ian Campbell , Tim Deegan , Ian Jackson , Xen-devel , stefano.stabellini@citrix.com, Jan Beulich , dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org --===============0158398640680903326== Content-Type: multipart/alternative; boundary=089e01227b8643769a05019f6305 --089e01227b8643769a05019f6305 Content-Type: text/plain; charset=UTF-8 On Wed, Aug 27, 2014 at 7:06 AM, Tamas K Lengyel wrote: > A faulty tool stack can brick a debug hypervisor. Unpleasant while > dev/test. > > Suggested-by: Andres Lagar Cavilla > Signed-off-by: Tamas K Lengyel > --- > xen/common/mem_event.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/xen/common/mem_event.c b/xen/common/mem_event.c > index e22b78e..8be32e1 100644 > --- a/xen/common/mem_event.c > +++ b/xen/common/mem_event.c > @@ -279,7 +279,11 @@ void mem_event_put_request(struct domain *d, > if ( current->domain != d ) > { > req->flags |= MEM_EVENT_FLAG_FOREIGN; > - ASSERT( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) ); > +#ifndef NDEBUG > + if ( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) ) > + printk(XENLOG_G_WARNING > + "VCPU was not paused.\n"); > 1. use gdprintk 2. enclose only the gdprintk in #ifdef 3. if the flags contain the improper VCPU_PAUSED value, also clear that value from flags (regardless from NDEBUG) Thanks Andres +#endif > } > > mem_event_ring_lock(med); > -- > 2.1.0.rc1 > > --089e01227b8643769a05019f6305 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Aug 27, 2014 at 7:06 AM, Tamas K Lengyel <tklengyel@sec.in.tum.= de> wrote:
A faulty tool stack can brick a debug hyperv= isor. Unpleasant while dev/test.

Suggested-by: Andres Lagar Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tamas K Lengyel <tklengyel@sec.in.tum.de>
---
=C2=A0xen/common/mem_event.c | 6 +++++-
=C2=A01 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/mem_event.c b/xen/common/mem_event.c
index e22b78e..8be32e1 100644
--- a/xen/common/mem_event.c
+++ b/xen/common/mem_event.c
@@ -279,7 +279,11 @@ void mem_event_put_request(struct domain *d,
=C2=A0 =C2=A0 =C2=A0if ( current->domain !=3D d )
=C2=A0 =C2=A0 =C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0req->flags |=3D MEM_EVENT_FLAG_FOREIGN= ;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT( !(req->flags & MEM_EVENT_FLAG_V= CPU_PAUSED) );
+#ifndef NDEBUG
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( !(req->flags & MEM_EVENT_FLAG_VCPU= _PAUSED) )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(XENLOG_G_WARNING
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"= ;VCPU was not paused.\n");

1. use = gdprintk
2. enclose only the gdprintk in #ifdef
3. if t= he flags contain the improper VCPU_PAUSED value, also clear that value from= flags (regardless from NDEBUG)

Thanks
Andres

+#endif
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0mem_event_ring_lock(med);
--
2.1.0.rc1


--089e01227b8643769a05019f6305-- --===============0158398640680903326== 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 --===============0158398640680903326==--