qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] SEV: QMP support for Inject-Launch-Secret


From: Dr. David Alan Gilbert
Subject: Re: [PATCH v2] SEV: QMP support for Inject-Launch-Secret
Date: Fri, 3 Jul 2020 17:02:08 +0100
User-agent: Mutt/1.14.5 (2020-06-23)

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]