From: "Jan Beulich" Subject: Re: [PATCH] x86/HVM: Improve EFER validation error messages Date: Fri, 23 Jan 2015 16:08:15 +0000 Message-ID: <54C27FFF0200007800058F9A@mail.emea.novell.com> References: <1422028439-309-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1422028439-309-1-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 23.01.15 at 16:53, wrote: > The previous error message was very little use in identifying the actual > problem after the fact. Now, hvm_efer_valid() will indicate the issue which > it objects to, which is far more useful for diagnosing issues from logs. Nice, but ... > @@ -1848,10 +1850,11 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) > return -EINVAL; > } > > - if ( !hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)) ) > + errstr = hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)); > + if ( errstr ) > { > - printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 "\n", > - d->domain_id, ctxt.msr_efer); > + printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 " - %s\n", > + d->domain_id, ctxt.msr_efer, errstr); ... as you fiddle with it to make it more useful, could you make this print domain and vcpu ID? > @@ -2988,13 +2991,16 @@ err: > int hvm_set_efer(uint64_t value) > { > struct vcpu *v = current; > + const char *errstr; > > value &= ~EFER_LMA; > > - if ( !hvm_efer_valid(v, value, -1) ) > + errstr = hvm_efer_valid(v, value, -1); > + if ( errstr ) > { > - gdprintk(XENLOG_WARNING, "Trying to set reserved bit in " > - "EFER: %#"PRIx64"\n", value); > + printk(XENLOG_G_WARNING > + "%pv Invalid EFER update: %#"PRIx64" -> %#"PRIx64" - %s\n", Perhaps another colon after the %pv? Jan