Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2673473pxb; Tue, 13 Apr 2021 07:34:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQvWM61t/xH7ANySqomwkt14nZpB7amM9PHtrwaNvlpFhPG9cMd0QoXikYR11h5oJupRM/ X-Received: by 2002:a63:d50c:: with SMTP id c12mr14811293pgg.145.1618324444488; Tue, 13 Apr 2021 07:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618324444; cv=none; d=google.com; s=arc-20160816; b=Saa+7NWFqexoB2PoBQU0mNe25wDlJ+qd3pkV7+7pKncOMqKXvFtNfSvugbqqAQrQUt Hnzdgsl7AYJy1vBpPtNyRTcXTNzMdrVAd53Iqoo17pRDWQSYrdF5BAZLNunIvxZhQOaV L0W0o3b0PHHreHfLnEWRNP4MWQmjmhXZlStNdXOAqnZKUSKtXp4wqcw1i5KpPSOMo9Sb PXek6oJctKgwQ5pC1eFG8S/ZPloQxhiQZ9M/VuTN0gh7ISP09TrO8bgfmZ4KVa5DE1Kw 0M+APKiAf7CULSS49EneYwnpOEh3AhHAzNJyAeFimb9lApFMs8u9dJHeDnwb6Bhq3cVl O14A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:from:references :in-reply-to:subject:cc:to:dkim-signature; bh=LU2r2VaAOHQrDcDegAXkrCbLQ5rLC3ELxpAY5KMD34k=; b=VWvBKxZE9X2+JQEvT8l9y0emBRIE7skQcLcgW1xVazC8wJ7WSlhUE44sSXLFsI6Rv4 5WTni/ZU2qQIA8HHJf/qCVbBECu2yk3N5Ke0Ue2UWx0X5MdeGOEhkLgZe52eZQoQPO+U WKbU1OoC3REHOfxu0qiQf4Z5dCKWoqnZ9qoHTo9SupiPa2Y2qkCoLSMkt6AZi1Uus611 L8fZ+JHeYNnAT26Dm4aFrgmPJX4bFQdDCswlOE7mODOGL9D7kxweGHv0QFJGTaKW987f g03xjXbpVPE9mY/wpdu36n5nzw+txMhjkYBvIWXKRq3hjKs/Zte2IJGD8wvnFZspMXwG P/Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Urrm1paw; 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 b10si17331495pgs.202.2021.04.13.07.33.50; Tue, 13 Apr 2021 07:34:04 -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=fm2 header.b=Urrm1paw; 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 S1344059AbhDMKzA (ORCPT + 99 others); Tue, 13 Apr 2021 06:55:00 -0400 Received: from forward4-smtp.messagingengine.com ([66.111.4.238]:55327 "EHLO forward4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344006AbhDMKx5 (ORCPT ); Tue, 13 Apr 2021 06:53:57 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.nyi.internal (Postfix) with ESMTP id BFD401940918; Tue, 13 Apr 2021 06:53:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 13 Apr 2021 06:53:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=LU2r2V aAOHQrDcDegAXkrCbLQ5rLC3ELxpAY5KMD34k=; b=Urrm1paw1rJuxWjNLyJb8B 8ysGi72VT4VwnBe+cqoWS6UK7J00L53pmGPeN2XXCtFDb52Cc0rONk8VuVbxWaLN PkjaavzYRLWkNZPC9evUu9KVszgP7/YPaoOtP4EWbEMTs4+oVsE0v91OD9eo5mkm xRSP1kOcaWvNRXkTYBEQsODv3hpSaDhz3h19MqqnpIVhiIt1rdE3pONkczF7YRsT amIhg32PhgY8yzngsgihsTYxuPXzh6TEa2bmw2cvyNg5ysPrPwADoM7ykH2OvwaA ZufsEKz/Nj+FTY7yD3ZSDkIp5/fYuBERqdoDkJ6oAZ7q5srdqZH4rZJ5Vwcte1pQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekledgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepvffujghfhfffkfggtgesthdtredttddttdenucfhrhhomhepffgrvhhiugcu gfgumhhonhgushhonhcuoegurghvihgurdgvughmohhnughsohhnsehorhgrtghlvgdrtg homheqnecuggftrfgrthhtvghrnhepheelfeefudeiudegudelgfetgeetkeelveeuieet udelheejkeeileekveeukedtnecukfhppeekuddrudekjedrvdeirddvfeeknecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrvhhiugdrvggu mhhonhgushhonhesohhrrggtlhgvrdgtohhm X-ME-Proxy: Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net [81.187.26.238]) by mail.messagingengine.com (Postfix) with ESMTPA id EFF4C24005C; Tue, 13 Apr 2021 06:53:31 -0400 (EDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id a8eaf34e; Tue, 13 Apr 2021 10:53:30 +0000 (UTC) To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov , "H. Peter Anvin" , x86@kernel.org, Thomas Gleixner , Joerg Roedel , Wanpeng Li , Borislav Petkov , Jim Mattson , Ingo Molnar , Joao Martins , Aaron Lewis Subject: Re: [PATCH 5/6] KVM: SVM: pass a proper reason in kvm_emulate_instruction() In-Reply-To: References: <20210412130938.68178-1-david.edmondson@oracle.com> <20210412130938.68178-6-david.edmondson@oracle.com> X-HGTTG: zarquon From: David Edmondson X-Now-Playing: Dido - Life for Rent: Stoned Date: Tue, 13 Apr 2021 11:53:30 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, 2021-04-12 at 16:04:02 GMT, Sean Christopherson wrote: > +Aaron > > On Mon, Apr 12, 2021, David Edmondson wrote: >> From: Joao Martins >> >> Declare various causes of emulation and use them as appropriate. >> >> Signed-off-by: Joao Martins >> Signed-off-by: David Edmondson >> --- >> arch/x86/include/asm/kvm_host.h | 6 ++++++ >> arch/x86/kvm/svm/avic.c | 3 ++- >> arch/x86/kvm/svm/svm.c | 26 +++++++++++++++----------- >> 3 files changed, 23 insertions(+), 12 deletions(-) >> >> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h >> index 79e9ca756742..e1284680cbdc 100644 >> --- a/arch/x86/include/asm/kvm_host.h >> +++ b/arch/x86/include/asm/kvm_host.h >> @@ -1535,6 +1535,12 @@ enum { >> EMULREASON_IO_COMPLETE, >> EMULREASON_UD, >> EMULREASON_PF, >> + EMULREASON_SVM_NOASSIST, >> + EMULREASON_SVM_RSM, >> + EMULREASON_SVM_RDPMC, >> + EMULREASON_SVM_CR, >> + EMULREASON_SVM_DR, >> + EMULREASON_SVM_AVIC_UNACCEL, > > Passing these to userspace arguably makes them ABI, i.e. they need to go into > uapi/kvm.h somewhere. That said, I don't like passing arbitrary values for what > is effectively the VM-Exit reason. Why not simply pass the exit reason, assuming > we do indeed want to dump this info to userspace? That would suffice, yes. > What is the intended end usage of this information? Actual emulation? Debug? > Logging? Debug (which implies logging, given that I want this to happen on systems that are in service). > Depending on what you're trying to do with the info, maybe there's a better > option. E.g. Aaron is working on a series that includes passing pass the code > stream (instruction bytes) to userspace on emulation failure, though I'm not > sure if he's planning on providing the VM-Exit reason. Having the instruction stream will be good. Aaron: do you have anything to share now? In what time frame do you think you might submit patches? I'm happy to re-work this to make the exit reason available, if that's the appropriate direction. dme. -- And you're standing here beside me, I love the passing of time.