All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Thomas Huth <thuth@redhat.com>, kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v1] s390x: generate asm offsets for the lowcore
Date: Mon, 29 May 2017 18:33:27 +0200	[thread overview]
Message-ID: <167ed1cc-91ea-8cb4-bf57-c803e3002e2c@redhat.com> (raw)
In-Reply-To: <c2375ad5-0f49-9056-3b48-a2e5ca004400@redhat.com>

On 29.05.2017 17:53, Thomas Huth wrote:
> On 29.05.2017 13:06, David Hildenbrand wrote:
>> Add the s390x psw and lowcore structs and generate asm offsets for lowcore
>> fields. Add all lowcore fields defined in the current PoP (z13).
>>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
> [...]
>> diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
>> new file mode 100644
>> index 0000000..25c9516
>> --- /dev/null
>> +++ b/lib/s390x/asm/arch_def.h
>> @@ -0,0 +1,85 @@
>> +/*
>> + * Copyright (c) 2017 Red Hat Inc
>> + *
>> + * Authors:
>> + *  David Hildenbrand <david@redhat.com>
>> + *
>> + * This code is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Library General Public License version 2.
>> + */
>> +#ifndef _ASM_S390X_ARCH_DEF_H_
>> +#define _ASM_S390X_ARCH_DEF_H_
>> +
>> +struct psw {
>> +	uint64_t	mask;
>> +	uint64_t	addr;
>> +} __attribute__ ((__packed__));
> 
> The struct is naturally aligned - I think you don't need the packed
> attribute here.

Okay, will drop it.

> 
>> +struct lowcore {
>> +	uint8_t		pad_0x0000[0x0080 - 0x0000];	/* 0x0000 */
>> +	uint32_t	ext_int_param;			/* 0x0080 */
>> +	uint16_t	cpu_addr;			/* 0x0084 */
>> +	uint16_t	ext_int_code;			/* 0x0086 */
>> +	uint16_t	svc_int_id;			/* 0x0088 */
>> +	uint16_t	svc_int_code;			/* 0x008a */
>> +	uint16_t	pgm_int_id;			/* 0x008c */
>> +	uint16_t	pgm_int_code;			/* 0x008e */
>> +	uint32_t	dxc_vxc;			/* 0x0090 */
>> +	uint16_t	mon_class_nb;			/* 0x0094 */
>> +	uint8_t		per_code;			/* 0x0096 */
>> +	uint8_t		per_atmid;			/* 0x0097 */
>> +	uint64_t	per_addr;			/* 0x0098 */
>> +	uint8_t		exc_acc_id;			/* 0x00a0 */
>> +	uint8_t		per_acc_id;			/* 0x00a1 */
>> +	uint8_t		op_acc_id;			/* 0x00a2 */
>> +	uint8_t		arch_mode_id;			/* 0x00a3 */
>> +	uint8_t		pad_0x00a4[0x00a8 - 0x00a4];	/* 0x00a4 */
>> +	uint64_t	trans_exc_id;			/* 0x00a8 */
>> +	uint64_t	mon_code;			/* 0x00b0 */
>> +	uint32_t	subsys_id_word;			/* 0x00b8 */
>> +	uint32_t	io_int_param;			/* 0x00bc */
>> +	uint32_t	io_int_word;			/* 0x00c0 */
>> +	uint8_t		pad_0x00c4[0x00c8 - 0x00c4];	/* 0x00c4 */
>> +	uint32_t	stfl;				/* 0x00c8 */
>> +	uint8_t		pad_0x00cc[0x00e8 - 0x00cc];	/* 0x00cc */
>> +	uint64_t	mcck_int_code;			/* 0x00e8 */
>> +	uint8_t		pad_0x00f0[0x00f4 - 0x00f0];	/* 0x00f0 */
>> +	uint32_t	ext_damage_code;		/* 0x00f4 */
>> +	uint64_t	failing_storage_addr;		/* 0x00f8 */
>> +	uint64_t	emon_ca_origin;			/* 0x0100 */
>> +	uint32_t	emon_ca_size;			/* 0x0108 */
>> +	uint32_t	emon_exc_count;			/* 0x010c */
>> +	uint64_t	breaking_event_addr;		/* 0x0110 */
>> +	uint8_t		pad_0x0118[0x0120 - 0x0118];	/* 0x0118 */
>> +	struct psw	restart_old_psw;		/* 0x0120 */
>> +	struct psw	ext_old_psw;			/* 0x0130 */
>> +	struct psw	svc_old_psw;			/* 0x0140 */
>> +	struct psw	pgm_old_psw;			/* 0x0150 */
>> +	struct psw	mcck_old_psw;			/* 0x0160 */
>> +	struct psw	io_old_psw;			/* 0x0170 */
>> +	uint8_t		pad_0x0180[0x01a0 - 0x0180];	/* 0x0180 */
>> +	struct psw	restart_new_psw;		/* 0x01a0 */
>> +	struct psw	ext_new_psw;			/* 0x01b0 */
>> +	struct psw	svc_new_psw;			/* 0x01c0 */
>> +	struct psw	pgm_new_psw;			/* 0x01d0 */
>> +	struct psw	mcck_new_psw;			/* 0x01e0 */
>> +	struct psw	io_new_psw;			/* 0x01f0 */
>> +	uint8_t		pad_0x0200[0x1200 - 0x0200];	/* 0x0200 */
> 
> In my version of the PoP, there is one more additional field at 0x11b0
> ("Machine-Check-Extended-Save-Area Address") ... maybe add that, too?
> 

Thanks, missed that as it does not appear in the table below that
section. Will add it.


>> +	uint64_t	fprs_sa[16];			/* 0x1200 */
>> +	uint64_t	grs_sa[16];			/* 0x1280 */
>> +	struct psw	psw_sa;				/* 0x1300 */
>> +	uint8_t		pad_0x1310[0x1318 - 0x1310];	/* 0x1310 */
>> +	uint32_t	prefix_sa;			/* 0x1318 */
>> +	uint32_t	fpc_sa;				/* 0x131c */
>> +	uint8_t		pad_0x1320[0x1324 - 0x1320];	/* 0x1320 */
>> +	uint32_t	tod_pr_sa;			/* 0x1324 */
>> +	uint64_t	cputm_sa;			/* 0x1328 */
>> +	uint64_t	cc_sa;				/* 0x1330 */
>> +	uint8_t		pad_0x1338[0x1340 - 0x1338];	/* 0x1338 */
>> +	uint32_t	ars_sa[16];			/* 0x1340 */
>> +	uint64_t	crs_sa[16];			/* 0x1380 */
>> +	uint8_t		pad_0x1400[0x1800 - 0x1400];	/* 0x1400 */
>> +	uint8_t		pgm_int_tdb[0x1900 - 0x1800];	/* 0x1800 */
>> +} __attribute__ ((__packed__));
>> +
>> +#endif
> 
> Patch looks fine to me. With or without fixing the nits above:
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 

Thanks!

-- 

Thanks,

David

      reply	other threads:[~2017-05-29 16:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 11:06 [kvm-unit-tests PATCH v1] s390x: generate asm offsets for the lowcore David Hildenbrand
2017-05-29 11:07 ` Paolo Bonzini
2017-05-29 11:08   ` David Hildenbrand
2017-05-29 15:53 ` Thomas Huth
2017-05-29 16:33   ` David Hildenbrand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=167ed1cc-91ea-8cb4-bf57-c803e3002e2c@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.