public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com
Subject: [kvm-unit-tests PATCH v4 1/7] lib: s390x: uv: Introduce UV validity function
Date: Tue,  2 May 2023 11:59:25 +0000	[thread overview]
Message-ID: <20230502115931.86280-2-frankja@linux.ibm.com> (raw)
In-Reply-To: <20230502115931.86280-1-frankja@linux.ibm.com>

PV related validities are in the 0x20** range but the last byte might
be implementation specific, so everytime we check for a UV validity we
need to mask the last byte.

Let's add a function that checks for a UV validity and returns a
boolean.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
---
 lib/s390x/uv.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 5fe29bda..78b979b7 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -35,4 +35,11 @@ static inline void uv_setup_asces(void)
 	lctlg(13, asce);
 }
 
+static inline bool uv_validity_check(struct vm *vm)
+{
+	uint16_t vir = sie_get_validity(vm);
+
+	return vm->sblk->icptcode == ICPT_VALIDITY && (vir & 0xff00) == 0x2000;
+}
+
 #endif /* UV_H */
-- 
2.34.1


  reply	other threads:[~2023-05-02 12:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 11:59 [kvm-unit-tests PATCH v4 0/7] s390x: Add PV SIE intercepts and ipl tests Janosch Frank
2023-05-02 11:59 ` Janosch Frank [this message]
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 2/7] lib: s390x: uv: Add intercept data check library function Janosch Frank
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 3/7] s390x: pv-diags: Drop snippet from snippet names Janosch Frank
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 4/7] lib: s390x: uv: Add pv host requirement check function Janosch Frank
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 5/7] s390x: pv: Add sie entry intercept and validity test Janosch Frank
2023-05-10  7:28   ` Nico Boehr
2023-05-15 11:53     ` [kvm-unit-tests PATCH v5] " Janosch Frank
2023-05-15 14:00       ` Nico Boehr
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 6/7] s390x: pv: Add IPL reset tests Janosch Frank
2023-05-10  7:32   ` Nico Boehr
2023-05-02 11:59 ` [kvm-unit-tests PATCH v4 7/7] s390x: pv-diags: Add the test to unittests.conf Janosch Frank
2023-05-10  7:33   ` Nico Boehr
2023-05-31 10:58 ` [kvm-unit-tests PATCH v4 0/7] s390x: Add PV SIE intercepts and ipl tests 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=20230502115931.86280-2-frankja@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=imbrenda@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