kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: mark sie block as 512 byte aligned
@ 2020-03-11  8:33 Christian Borntraeger
  2020-03-11  8:41 ` David Hildenbrand
  2020-03-16 12:10 ` Claudio Imbrenda
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11  8:33 UTC (permalink / raw)
  To: Janosch Frank
  Cc: KVM, Cornelia Huck, Christian Borntraeger, David Hildenbrand,
	linux-s390, Thomas Huth

The sie block must be aligned to 512 bytes. Mark it as such.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 0ea82152d2f7..2d50f6c432e2 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
 	__u64	itdba;			/* 0x01e8 */
 	__u64   riccbd;			/* 0x01f0 */
 	__u64	gvrd;			/* 0x01f8 */
-} __attribute__((packed));
+} __packed __aligned(512);
 
 struct kvm_s390_itdb {
 	__u8	data[256];
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: s390: mark sie block as 512 byte aligned
  2020-03-11  8:33 [PATCH] KVM: s390: mark sie block as 512 byte aligned Christian Borntraeger
@ 2020-03-11  8:41 ` David Hildenbrand
  2020-03-11 10:37   ` Christian Borntraeger
  2020-03-16 12:10 ` Claudio Imbrenda
  1 sibling, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2020-03-11  8:41 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank
  Cc: KVM, Cornelia Huck, linux-s390, Thomas Huth

On 11.03.20 09:33, Christian Borntraeger wrote:
> The sie block must be aligned to 512 bytes. Mark it as such.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/include/asm/kvm_host.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
> index 0ea82152d2f7..2d50f6c432e2 100644
> --- a/arch/s390/include/asm/kvm_host.h
> +++ b/arch/s390/include/asm/kvm_host.h
> @@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
>  	__u64	itdba;			/* 0x01e8 */
>  	__u64   riccbd;			/* 0x01f0 */
>  	__u64	gvrd;			/* 0x01f8 */
> -} __attribute__((packed));
> +} __packed __aligned(512);
>  

I guess there is no change in the code/behavior, because we always place
into well defined spots within a page.

Reviewed-by: David Hildenbrand <david@redhat.com>


-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: s390: mark sie block as 512 byte aligned
  2020-03-11  8:41 ` David Hildenbrand
@ 2020-03-11 10:37   ` Christian Borntraeger
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11 10:37 UTC (permalink / raw)
  To: David Hildenbrand, Janosch Frank
  Cc: KVM, Cornelia Huck, linux-s390, Thomas Huth



On 11.03.20 09:41, David Hildenbrand wrote:
> On 11.03.20 09:33, Christian Borntraeger wrote:
>> The sie block must be aligned to 512 bytes. Mark it as such.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  arch/s390/include/asm/kvm_host.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
>> index 0ea82152d2f7..2d50f6c432e2 100644
>> --- a/arch/s390/include/asm/kvm_host.h
>> +++ b/arch/s390/include/asm/kvm_host.h
>> @@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
>>  	__u64	itdba;			/* 0x01e8 */
>>  	__u64   riccbd;			/* 0x01f0 */
>>  	__u64	gvrd;			/* 0x01f8 */
>> -} __attribute__((packed));
>> +} __packed __aligned(512);
>>  
> 
> I guess there is no change in the code/behavior, because we always place
> into well defined spots within a page.

In theory gcc can  generate code that relies on that alignment. For example
load relative long requires double word alignment. Or some atomic instructions.
This could - in theory - generate better code.

> 
> Reviewed-by: David Hildenbrand <david@redhat.com>
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: s390: mark sie block as 512 byte aligned
  2020-03-11  8:33 [PATCH] KVM: s390: mark sie block as 512 byte aligned Christian Borntraeger
  2020-03-11  8:41 ` David Hildenbrand
@ 2020-03-16 12:10 ` Claudio Imbrenda
  2020-03-16 12:11   ` David Hildenbrand
  1 sibling, 1 reply; 6+ messages in thread
From: Claudio Imbrenda @ 2020-03-16 12:10 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Janosch Frank, KVM, Cornelia Huck, David Hildenbrand, linux-s390,
	Thomas Huth

On Wed, 11 Mar 2020 09:33:04 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> The sie block must be aligned to 512 bytes. Mark it as such.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/include/asm/kvm_host.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/include/asm/kvm_host.h
> b/arch/s390/include/asm/kvm_host.h index 0ea82152d2f7..2d50f6c432e2
> 100644 --- a/arch/s390/include/asm/kvm_host.h
> +++ b/arch/s390/include/asm/kvm_host.h
> @@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
>  	__u64	itdba;			/* 0x01e8 */
>  	__u64   riccbd;			/* 0x01f0 */
>  	__u64	gvrd;			/* 0x01f8 */
> -} __attribute__((packed));
> +} __packed __aligned(512);
>  
>  struct kvm_s390_itdb {
>  	__u8	data[256];

I agree with the addition of aligned, but did you really have to remove
packed? it makes me a little uncomfortable.

do we have any compile-time assertions that the size of the block will
be the one we expect?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: s390: mark sie block as 512 byte aligned
  2020-03-16 12:10 ` Claudio Imbrenda
@ 2020-03-16 12:11   ` David Hildenbrand
  2020-03-16 14:22     ` Claudio Imbrenda
  0 siblings, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2020-03-16 12:11 UTC (permalink / raw)
  To: Claudio Imbrenda, Christian Borntraeger
  Cc: Janosch Frank, KVM, Cornelia Huck, linux-s390, Thomas Huth

On 16.03.20 13:10, Claudio Imbrenda wrote:
> On Wed, 11 Mar 2020 09:33:04 +0100
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> 
>> The sie block must be aligned to 512 bytes. Mark it as such.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  arch/s390/include/asm/kvm_host.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/include/asm/kvm_host.h
>> b/arch/s390/include/asm/kvm_host.h index 0ea82152d2f7..2d50f6c432e2
>> 100644 --- a/arch/s390/include/asm/kvm_host.h
>> +++ b/arch/s390/include/asm/kvm_host.h
>> @@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
>>  	__u64	itdba;			/* 0x01e8 */
>>  	__u64   riccbd;			/* 0x01f0 */
>>  	__u64	gvrd;			/* 0x01f8 */
>> -} __attribute__((packed));
>> +} __packed __aligned(512);
>>  
>>  struct kvm_s390_itdb {
>>  	__u8	data[256];
> 
> I agree with the addition of aligned, but did you really have to remove
> packed? it makes me a little uncomfortable.

There is still "__packed".


-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: s390: mark sie block as 512 byte aligned
  2020-03-16 12:11   ` David Hildenbrand
@ 2020-03-16 14:22     ` Claudio Imbrenda
  0 siblings, 0 replies; 6+ messages in thread
From: Claudio Imbrenda @ 2020-03-16 14:22 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Christian Borntraeger, Janosch Frank, KVM, Cornelia Huck,
	linux-s390, Thomas Huth

On Mon, 16 Mar 2020 13:11:30 +0100
David Hildenbrand <david@redhat.com> wrote:

> On 16.03.20 13:10, Claudio Imbrenda wrote:
> > On Wed, 11 Mar 2020 09:33:04 +0100
> > Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >   
> >> The sie block must be aligned to 512 bytes. Mark it as such.
> >>
> >> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> >> ---
> >>  arch/s390/include/asm/kvm_host.h | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/s390/include/asm/kvm_host.h
> >> b/arch/s390/include/asm/kvm_host.h index 0ea82152d2f7..2d50f6c432e2
> >> 100644 --- a/arch/s390/include/asm/kvm_host.h
> >> +++ b/arch/s390/include/asm/kvm_host.h
> >> @@ -344,7 +344,7 @@ struct kvm_s390_sie_block {
> >>  	__u64	itdba;			/* 0x01e8 */
> >>  	__u64   riccbd;			/* 0x01f0 */
> >>  	__u64	gvrd;			/* 0x01f8 */
> >> -} __attribute__((packed));
> >> +} __packed __aligned(512);
> >>  
> >>  struct kvm_s390_itdb {
> >>  	__u8	data[256];  
> > 
> > I agree with the addition of aligned, but did you really have to
> > remove packed? it makes me a little uncomfortable.  
> 
> There is still "__packed".
> 

I had somehow totally missed it

this is what happens when you start working before actually waking up :D


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-16 14:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11  8:33 [PATCH] KVM: s390: mark sie block as 512 byte aligned Christian Borntraeger
2020-03-11  8:41 ` David Hildenbrand
2020-03-11 10:37   ` Christian Borntraeger
2020-03-16 12:10 ` Claudio Imbrenda
2020-03-16 12:11   ` David Hildenbrand
2020-03-16 14:22     ` Claudio Imbrenda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).