qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, patches@apm.com,
	alex.bennee@linaro.org, kvmarm@lists.cs.columbia.edu,
	christoffer.dall@linaro.org,
	Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Subject: [Qemu-devel] [PATCH V3 1/2] target-arm: KVM64: Get and Sync up guest register state like kvm32.
Date: Thu,  5 Feb 2015 15:29:41 +0530	[thread overview]
Message-ID: <1423130382-18640-2-git-send-email-pranavkumar@linaro.org> (raw)
In-Reply-To: <1423130382-18640-1-git-send-email-pranavkumar@linaro.org>

This patch adds:
1. Call write_kvmstate_to_list() and write_list_to_cpustate()
   in kvm_arch_get_registers() to sync guest register state.
2. Call write_list_to_kvmstate() in kvm_arch_put_registers()
   to sync guest register state.

These changes are already there for kvm32 in target-arm/kvm32.c.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
---
 target-arm/kvm64.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c
index ba16821..033babf 100644
--- a/target-arm/kvm64.c
+++ b/target-arm/kvm64.c
@@ -193,9 +193,12 @@ int kvm_arch_put_registers(CPUState *cs, int level)
         }
     }
 
+    if (!write_list_to_kvmstate(cpu)) {
+        return EINVAL;
+    }
+
     /* TODO:
      * FP state
-     * system registers
      */
     return ret;
 }
@@ -269,6 +272,14 @@ int kvm_arch_get_registers(CPUState *cs)
         }
     }
 
+    if (!write_kvmstate_to_list(cpu)) {
+        return EINVAL;
+    }
+    /* Note that it's OK to have registers which aren't in CPUState,
+     * so we can ignore a failure return here.
+     */
+    write_list_to_cpustate(cpu);
+
     /* TODO: other registers */
     return ret;
 }
-- 
1.9.1

  reply	other threads:[~2015-02-05 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05  9:59 [Qemu-devel] [PATCH V3 0/2] Add virtio endianness determination in KVM ARM/ARM64 Pranavkumar Sawargaonkar
2015-02-05  9:59 ` Pranavkumar Sawargaonkar [this message]
2015-02-05  9:59 ` [Qemu-devel] [PATCH V3 2/2] target-arm: Guest cpu endianness determination for virtio " Pranavkumar Sawargaonkar
2015-02-05 11:43   ` Peter Maydell
2015-02-05 11:48     ` Peter Maydell
2015-02-06 16:43       ` Pranavkumar Sawargaonkar

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=1423130382-18640-2-git-send-email-pranavkumar@linaro.org \
    --to=pranavkumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@apm.com \
    --cc=peter.maydell@linaro.org \
    --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 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).