qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, alex.bennee@linaro.org, berrange@redhat.com,
	philmd@linaro.org
Subject: [PATCH 1/3] target/i386/sev: Cast id_auth_uaddr through uintptr_t
Date: Wed, 26 Jun 2024 12:49:48 -0700	[thread overview]
Message-ID: <20240626194950.1725800-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20240626194950.1725800-1-richard.henderson@linaro.org>

This member is __u64 in the kernel structure.
Cast via uintptr_t to match the host's pointer size.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/i386/sev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/i386/sev.c b/target/i386/sev.c
index 30b83f1d77..9dfdac69ab 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -2171,13 +2171,13 @@ sev_snp_guest_set_id_block(Object *obj, const char *value, Error **errp)
 
     finish->id_block_en = 0;
     g_free(sev_snp_guest->id_block);
-    g_free((guchar *)finish->id_block_uaddr);
+    g_free((void *)(uintptr_t)finish->id_block_uaddr);
 
     /* store the base64 str so we don't need to re-encode in getter */
     sev_snp_guest->id_block = g_strdup(value);
 
     finish->id_block_uaddr =
-        (uint64_t)qbase64_decode(sev_snp_guest->id_block, -1, &len, errp);
+        (uintptr_t)qbase64_decode(sev_snp_guest->id_block, -1, &len, errp);
 
     if (!finish->id_block_uaddr) {
         return;
@@ -2208,13 +2208,13 @@ sev_snp_guest_set_id_auth(Object *obj, const char *value, Error **errp)
     gsize len;
 
     g_free(sev_snp_guest->id_auth);
-    g_free((guchar *)finish->id_auth_uaddr);
+    g_free((void *)(uintptr_t)finish->id_auth_uaddr);
 
     /* store the base64 str so we don't need to re-encode in getter */
     sev_snp_guest->id_auth = g_strdup(value);
 
     finish->id_auth_uaddr =
-        (uint64_t)qbase64_decode(sev_snp_guest->id_auth, -1, &len, errp);
+        (uintptr_t)qbase64_decode(sev_snp_guest->id_auth, -1, &len, errp);
 
     if (!finish->id_auth_uaddr) {
         return;
-- 
2.34.1



  reply	other threads:[~2024-06-26 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 19:49 [PATCH 0/3] target/i386/sev: Fix 32-bit host build issues Richard Henderson
2024-06-26 19:49 ` Richard Henderson [this message]
2024-06-26 19:49 ` [PATCH 2/3] target/i386/sev: Use size_t for object sizes Richard Henderson
2024-06-26 19:49 ` [PATCH 3/3] target/i386/sev: Fix printf formats Richard Henderson
2024-06-27  6:17 ` [PATCH 0/3] target/i386/sev: Fix 32-bit host build issues Philippe Mathieu-Daudé
2024-06-27 14:58 ` Paolo Bonzini

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=20240626194950.1725800-2-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@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).