From: Anthony Liguori <aliguori@us.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Avi Kivity <avi@qumranet.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Alexandre Oliva <aoliva@redhat.com>,
kvm-devel <kvm@vger.kernel.org>
Subject: Re: KVM: pvmmu breakage with gcc 4.3.0
Date: Thu, 26 Jun 2008 10:21:05 -0500 [thread overview]
Message-ID: <4863B3E1.2090505@us.ibm.com> (raw)
In-Reply-To: <200806261708.09579.borntraeger@de.ibm.com>
Christian Borntraeger wrote:
> Am Donnerstag, 26. Juni 2008 schrieb Avi Kivity:
>
>> I don't think "p" should force the contents into memory? Perhaps
>> "m"(*(char *)buffer)?
>>
>> Anthony, I don't see why a memory clobber would tell gcc that the
>> variables is actually used. The problem is with the void * -> unsigned
>> long cast (__pa), once that happens gcc loses track. It's probably
>> needed anyway since hypercalls _do_ clobber memory.
>>
>
> I I think about that again, the correct solution should be to use 2 input
> constraints for parameters together with the memory clobber on hypercall.
>
> I think something like the following covers all cases:
>
> static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
> {
> long ret;
> asm volatile(KVM_HYPERCALL
> : "=a"(ret)
> : "a"(nr), "b"(p1), "m"(*(char *) p1)
> : "memory" );
> return ret;
> }
>
>
> The address and the memory content of p1 (if it is a pointer) is not ommitted
> by gcc. Furthermore, the memory clobbering nature of a hypercall is specified
> as well.
>
Isn't that redundant though? Shouldn't a memory clobber force GCC to
assume that anything that's reachable is live?
Regards,
Anthony Liguori
> Christian
>
next prev parent reply other threads:[~2008-06-26 15:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-26 2:10 KVM: pvmmu breakage with gcc 4.3.0 Marcelo Tosatti
2008-06-26 3:10 ` Anthony Liguori
2008-06-26 13:18 ` Christian Borntraeger
2008-06-26 18:06 ` Alexandre Oliva
2008-06-29 8:56 ` Avi Kivity
2008-06-26 11:43 ` Avi Kivity
2008-06-26 12:47 ` Anthony Liguori
2008-06-27 16:11 ` Bill Davidsen
2008-06-26 15:08 ` Christian Borntraeger
2008-06-26 15:21 ` Anthony Liguori [this message]
2008-06-26 15:41 ` Anthony Liguori
2008-06-26 16:34 ` Christian Borntraeger
2008-06-29 10:16 ` Avi Kivity
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=4863B3E1.2090505@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=aoliva@redhat.com \
--cc=avi@qumranet.com \
--cc=borntraeger@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox