From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Carstens Subject: Re: [PATCH 02/12] KVM: s390: define GISA format-0 data structure Date: Wed, 17 Jan 2018 08:57:22 +0100 Message-ID: <20180117075722.GA5708@osiris> References: <20180116200217.211897-1-borntraeger@de.ibm.com> <20180116200217.211897-3-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christian Borntraeger , Cornelia Huck , KVM , linux-s390 , Janosch Frank , Michael Mueller To: David Hildenbrand Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42140 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbeAQH5f (ORCPT ); Wed, 17 Jan 2018 02:57:35 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0H7u9lR143767 for ; Wed, 17 Jan 2018 02:57:35 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fj0kh4cpk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 17 Jan 2018 02:57:34 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Jan 2018 07:57:32 -0000 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 16, 2018 at 09:25:12PM +0100, David Hildenbrand wrote: > > > +struct kvm_s390_gisa { > > + u32 next_alert; > > + u8 ipm; > > + u8 reserved01; > > + u8:6; > > + u8 g:1; > > + u8 c:1; > > + u8 iam; > > + u8 reserved02[4]; > > + u32 airq_count; > > +}; > > + > > /* > > - * sie_page2 has to be allocated as DMA because fac_list and crycb need > > - * 31bit addresses in the sie control block. > > + * sie_page2 has to be allocated as DMA because fac_list, crycb and > > + * gisa need 31bit addresses in the sie control block. > > */ > > struct sie_page2 { > > __u64 fac_list[S390_ARCH_FAC_LIST_SIZE_U64]; /* 0x0000 */ > > struct kvm_s390_crypto_cb crycb; /* 0x0800 */ > > - u8 reserved900[0x1000 - 0x900]; /* 0x0900 */ > > + struct kvm_s390_gisa gisa __aligned(sizeof(struct kvm_s390_gisa)); /* 0x0900 */ > > can we instead specify sie_page2 as packed if really needed? (I can see > that we have a BUILD_BUG_ON below, which is nice) > > (alignment within well defined data structures looks strange) The alignment, if needed, should go to the definition of struct kvm_s390_gisa above. The structure needs at least an alignment of eight bytes since bitops are used to modify ipm (in a later patch), by using a (long *) cast to this structure. But of course it is all naturally aligned anyway... ;)