All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Lara Lazier <laramglazier@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2] target/i386: Added VGIF feature
Date: Thu, 29 Jul 2021 10:01:22 +0200	[thread overview]
Message-ID: <1c07bcfd-b240-92ef-03b9-a87d6deff61c@redhat.com> (raw)
In-Reply-To: <20210728113742.41464-1-laramglazier@gmail.com>

On 28/07/21 13:37, Lara Lazier wrote:
> +    uint32_t int_ctl = x86_ldl_phys(cs,
> +                       env->vm_vmcb + offsetof(struct vmcb, control.int_ctl));
> +    if (virtual_gif_enabled(env, int_ctl) && likely(env->hflags & HF_GUEST_MASK)) {
> +        x86_stl_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.int_ctl),
> +                        int_ctl & ~V_GIF_MASK);
> +    } else {

Sorry for the double reply.  env->vm_vmcb is not guaranteed to be valid 
if not in guest mode, so there are two possibilities.

1) Keep the HF_GUEST_MASK check directly in the helpers, but do it 
before x86_ldl_phys

2) Move x86_ldl_phys to virtual_gif_enabled, with a prototype like

bool virtual_gif_enabled(CPUX86State *env, uint32_t *int_ctl)

i.e. returning int_ctl from virtual_gif_enabled via pass-by-reference.

Thanks,

Paolo



      parent reply	other threads:[~2021-07-29  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 11:37 [PATCH v2] target/i386: Added VGIF feature Lara Lazier
2021-07-29  7:59 ` Paolo Bonzini
2021-07-29  8:01 ` 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=1c07bcfd-b240-92ef-03b9-a87d6deff61c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=laramglazier@gmail.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.