qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Andreas Färber" <afaerber@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 2/3] target-i386: Add a marker to the end of region zeroed on reset
Date: Fri, 24 Apr 2015 16:37:31 -0300	[thread overview]
Message-ID: <1429904252-9841-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1429904252-9841-1-git-send-email-ehabkost@redhat.com>

Instead of using the next field in the struct (that's a moving target
because we are gradually moving fields to X86CPU), add an empty struct
as a marker (like we already did with {start,end}_init_save).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 2 +-
 target-i386/cpu.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 11da4b5..928e2be 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2595,7 +2595,7 @@ static void x86_cpu_reset(CPUState *s)
 
     xcc->parent_reset(s);
 
-    memset(env, 0, offsetof(CPUX86State, cpuid_level));
+    memset(env, 0, offsetof(CPUX86State, end_reset_fields));
 
     tlb_flush(s, 1);
 
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 1d9f1d7..750b5b7 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -931,6 +931,7 @@ typedef struct CPUX86State {
     CPU_COMMON
 
     /* Fields from here on are preserved across CPU reset. */
+    struct {} end_reset_fields;
 
     /* processor features (e.g. for CPUID insn) */
     uint32_t cpuid_level;
-- 
2.1.0

  parent reply	other threads:[~2015-04-24 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 19:37 [Qemu-devel] [PATCH 0/3] target-i386: Move CPUID fields to X86CPU Eduardo Habkost
2015-04-24 19:37 ` [Qemu-devel] [PATCH 1/3] target-i386: Coding style fix on x86_cpuid_set_vendor() Eduardo Habkost
2015-04-24 19:37 ` Eduardo Habkost [this message]
2015-04-24 19:37 ` [Qemu-devel] [PATCH 3/3] target-i386: Move CPUID fields to X86CPU Eduardo Habkost

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=1429904252-9841-3-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).