From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: James Bottomley <jejb@linux.ibm.com>
Cc: thomas.lendacky@amd.com, brijesh.singh@amd.com, tobin@ibm.com,
qemu-devel@nongnu.org,
Tobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>,
pbonzini@redhat.com
Subject: Re: [PATCH v2] SEV: QMP support for Inject-Launch-Secret
Date: Fri, 3 Jul 2020 17:02:08 +0100 [thread overview]
Message-ID: <20200703160208.GG6641@work-vm> (raw)
In-Reply-To: <1593791654.3972.26.camel@linux.ibm.com>
* James Bottomley (jejb@linux.ibm.com) wrote:
> On Fri, 2020-07-03 at 12:11 +0100, Dr. David Alan Gilbert wrote:
> > * Tobin Feldman-Fitzthum (tobin@linux.vnet.ibm.com) wrote:
> [...]
> > > + input.trans_uaddr = (uint64_t)data;
> > > + input.trans_len = data_sz;
> > > +
> > > + input.guest_uaddr = (uint64_t)hva;
> >
> > Thanks for changing these; although it fails a 32bit build (which is
> > probably mostly pointless for SEV, but it fails the build rather than
> > building it out). The easy fix here seems to be:
> > (uint64_t)(uintptr_t)
>
> That's a pointer width issue. The recommended way to communicate to
> the compiler that we really want to cast a 32 bit pointer to a 64 bit
> value is actually to cast to unsigned long before casting to pointer,
> so
>
> (uint64_t)(unsigned long)hva
>
> Many other things work, of course, but if you follow the recommendation
> you (hopefully) don't trip future compiler warnings.
OK, fair enough
(Out of curiosity can you explain why unsigned long not uintptr_t?)
Dave
> James
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2020-07-03 16:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 19:42 [PATCH v2] SEV: QMP support for Inject-Launch-Secret Tobin Feldman-Fitzthum
2020-07-03 11:11 ` Dr. David Alan Gilbert
2020-07-03 13:25 ` Brijesh Singh
2020-07-03 22:25 ` tobin
2020-07-03 15:54 ` James Bottomley
2020-07-03 16:02 ` Dr. David Alan Gilbert [this message]
2020-07-03 16:33 ` James Bottomley
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=20200703160208.GG6641@work-vm \
--to=dgilbert@redhat.com \
--cc=brijesh.singh@amd.com \
--cc=jejb@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thomas.lendacky@amd.com \
--cc=tobin@ibm.com \
--cc=tobin@linux.vnet.ibm.com \
/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.