History

fw_cfg: write vmcoreinfo details

If the "etc/vmcoreinfo" fw_cfg file is present and we are not running the kdump kernel, write the addr/size of the vmcoreinfo ELF note. The DMA operation is expected to run synchronously with today qemu, but the specification states that it may become async, so we run "control" field check in a loop for eventual changes.

Marc-André Lureau committed 8 years ago

Commit 2d6d60a1 parent 43d4cb42 files · +173 −3Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/qemu_fw_cfg.h+31−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
54 54
55/* FW_CFG_ID bits */55/* FW_CFG_ID bits */
56#define FW_CFG_VERSION 0x0156#define FW_CFG_VERSION 0x01
57#define FW_CFG_VERSION_DMA 0x02
57 58
58/* fw_cfg file directory entry type */59/* fw_cfg file directory entry type */
59struct fw_cfg_file {60struct fw_cfg_file {
@@ -63,4 +64,34 @@ struct fw_cfg_file { · 3 unmodified lines
63 char name[FW_CFG_MAX_FILE_PATH];64 char name[FW_CFG_MAX_FILE_PATH];
64};65};
65 66
67/* FW_CFG_DMA_CONTROL bits */
68#define FW_CFG_DMA_CTL_ERROR 0x01
69#define FW_CFG_DMA_CTL_READ 0x02
70#define FW_CFG_DMA_CTL_SKIP 0x04
71#define FW_CFG_DMA_CTL_SELECT 0x08
72#define FW_CFG_DMA_CTL_WRITE 0x10
73
74#define FW_CFG_DMA_SIGNATURE 0x51454d5520434647ULL /* "QEMU CFG" */
75
76/* Control as first field allows for different structures selected by this
77 * field, which might be useful in the future
78 */
79struct fw_cfg_dma_access {
80 __be32 control;
81 __be32 length;
82 __be64 address;
83};
84
85#define FW_CFG_VMCOREINFO_FILENAME "etc/vmcoreinfo"
86
87#define FW_CFG_VMCOREINFO_FORMAT_NONE 0x0
88#define FW_CFG_VMCOREINFO_FORMAT_ELF 0x1
89
90struct fw_cfg_vmcoreinfo {
91 __le16 host_format;
92 __le16 guest_format;
93 __le32 size;
94 __le64 paddr;
95};
96
66#endif97#endif