public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>
Cc: frankja@linux.ibm.com, thuth@redhat.com, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 1/6] s390x: add function to set DAT mode for all interrupts
Date: Wed, 17 May 2023 15:04:25 +0200	[thread overview]
Message-ID: <20230517150425.19c4a7da@p-imbrenda> (raw)
In-Reply-To: <168432630149.12463.14017444493360473166@t14-nrb>

On Wed, 17 May 2023 14:25:01 +0200
Nico Boehr <nrb@linux.ibm.com> wrote:

> Quoting Claudio Imbrenda (2023-05-16 19:17:24)
> [...]
> > > diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
> > > index 3f993a363ae2..1180ec44d72f 100644
> > > --- a/lib/s390x/interrupt.c
> > > +++ b/lib/s390x/interrupt.c  
> [...]
> > > +void irq_set_dat_mode(bool dat, uint64_t as)
> > > +{  
> [...]
> > > +     for (struct psw *irq_psw = irq_psws[0]; irq_psw != NULL; irq_psw++) {  
> > 
> > just call it psw, or cur_psw, it's a little confusing otherwise  
> 
> will do. 
> 
> [...]
> > alternatively, you can redefine psw with a bitfield (as you mentioned
> > offline):
> > 
> > cur_psw->mask.dat = dat;
> > if (dat)
> >         cur_psw->mask.as = as;  
> 
> Yep, I'll go with that.
> 
> >   
> > > +             else
> > > +                     irq_psw->mask |= PSW_MASK_DAT | as << (63 - 16);  
> > 
> > otherwise here you're ORing stuff to other stuff, if you had 3 and you
> > OR 0 you get 3, but you actually want 0  
> 
> And that's the advantage of the bitfield. :)
> 
> >   
> > > +     }
> > > +
> > > +     mb();  
> > 
> > what's the purpose of this?  
> 
> Make sure that the lowcore really has been written, but I think it's quite
> useless, since a function is a sequence point, right?

yes

  reply	other threads:[~2023-05-17 13:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 13:04 [kvm-unit-tests PATCH v2 0/6] s390x: Add support for running guests without MSO/MSL Nico Boehr
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 1/6] s390x: add function to set DAT mode for all interrupts Nico Boehr
2023-05-16 17:17   ` Claudio Imbrenda
2023-05-17 12:25     ` Nico Boehr
2023-05-17 13:04       ` Claudio Imbrenda [this message]
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 2/6] s390x: sie: switch to home space mode before entering SIE Nico Boehr
2023-05-16 17:22   ` Claudio Imbrenda
2023-05-17 12:44     ` Nico Boehr
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 3/6] s390x: lib: don't forward PSW when handling exception in SIE Nico Boehr
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 4/6] s390x: fix compile of interrupt.c Nico Boehr
2023-05-16 17:24   ` Claudio Imbrenda
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 5/6] s390x: lib: sie: don't reenter SIE on pgm int Nico Boehr
2023-05-16 17:30   ` Claudio Imbrenda
2023-05-17 12:52     ` Nico Boehr
2023-05-16 13:04 ` [kvm-unit-tests PATCH v2 6/6] s390x: add a test for SIE without MSO/MSL Nico Boehr

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=20230517150425.19c4a7da@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox