[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] s390x/pv: Move check on hugepage under s390_pv_guest_check()
From: |
Cédric Le Goater |
Subject: |
[PATCH 5/5] s390x/pv: Move check on hugepage under s390_pv_guest_check() |
Date: |
Wed, 4 Jan 2023 12:51:11 +0100 |
From: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/s390x/pv.c | 14 +++++++++++++-
target/s390x/diag.c | 7 -------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
index 96c0728ec9..4e1f991d98 100644
--- a/hw/s390x/pv.c
+++ b/hw/s390x/pv.c
@@ -302,9 +302,21 @@ static bool s390_pv_check_host(Error **errp)
return true;
}
+static bool s390_pv_check_hpage(Error **errp)
+{
+ if (kvm_s390_get_hpage_1m()) {
+ error_setg(errp, "Protected VMs can currently not be backed with "
+ "huge pages");
+ return false;
+ }
+
+ return true;
+}
+
static bool s390_pv_guest_check(const Object *obj, Error **errp)
{
- return s390_pv_check_cpus(errp) && s390_pv_check_host(errp);
+ return s390_pv_check_cpus(errp) && s390_pv_check_host(errp) &&
+ s390_pv_check_hpage(errp);
}
bool s390_pv_check(Error **errp)
diff --git a/target/s390x/diag.c b/target/s390x/diag.c
index 9b16e25930..28f4350aed 100644
--- a/target/s390x/diag.c
+++ b/target/s390x/diag.c
@@ -170,13 +170,6 @@ out:
return;
}
- if (kvm_enabled() && kvm_s390_get_hpage_1m()) {
- error_report("Protected VMs can currently not be backed with "
- "huge pages");
- env->regs[r1 + 1] = DIAG_308_RC_INVAL_FOR_PV;
- return;
- }
-
if (!s390_pv_check(&local_err)) {
error_report_err(local_err);
env->regs[r1 + 1] = DIAG_308_RC_INVAL_FOR_PV;
--
2.38.1
- Re: [PATCH 2/5] s390x/pv: Implement CGS check handler, (continued)
[PATCH 3/5] s390x/pv: Check for support on the host, Cédric Le Goater, 2023/01/04
[PATCH 4/5] s390x/pv: Introduce a s390_pv_check() helper for runtime, Cédric Le Goater, 2023/01/04
[PATCH 5/5] s390x/pv: Move check on hugepage under s390_pv_guest_check(),
Cédric Le Goater <=