From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness Date: Sun, 07 Feb 2010 18:15:57 +0200 Message-ID: <4B6EE73D.6020709@redhat.com> References: <1265298925-31954-1-git-send-email-agraf@suse.de> <1265298925-31954-4-git-send-email-agraf@suse.de> <4B6EB2D7.1030500@redhat.com> <3CEF000F-1751-4E65-A08A-C71B2CE8DAEE@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" To: Alexander Graf Return-path: In-Reply-To: <3CEF000F-1751-4E65-A08A-C71B2CE8DAEE-l3A5Bk7waGM@public.gmane.org> Sender: kvm-ppc-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: kvm.vger.kernel.org On 02/07/2010 05:51 PM, Alexander Graf wrote: >>> + if (vcpu->arch.mmio_sign_extend) { >>> + switch (run->mmio.len) { >>> +#ifdef CONFIG_PPC64 >>> + case 4: >>> + if (gpr& 0x80000000) >>> + gpr |= 0xffffffff00000000ULL; >>> + break; >>> >> >> Wouldn't >> >> gpr = (s64)(gpr << 32) >> 32; >> >> work? Not sure if >> is guaranteed to sign extend. > > > Not sure either. The code as is is rather obvious imho, so I wouldn't > want to replace it with anything that's even remotely magical. > That's fair. -- error compiling committee.c: too many arguments to function