From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] xen/x86: Identify which vcpu's CR4 is being badly modified Date: Wed, 26 Mar 2014 13:30:59 +0000 Message-ID: <5332D693.7010204@citrix.com> References: <1395776406-24793-1-git-send-email-andrew.cooper3@citrix.com> <5332E15F020000780000253F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5332E15F020000780000253F@nat28.tlf.novell.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: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org On 26/03/14 13:17, Jan Beulich wrote: >>>> On 25.03.14 at 20:40, wrote: >> When the toolstack is setting vcpu state on behalf of a migrating guest, the >> domain/vcpu reference from gdprintk() identifies the toolstack, not the >> affected domain. >> >> After this change, the error looks more like: >> >> domain.c:632:d0v3 Attempt to change d1v0's CR4 flags 00002660 -> 01875000 > And is the leading d0v3 really useful here in any way? I'd really like to > see unmotivated uses of gdprintk() replaced by printk(XENLOG_G_...). > > Jan Personally, I find it useful to distinguish between "the toolstack tried something" and "a guest tried something", although the file/line reference is quite useless. Perhaps printk(XENLOG_G_WARNING "%pv attempted to change %pv's CR4 flags ...", current, v ....) ? ~Andrew > >> Signed-off-by: Andrew Cooper >> CC: Keir Fraser >> CC: Jan Beulich >> --- >> xen/arch/x86/domain.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c >> index b48f2dc..59e2729 100644 >> --- a/xen/arch/x86/domain.c >> +++ b/xen/arch/x86/domain.c >> @@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, >> unsigned long guest_cr4) >> >> if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) ) >> gdprintk(XENLOG_WARNING, >> - "Attempt to change CR4 flags %08lx -> %08lx\n", >> - hv_cr4, guest_cr4); >> + "Attempt to change %pv's CR4 flags %08lx -> %08lx\n", >> + v, hv_cr4, guest_cr4); >> >> return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask); >> } >> -- >> 1.7.10.4 > >