From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084AbbLDOmy (ORCPT ); Fri, 4 Dec 2015 09:42:54 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:33438 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbbLDOmw (ORCPT ); Fri, 4 Dec 2015 09:42:52 -0500 Subject: Re: [PATCH] kvm: Dump guest rIP when the guest tried something unsupported To: Borislav Petkov , KVM References: <1448045532-12281-1-git-send-email-bp@alien8.de> Cc: LKML From: Paolo Bonzini Message-ID: <5661A669.8020901@redhat.com> Date: Fri, 4 Dec 2015 15:42:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1448045532-12281-1-git-send-email-bp@alien8.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/11/2015 19:52, Borislav Petkov wrote: > From: Borislav Petkov > > It looks like this in action: > > kvm [5197]: vcpu0, guest rIP: 0xffffffff810187ba unhandled rdmsr: 0xc001102 > > and helps to pinpoint quickly where in the guest we did the unsupported > thing. > > Signed-off-by: Borislav Petkov > --- > include/linux/kvm_host.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 5706a2108f0a..597f6607c440 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -439,7 +439,8 @@ struct kvm { > > /* The guest did something we don't support. */ > #define vcpu_unimpl(vcpu, fmt, ...) \ > - kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) > + kvm_pr_unimpl("vcpu%i, guest rIP: 0x%lx " fmt, \ > + (vcpu)->vcpu_id, kvm_rip_read(vcpu), ## __VA_ARGS__) > > #define vcpu_debug(vcpu, fmt, ...) \ > kvm_debug("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) > Thanks, applying this to kvm/queue. Paolo