From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 1/3] x86/emul: Introduce build time assertions for struct segment_register
Date: Fri, 30 Jun 2017 16:04:00 +0100 [thread overview]
Message-ID: <1498835042-22501-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1498835042-22501-1-git-send-email-andrew.cooper3@citrix.com>
This structure is shared with hardware in the AMD VMCB.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
---
xen/arch/x86/x86_emulate/x86_emulate.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 87e84c6..5805d70 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -7899,6 +7899,12 @@ static void __init __maybe_unused build_assertions(void)
BUILD_BUG_ON(X86_EVENTTYPE_SW_INTERRUPT != 4);
BUILD_BUG_ON(X86_EVENTTYPE_PRI_SW_EXCEPTION != 5);
BUILD_BUG_ON(X86_EVENTTYPE_SW_EXCEPTION != 6);
+
+ /* Check struct segment_register against the VMCB segment layout. */
+ BUILD_BUG_ON(sizeof(struct segment_register) != 16);
+ BUILD_BUG_ON(offsetof(struct segment_register, attr) != 2);
+ BUILD_BUG_ON(offsetof(struct segment_register, limit) != 4);
+ BUILD_BUG_ON(offsetof(struct segment_register, base) != 8);
}
#ifndef NDEBUG
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-06-30 15:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 15:03 [PATCH 0/3] Improvements to struct semgent_register Andrew Cooper
2017-06-30 15:04 ` Andrew Cooper [this message]
2017-07-03 12:29 ` [PATCH 1/3] x86/emul: Introduce build time assertions for struct segment_register Jan Beulich
2017-07-03 13:05 ` Andrew Cooper
2017-07-03 13:32 ` Jan Beulich
2017-07-03 13:37 ` Andrew Cooper
2017-06-30 15:04 ` [PATCH 2/3] x86/hvm: Rearange check_segment() to use a switch statement Andrew Cooper
2017-07-03 12:34 ` Jan Beulich
2017-07-03 13:15 ` Andrew Cooper
2017-07-03 13:33 ` Jan Beulich
2017-07-03 13:58 ` Andrew Cooper
2017-07-03 14:05 ` Jan Beulich
2017-06-30 15:04 ` [PATCH 3/3] x86/emul: Drop segment_attributes_t Andrew Cooper
2017-07-03 12:50 ` Jan Beulich
2017-07-03 13:20 ` Andrew Cooper
2017-07-03 13:10 ` [PATCH 4/3] x86/svm: Drop svm_segment_register_t Andrew Cooper
2017-07-03 13:37 ` Jan Beulich
2017-07-03 13:39 ` Andrew Cooper
2017-07-03 14:10 ` 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=1498835042-22501-2-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).