kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Huang <wei.huang2@amd.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, pbonzini@redhat.com, vkuznets@redhat.com,
	thuth@redhat.com, drjones@redhat.com
Subject: Re: [PATCH v3 2/3] selftests: KVM: AMD Nested test infrastructure
Date: Fri, 7 Feb 2020 09:49:39 -0600	[thread overview]
Message-ID: <c4af40ab-3ad3-ace1-36dc-44e2613a6bbb@amd.com> (raw)
In-Reply-To: <88fe7667-17ab-6856-0e99-7106454b9de4@redhat.com>



On 2/7/20 3:53 AM, Auger Eric wrote:
[snip]
>>> +
>>> +#define	SVM_EXITINTINFO_TYPE_INTR SVM_EVTINJ_TYPE_INTR
>>> +#define	SVM_EXITINTINFO_TYPE_NMI SVM_EVTINJ_TYPE_NMI
>>> +#define	SVM_EXITINTINFO_TYPE_EXEPT SVM_EVTINJ_TYPE_EXEPT
>>> +#define	SVM_EXITINTINFO_TYPE_SOFT SVM_EVTINJ_TYPE_SOFT
>>           ^^^^^^
>> TAB instead of SPACE
> 
> as written in the history log (but I think I will add this to the commit
> msg too), this file is an exact copy of arch/x86/include/asm/svm.h
> (except the header includer #ifdef + uapi/asm/svm.h header inclusion. So
> it inherits the style issue of its parent ;-)
>>
>>> +
>>> +#define SVM_EXITINTINFO_VALID SVM_EVTINJ_VALID
>>> +#define SVM_EXITINTINFO_VALID_ERR SVM_EVTINJ_VALID_ERR
>>> +
>>> +#define SVM_EXITINFOSHIFT_TS_REASON_IRET 36
>>> +#define SVM_EXITINFOSHIFT_TS_REASON_JMP 38
>>> +#define SVM_EXITINFOSHIFT_TS_HAS_ERROR_CODE 44
>>> +
>>> +#define SVM_EXITINFO_REG_MASK 0x0F
>>> +
>>> +#define SVM_CR0_SELECTIVE_MASK (X86_CR0_TS | X86_CR0_MP)
>>> +
>>> +#endif /* SELFTEST_KVM_SVM_H */
>>> diff --git a/tools/testing/selftests/kvm/include/x86_64/svm_util.h b/tools/testing/selftests/kvm/include/x86_64/svm_util.h
>>> new file mode 100644
>>> index 000000000000..6a67a89c5d06
>>> --- /dev/null
>>> +++ b/tools/testing/selftests/kvm/include/x86_64/svm_util.h
>>> @@ -0,0 +1,36 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +/*
>>> + * tools/testing/selftests/kvm/include/x86_64/svm_utils.h
>>> + * Header for nested SVM testing
>>> + *
>>> + * Copyright (C) 2020, Red Hat, Inc.
>>> + */
>>> +
>>> +#ifndef SELFTEST_KVM_SVM_UTILS_H
>>> +#define SELFTEST_KVM_SVM_UTILS_H
>>> +
>>> +#include <stdint.h>
>>> +#include "svm.h"
>>> +#include "processor.h"
>>> +
>>> +#define CPUID_SVM_BIT		2
>>> +#define CPUID_SVM		BIT_ULL(CPUID_SVM_BIT)
>>> +
>>> +#define SVM_EXIT_VMMCALL	0x081
>>
>> SVM_EXIT_VMMCALL is better to relocate to svm.h file as it is an
>> architecture definition.
> For the same reason I am tempted to leave this definition here for now.
> Maybe at some point if we introduce some additional ones, this will
> indeed deserve to be moved to the parent? Is it ok?
> 

I figured out this was your intention when I compared arch/x86/include/asm/svm.h with tools/testing/selftests/kvm/include/x86_64/svm.h. However I also noticed that vmx.h in tools/testing/selftests/kvm/include/x86_64/ is not identical as arch/x86/include/asm/vmx.h. So being the same isn't a hard requirement. I am OK with either way.

-Wei



  reply	other threads:[~2020-02-07 15:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 15:00 [PATCH v3 0/3] selftests: KVM: AMD Nested SVM test infrastructure Eric Auger
2020-02-04 15:00 ` [PATCH v3 1/3] selftests: KVM: Replace get_gdt/idt_base() by get_gdt/idt() Eric Auger
2020-02-04 15:44   ` Vitaly Kuznetsov
2020-02-04 15:00 ` [PATCH v3 2/3] selftests: KVM: AMD Nested test infrastructure Eric Auger
2020-02-04 16:03   ` Vitaly Kuznetsov
2020-02-06  7:24     ` Auger Eric
2020-02-06 18:15   ` Wei Huang
2020-02-07  9:53     ` Auger Eric
2020-02-07 15:49       ` Wei Huang [this message]
2020-02-04 15:00 ` [PATCH v3 3/3] selftests: KVM: SVM: Add vmcall test Eric Auger
2020-02-04 16:09   ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4af40ab-3ad3-ace1-36dc-44e2613a6bbb@amd.com \
    --to=wei.huang2@amd.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).