All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: frankja@linux.ibm.com, nrb@linux.ibm.com, seiden@linux.ibm.com,
	scgl@linux.ibm.com, thuth@redhat.com
Subject: [PATCH v2 1/2] lib: s390x: add PSW and PSW_CUR_MASK macros
Date: Tue, 29 Nov 2022 10:41:41 +0100	[thread overview]
Message-ID: <20221129094142.10141-2-imbrenda@linux.ibm.com> (raw)
In-Reply-To: <20221129094142.10141-1-imbrenda@linux.ibm.com>

Since a lot of code starts new CPUs using the current PSW mask, add two
macros to streamline the creation of generic PSWs and PSWs with the
current program mask.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 lib/s390x/asm/arch_def.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
index 783a7eaa..43137d5f 100644
--- a/lib/s390x/asm/arch_def.h
+++ b/lib/s390x/asm/arch_def.h
@@ -41,6 +41,8 @@ struct psw {
 	uint64_t	addr;
 };
 
+#define PSW(m, a) ((struct psw){ .mask = (m), .addr = (uint64_t)(a) })
+
 struct short_psw {
 	uint32_t	mask;
 	uint32_t	addr;
@@ -321,6 +323,8 @@ static inline uint64_t extract_psw_mask(void)
 	return (uint64_t) mask_upper << 32 | mask_lower;
 }
 
+#define PSW_CUR_MASK(addr) PSW(extract_psw_mask(), (addr))
+
 static inline void load_psw_mask(uint64_t mask)
 {
 	struct psw psw = {
-- 
2.38.1


  reply	other threads:[~2022-11-29  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  9:41 [PATCH v2 0/2] lib: s390x: add PSW and PSW_CUR_MASK macros Claudio Imbrenda
2022-11-29  9:41 ` Claudio Imbrenda [this message]
2022-11-29  9:43   ` [PATCH v2 1/2] " Nico Boehr
2022-11-29 10:45   ` Janis Schoetterl-Glausch
2022-11-29 14:17   ` Janosch Frank
2022-11-30 11:29     ` Claudio Imbrenda
2022-11-29  9:41 ` [PATCH v2 2/2] s390x: use the new " Claudio Imbrenda
2022-11-29 10:46   ` Janis Schoetterl-Glausch

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=20221129094142.10141-2-imbrenda@linux.ibm.com \
    --to=imbrenda@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=scgl@linux.ibm.com \
    --cc=seiden@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 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.