public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: nrb@linux.ibm.com, frankja@linux.ibm.com, borntraeger@de.ibm.com,
	thuth@redhat.com, david@redhat.com, schlameuss@linux.ibm.com,
	linux-s390@vger.kernel.org
Subject: [kvm-unit-tests PATCH v3 2/3] lib: s390x: add function to test available UV features
Date: Wed, 18 Dec 2024 14:51:37 +0100	[thread overview]
Message-ID: <20241218135138.51348-3-imbrenda@linux.ibm.com> (raw)
In-Reply-To: <20241218135138.51348-1-imbrenda@linux.ibm.com>

Add uv_query_test_feature(), to test specific bits in the
uv_feature_indications bitmask, similar to uv_query_test_call().

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 lib/s390x/uv.h | 1 +
 lib/s390x/uv.c | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 00a37041..b0fbc478 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -10,6 +10,7 @@ bool uv_os_is_guest(void);
 bool uv_os_is_host(void);
 bool uv_host_requirement_checks(void);
 bool uv_query_test_call(unsigned int nr);
+bool uv_query_test_feature(unsigned int nr);
 const struct uv_cb_qui *uv_get_query_data(void);
 void uv_init(void);
 int uv_setup(void);
diff --git a/lib/s390x/uv.c b/lib/s390x/uv.c
index 723bb4f2..03499272 100644
--- a/lib/s390x/uv.c
+++ b/lib/s390x/uv.c
@@ -67,6 +67,15 @@ bool uv_query_test_call(unsigned int nr)
 	return test_bit_inv(nr, uvcb_qui.inst_calls_list);
 }
 
+bool uv_query_test_feature(unsigned int nr)
+{
+	/* Query needs to be called first */
+	assert(uvcb_qui.header.rc);
+	assert(nr < BITS_PER_LONG);
+
+	return test_bit_inv(nr, &uvcb_qui.uv_feature_indications);
+}
+
 const struct uv_cb_qui *uv_get_query_data(void)
 {
 	/* Query needs to be called first */
-- 
2.47.1


  parent reply	other threads:[~2024-12-18 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 13:51 [kvm-unit-tests PATCH v3 0/3] s390x: pv: Add test for large host pages backing Claudio Imbrenda
2024-12-18 13:51 ` [kvm-unit-tests PATCH v3 1/3] lib: s390: add ptlb wrapper Claudio Imbrenda
2024-12-18 13:51 ` Claudio Imbrenda [this message]
2024-12-18 13:51 ` [kvm-unit-tests PATCH v3 3/3] s390x: pv: Add test for large host pages backing Claudio Imbrenda
2024-12-20 15:22   ` Nico Boehr
2024-12-20 15:52     ` Claudio Imbrenda
2025-01-09  9:51       ` Nico Boehr
2024-12-20 15:40   ` Christoph Schlameuss

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=20241218135138.51348-3-imbrenda@linux.ibm.com \
    --to=imbrenda@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=schlameuss@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