Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3919340pxv; Mon, 28 Jun 2021 16:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYc/YIscj6INiaIrgqkQvwcIuarcCDzaP8wqi2kYPlKt9/ylxjGudVbN9eP7y7tbfbxF2W X-Received: by 2002:a05:6e02:156a:: with SMTP id k10mr20123800ilu.111.1624923608830; Mon, 28 Jun 2021 16:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624923608; cv=none; d=google.com; s=arc-20160816; b=qFepGTeg5HXpFxn8cAzBdI4ey+mlfmTlBJF7mjLZXmyomkHYE+YR6ZdJ0IK+PSHuDi 3HDEsNxmBA5H07+5DL8724vbIlcgTFFtMzUraJqL7V+YZV32wLKkcHd3UJbY5Bf2+kof Tzooucm/k0WxVBg371eGtZZeb0hq1qV+aWzhUvRoWlNVU1YP5D47fW73rvFr82fGNt4N GdCzuqj+OOHfY/oC1bzSIiFfZ+BUYdpcSYk4cjvKYULYOX6hKc2xjsszRa4CYiGov/o1 Tn2O+JWWXZe8W195Lkt2zOC239B6m/FzHX4pm1K/vPVAHXo6O3HMRwH4qDPJxKjX9kpn +ARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qX6seYzechjeHaUvwCiEvbqf3DDRF8gmaZeeYhm+qKk=; b=UJXn39MaunF7wj3fnmCSDm7xyUgUsPIW7ooOk6LE649NGej4XmmsbIsVwggGvhBJgm jqntnMqRl9sJgBQgG2n0hIAvgGFo1u7BVxA2O0xUiY7YeZetcnjOhBZnKAO82L3gV4V0 WP1fV4Nfvo1xhOz7tRrO16nIDk4RfNHIay8BNuN8FzNabW7IahwZNBftjXKDpzSeq4vq A8MIBIU14shequMclcjTqP3xL5g0JDtVFOf6rV8E3Sx+Rb7mvylAJtKmEI7PcFUPAc68 D0K4a2ktDRMZUrTPJJ53ZlMC6Y3cMgCurlGpPoTXiq20SnMPPZuiqcO5S6kBdAFsmKCQ ieGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=k51kt4wy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si18523446jam.40.2021.06.28.16.39.57; Mon, 28 Jun 2021 16:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=k51kt4wy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234666AbhF1Rn1 (ORCPT + 99 others); Mon, 28 Jun 2021 13:43:27 -0400 Received: from forward3-smtp.messagingengine.com ([66.111.4.237]:50183 "EHLO forward3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhF1RnZ (ORCPT ); Mon, 28 Jun 2021 13:43:25 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.nyi.internal (Postfix) with ESMTP id 0A78719403B9; Mon, 28 Jun 2021 13:31:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 28 Jun 2021 13:31:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=qX6seYzechjeHaUvw CiEvbqf3DDRF8gmaZeeYhm+qKk=; b=k51kt4wyFTPRHWZeJYFNJdVnHAb2Nvhke 5eQUqxJzUj+GrrFMaVZtYS+c7+TOH1qhzhjOJEouD18wZYfP725wQuvHxETXGKxH uHzpPD2+cgXQuDzltLW2G39aFNUKZ9fskh9pPmviS6Jvyh1wG8wRfku/8ElQVRdJ MLAA+RSu/p6AnCpTRKihoF6rl88yYRV++VfwbiKftufK6YoeZnqRTZsHuGjyEriI TLrBaUf3Xlnp62c2kSLGAja5lOlKGP3do4lIDvfhCrQme+smGADegNp/UqDvFMzx ODS5UtLocpnTtrFuT+cNAy1LbNIJrCqdmdOosrx0ASjRu5CH/rYpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepffgrvhhiugcu gfgumhhonhgushhonhcuoegurghvihgurdgvughmohhnughsohhnsehorhgrtghlvgdrtg homheqnecuggftrfgrthhtvghrnhephfeftdeiveelteeuueekffdvffefiefgtddvffeg iedtgeefffeliefhvedtkeefnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghvihgurdgv ughmohhnughsohhnsehorhgrtghlvgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Jun 2021 13:31:53 -0400 (EDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 11d09b7f; Mon, 28 Jun 2021 17:31:52 +0000 (UTC) From: David Edmondson To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, Thomas Gleixner , Borislav Petkov , Vitaly Kuznetsov , Joerg Roedel , Ingo Molnar , Sean Christopherson , Wanpeng Li , Jim Mattson , "H. Peter Anvin" , Paolo Bonzini , x86@kernel.org, David Edmondson Subject: [PATCH 0/2] KVM: x86: Convey the exit reason to user-space on emulation failure Date: Mon, 28 Jun 2021 18:31:50 +0100 Message-Id: <20210628173152.2062988-1-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To aid in debugging failures in the field, when instruction emulation fails, report the VM exit reason to userspace in order that it can be recorded. The changes are on top of Aaron's patches from https://lore.kernel.org/r/20210510144834.658457-1-aaronlewis@google.com which are in the KVM queue, but not yet upstream. David Edmondson (2): KVM: x86: Add kvm_x86_ops.get_exit_reason KVM: x86: On emulation failure, convey the exit reason to userspace arch/x86/include/asm/kvm-x86-ops.h | 1 + arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm/svm.c | 6 ++++++ arch/x86/kvm/vmx/vmx.c | 6 ++++++ arch/x86/kvm/x86.c | 23 +++++++++++++++++------ include/uapi/linux/kvm.h | 2 ++ 6 files changed, 33 insertions(+), 6 deletions(-) -- 2.30.2