From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPXtG-0005n1-Ob for qemu-devel@nongnu.org; Thu, 04 Sep 2014 10:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPXt7-00011e-ND for qemu-devel@nongnu.org; Thu, 04 Sep 2014 10:19:58 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:52263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPXt7-0000wm-CS for qemu-devel@nongnu.org; Thu, 04 Sep 2014 10:19:49 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Sep 2014 15:19:46 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3D14017D8043 for ; Thu, 4 Sep 2014 15:21:44 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s84EJjLS27918346 for ; Thu, 4 Sep 2014 14:19:45 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s84EJh3K006563 for ; Thu, 4 Sep 2014 08:19:45 -0600 Date: Thu, 4 Sep 2014 16:19:42 +0200 From: Heiko Carstens Message-ID: <20140904141942.GB4206@osiris> References: <20140904105223.336503578@de.ibm.com> <20140904105337.081387456@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140904105337.081387456@de.ibm.com> Subject: Re: [Qemu-devel] [RFC][patch 3/6] KVM: s390: Add GISA support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: frank.blaschka@de.ibm.com Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, pbonzini@redhat.com On Thu, Sep 04, 2014 at 12:52:26PM +0200, frank.blaschka@de.ibm.com wrote: > +void kvm_s390_gisa_register_alert(struct kvm *kvm, u32 gisc) > +{ > + int bito = BITS_PER_BYTE * 7 + gisc; > + > + set_bit(bito ^ (BITS_PER_LONG - 1), &kvm->arch.iam); > +} Just a very minor nit: you could also use set_bit_inv() & friends. > +static inline u64 kvm_s390_get_base_disp_rxy(struct kvm_vcpu *vcpu) > +{ > + u32 x2 = (vcpu->arch.sie_block->ipa & 0x000f); > + u32 base2 = vcpu->arch.sie_block->ipb >> 28; > + u32 disp2 = ((vcpu->arch.sie_block->ipb & 0x0fff0000) >> 16) + > + ((vcpu->arch.sie_block->ipb & 0xff00) << 4); > + > + return (base2 ? vcpu->run->s.regs.gprs[base2] : 0) + > + (x2 ? vcpu->run->s.regs.gprs[x2] : 0) + (u64)disp2; > +} Not very readable ;) However.. for the RXY instruction format the 20 bit displacement is usually signed and not unsigned like your code seems to treat it.