public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oupton@google.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	David Dunn <daviddunn@google.com>,
	Peter Shier <pshier@google.com>
Subject: Re: [PATCH 2/2] selftests: KVM: Test KVM_X86_QUIRK_FIX_HYPERCALL_INSN
Date: Thu, 24 Mar 2022 19:09:38 +0000	[thread overview]
Message-ID: <YjzB8nMugCPCNtKH@google.com> (raw)
In-Reply-To: <20220316005538.2282772-3-oupton@google.com>

I realized there was some leftover debugging residue in this test, and
some blatantly obvious copy/pasting. I'll address in v2, but as an FYI:

On Wed, Mar 16, 2022 at 12:55:38AM +0000, Oliver Upton wrote:
> Add a test that asserts KVM rewrites guest hypercall instructions to
> match the running architecture (VMCALL on VMX, VMMCALL on SVM).
> Additionally, test that with the quirk disabled, KVM no longer rewrites
> guest instructions and instead injects a #UD.
> 
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  tools/testing/selftests/kvm/.gitignore        |   1 +
>  tools/testing/selftests/kvm/Makefile          |   1 +
>  .../selftests/kvm/x86_64/fix_hypercall_test.c | 170 ++++++++++++++++++
>  3 files changed, 172 insertions(+)
>  create mode 100644 tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
> 
> diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
> index 9b67343dc4ab..1f1b6c978bf7 100644
> --- a/tools/testing/selftests/kvm/.gitignore
> +++ b/tools/testing/selftests/kvm/.gitignore
> @@ -15,6 +15,7 @@
>  /x86_64/debug_regs
>  /x86_64/evmcs_test
>  /x86_64/emulator_error_test
> +/x86_64/fix_hypercall_test
>  /x86_64/get_msr_index_features
>  /x86_64/kvm_clock_test
>  /x86_64/kvm_pv_test
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 6d69e196f1b7..c9cdbd248727 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -48,6 +48,7 @@ TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
>  TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
>  TEST_GEN_PROGS_x86_64 += x86_64/evmcs_test
>  TEST_GEN_PROGS_x86_64 += x86_64/emulator_error_test
> +TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
>  TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
>  TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
>  TEST_GEN_PROGS_x86_64 += x86_64/hyperv_features
> diff --git a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
> new file mode 100644
> index 000000000000..1f5c32146f3d
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
> @@ -0,0 +1,170 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2020, Google LLC.
> + *
> + * Tests for KVM paravirtual feature disablement

Oops.

[...]

> +	case UCALL_SYNC:
> +		pr_info("%s: %016lx\n", (const char *)uc.args[2], uc.args[3]);
> +		break;

This was for debugging, there are no ucalls in the guest any more.

--
Thanks,
Oliver

      reply	other threads:[~2022-03-24 19:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  0:55 [PATCH 0/2] KVM: x86: Allow opt out of guest hypercall patching Oliver Upton
2022-03-16  0:55 ` [PATCH 1/2] KVM: x86: Allow userspace to opt out of " Oliver Upton
2022-03-24 17:44   ` Sean Christopherson
2022-03-24 17:57     ` Paolo Bonzini
2022-03-24 19:05       ` Oliver Upton
2022-03-25 23:53         ` Sean Christopherson
2022-03-28 17:28           ` Oliver Upton
2022-03-28 18:28             ` Sean Christopherson
2022-08-24  9:34               ` Maxim Levitsky
2022-08-24 14:43                 ` Sean Christopherson
2022-08-24 15:06                   ` Maxim Levitsky
2022-08-24 17:15                     ` Paolo Bonzini
2022-08-24 18:40                     ` Sean Christopherson
2022-03-16  0:55 ` [PATCH 2/2] selftests: KVM: Test KVM_X86_QUIRK_FIX_HYPERCALL_INSN Oliver Upton
2022-03-24 19:09   ` Oliver Upton [this message]

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=YjzB8nMugCPCNtKH@google.com \
    --to=oupton@google.com \
    --cc=daviddunn@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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