All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 3/4] x86/svm: Clean up intinfo_t variables
Date: Thu, 5 Dec 2019 12:33:13 +0000	[thread overview]
Message-ID: <31e41913-8ead-37e6-99de-1fa07e24bba5@citrix.com> (raw)
In-Reply-To: <20191204094335.24603-4-andrew.cooper3@citrix.com>

On 04/12/2019 09:43, Andrew Cooper wrote:
> The type name is poor because the type is also used for the IDT vectoring
> field, not just for the event injection field.  Rename it to intinfo_t which
> is how the APM refers to the data.
>
> Rearrange the union to drop the .fields infix, and rename bytes to the more
> common raw.
>
> While adjusting all call sites, fix up style issues and make use of structure
> assignments where applicable.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/hvm/svm/intr.c        | 32 ++++++++----------
>  xen/arch/x86/hvm/svm/nestedsvm.c   | 28 +++++++---------
>  xen/arch/x86/hvm/svm/svm.c         | 68 ++++++++++++++++++--------------------
>  xen/arch/x86/hvm/svm/svmdebug.c    | 12 +++----
>  xen/include/asm-x86/hvm/svm/vmcb.h | 22 ++++++------
>  5 files changed, 75 insertions(+), 87 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
> index ff755165cd..4eede5cc23 100644
> --- a/xen/arch/x86/hvm/svm/intr.c
> +++ b/xen/arch/x86/hvm/svm/intr.c
> @@ -43,15 +43,13 @@ static void svm_inject_nmi(struct vcpu *v)
>  {
>      struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
>      u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
> -    eventinj_t event;
>  
> -    event.bytes = 0;
> -    event.fields.v = 1;
> -    event.fields.type = X86_EVENTTYPE_NMI;
> -    event.fields.vector = 2;
> -
> -    ASSERT(vmcb->eventinj.fields.v == 0);
> -    vmcb->eventinj = event;
> +    ASSERT(!vmcb->eventinj.v);
> +    vmcb->eventinj = (intinfo_t){
> +        .vector = 2,
> +        .type = X86_EVENTTYPE_NMI,
> +        .v = true,
> +    };

And in a surprise move (not really), CentOS 6 isn't happy with this.

I'll revert back to the previous way of filling in eventinj (until we
can actually decide on a newer tools baseline).

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-12-05 12:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  9:43 [Xen-devel] [PATCH 0/4] x86/svm: (Post TASK_SWITCH) cleanup Andrew Cooper
2019-12-04  9:43 ` [Xen-devel] [PATCH 1/4] x86/svm: Clean up construct_vmcb() Andrew Cooper
2019-12-04 10:06   ` Jan Beulich
2019-12-04 19:21     ` Andrew Cooper
2019-12-04  9:43 ` [Xen-devel] [PATCH 2/4] x86/svm: Don't shadow variables in svm_vmexit_handler() Andrew Cooper
2019-12-04 10:10   ` Jan Beulich
2019-12-04  9:43 ` [Xen-devel] [PATCH 3/4] x86/svm: Clean up intinfo_t variables Andrew Cooper
2019-12-04 10:19   ` Jan Beulich
2019-12-04 19:22     ` Andrew Cooper
2019-12-04 19:38   ` Andrew Cooper
2019-12-05  9:11     ` Jan Beulich
2019-12-05 12:33   ` Andrew Cooper [this message]
2019-12-04  9:43 ` [Xen-devel] [PATCH 4/4] x86/svm: Use named (bit)fields for task switch exit info Andrew Cooper
2019-12-04 10:24   ` Jan Beulich
2019-12-04 20:04     ` Andrew Cooper
2019-12-05  9:05       ` Jan Beulich
2019-12-05 10:51 ` [Xen-devel] [PATCH 5/4] x86/svm: Minor cleanup to start_svm() Andrew Cooper
2019-12-05 10:53   ` Jan Beulich

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=31e41913-8ead-37e6-99de-1fa07e24bba5@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.