From patchwork Mon Mar 15 22:10:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12140759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EFC3C43381 for ; Mon, 15 Mar 2021 22:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAF9364F64 for ; Mon, 15 Mar 2021 22:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232169AbhCOWKl (ORCPT ); Mon, 15 Mar 2021 18:10:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39314 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232605AbhCOWKb (ORCPT ); Mon, 15 Mar 2021 18:10:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615846230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GO4Svw6p1VObWYcp8yWMtHx+jBqxgLew+cAErGqrrHw=; b=ZXzROqVC+NIBFFOHqbfv4OmaH/FZ9mto+xfqza7ja/Qic/Ra3jRFJF90VENUycRhWj5Y/f fhNRL5Z68QNx0Y+hYPLQ8MuHwg/l+8mWsbee5w8mXzUFwgWNpgzdNTp9scovdJJEmGvJty mtvU96nhdmNPQDckbi3xXyNmTmOB+vU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-dg5EnmfcNuaKPeeqVJjVGw-1; Mon, 15 Mar 2021 18:10:29 -0400 X-MC-Unique: dg5EnmfcNuaKPeeqVJjVGw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D693C801817; Mon, 15 Mar 2021 22:10:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.207.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAD6C5C261; Mon, 15 Mar 2021 22:10:21 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Vitaly Kuznetsov , linux-kernel@vger.kernel.org, Thomas Gleixner , Wanpeng Li , Kieran Bingham , Jessica Yu , Jan Kiszka , Andrew Morton , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Joerg Roedel , Sean Christopherson , Jim Mattson , Borislav Petkov , Stefano Garzarella , Maxim Levitsky , "H. Peter Anvin" , Paolo Bonzini , Ingo Molnar Subject: [PATCH 0/3] KVM: my debug patch queue Date: Tue, 16 Mar 2021 00:10:17 +0200 Message-Id: <20210315221020.661693-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi! I would like to publish two debug features which were needed for other stuff I work on. One is the reworked lx-symbols script which now actually works on at least gdb 9.1 (gdb 9.2 was reported to fail to load the debug symbols from the kernel for some reason, not related to this patch) and upstream qemu. The other feature is the ability to trap all guest exceptions (on SVM for now) and see them in kvmtrace prior to potential merge to double/triple fault. This can be very useful and I already had to manually patch KVM a few times for this. I will, once time permits, implement this feature on Intel as well. Best regards, Maxim Levitsky Maxim Levitsky (3): scripts/gdb: rework lx-symbols gdb script KVM: x86: guest debug: don't inject interrupts while single stepping KVM: SVM: allow to intercept all exceptions for debug arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/svm/svm.c | 77 ++++++++++++++++++++++- arch/x86/kvm/svm/svm.h | 5 +- arch/x86/kvm/x86.c | 11 +++- kernel/module.c | 8 ++- scripts/gdb/linux/symbols.py | 106 +++++++++++++++++++++++--------- 6 files changed, 174 insertions(+), 35 deletions(-)