|
18 | 18 | #include "qapi/qmp/qdict.h"
|
19 | 19 | #include "qemu/error-report.h"
|
20 | 20 | #include "sysemu/memory_mapping.h"
|
| 21 | +#include "exec/address-spaces.h" |
21 | 22 | #include "sysemu/kvm.h"
|
22 | 23 | #include "migration/qemu-file-types.h"
|
23 | 24 | #include "migration/register.h"
|
@@ -86,6 +87,13 @@ void hmp_info_skeys(Monitor *mon, const QDict *qdict)
|
86 | 87 | return;
|
87 | 88 | }
|
88 | 89 |
|
| 90 | + if (!address_space_access_valid(&address_space_memory, |
| 91 | + addr & TARGET_PAGE_MASK, TARGET_PAGE_SIZE, |
| 92 | + false, MEMTXATTRS_UNSPECIFIED)) { |
| 93 | + monitor_printf(mon, "Error: The given address is not valid\n"); |
| 94 | + return; |
| 95 | + } |
| 96 | + |
89 | 97 | r = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
|
90 | 98 | if (r < 0) {
|
91 | 99 | monitor_printf(mon, "Error: %s\n", strerror(-r));
|
@@ -197,11 +205,6 @@ static int qemu_s390_skeys_enabled(S390SKeysState *ss)
|
197 | 205 | return 1;
|
198 | 206 | }
|
199 | 207 |
|
200 |
| -/* |
201 |
| - * TODO: for memory hotplug support qemu_s390_skeys_set and qemu_s390_skeys_get |
202 |
| - * will have to make sure that the given gfn belongs to a memory region and not |
203 |
| - * a memory hole. |
204 |
| - */ |
205 | 208 | static int qemu_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,
|
206 | 209 | uint64_t count, uint8_t *keys)
|
207 | 210 | {
|
|
0 commit comments