]>
git.proxmox.com Git - mirror_qemu.git/blob - target/i386/monitor.c
4 * Copyright (c) 2003-2004 Fabrice Bellard
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 #include "qemu/osdep.h"
27 #include "monitor/monitor.h"
28 #include "monitor/hmp-target.h"
29 #include "qapi/qmp/qdict.h"
30 #include "hw/i386/pc.h"
31 #include "sysemu/kvm.h"
32 #include "sysemu/sev.h"
34 #include "qapi/error.h"
36 #include "qapi/qapi-commands-misc.h"
39 static void print_pte(Monitor
*mon
, CPUArchState
*env
, hwaddr addr
,
40 hwaddr pte
, hwaddr mask
)
43 if (env
->cr
[4] & CR4_LA57_MASK
) {
44 if (addr
& (1ULL << 56)) {
48 if (addr
& (1ULL << 47)) {
53 monitor_printf(mon
, TARGET_FMT_plx
": " TARGET_FMT_plx
54 " %c%c%c%c%c%c%c%c%c\n",
57 pte
& PG_NX_MASK
? 'X' : '-',
58 pte
& PG_GLOBAL_MASK
? 'G' : '-',
59 pte
& PG_PSE_MASK
? 'P' : '-',
60 pte
& PG_DIRTY_MASK
? 'D' : '-',
61 pte
& PG_ACCESSED_MASK
? 'A' : '-',
62 pte
& PG_PCD_MASK
? 'C' : '-',
63 pte
& PG_PWT_MASK
? 'T' : '-',
64 pte
& PG_USER_MASK
? 'U' : '-',
65 pte
& PG_RW_MASK
? 'W' : '-');
68 static void tlb_info_32(Monitor
*mon
, CPUArchState
*env
)
71 uint32_t pgd
, pde
, pte
;
73 pgd
= env
->cr
[3] & ~0xfff;
74 for(l1
= 0; l1
< 1024; l1
++) {
75 cpu_physical_memory_read(pgd
+ l1
* 4, &pde
, 4);
76 pde
= le32_to_cpu(pde
);
77 if (pde
& PG_PRESENT_MASK
) {
78 if ((pde
& PG_PSE_MASK
) && (env
->cr
[4] & CR4_PSE_MASK
)) {
80 print_pte(mon
, env
, (l1
<< 22), pde
, ~((1 << 21) - 1));
82 for(l2
= 0; l2
< 1024; l2
++) {
83 cpu_physical_memory_read((pde
& ~0xfff) + l2
* 4, &pte
, 4);
84 pte
= le32_to_cpu(pte
);
85 if (pte
& PG_PRESENT_MASK
) {
86 print_pte(mon
, env
, (l1
<< 22) + (l2
<< 12),
96 static void tlb_info_pae32(Monitor
*mon
, CPUArchState
*env
)
98 unsigned int l1
, l2
, l3
;
99 uint64_t pdpe
, pde
, pte
;
100 uint64_t pdp_addr
, pd_addr
, pt_addr
;
102 pdp_addr
= env
->cr
[3] & ~0x1f;
103 for (l1
= 0; l1
< 4; l1
++) {
104 cpu_physical_memory_read(pdp_addr
+ l1
* 8, &pdpe
, 8);
105 pdpe
= le64_to_cpu(pdpe
);
106 if (pdpe
& PG_PRESENT_MASK
) {
107 pd_addr
= pdpe
& 0x3fffffffff000ULL
;
108 for (l2
= 0; l2
< 512; l2
++) {
109 cpu_physical_memory_read(pd_addr
+ l2
* 8, &pde
, 8);
110 pde
= le64_to_cpu(pde
);
111 if (pde
& PG_PRESENT_MASK
) {
112 if (pde
& PG_PSE_MASK
) {
113 /* 2M pages with PAE, CR4.PSE is ignored */
114 print_pte(mon
, env
, (l1
<< 30) + (l2
<< 21), pde
,
115 ~((hwaddr
)(1 << 20) - 1));
117 pt_addr
= pde
& 0x3fffffffff000ULL
;
118 for (l3
= 0; l3
< 512; l3
++) {
119 cpu_physical_memory_read(pt_addr
+ l3
* 8, &pte
, 8);
120 pte
= le64_to_cpu(pte
);
121 if (pte
& PG_PRESENT_MASK
) {
122 print_pte(mon
, env
, (l1
<< 30) + (l2
<< 21)
136 static void tlb_info_la48(Monitor
*mon
, CPUArchState
*env
,
137 uint64_t l0
, uint64_t pml4_addr
)
139 uint64_t l1
, l2
, l3
, l4
;
140 uint64_t pml4e
, pdpe
, pde
, pte
;
141 uint64_t pdp_addr
, pd_addr
, pt_addr
;
143 for (l1
= 0; l1
< 512; l1
++) {
144 cpu_physical_memory_read(pml4_addr
+ l1
* 8, &pml4e
, 8);
145 pml4e
= le64_to_cpu(pml4e
);
146 if (!(pml4e
& PG_PRESENT_MASK
)) {
150 pdp_addr
= pml4e
& 0x3fffffffff000ULL
;
151 for (l2
= 0; l2
< 512; l2
++) {
152 cpu_physical_memory_read(pdp_addr
+ l2
* 8, &pdpe
, 8);
153 pdpe
= le64_to_cpu(pdpe
);
154 if (!(pdpe
& PG_PRESENT_MASK
)) {
158 if (pdpe
& PG_PSE_MASK
) {
159 /* 1G pages, CR4.PSE is ignored */
160 print_pte(mon
, env
, (l0
<< 48) + (l1
<< 39) + (l2
<< 30),
161 pdpe
, 0x3ffffc0000000ULL
);
165 pd_addr
= pdpe
& 0x3fffffffff000ULL
;
166 for (l3
= 0; l3
< 512; l3
++) {
167 cpu_physical_memory_read(pd_addr
+ l3
* 8, &pde
, 8);
168 pde
= le64_to_cpu(pde
);
169 if (!(pde
& PG_PRESENT_MASK
)) {
173 if (pde
& PG_PSE_MASK
) {
174 /* 2M pages, CR4.PSE is ignored */
175 print_pte(mon
, env
, (l0
<< 48) + (l1
<< 39) + (l2
<< 30) +
176 (l3
<< 21), pde
, 0x3ffffffe00000ULL
);
180 pt_addr
= pde
& 0x3fffffffff000ULL
;
181 for (l4
= 0; l4
< 512; l4
++) {
182 cpu_physical_memory_read(pt_addr
185 pte
= le64_to_cpu(pte
);
186 if (pte
& PG_PRESENT_MASK
) {
187 print_pte(mon
, env
, (l0
<< 48) + (l1
<< 39) +
188 (l2
<< 30) + (l3
<< 21) + (l4
<< 12),
189 pte
& ~PG_PSE_MASK
, 0x3fffffffff000ULL
);
197 static void tlb_info_la57(Monitor
*mon
, CPUArchState
*env
)
203 pml5_addr
= env
->cr
[3] & 0x3fffffffff000ULL
;
204 for (l0
= 0; l0
< 512; l0
++) {
205 cpu_physical_memory_read(pml5_addr
+ l0
* 8, &pml5e
, 8);
206 pml5e
= le64_to_cpu(pml5e
);
207 if (pml5e
& PG_PRESENT_MASK
) {
208 tlb_info_la48(mon
, env
, l0
, pml5e
& 0x3fffffffff000ULL
);
212 #endif /* TARGET_X86_64 */
214 void hmp_info_tlb(Monitor
*mon
, const QDict
*qdict
)
218 env
= mon_get_cpu_env();
220 monitor_printf(mon
, "No CPU available\n");
224 if (!(env
->cr
[0] & CR0_PG_MASK
)) {
225 monitor_printf(mon
, "PG disabled\n");
228 if (env
->cr
[4] & CR4_PAE_MASK
) {
230 if (env
->hflags
& HF_LMA_MASK
) {
231 if (env
->cr
[4] & CR4_LA57_MASK
) {
232 tlb_info_la57(mon
, env
);
234 tlb_info_la48(mon
, env
, 0, env
->cr
[3] & 0x3fffffffff000ULL
);
239 tlb_info_pae32(mon
, env
);
242 tlb_info_32(mon
, env
);
246 static void mem_print(Monitor
*mon
, hwaddr
*pstart
,
248 hwaddr end
, int prot
)
254 monitor_printf(mon
, TARGET_FMT_plx
"-" TARGET_FMT_plx
" "
255 TARGET_FMT_plx
" %c%c%c\n",
256 *pstart
, end
, end
- *pstart
,
257 prot1
& PG_USER_MASK
? 'u' : '-',
259 prot1
& PG_RW_MASK
? 'w' : '-');
269 static void mem_info_32(Monitor
*mon
, CPUArchState
*env
)
273 uint32_t pgd
, pde
, pte
;
276 pgd
= env
->cr
[3] & ~0xfff;
279 for(l1
= 0; l1
< 1024; l1
++) {
280 cpu_physical_memory_read(pgd
+ l1
* 4, &pde
, 4);
281 pde
= le32_to_cpu(pde
);
283 if (pde
& PG_PRESENT_MASK
) {
284 if ((pde
& PG_PSE_MASK
) && (env
->cr
[4] & CR4_PSE_MASK
)) {
285 prot
= pde
& (PG_USER_MASK
| PG_RW_MASK
| PG_PRESENT_MASK
);
286 mem_print(mon
, &start
, &last_prot
, end
, prot
);
288 for(l2
= 0; l2
< 1024; l2
++) {
289 cpu_physical_memory_read((pde
& ~0xfff) + l2
* 4, &pte
, 4);
290 pte
= le32_to_cpu(pte
);
291 end
= (l1
<< 22) + (l2
<< 12);
292 if (pte
& PG_PRESENT_MASK
) {
294 (PG_USER_MASK
| PG_RW_MASK
| PG_PRESENT_MASK
);
298 mem_print(mon
, &start
, &last_prot
, end
, prot
);
303 mem_print(mon
, &start
, &last_prot
, end
, prot
);
306 /* Flush last range */
307 mem_print(mon
, &start
, &last_prot
, (hwaddr
)1 << 32, 0);
310 static void mem_info_pae32(Monitor
*mon
, CPUArchState
*env
)
312 unsigned int l1
, l2
, l3
;
314 uint64_t pdpe
, pde
, pte
;
315 uint64_t pdp_addr
, pd_addr
, pt_addr
;
318 pdp_addr
= env
->cr
[3] & ~0x1f;
321 for (l1
= 0; l1
< 4; l1
++) {
322 cpu_physical_memory_read(pdp_addr
+ l1
* 8, &pdpe
, 8);
323 pdpe
= le64_to_cpu(pdpe
);
325 if (pdpe
& PG_PRESENT_MASK
) {
326 pd_addr
= pdpe
& 0x3fffffffff000ULL
;
327 for (l2
= 0; l2
< 512; l2
++) {
328 cpu_physical_memory_read(pd_addr
+ l2
* 8, &pde
, 8);
329 pde
= le64_to_cpu(pde
);
330 end
= (l1
<< 30) + (l2
<< 21);
331 if (pde
& PG_PRESENT_MASK
) {
332 if (pde
& PG_PSE_MASK
) {
333 prot
= pde
& (PG_USER_MASK
| PG_RW_MASK
|
335 mem_print(mon
, &start
, &last_prot
, end
, prot
);
337 pt_addr
= pde
& 0x3fffffffff000ULL
;
338 for (l3
= 0; l3
< 512; l3
++) {
339 cpu_physical_memory_read(pt_addr
+ l3
* 8, &pte
, 8);
340 pte
= le64_to_cpu(pte
);
341 end
= (l1
<< 30) + (l2
<< 21) + (l3
<< 12);
342 if (pte
& PG_PRESENT_MASK
) {
343 prot
= pte
& pde
& (PG_USER_MASK
| PG_RW_MASK
|
348 mem_print(mon
, &start
, &last_prot
, end
, prot
);
353 mem_print(mon
, &start
, &last_prot
, end
, prot
);
358 mem_print(mon
, &start
, &last_prot
, end
, prot
);
361 /* Flush last range */
362 mem_print(mon
, &start
, &last_prot
, (hwaddr
)1 << 32, 0);
367 static void mem_info_la48(Monitor
*mon
, CPUArchState
*env
)
370 uint64_t l1
, l2
, l3
, l4
;
371 uint64_t pml4e
, pdpe
, pde
, pte
;
372 uint64_t pml4_addr
, pdp_addr
, pd_addr
, pt_addr
, start
, end
;
374 pml4_addr
= env
->cr
[3] & 0x3fffffffff000ULL
;
377 for (l1
= 0; l1
< 512; l1
++) {
378 cpu_physical_memory_read(pml4_addr
+ l1
* 8, &pml4e
, 8);
379 pml4e
= le64_to_cpu(pml4e
);
381 if (pml4e
& PG_PRESENT_MASK
) {
382 pdp_addr
= pml4e
& 0x3fffffffff000ULL
;
383 for (l2
= 0; l2
< 512; l2
++) {
384 cpu_physical_memory_read(pdp_addr
+ l2
* 8, &pdpe
, 8);
385 pdpe
= le64_to_cpu(pdpe
);
386 end
= (l1
<< 39) + (l2
<< 30);
387 if (pdpe
& PG_PRESENT_MASK
) {
388 if (pdpe
& PG_PSE_MASK
) {
389 prot
= pdpe
& (PG_USER_MASK
| PG_RW_MASK
|
392 mem_print(mon
, &start
, &last_prot
, end
, prot
);
394 pd_addr
= pdpe
& 0x3fffffffff000ULL
;
395 for (l3
= 0; l3
< 512; l3
++) {
396 cpu_physical_memory_read(pd_addr
+ l3
* 8, &pde
, 8);
397 pde
= le64_to_cpu(pde
);
398 end
= (l1
<< 39) + (l2
<< 30) + (l3
<< 21);
399 if (pde
& PG_PRESENT_MASK
) {
400 if (pde
& PG_PSE_MASK
) {
401 prot
= pde
& (PG_USER_MASK
| PG_RW_MASK
|
403 prot
&= pml4e
& pdpe
;
404 mem_print(mon
, &start
, &last_prot
, end
, prot
);
406 pt_addr
= pde
& 0x3fffffffff000ULL
;
407 for (l4
= 0; l4
< 512; l4
++) {
408 cpu_physical_memory_read(pt_addr
411 pte
= le64_to_cpu(pte
);
412 end
= (l1
<< 39) + (l2
<< 30) +
413 (l3
<< 21) + (l4
<< 12);
414 if (pte
& PG_PRESENT_MASK
) {
415 prot
= pte
& (PG_USER_MASK
| PG_RW_MASK
|
417 prot
&= pml4e
& pdpe
& pde
;
421 mem_print(mon
, &start
, &last_prot
, end
, prot
);
426 mem_print(mon
, &start
, &last_prot
, end
, prot
);
432 mem_print(mon
, &start
, &last_prot
, end
, prot
);
437 mem_print(mon
, &start
, &last_prot
, end
, prot
);
440 /* Flush last range */
441 mem_print(mon
, &start
, &last_prot
, (hwaddr
)1 << 48, 0);
444 static void mem_info_la57(Monitor
*mon
, CPUArchState
*env
)
447 uint64_t l0
, l1
, l2
, l3
, l4
;
448 uint64_t pml5e
, pml4e
, pdpe
, pde
, pte
;
449 uint64_t pml5_addr
, pml4_addr
, pdp_addr
, pd_addr
, pt_addr
, start
, end
;
451 pml5_addr
= env
->cr
[3] & 0x3fffffffff000ULL
;
454 for (l0
= 0; l0
< 512; l0
++) {
455 cpu_physical_memory_read(pml5_addr
+ l0
* 8, &pml5e
, 8);
456 pml5e
= le64_to_cpu(pml5e
);
458 if (!(pml5e
& PG_PRESENT_MASK
)) {
460 mem_print(mon
, &start
, &last_prot
, end
, prot
);
464 pml4_addr
= pml5e
& 0x3fffffffff000ULL
;
465 for (l1
= 0; l1
< 512; l1
++) {
466 cpu_physical_memory_read(pml4_addr
+ l1
* 8, &pml4e
, 8);
467 pml4e
= le64_to_cpu(pml4e
);
468 end
= (l0
<< 48) + (l1
<< 39);
469 if (!(pml4e
& PG_PRESENT_MASK
)) {
471 mem_print(mon
, &start
, &last_prot
, end
, prot
);
475 pdp_addr
= pml4e
& 0x3fffffffff000ULL
;
476 for (l2
= 0; l2
< 512; l2
++) {
477 cpu_physical_memory_read(pdp_addr
+ l2
* 8, &pdpe
, 8);
478 pdpe
= le64_to_cpu(pdpe
);
479 end
= (l0
<< 48) + (l1
<< 39) + (l2
<< 30);
480 if (pdpe
& PG_PRESENT_MASK
) {
482 mem_print(mon
, &start
, &last_prot
, end
, prot
);
486 if (pdpe
& PG_PSE_MASK
) {
487 prot
= pdpe
& (PG_USER_MASK
| PG_RW_MASK
|
489 prot
&= pml5e
& pml4e
;
490 mem_print(mon
, &start
, &last_prot
, end
, prot
);
494 pd_addr
= pdpe
& 0x3fffffffff000ULL
;
495 for (l3
= 0; l3
< 512; l3
++) {
496 cpu_physical_memory_read(pd_addr
+ l3
* 8, &pde
, 8);
497 pde
= le64_to_cpu(pde
);
498 end
= (l0
<< 48) + (l1
<< 39) + (l2
<< 30) + (l3
<< 21);
499 if (pde
& PG_PRESENT_MASK
) {
501 mem_print(mon
, &start
, &last_prot
, end
, prot
);
505 if (pde
& PG_PSE_MASK
) {
506 prot
= pde
& (PG_USER_MASK
| PG_RW_MASK
|
508 prot
&= pml5e
& pml4e
& pdpe
;
509 mem_print(mon
, &start
, &last_prot
, end
, prot
);
513 pt_addr
= pde
& 0x3fffffffff000ULL
;
514 for (l4
= 0; l4
< 512; l4
++) {
515 cpu_physical_memory_read(pt_addr
+ l4
* 8, &pte
, 8);
516 pte
= le64_to_cpu(pte
);
517 end
= (l0
<< 48) + (l1
<< 39) + (l2
<< 30) +
518 (l3
<< 21) + (l4
<< 12);
519 if (pte
& PG_PRESENT_MASK
) {
520 prot
= pte
& (PG_USER_MASK
| PG_RW_MASK
|
522 prot
&= pml5e
& pml4e
& pdpe
& pde
;
526 mem_print(mon
, &start
, &last_prot
, end
, prot
);
532 /* Flush last range */
533 mem_print(mon
, &start
, &last_prot
, (hwaddr
)1 << 57, 0);
535 #endif /* TARGET_X86_64 */
537 void hmp_info_mem(Monitor
*mon
, const QDict
*qdict
)
541 env
= mon_get_cpu_env();
543 monitor_printf(mon
, "No CPU available\n");
547 if (!(env
->cr
[0] & CR0_PG_MASK
)) {
548 monitor_printf(mon
, "PG disabled\n");
551 if (env
->cr
[4] & CR4_PAE_MASK
) {
553 if (env
->hflags
& HF_LMA_MASK
) {
554 if (env
->cr
[4] & CR4_LA57_MASK
) {
555 mem_info_la57(mon
, env
);
557 mem_info_la48(mon
, env
);
562 mem_info_pae32(mon
, env
);
565 mem_info_32(mon
, env
);
569 void hmp_mce(Monitor
*mon
, const QDict
*qdict
)
573 int cpu_index
= qdict_get_int(qdict
, "cpu_index");
574 int bank
= qdict_get_int(qdict
, "bank");
575 uint64_t status
= qdict_get_int(qdict
, "status");
576 uint64_t mcg_status
= qdict_get_int(qdict
, "mcg_status");
577 uint64_t addr
= qdict_get_int(qdict
, "addr");
578 uint64_t misc
= qdict_get_int(qdict
, "misc");
579 int flags
= MCE_INJECT_UNCOND_AO
;
581 if (qdict_get_try_bool(qdict
, "broadcast", false)) {
582 flags
|= MCE_INJECT_BROADCAST
;
584 cs
= qemu_get_cpu(cpu_index
);
587 cpu_x86_inject_mce(mon
, cpu
, bank
, status
, mcg_status
, addr
, misc
,
592 static target_long
monitor_get_pc(const struct MonitorDef
*md
, int val
)
594 CPUArchState
*env
= mon_get_cpu_env();
595 return env
->eip
+ env
->segs
[R_CS
].base
;
598 const MonitorDef monitor_defs
[] = {
599 #define SEG(name, seg) \
600 { name, offsetof(CPUX86State, segs[seg].selector), NULL, MD_I32 },\
601 { name ".base", offsetof(CPUX86State, segs[seg].base) },\
602 { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 },
604 { "eax", offsetof(CPUX86State
, regs
[0]) },
605 { "ecx", offsetof(CPUX86State
, regs
[1]) },
606 { "edx", offsetof(CPUX86State
, regs
[2]) },
607 { "ebx", offsetof(CPUX86State
, regs
[3]) },
608 { "esp|sp", offsetof(CPUX86State
, regs
[4]) },
609 { "ebp|fp", offsetof(CPUX86State
, regs
[5]) },
610 { "esi", offsetof(CPUX86State
, regs
[6]) },
611 { "edi", offsetof(CPUX86State
, regs
[7]) },
613 { "r8", offsetof(CPUX86State
, regs
[8]) },
614 { "r9", offsetof(CPUX86State
, regs
[9]) },
615 { "r10", offsetof(CPUX86State
, regs
[10]) },
616 { "r11", offsetof(CPUX86State
, regs
[11]) },
617 { "r12", offsetof(CPUX86State
, regs
[12]) },
618 { "r13", offsetof(CPUX86State
, regs
[13]) },
619 { "r14", offsetof(CPUX86State
, regs
[14]) },
620 { "r15", offsetof(CPUX86State
, regs
[15]) },
622 { "eflags", offsetof(CPUX86State
, eflags
) },
623 { "eip", offsetof(CPUX86State
, eip
) },
630 { "pc", 0, monitor_get_pc
, },
634 const MonitorDef
*target_monitor_defs(void)
639 void hmp_info_local_apic(Monitor
*mon
, const QDict
*qdict
)
643 if (qdict_haskey(qdict
, "apic-id")) {
644 int id
= qdict_get_try_int(qdict
, "apic-id", 0);
645 cs
= cpu_by_arch_id(id
);
652 monitor_printf(mon
, "No CPU available\n");
655 x86_cpu_dump_local_apic_state(cs
, (FILE *)mon
, monitor_fprintf
,
659 void hmp_info_io_apic(Monitor
*mon
, const QDict
*qdict
)
661 if (kvm_irqchip_in_kernel() &&
662 !kvm_irqchip_is_split()) {
663 kvm_ioapic_dump_state(mon
, qdict
);
665 ioapic_dump_state(mon
, qdict
);
669 SevInfo
*qmp_query_sev(Error
**errp
)
673 info
= sev_get_info();
675 error_setg(errp
, "SEV feature is not available");
682 void hmp_info_sev(Monitor
*mon
, const QDict
*qdict
)
684 SevInfo
*info
= sev_get_info();
686 if (info
&& info
->enabled
) {
687 monitor_printf(mon
, "handle: %d\n", info
->handle
);
688 monitor_printf(mon
, "state: %s\n", SevState_str(info
->state
));
689 monitor_printf(mon
, "build: %d\n", info
->build_id
);
690 monitor_printf(mon
, "api version: %d.%d\n",
691 info
->api_major
, info
->api_minor
);
692 monitor_printf(mon
, "debug: %s\n",
693 info
->policy
& SEV_POLICY_NODBG
? "off" : "on");
694 monitor_printf(mon
, "key-sharing: %s\n",
695 info
->policy
& SEV_POLICY_NOKS
? "off" : "on");
697 monitor_printf(mon
, "SEV is not enabled\n");
701 SevLaunchMeasureInfo
*qmp_query_sev_launch_measure(Error
**errp
)
704 SevLaunchMeasureInfo
*info
;
706 data
= sev_get_launch_measurement();
708 error_setg(errp
, "Measurement is not available");
712 info
= g_malloc0(sizeof(*info
));