mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Cc: Shuah Khan <shuah@kernel.org>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: selftests: svm_int_ctl_test: fix intercept calculation
Date: Wed, 8 Dec 2021 15:04:16 +0100	[thread overview]
Message-ID: <111d46ba-0a9b-fdb2-d8c4-fe8045edc092@redhat.com> (raw)
In-Reply-To: <49b9571d25588870db5380b0be1a41df4bbaaf93.1638486479.git.maciej.szmigiero@oracle.com>

On 12/3/21 00:10, Maciej S. Szmigiero wrote:
> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> 
> INTERCEPT_x are bit positions, but the code was using the raw value of
> INTERCEPT_VINTR (4) instead of BIT(INTERCEPT_VINTR).
> This resulted in masking of bit 2 - that is, SMI instead of VINTR.
> 
> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
> ---
>   tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c b/tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c
> index df04f56ce859..30a81038df46 100644
> --- a/tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c
> @@ -75,7 +75,7 @@ static void l1_guest_code(struct svm_test_data *svm)
>   	vmcb->control.int_ctl &= ~V_INTR_MASKING_MASK;
>   
>   	/* No intercepts for real and virtual interrupts */
> -	vmcb->control.intercept &= ~(1ULL << INTERCEPT_INTR | INTERCEPT_VINTR);
> +	vmcb->control.intercept &= ~(BIT(INTERCEPT_INTR) | BIT(INTERCEPT_VINTR));
>   
>   	/* Make a virtual interrupt VINTR_IRQ_NUMBER pending */
>   	vmcb->control.int_ctl |= V_IRQ_MASK | (0x1 << V_INTR_PRIO_SHIFT);
> 

Queued, thanks.

Paolo

      parent reply	other threads:[~2021-12-08 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 23:10 Maciej S. Szmigiero
2021-12-03  7:36 ` Maxim Levitsky
2021-12-08 14:04 ` Paolo Bonzini [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=111d46ba-0a9b-fdb2-d8c4-fe8045edc092@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=mlevitsk@redhat.com \
    --cc=shuah@kernel.org \
    /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

all inboxes | Powered by JetHome®