Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp492491pxv; Wed, 30 Jun 2021 10:10:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgawGxd+DYO6R2aO4RjDFK5iAn5UbznqRJD4ko3T7tFV277IiRkHM1Au2S8WHwX79TQPos X-Received: by 2002:a6b:7617:: with SMTP id g23mr8834458iom.63.1625073037322; Wed, 30 Jun 2021 10:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625073037; cv=none; d=google.com; s=arc-20160816; b=FNIVKRLAmHm1z4qWX+51pYmPh1AHNNJxuEywnZhGmt8YNXJzW30CQawPJwhsePW6DL LPUipaeryU3rIZ+NrH54UElGk7EIHo0qQUOYrDD1gpw6prFaQ/dEPwj1+Iq5dhuIs7bn shH1EHJStqCQj/+f8qmoweKBQFPsHVyNOFqr826ZRwMru2VQZxNQf2TBNoR/CUW9sHyf 3VfJ4e2+BNl8NughYu6Wb8He6fRKpvpunVTAMMHFJU96hil/9A6tFbN3RmGfO4pQtZEB 4RaWJHvBK+2F3wCS62NyMq+Ybq42Wuyeq767QU3bGoGMWeJ03KPqLSwZm12HUt12caba 50pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wMrs2skzTM0HY+lsZxoBQR/QKSygEmkXMJOZY+h7EgU=; b=ZWLxfNL2/P04hrtwFhOSSItxC+Vl083ZQ2yGY+mHrWrwdd6/LbSHwCxaW+/MKeZ1wH sA6g3Fr7ABFoYjuxK/yIm0BYikPkDfZn4c1hDYLz8Oojqzz4Ek3a6Vj2gC8z2RMA0fNJ ROnbC4NCRsTAu9o+zY/29wjP1AZb8RRiEekv7KB/116HnYIQOBHDsl17x9Z0Dv2OWEN/ IytctMJAAG5NkDeTpitVXzGuwHGpyL29zJHD1zTWOuGmyEGu8mowMGqhjsn2N0SHqrEf gAfe8342C0OJaT19WPOLd9Kq5/CNtFlGAegENemnVmiYRVqZX1lQJZ+XrJ0s1xHI7N+G 7Klw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="I/5vOpSF"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si22750558ilu.89.2021.06.30.10.10.25; Wed, 30 Jun 2021 10:10:37 -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=@google.com header.s=20161025 header.b="I/5vOpSF"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232469AbhF3RLw (ORCPT + 99 others); Wed, 30 Jun 2021 13:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhF3RLv (ORCPT ); Wed, 30 Jun 2021 13:11:51 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0444AC061756 for ; Wed, 30 Jun 2021 10:09:21 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id a15so6432812lfr.6 for ; Wed, 30 Jun 2021 10:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wMrs2skzTM0HY+lsZxoBQR/QKSygEmkXMJOZY+h7EgU=; b=I/5vOpSFnyOPXZ3RLvoghmYhzElCIdMhy+l/aRdXSWff3CU0Y6AwdAXjYXvYyjqzvu rolos0Kx+uEM6ryzcmaErs3qWR4n+D3cWk7aFTNjjNZQ5ESC4MAsLzcxmssHOAH1wCBl Xz8xcxm+pKmIK+ccbCHfDr7EO4MaqK9/I7K3PPy0EEUbZadSwbU/PRuXBmOo4L7sUcKx nz/MenT5nb54eWizcmxlYfrRjcQ7OmOSwP13r1onCw6hDZEJXZmqsqAijN5RJ2D6u8Gm YGZ76RagyQ26oA9iNgtgM6Kzd6WjkDEgZseVgxjAdloZ5J5rEzBvxPsfp4+PuQ7oYk2c JdJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wMrs2skzTM0HY+lsZxoBQR/QKSygEmkXMJOZY+h7EgU=; b=gsG1hdQnab0oPb3yKYMSMp1AXf/JeA3siW1MCJmp3TIllGGbCcj698nUU0bZNNCKoZ 7FNavmx097m/Qjv7602tTxCRGOQu8e82I17j5ptUVLa2vMmXdCBoso3f6udmq1YKe/xx yWEyP9GeouWBujf5V3awcW+znrdCugId5i6N5M+bZklW2matEmfZksFzJ1gFDyS6+Isg XxVT8flutLOxjRtGbSs71FW1JB4alWdQZeQgv4//NNFe1gLIYk83rdvxmCb1qglGy+nl 47/CbRRI/pnbRD5/lrIrZigOVDm6minNMx5ddvp+6zXvbiIRcVyQ2RGkkJ+CXf6yR8RS uV0w== X-Gm-Message-State: AOAM531QlVYyWBfY5eCQyfetlaZb6q7ySHeoV/FZVhVxPYRRYTMh5E73 AiKrDNm0FSFB3AZDJNAsv9quD0XtRUUgp6gKt+IZ3Iitl6M= X-Received: by 2002:a05:6512:2314:: with SMTP id o20mr27246583lfu.531.1625072959006; Wed, 30 Jun 2021 10:09:19 -0700 (PDT) MIME-Version: 1.0 References: <20210628173152.2062988-1-david.edmondson@oracle.com> In-Reply-To: From: David Matlack Date: Wed, 30 Jun 2021 10:08:52 -0700 Message-ID: Subject: Re: [PATCH 0/2] KVM: x86: Convey the exit reason to user-space on emulation failure To: David Edmondson Cc: LKML , kvm list , Thomas Gleixner , Borislav Petkov , Vitaly Kuznetsov , Joerg Roedel , Ingo Molnar , Sean Christopherson , Wanpeng Li , Jim Mattson , "H. Peter Anvin" , Paolo Bonzini , X86 ML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 9:33 AM David Matlack wrote: > > On Mon, Jun 28, 2021 at 06:31:50PM +0100, David Edmondson wrote: > > To aid in debugging failures in the field, when instruction emulation > > What do you mean by a "debugging failure"? Oh! Sorry I misread this as "*debugging failures*" rather than "debugging *failures*". I know what you mean here :-). > > > fails, report the VM exit reason to userspace in order that it can be > > recorded. > > What is the benefit of seeing the VM-exit reason that led to an > emulation failure? > > > > > 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 > >