From: Janosch Frank <frankja@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, scgl@linux.ibm.com,
nrb@linux.ibm.com, thuth@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 1/3] lib: s390x: add functions to set and clear PSW bits
Date: Mon, 27 Jun 2022 10:35:11 +0200 [thread overview]
Message-ID: <6e6e4e06-a32f-c5b7-0b3a-f9f62ed164df@linux.ibm.com> (raw)
In-Reply-To: <20220624144518.66573-2-imbrenda@linux.ibm.com>
On 6/24/22 16:45, Claudio Imbrenda wrote:
> Add some functions to set and/or clear bits in the PSW.
> This should improve code readability.
>
Also we introduce PSW_MASK_KEY and re-order the PSW_MASK_* constants so
they are descending in value.
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> lib/s390x/asm/arch_def.h | 58 +++++++++++++++++++++++++++++++++++-----
> lib/s390x/asm/pgtable.h | 2 --
> lib/s390x/mmu.c | 14 +---------
> lib/s390x/sclp.c | 7 +----
> s390x/diag288.c | 6 ++---
> s390x/selftest.c | 4 +--
> s390x/skrf.c | 12 +++------
> s390x/smp.c | 18 +++----------
> 8 files changed, 63 insertions(+), 58 deletions(-)
>
> diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
> index 78b257b7..b0052848 100644
> --- a/lib/s390x/asm/arch_def.h
> +++ b/lib/s390x/asm/arch_def.h
> @@ -46,9 +46,10 @@ struct psw {
> #define AS_SECN 2
> #define AS_HOME 3
>
> -#define PSW_MASK_EXT 0x0100000000000000UL
> -#define PSW_MASK_IO 0x0200000000000000UL
> #define PSW_MASK_DAT 0x0400000000000000UL
> +#define PSW_MASK_IO 0x0200000000000000UL
> +#define PSW_MASK_EXT 0x0100000000000000UL
> +#define PSW_MASK_KEY 0x00F0000000000000UL
> #define PSW_MASK_WAIT 0x0002000000000000UL
> #define PSW_MASK_PSTATE 0x0001000000000000UL
> #define PSW_MASK_EA 0x0000000100000000UL
> @@ -313,6 +314,53 @@ static inline void load_psw_mask(uint64_t mask)
> : "+r" (tmp) : "a" (&psw) : "memory", "cc" );
> }
>
> +/**
> + * psw_mask_set_clear_bits - sets and clears bits from the current PSW mask
> + * @clear: bitmask of bits that will be cleared
> + * @set: bitmask of bits that will be set
> + *
> + * Bits will be cleared first, and then set, so if (@clear & @set != 0) then
> + * the bits in the intersection will be set.
> + */
> +static inline void psw_mask_set_clear_bits(uint64_t clear, uint64_t set)
This function isn't used at all, no?
next prev parent reply other threads:[~2022-06-27 8:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 14:45 [kvm-unit-tests PATCH v2 0/3] better smp interrupt checks Claudio Imbrenda
2022-06-24 14:45 ` [kvm-unit-tests PATCH v2 1/3] lib: s390x: add functions to set and clear PSW bits Claudio Imbrenda
2022-06-27 8:35 ` Janosch Frank [this message]
2022-06-27 10:47 ` Claudio Imbrenda
2022-06-24 14:45 ` [kvm-unit-tests PATCH v2 2/3] s390x: skey.c: rework the interrupt handler Claudio Imbrenda
2022-06-24 14:45 ` [kvm-unit-tests PATCH v2 3/3] lib: s390x: better smp interrupt checks Claudio Imbrenda
2022-06-27 9:28 ` Janosch Frank
2022-06-27 10:53 ` Claudio Imbrenda
2022-06-27 11:09 ` Janosch Frank
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=6e6e4e06-a32f-c5b7-0b3a-f9f62ed164df@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=scgl@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