[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 12/14] s390x: introduce s390_get_max_pagesize()
From: |
David Hildenbrand |
Subject: |
[PATCH v1 12/14] s390x: introduce s390_get_max_pagesize() |
Date: |
Tue, 10 Sep 2024 19:58:07 +0200 |
Let's add a way to return the value (successfully) set via
s390_set_max_pagesize() previously. This will be helpful to reject
hotplugged memory devices that would exceed this initially set page size.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
target/s390x/cpu-sysemu.c | 16 ++++++++++++++++
target/s390x/cpu.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/target/s390x/cpu-sysemu.c b/target/s390x/cpu-sysemu.c
index 1915567b3a..bee5d6c2ee 100644
--- a/target/s390x/cpu-sysemu.c
+++ b/target/s390x/cpu-sysemu.c
@@ -278,11 +278,27 @@ uint64_t s390_get_memory_limit(void)
return memory_limit;
}
+static uint64_t max_pagesize;
+
void s390_set_max_pagesize(uint64_t pagesize, Error **errp)
{
+ ERRP_GUARD();
+
+ if (max_pagesize) {
+ error_setg(errp, "Maximum page size can only be set once");
+ return;
+ }
if (kvm_enabled()) {
kvm_s390_set_max_pagesize(pagesize, errp);
}
+ if (!*errp) {
+ max_pagesize = pagesize;
+ }
+}
+
+uint64_t s390_get_max_pagesize(void)
+{
+ return max_pagesize;
}
void s390_cmma_reset(void)
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 7a51b606ed..37845e0d9d 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -897,6 +897,7 @@ void s390_crypto_reset(void);
int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit);
uint64_t s390_get_memory_limit(void);
void s390_set_max_pagesize(uint64_t pagesize, Error **errp);
+uint64_t s390_get_max_pagesize(void);
void s390_cmma_reset(void);
void s390_enable_css_support(S390CPU *cpu);
void s390_do_cpu_set_diag318(CPUState *cs, run_on_cpu_data arg);
--
2.46.0
- [PATCH v1 09/14] s390x/s390-skeys: prepare for memory devices, (continued)
- [PATCH v1 09/14] s390x/s390-skeys: prepare for memory devices, David Hildenbrand, 2024/09/10
- [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, David Hildenbrand, 2024/09/10
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, Nina Schoetterl-Glausch, 2024/09/24
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, David Hildenbrand, 2024/09/24
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, David Hildenbrand, 2024/09/26
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, Christian Borntraeger, 2024/09/30
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, Claudio Imbrenda, 2024/09/30
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, David Hildenbrand, 2024/09/30
- Re: [PATCH v1 10/14] s390x/pv: check initial, not maximum RAM size, Claudio Imbrenda, 2024/09/30
[PATCH v1 11/14] s390x/s390-virtio-ccw: prepare for memory devices, David Hildenbrand, 2024/09/10
[PATCH v1 12/14] s390x: introduce s390_get_max_pagesize(),
David Hildenbrand <=
[PATCH v1 13/14] s390x/virtio-ccw: add support for virtio based memory devices, David Hildenbrand, 2024/09/10
[PATCH v1 14/14] s390x: virtio-mem support, David Hildenbrand, 2024/09/10
Re: [PATCH v1 00/14] s390x: virtio-mem support, Michael S. Tsirkin, 2024/09/10
Re: [PATCH v1 00/14] s390x: virtio-mem support, Janosch Frank, 2024/09/11