From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: KVM: pvmmu breakage with gcc 4.3.0 Date: Thu, 26 Jun 2008 10:21:05 -0500 Message-ID: <4863B3E1.2090505@us.ibm.com> References: <20080626021047.GA10263@dmt.cnet> <486380DB.9070905@qumranet.com> <200806261708.09579.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , Alexandre Oliva , kvm-devel To: Christian Borntraeger Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:59902 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbYFZPVd (ORCPT ); Thu, 26 Jun 2008 11:21:33 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e34.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m5QFLWxB008338 for ; Thu, 26 Jun 2008 11:21:32 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5QFLWM1147116 for ; Thu, 26 Jun 2008 09:21:32 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5QFLUvj028756 for ; Thu, 26 Jun 2008 09:21:31 -0600 In-Reply-To: <200806261708.09579.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 >