From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRkHE-0002QP-Tq for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:53:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRkH9-0004q0-Cs for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:53:16 -0400 Received: from mail-yh0-x22a.google.com ([2607:f8b0:4002:c01::22a]:36432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRkH9-0004pv-85 for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:53:11 -0400 Received: by mail-yh0-f42.google.com with SMTP id z12so679794yhz.1 for ; Thu, 03 Oct 2013 07:53:10 -0700 (PDT) Sender: Richard Henderson Message-ID: <524D84CE.1000601@twiddle.net> Date: Thu, 03 Oct 2013 07:53:02 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1380713622-22325-1-git-send-email-mimu@linux.vnet.ibm.com> <1380713622-22325-5-git-send-email-mimu@linux.vnet.ibm.com> In-Reply-To: <1380713622-22325-5-git-send-email-mimu@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 04/11] s390/qemu: cpu model cpu facilitiy support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Mueller Cc: qemu-devel@nongnu.org On 10/02/2013 04:33 AM, Michael Mueller wrote: > +/* set a specific bit in facility set */ > +static void set_facility(unsigned int nr, void *facilities) > +{ > + unsigned char *ptr; > + > + if (nr >= MAX_S390_FACILITY_BIT) { > + return; > + } > + ptr = (unsigned char *) facilities + (nr >> 3); > + *ptr |= (0x80 >> (nr & 7)); > +} I'd like to see this done in a host endian independent way. See my recent patch set to add facility support to the tcg side of target-s390, with which this patch set is going to conflict. Is there a good reason not to compute these facility masks at compile-time? See http://patchwork.ozlabs.org/patch/279534/ where I have pre-computed (possibly incomplete) facilities lists for the major cpu revisions. It just seems like your facility_availability array is the wrong way to go about things, taking up more memory and startup time than necessary. r~