Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/kerneldump.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#define htod64(x) __bswap64(x) | #define htod64(x) __bswap64(x) | ||||
#elif BYTE_ORDER == BIG_ENDIAN | #elif BYTE_ORDER == BIG_ENDIAN | ||||
#define dtoh32(x) (x) | #define dtoh32(x) (x) | ||||
#define dtoh64(x) (x) | #define dtoh64(x) (x) | ||||
#define htod32(x) (x) | #define htod32(x) (x) | ||||
#define htod64(x) (x) | #define htod64(x) (x) | ||||
#endif | #endif | ||||
#define KERNELDUMP_COMP_NONE 0 | |||||
#define KERNELDUMP_COMP_GZIP 1 | |||||
#define KERNELDUMP_ENC_NONE 0 | #define KERNELDUMP_ENC_NONE 0 | ||||
#define KERNELDUMP_ENC_AES_256_CBC 1 | #define KERNELDUMP_ENC_AES_256_CBC 1 | ||||
#define KERNELDUMP_BUFFER_SIZE 4096 | #define KERNELDUMP_BUFFER_SIZE 4096 | ||||
#define KERNELDUMP_IV_MAX_SIZE 32 | #define KERNELDUMP_IV_MAX_SIZE 32 | ||||
#define KERNELDUMP_KEY_MAX_SIZE 64 | #define KERNELDUMP_KEY_MAX_SIZE 64 | ||||
#define KERNELDUMP_ENCKEY_MAX_SIZE (16384 / 8) | #define KERNELDUMP_ENCKEY_MAX_SIZE (16384 / 8) | ||||
/* | /* | ||||
* All uintX_t fields are in dump byte order, which is the same as | * All uintX_t fields are in dump byte order, which is the same as | ||||
* network byte order. Use the macros defined above to read or | * network byte order. Use the macros defined above to read or | ||||
* write the fields. | * write the fields. | ||||
*/ | */ | ||||
struct kerneldumpheader { | struct kerneldumpheader { | ||||
char magic[20]; | char magic[20]; | ||||
#define KERNELDUMPMAGIC "FreeBSD Kernel Dump" | #define KERNELDUMPMAGIC "FreeBSD Kernel Dump" | ||||
#define TEXTDUMPMAGIC "FreeBSD Text Dump" | #define TEXTDUMPMAGIC "FreeBSD Text Dump" | ||||
#define KERNELDUMPMAGIC_CLEARED "Cleared Kernel Dump" | #define KERNELDUMPMAGIC_CLEARED "Cleared Kernel Dump" | ||||
char architecture[12]; | char architecture[12]; | ||||
uint32_t version; | uint32_t version; | ||||
#define KERNELDUMPVERSION 2 | #define KERNELDUMPVERSION 3 | ||||
#define KERNELDUMP_TEXT_VERSION 2 | #define KERNELDUMP_TEXT_VERSION 3 | ||||
uint32_t architectureversion; | uint32_t architectureversion; | ||||
#define KERNELDUMP_AARCH64_VERSION 1 | #define KERNELDUMP_AARCH64_VERSION 1 | ||||
#define KERNELDUMP_AMD64_VERSION 2 | #define KERNELDUMP_AMD64_VERSION 2 | ||||
#define KERNELDUMP_ARM_VERSION 1 | #define KERNELDUMP_ARM_VERSION 1 | ||||
#define KERNELDUMP_I386_VERSION 2 | #define KERNELDUMP_I386_VERSION 2 | ||||
#define KERNELDUMP_MIPS_VERSION 1 | #define KERNELDUMP_MIPS_VERSION 1 | ||||
#define KERNELDUMP_POWERPC_VERSION 1 | #define KERNELDUMP_POWERPC_VERSION 1 | ||||
#define KERNELDUMP_RISCV_VERSION 1 | #define KERNELDUMP_RISCV_VERSION 1 | ||||
#define KERNELDUMP_SPARC64_VERSION 1 | #define KERNELDUMP_SPARC64_VERSION 1 | ||||
uint64_t dumplength; /* excl headers */ | uint64_t dumplength; /* excl headers */ | ||||
uint64_t dumpextent; | |||||
uint64_t dumptime; | uint64_t dumptime; | ||||
uint32_t dumpkeysize; | uint32_t dumpkeysize; | ||||
uint32_t blocksize; | uint32_t blocksize; | ||||
uint8_t compression; | |||||
char hostname[64]; | char hostname[64]; | ||||
char versionstring[192]; | char versionstring[192]; | ||||
char panicstring[188]; | char panicstring[179]; | ||||
uint32_t parity; | uint32_t parity; | ||||
cem: I know this is a bit late, but given this feature hasn't made it to a stable/ branch yet, would… | |||||
}; | }; | ||||
struct kerneldumpkey { | struct kerneldumpkey { | ||||
uint8_t kdk_encryption; | uint8_t kdk_encryption; | ||||
uint8_t kdk_iv[KERNELDUMP_IV_MAX_SIZE]; | uint8_t kdk_iv[KERNELDUMP_IV_MAX_SIZE]; | ||||
uint32_t kdk_encryptedkeysize; | uint32_t kdk_encryptedkeysize; | ||||
uint8_t kdk_encryptedkey[]; | uint8_t kdk_encryptedkey[]; | ||||
} __packed; | } __packed; | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
I know this is a bit late, but given this feature hasn't made it to a stable/ branch yet, would it be possible to move dumpextent and compression to after panicstring, to avoid changing offsets unnecessarily? Yes, it'd involve revving the KERNELDUMPVERSION again. I guess I'll post a review for the proposal and see what you think.