qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org, borntraeger@de.ibm.com
Subject: Re: [Qemu-devel] [PATCH v5 1/1] s390x/sclp: extend SCLP event masks to 64 bits
Date: Wed, 7 Mar 2018 16:55:48 +0100	[thread overview]
Message-ID: <20180307165548.29f7ec07.cohuck@redhat.com> (raw)
In-Reply-To: <1520435434-24471-1-git-send-email-imbrenda@linux.vnet.ibm.com>

On Wed,  7 Mar 2018 16:10:34 +0100
Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> wrote:

> Extend the SCLP event masks to 64 bits.
> 
> Notice that using any of the new bits results in a state that cannot be
> migrated to an older version.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
> ---
>  hw/s390x/event-facility.c         | 49 ++++++++++++++++++++++++++++++++-------
>  include/hw/s390x/event-facility.h |  2 +-
>  2 files changed, 41 insertions(+), 10 deletions(-)
> 

> @@ -376,6 +387,21 @@ static bool vmstate_event_facility_mask_length_needed(void *opaque)
>      return ef->allow_all_mask_sizes;
>  }
>  
> +static const VMStateDescription vmstate_event_facility_mask64 = {
> +    .name = "vmstate-event-facility/mask64",

Should that really be called 'mask64' - you're just transferring the
missing part of the mask here, aren't you?

> +    .version_id = 0,
> +    .minimum_version_id = 0,
> +    .needed = vmstate_event_facility_mask64_needed,
> +    .fields = (VMStateField[]) {
> +#ifdef HOST_WORDS_BIGENDIAN
> +        VMSTATE_UINT32(receive_mask_pieces[1], SCLPEventFacility),
> +#else
> +        VMSTATE_UINT32(receive_mask_pieces[0], SCLPEventFacility),
> +#endif

That #ifdef is kind of ugly, and a bit confusing, I think.

What about doing something like

/* we need to save 32 bit chunks for compatibility */
#ifdef HOST_WORDS_BIGENDIAN
#define RECV_MASK_LOWER 0
#define RECV_MASK_UPPER 1
#else /* little endian host */
#define RECV_MASK_LOWER 1
#define RECV_MASK_UPPER 0
#endif

and transfer receive_mask_pieces[RECV_MASK_UPPER] here...

> +        VMSTATE_END_OF_LIST()
> +     }
> +};
> +
>  static const VMStateDescription vmstate_event_facility_mask_length = {
>      .name = "vmstate-event-facility/mask_length",
>      .version_id = 0,
> @@ -392,10 +418,15 @@ static const VMStateDescription vmstate_event_facility = {
>      .version_id = 0,
>      .minimum_version_id = 0,
>      .fields = (VMStateField[]) {
> -        VMSTATE_UINT32(receive_mask, SCLPEventFacility),
> +#ifdef HOST_WORDS_BIGENDIAN
> +        VMSTATE_UINT32(receive_mask_pieces[0], SCLPEventFacility),
> +#else
> +        VMSTATE_UINT32(receive_mask_pieces[1], SCLPEventFacility),
> +#endif

...and receive_mask_pieces[REV_MASK_LOWER] here?

(And I guess 64bit receive masks should be enough for everybody? IOW, we
don't expect a similar dance in the near future?)

>          VMSTATE_END_OF_LIST()
>       },
>      .subsections = (const VMStateDescription * []) {
> +        &vmstate_event_facility_mask64,
>          &vmstate_event_facility_mask_length,
>          NULL
>       }

  reply	other threads:[~2018-03-07 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 15:10 [Qemu-devel] [PATCH v5 1/1] s390x/sclp: extend SCLP event masks to 64 bits Claudio Imbrenda
2018-03-07 15:55 ` Cornelia Huck [this message]
2018-03-07 16:54   ` Claudio Imbrenda
2018-03-08  7:41 ` Christian Borntraeger
2018-03-08 10:02   ` Claudio Imbrenda
2018-03-08 10:07     ` Christian Borntraeger

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=20180307165548.29f7ec07.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    /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 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).