From patchwork Fri Nov 20 18:52:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 7670771 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5736E9F1C2 for ; Fri, 20 Nov 2015 18:52:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECCC320425 for ; Fri, 20 Nov 2015 18:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BFD52041F for ; Fri, 20 Nov 2015 18:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161918AbbKTSwR (ORCPT ); Fri, 20 Nov 2015 13:52:17 -0500 Received: from mail.skyhub.de ([78.46.96.112]:36870 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161213AbbKTSwQ (ORCPT ); Fri, 20 Nov 2015 13:52:16 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ASPaC+MxzkME; Fri, 20 Nov 2015 19:52:14 +0100 (CET) Received: from pd.tnic (p5DDC4AA5.dip0.t-ipconnect.de [93.220.74.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0B5E41DA2A2; Fri, 20 Nov 2015 19:52:13 +0100 (CET) Received: by pd.tnic (Postfix, from userid 1000) id 41BCA160E2A; Fri, 20 Nov 2015 19:52:12 +0100 (CET) From: Borislav Petkov To: KVM Cc: Paolo Bonzini , LKML Subject: [PATCH] kvm: Dump guest rIP when the guest tried something unsupported Date: Fri, 20 Nov 2015 19:52:12 +0100 Message-Id: <1448045532-12281-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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__)