lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cuno8eisbf9.fsf@oracle.com>
Date:   Tue, 13 Apr 2021 11:53:30 +0100
From:   David Edmondson <david.edmondson@...cle.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Joerg Roedel <joro@...tes.org>,
        Wanpeng Li <wanpengli@...cent.com>,
        Borislav Petkov <bp@...en8.de>,
        Jim Mattson <jmattson@...gle.com>,
        Ingo Molnar <mingo@...hat.com>,
        Joao Martins <joao.m.martins@...cle.com>,
        Aaron Lewis <aaronlewis@...gle.com>
Subject: Re: [PATCH 5/6] KVM: SVM: pass a proper reason in
 kvm_emulate_instruction()

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 <joao.m.martins@...cle.com>
>> 
>> Declare various causes of emulation and use them as appropriate.
>> 
>> Signed-off-by: Joao Martins <joao.m.martins@...cle.com>
>> Signed-off-by: David Edmondson <david.edmondson@...cle.com>
>> ---
>>  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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ