[PATCH] Add "log -R" to display human readable Rust symbol name
by Lianbo Jiang
Currently, the log command will display human readable Rust
symbol name by default if any, but, sometimes still want to
print the original messages from the log buffer(do not demangle).
In addition, if the log buffer has lines like "_R ... +" which
are not Rust symbols unexpectedly, probably the output will be
missed, that is unexpected.
To fix above cases, add "log -R" to display human readable Rust
symbol name, otherwise still print the original messages.
With the patch:
crash> log -R
...
[ 2174.289360] Tainted: [S]=CPU_OUT_OF_SPEC, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[ 2174.297322] Hardware name: Intel Corporation S2600CWR/S2600CWR, BIOS SE5C610.86B.01.01.0018.072020161249 07/20/2016
[ 2174.308966] Call Trace:
[ 2174.311693] <TASK>
[ 2174.314033] dump_stack_lvl+0x5d/0x80
[ 2174.318125] panic+0x156/0x32a
[ 2174.321539] rust_panic::area_in_hp+0xf7/0x120 [rust_panic]
[ 2174.329700] ? console_unlock+0x9c/0x140
[ 2174.334080] ? irq_work_queue+0x2d/0x50
[ 2174.338352] ? __pfx_init_module+0x10/0x10 [rust_panic]
[ 2174.344183] <rust_panic::HelloPanic>::step_two+0x20/0xe0 [rust_panic]
[ 2174.353698] ? _printk+0x6b/0x90
[ 2174.357303] init_module+0x57/0xff0 [rust_panic]
[ 2174.362456] ? __pfx_init_module+0x10/0x10 [rust_panic]
...
Suggested-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
defs.h | 1 +
help.c | 24 +++++++++++++++++++++++-
kernel.c | 5 ++++-
printk.c | 46 +++++++++++++++++++++++++---------------------
4 files changed, 53 insertions(+), 23 deletions(-)
diff --git a/defs.h b/defs.h
index 156ac0232906..997145cba9d2 100644
--- a/defs.h
+++ b/defs.h
@@ -6227,6 +6227,7 @@ void parse_kernel_version(char *);
#define SHOW_LOG_CTIME (0x10)
#define SHOW_LOG_SAFE (0x20)
#define SHOW_LOG_CALLER (0x40)
+#define SHOW_LOG_RUST (0x80)
void set_cpu(int);
void clear_machdep_cache(void);
struct stack_hook *gather_text_list(struct bt_info *);
diff --git a/help.c b/help.c
index 4f071e0bd0a0..78d7a5c70e30 100644
--- a/help.c
+++ b/help.c
@@ -4026,7 +4026,7 @@ NULL
char *help_log[] = {
"log",
"dump system message buffer",
-"[-Ttdmasc]",
+"[-TtdmascR]",
" This command dumps the kernel log_buf contents in chronological order. The",
" command supports the older log_buf formats, which may or may not contain a",
" timestamp inserted prior to each message, as well as the newer variable-length",
@@ -4053,6 +4053,8 @@ char *help_log[] = {
" the CPU id (if in CPU context) that called printk(), if available.",
" Generally available on Linux 5.1 to 5.9 kernels configured with",
" CONFIG_PRINTK_CALLER or Linux 5.10 and later kernels.",
+" -R Display the message text with human readable Rust symbol name if any,",
+" otherwise still print the original message text.",
" ",
"\nEXAMPLES",
" Dump the kernel message buffer:\n",
@@ -4231,6 +4233,26 @@ char *help_log[] = {
" [ 0.014179] [ T29] RAMDISK: [mem 0x3cf4f000-0x437bbfff]",
" [ 0.198789] [ C0] DMAR: DRHD: handling fault status reg 3",
" ...",
+" ",
+" Display the message text with human readable Rust symbol name if any,",
+" otherwise still print the original message text.\n",
+" %s> log -R",
+" ...",
+" [ 2174.289360] Tainted: [S]=CPU_OUT_OF_SPEC, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE",
+" [ 2174.297322] Hardware name: Intel Corporation S2600CWR/S2600CWR, BIOS SE5C610.86B.01.01.0018.072020161249 07/20/2016",
+" [ 2174.308966] Call Trace:",
+" [ 2174.311693] <TASK>",
+" [ 2174.314033] dump_stack_lvl+0x5d/0x80",
+" [ 2174.318125] panic+0x156/0x32a",
+" [ 2174.321539] rust_panic::area_in_hp+0xf7/0x120 [rust_panic]",
+" [ 2174.329700] ? console_unlock+0x9c/0x140",
+" [ 2174.334080] ? irq_work_queue+0x2d/0x50",
+" [ 2174.338352] ? __pfx_init_module+0x10/0x10 [rust_panic]",
+" [ 2174.344183] <rust_panic::HelloPanic>::step_two+0x20/0xe0 [rust_panic]",
+" [ 2174.353698] ? _printk+0x6b/0x90",
+" [ 2174.357303] init_module+0x57/0xff0 [rust_panic]",
+" [ 2174.362456] ? __pfx_init_module+0x10/0x10 [rust_panic]",
+" ...",
NULL
};
diff --git a/kernel.c b/kernel.c
index e4213d7a663e..e077275d7ed6 100644
--- a/kernel.c
+++ b/kernel.c
@@ -5136,7 +5136,7 @@ cmd_log(void)
msg_flags = 0;
- while ((c = getopt(argcnt, args, "Ttdmasc")) != EOF) {
+ while ((c = getopt(argcnt, args, "TtdmascR")) != EOF) {
switch(c)
{
case 'T':
@@ -5160,6 +5160,9 @@ cmd_log(void)
case 'c':
msg_flags |= SHOW_LOG_CALLER;
break;
+ case 'R':
+ msg_flags |= SHOW_LOG_RUST;
+ break;
default:
argerrs++;
break;
diff --git a/printk.c b/printk.c
index 51b618e2a434..e4cc6dc30065 100644
--- a/printk.c
+++ b/printk.c
@@ -202,7 +202,7 @@ dump_record(struct prb_map *m, unsigned long id, int msg_flags)
text = m->text_data + begin;
- if (text_len > BUFSIZE) {
+ if ((msg_flags & SHOW_LOG_RUST) && (text_len > BUFSIZE)) {
error(WARNING, "\nThe messages could be truncated!\n");
text_len = BUFSIZE;
}
@@ -218,26 +218,30 @@ dump_record(struct prb_map *m, unsigned long id, int msg_flags)
/*
* Try to demangle a mangled Rust symbol(calltrace) from log buffer
*/
- char *p1 = strstr(buf, "_R");
- if (!p1)
- p1 = strstr(buf, "_ZN");
- char *p2 = strrchr(buf, '+');
- if (p1 && p2) {
- char mangled[BUFSIZE] = {0};
- char demangled[BUFSIZE] = {0};
- char *res;
- size_t slen = p1 - buf;
-
- if (slen)
- memcpy(demangled, buf, slen);
-
- memcpy(mangled, p1, p2-p1);
- res = rust_demangle(mangled, DMGL_RUST);
- if (res) {
- snprintf(demangled+slen, BUFSIZE-slen, "%s%s", res, p2);
- fprintf(fp, "%s",demangled);
- free(res);
- }
+ if (msg_flags & SHOW_LOG_RUST) {
+ char *p1 = strstr(buf, "_R");
+ if (!p1)
+ p1 = strstr(buf, "_ZN");
+ char *p2 = strrchr(buf, '+');
+ if (p1 && p2) {
+ char mangled[BUFSIZE] = {0};
+ char demangled[BUFSIZE] = {0};
+ char *res;
+ size_t slen = p1 - buf;
+
+ if (slen)
+ memcpy(demangled, buf, slen);
+
+ memcpy(mangled, p1, p2-p1);
+ res = rust_demangle(mangled, DMGL_RUST);
+ if (res) {
+ snprintf(demangled+slen, BUFSIZE-slen, "%s%s", res, p2);
+ fprintf(fp, "%s",demangled);
+ free(res);
+ } else
+ fprintf(fp, "%s", buf);
+ } else
+ fprintf(fp, "%s", buf);
} else
fprintf(fp, "%s", buf);
--
2.50.1
2 months
[PATCH] Fix for log command printed a couple of empty lines
by Lianbo Jiang
The log command printed a couple of empty lines (only timestamps), which
was caused by the commit 99bb57ac98af ("Enable resolving mangled Rust
symbol in lockless ring buffer"), E.g:
$ diff -u log.pre log.cur
--- log.pre 2025-09-16 13:14:31.022206514 +0900
+++ log.cur 2025-09-16 13:14:56.220390987 +0900
@@ -210,7 +210,7 @@
[ 0.169375] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.169375] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.169375] pinctrl core: initialized pinctrl subsystem
-[ 0.172925] NET: Registered PF_NETLINK/PF_ROUTE protocol family
+[ 0.172925]
[ 0.172983] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations
[ 0.172986] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.172988] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
@@ -807,7 +807,7 @@
[771438.513231] entry_SYSCALL_64_after_hwframe+0x72/0xdc
[771438.513423] RIP: 0033:0x7fbd9f8fda57
[771438.513576] Code: 0f 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
-[771438.514251] RSP: 002b:00007ffee0de2b98 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
+[771438.514251]
[771438.514534] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fbd9f8fda57
[771438.514800] RDX: 0000000000000002 RSI: 00005647ccc0a330 RDI: 0000000000000001
[771438.515066] RBP: 00005647ccc0a330 R08: 0000000000000003 R09: 0000000000000000
This is because the strchrnul() returns a pointer to the null byte
instead NULL if the char to be searched is not in the string. Given
that, let's replace the strchrnul() with the strrchr().
Fixes: 99bb57ac98af ("Enable resolving mangled Rust symbol in lockless ring buffer")
Reported-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/printk.c b/printk.c
index ae28c4fa0b21..51b618e2a434 100644
--- a/printk.c
+++ b/printk.c
@@ -221,7 +221,7 @@ dump_record(struct prb_map *m, unsigned long id, int msg_flags)
char *p1 = strstr(buf, "_R");
if (!p1)
p1 = strstr(buf, "_ZN");
- char *p2 = strchrnul(buf, '+');
+ char *p2 = strrchr(buf, '+');
if (p1 && p2) {
char mangled[BUFSIZE] = {0};
char demangled[BUFSIZE] = {0};
--
2.50.1
2 months
[PATCH] Fix a compilation error on the old gcc version 8.5.0
by Lianbo Jiang
The current issue occured on gcc version 8.5.0, can not been
seen in the latest gcc version.
$ make -j8 lzo
symbols.c: In function ‘namespace_ctl’:
symbols.c:3358:3: error: a label can only be part of a statement and a declaration is not a statement
char demangled[BUFSIZE] = {0};
^~~~
make[5]: *** [Makefile:403: symbols.o] Error 1
make[5]: *** Waiting for unfinished jobs....
...
crash build failed
...
Let's put the declaration at the beginning of this function to
fix such cases.
Reported-by: Tao Liu <ltao(a)redhat.com>
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
symbols.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/symbols.c b/symbols.c
index f9eb51f6cd63..112bcc630bf2 100644
--- a/symbols.c
+++ b/symbols.c
@@ -3325,6 +3325,7 @@ namespace_ctl(int cmd, struct symbol_namespace *ns, void *nsarg1, void *nsarg2)
char *name;
long cnt;
int len;
+ char demangled[BUFSIZE] = {0};
switch (cmd)
{
@@ -3355,7 +3356,6 @@ namespace_ctl(int cmd, struct symbol_namespace *ns, void *nsarg1, void *nsarg2)
return TRUE;
case NAMESPACE_INSTALL:
- char demangled[BUFSIZE] = {0};
sp = (struct syment *)nsarg1;
name = (char *)nsarg2;
len = strlen(name)+1;
--
2.50.1
2 months
[PATCH 0/3] Add Rust support in crash-utility
by Lianbo Jiang
Currently, the kernel has supported Rust, and it has been
enabled in some distributions by default. So the crash tool
can not resolve the mangled Rust symbols on such vmcores.
For example:
crash> bt
PID: 3520 TASK: ffff8f240f670000 CPU: 1 COMMAND: "insmod"
#0 [ffffd08c4f063a20] machine_kexec at ffffffff9575e60e
#1 [ffffd08c4f063a40] __crash_kexec at ffffffff958db711
#2 [ffffd08c4f063b00] panic at ffffffff9560cede
#3 [ffffd08c4f063b80] _RNvCscb18lrEyTSA_10rust_panic10area_in_hp at ffffffffc07fe107 [rust_panic]
#4 [ffffd08c4f063c20] _RNvMCscb18lrEyTSA_10rust_panicNtB2_10HelloPanic8step_two at ffffffffc07fe160 [rust_panic]
#5 [ffffd08c4f063cf0] do_one_initcall at ffffffff956c7aaa
...
The patchset will solve the current issues, the crash tool
reuses the rust demangle lib in gdb to demangle the mangled
Rust symbol into human-readable symbol.
With the patchset:
crash> bt
PID: 3520 TASK: ffff8f240f670000 CPU: 1 COMMAND: "insmod"
#0 [ffffd08c4f063a20] machine_kexec at ffffffff9575e60e
#1 [ffffd08c4f063a40] __crash_kexec at ffffffff958db711
#2 [ffffd08c4f063b00] panic at ffffffff9560cede
#3 [ffffd08c4f063b80] rust_panic::area_in_hp at ffffffffc07fe107 [rust_panic]
#4 [ffffd08c4f063c20] <rust_panic::HelloPanic>::step_two at ffffffffc07fe160 [rust_panic]
#5 [ffffd08c4f063cf0] do_one_initcall at ffffffff956c7aaa
...
crash> sym "rust_panic::area_in_hp"
ffffffffc07fe010 (t) rust_panic::area_in_hp [rust_panic] /root/linux-6.16.3/samples/rust/rust_panic.rs: 22
crash> dis "rust_panic::area_in_hp"
0xffffffffc07fe010 <rust_panic::area_in_hp>::area_in_hp>: push %rbx
0xffffffffc07fe011 <rust_panic::area_in_hp+1>::area_in_hp+1>: sub $0x90,%rsp
0xffffffffc07fe018 <rust_panic::area_in_hp+8>::area_in_hp+8>: mov %rdi,%rbx
0xffffffffc07fe01b <rust_panic::area_in_hp+11>::area_in_hp+11>: movq $0xffffffffc0bd5020,(%rsp)
0xffffffffc07fe023 <rust_panic::area_in_hp+19>::area_in_hp+19>: movq $0x1,0x8(%rsp)
0xffffffffc07fe02c <rust_panic::area_in_hp+28>::area_in_hp+28>: movq $0x0,0x20(%rsp)
0xffffffffc07fe035 <rust_panic::area_in_hp+37>::area_in_hp+37>: movq $0x8,0x10(%rsp)
0xffffffffc07fe03e <rust_panic::area_in_hp+46>::area_in_hp+46>: movq $0x0,0x18(%rsp)
0xffffffffc07fe047 <rust_panic::area_in_hp+55>::area_in_hp+55>: mov %rsp,%rcx
0xffffffffc07fe04a <rust_panic::area_in_hp+58>::area_in_hp+58>: mov $0xc,%edx
0xffffffffc07fe04f <rust_panic::area_in_hp+63>::area_in_hp+63>: mov $0xffffffff96afb62c,%rdi
0xffffffffc07fe056 <rust_panic::area_in_hp+70>::area_in_hp+70>: mov $0xffffffffc0bd5118,%rsi
0xffffffffc07fe05d <rust_panic::area_in_hp+77>::area_in_hp+77>: call 0xffffffff95fcb2e0 <kernel::print::call_printk>
0xffffffffc07fe062 <rust_panic::area_in_hp+82>::area_in_hp+82>: movq $0xffffffffc0bd50d0,0x30(%rsp)
...
crash> gdb bt
#0 0xffffffff958db684 in crash_setup_regs (newregs=0xffffd08c4f063a48, oldregs=0x0) at ./arch/x86/include/asm/kexec.h:108
#1 0xffffffff958db711 in __crash_kexec (regs=regs@entry=0x0) at kernel/crash_core.c:122
#2 0xffffffff9560cede in panic (fmt=<optimized out>) at kernel/panic.c:401
#3 0xffffffffc07fe107 in rust_panic::HelloPanic::trigger_panic (self=0x1) at rust_panic.rs:59
#4 rust_panic::HelloPanic::step_three (self=0x1) at rust_panic.rs:53
#5 rust_panic::area_in_hp (rectangle=0xffffd08c4f063c38) at rust_panic.rs:24
#6 0xffffffffc07fe160 in rust_panic::HelloPanic::step_two (self=<optimized out>) at rust_panic.rs:46
#7 0xffffffffc0c5d067 in ?? ()
crash> frame 5
#5 rust_panic::area_in_hp (rectangle=0xffffd08c4f063c38) at rust_panic.rs:24
24 in rust_panic.rs
crash> whatis rectangle
*mut rust_panic::RectangleHP
crash> p *rectangle
$2 = rust_panic::RectangleHP {
width: 30,
height: 50
}
crash> struct RectangleHP
struct rust_panic::RectangleHP {
width: u32,
height: u32,
}
SIZE: 8
crash>
Anyway, there are still many limitations of debugging complex, nested
data type about Rust code in kernel. I do not expect patches to always
work well in the real world, but it can get improved over time. As you
know, also some challenges come from the compilers, they may have
different behavior, for example:
crash> gdb bt
#0 rust_helper_BUG () at rust/helpers/bug.c:7
#1 0xffffffff98b5a92a in kernel::panic (info=0xffffcf05880d7800) at rust/kernel/lib.rs:202
#2 0xffffffff9840e310 in core::panicking::panic_fmt (fmt=...) at /home/llvm-20.1.8-rust-1.88.0-x86_64/lib/rustlib/src/rust/library/core/src/panicking.rs:75
#3 0xffffffffc12e71ec in ?? ()
#4 0xffffcf05880d7880 in ?? ()
#5 0xffffffffc14680a8 in ?? ()
crash>
Note: The above kernel is compiled with the clang(clang version 20.1.8 (https://github.com/llvm/llvm-project.git 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)), the gdb stack unwind looks incomplete.
BTW: I did not see the similar issues on the kernel that compiled by the gcc (GCC) 14.3.1.
Note: the rust_panic is a Rust kernel module, which is used to test the
current patchset. If anyone needs it, I can share it via email.
Lianbo Jiang (3):
Add a rustfilt command to demangle a mangled Rust symbol
Enable demangling a mangled Rust support
Enable resolving mangled Rust symbol in lockless ring buffer
Makefile | 2 +-
defs.h | 2 ++
global_data.c | 1 +
help.c | 10 +++++++
printk.c | 28 +++++++++++++++++-
symbols.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 119 insertions(+), 2 deletions(-)
--
2.50.1
2 months, 1 week
[Extension] Request to add new extension to Crash Extension Modules page: sdinfo
by briston_dev
Dear Crash Utility Maintainers,
I would like to submit a new extension module for inclusion in the Crash Extension Modules page. Below are the required details:
1.Extension Name: sdinfo
2.Command(s): sdinfo
3.Comments
- Functionality: Displays Linux kernel's SCSI disk information, including devices, hosts, targets, and associated I/O requests and SCSI commands. Support for NVMe devices is currently under development and will be added in upcoming releases.
- To build the module from the top-level `crash-<version>` directory, enter:
$ cp <path-to>/scsi.c scsi.mk extensions
$ make extensions
- Package Website: https://github.com/briston-dev/crash-diskutils
- Requires crash-utility version >= 7.2.8
- Author: Yao Sang <sangyao(a)kylinos.cn>
As specified in the extension guidelines, please add this module to the Crash Extension Modules page. This extension will be actively maintained with regular updates to ensure compatibility with new kernel versions and additional feature enhancements.
Let me know if additional information is needed. Thank you for your consideration!
Best regards,
Yao Sang
2 months, 1 week
[PATCH] bpf: Implement ringbuf_map memory usage calculation
by Tao Liu
This patch replicates the kernel code for bpf ringbuf_map mm usage
calculation.
$ bpftool map create /sys/fs/bpf/rb0 type ringbuf key 0 value 0 entries $((1<<24)) name rb0
Before:
crash> bpf -m 12
ID BPF_MAP BPF_MAP_TYPE MAP_FLAGS
12 ffff8dc4d7c0ed00 RINGBUF 00000000
KEY_SIZE: 0 VALUE_SIZE: 0 MAX_ENTRIES: 16777216 MEMLOCK: (unknown)
NAME: "rb0" UID: (unused)
After:
crash> bpf -m 12
ID BPF_MAP BPF_MAP_TYPE MAP_FLAGS
12 ffff8dc4d7c0ed00 RINGBUF 00000000
KEY_SIZE: 0 VALUE_SIZE: 0 MAX_ENTRIES: 16777216 MEMLOCK: 16855320
NAME: "rb0" UID: (unused)
Thus, the output will be the same as bpftool:
$ bpftool map show id 12
12: ringbuf name rb0 flags 0x0
key 0B value 0B max_entries 16777216 memlock 16855320B
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
bpf.c | 30 +++++++++++++++++++++++++++++-
defs.h | 5 +++++
symbols.c | 5 +++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/bpf.c b/bpf.c
index 466b244..43e4ff5 100644
--- a/bpf.c
+++ b/bpf.c
@@ -121,6 +121,26 @@ static ulong bpf_map_memory_size(int map_type, uint value_size,
return roundup((max_entries * size), PAGESIZE());
}
+/*
+ * Code replicated from kernel/bpf/ringbuf.c:ringbuf_map_mem_usage()
+*/
+static ulong ringbuf_map_mem_usage(struct bpf_info *bpf, int i)
+{
+ ulong nr_pages;
+ ulong usage = SIZE(bpf_ringbuf_map);
+ ulong rb = (ulong)(bpf->maplist[i].value) - OFFSET(bpf_ringbuf_map_map)
+ + OFFSET(bpf_ringbuf_map_rb);
+ readmem(rb, KVADDR, &rb, sizeof(ulong), "bpf_ringbuf *", RETURN_ON_ERROR);
+ readmem(rb + OFFSET(bpf_ringbuf_nr_pages), KVADDR, &nr_pages,
+ sizeof(ulong), "bpf_ringbuf.nr_pages", RETURN_ON_ERROR);
+ usage += (nr_pages << PAGESHIFT());
+ ulong nr_meta_pages = (OFFSET(bpf_ringbuf_consumer_pos) >> PAGESHIFT()) + 2;
+ ulong nr_data_pages = UINT(bpf->bpf_map_buf + OFFSET(bpf_map_max_entries)) >> PAGESHIFT();
+ usage += (nr_meta_pages + 2 * nr_data_pages) * sizeof(void *);
+
+ return usage;
+}
+
void
cmd_bpf(void)
{
@@ -217,6 +237,7 @@ bpf_init(struct bpf_info *bpf)
STRUCT_SIZE_INIT(bpf_prog_aux, "bpf_prog_aux");
STRUCT_SIZE_INIT(bpf_map, "bpf_map");
STRUCT_SIZE_INIT(bpf_insn, "bpf_insn");
+ STRUCT_SIZE_INIT(bpf_ringbuf_map, "bpf_ringbuf_map");
MEMBER_OFFSET_INIT(bpf_prog_aux, "bpf_prog", "aux");
MEMBER_OFFSET_INIT(bpf_prog_type, "bpf_prog", "type");
MEMBER_OFFSET_INIT(bpf_prog_tag, "bpf_prog", "tag");
@@ -228,6 +249,10 @@ bpf_init(struct bpf_info *bpf)
MEMBER_OFFSET_INIT(bpf_map_map_flags, "bpf_map", "map_flags");
MEMBER_OFFSET_INIT(bpf_prog_aux_used_maps, "bpf_prog_aux", "used_maps");
MEMBER_OFFSET_INIT(bpf_prog_aux_used_map_cnt, "bpf_prog_aux", "used_map_cnt");
+ MEMBER_OFFSET_INIT(bpf_ringbuf_map_map, "bpf_ringbuf_map", "map");
+ MEMBER_OFFSET_INIT(bpf_ringbuf_map_rb, "bpf_ringbuf_map", "rb");
+ MEMBER_OFFSET_INIT(bpf_ringbuf_consumer_pos, "bpf_ringbuf", "consumer_pos");
+ MEMBER_OFFSET_INIT(bpf_ringbuf_nr_pages, "bpf_ringbuf", "nr_pages");
if (!VALID_STRUCT(bpf_prog) ||
!VALID_STRUCT(bpf_prog_aux) ||
!VALID_STRUCT(bpf_map) ||
@@ -664,7 +689,10 @@ do_map_only:
fprintf(fp, "%d\n", map_pages * PAGESIZE());
} else if ((msize = bpf_map_memory_size(type, value_size, key_size, max_entries)))
fprintf(fp, "%ld\n", msize);
- else
+#define BPF_MAP_TYPE_RINGBUF (0x1BUL)
+ else if (type == BPF_MAP_TYPE_RINGBUF) {
+ fprintf(fp, "%ld\n", ringbuf_map_mem_usage(bpf, i));
+ } else
fprintf(fp, "(unknown)");
fprintf(fp, " NAME: ");
diff --git a/defs.h b/defs.h
index 4fecb83..498c262 100644
--- a/defs.h
+++ b/defs.h
@@ -2274,6 +2274,10 @@ struct offset_table { /* stash of commonly-used offsets */
long request_queue_tag_set;
long blk_mq_tag_set_flags;
long blk_mq_tag_set_shared_tags;
+ long bpf_ringbuf_map_map;
+ long bpf_ringbuf_map_rb;
+ long bpf_ringbuf_consumer_pos;
+ long bpf_ringbuf_nr_pages;
};
struct size_table { /* stash of commonly-used sizes */
@@ -2452,6 +2456,7 @@ struct size_table { /* stash of commonly-used sizes */
long vmap_node;
long cpumask_t;
long task_struct_exit_state;
+ long bpf_ringbuf_map;
};
struct array_table {
diff --git a/symbols.c b/symbols.c
index ce0b441..19e1316 100644
--- a/symbols.c
+++ b/symbols.c
@@ -11868,6 +11868,10 @@ dump_offset_table(char *spec, ulong makestruct)
fprintf(fp, " thread_struct_gsbase: %ld\n", OFFSET(thread_struct_gsbase));
fprintf(fp, " thread_struct_fs: %ld\n", OFFSET(thread_struct_fs));
fprintf(fp, " thread_struct_gs: %ld\n", OFFSET(thread_struct_gs));
+ fprintf(fp, " bpf_ringbuf_map_map: %ld\n", OFFSET(bpf_ringbuf_map_map));
+ fprintf(fp, " bpf_ringbuf_map_rb: %ld\n", OFFSET(bpf_ringbuf_map_rb));
+ fprintf(fp, " bpf_ringbuf_consumer_pos: %ld\n", OFFSET(bpf_ringbuf_consumer_pos));
+ fprintf(fp, " bpf_ringbuf_nr_pages: %ld\n", OFFSET(bpf_ringbuf_nr_pages));
fprintf(fp, "\n size_table:\n");
fprintf(fp, " page: %ld\n", SIZE(page));
@@ -12148,6 +12152,7 @@ dump_offset_table(char *spec, ulong makestruct)
fprintf(fp, " percpu_counter: %ld\n", SIZE(percpu_counter));
fprintf(fp, " cpumask_t: %ld\n", SIZE(cpumask_t));
+ fprintf(fp, " bpf_ringbuf_map: %ld\n", SIZE(bpf_ringbuf_map));
fprintf(fp, "\n array_table:\n");
/*
--
2.47.0
2 months, 1 week
[PATCH] Support running on X86_64 with RISCV target
by Pnina Feder
Signed-off-by: Pnina Feder <pnina.feder(a)mobileye.com>
---
symbols.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/symbols.c b/symbols.c
index e30fafe..5b42ecf 100644
--- a/symbols.c
+++ b/symbols.c
@@ -4539,7 +4539,7 @@ is_shared_object(char *file)
case EM_X86_64:
if (machine_type("X86_64") || machine_type("ARM64") ||
- machine_type("PPC64"))
+ machine_type("PPC64") || machine_type("RISCV64"))
return TRUE;
break;
--
2.43.0
2 months, 2 weeks
[PATCH] RISCV64: Add 'PAGE DIRECTORY' property to the 'vtop' command
by Austin Kim
Currently, 'vtop' command does not include 'PAGE DIRECTORY' information for
RISC-V-based vmcores. Since 'PAGE DIRECTORY' is used as the root page table,
we need this information. Note that Arm64, Arm32 and x86 vmcore shows
'PAGE DIRECTORY' for 'vtop' command.
(before)
crash> vtop 0xffffffff80d8e1e0
VIRTUAL PHYSICAL
ffffffff80d8e1e0 40f8e1e0
PGD: ffffffff81c4fff0 => 4fffe801
PMD: 000000013fffa000 => 00000000103800eb
PTE: 40e00000 => b35030414c583
PAGE: 002cd40c10531000
PTE PHYSICAL FLAGS
b35030414c583 2cd40c10531000 (PRESENT|READ|DIRTY|SOFT)
(after)
crash> vtop 0xffffffff80d8e1e0
VIRTUAL PHYSICAL
ffffffff80d8e1e0 40f8e1e0
PAGE DIRECTORY: ffffffff81c4f000
PGD: ffffffff81c4fff0 => 4fffe801
PMD: 000000013fffa000 => 00000000103800eb
PTE: 40e00000 => b35030414c583
PAGE: 002cd40c10531000
PTE PHYSICAL FLAGS
b35030414c583 2cd40c10531000 (PRESENT|READ|DIRTY|SOFT)
Signed-off-by: Austin Kim <austindh.kim(a)gmail.com>
---
riscv64.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/riscv64.c b/riscv64.c
index 073ebb9..ef5c41d 100644
--- a/riscv64.c
+++ b/riscv64.c
@@ -634,6 +634,9 @@ riscv64_vtop_3level_4k(ulong *pgd, ulong vaddr, physaddr_t *paddr, int verbose)
ulong pte_val, pte_pfn;
ulong pt_phys;
+ if (verbose)
+ fprintf(fp, "PAGE DIRECTORY: %lx\n", (ulong)pgd);
+
/* PGD */
pgd_ptr = pgd + pgd_index_l3_4k(vaddr);
FILL_PGD(pgd, KVADDR, PAGESIZE());
@@ -1213,6 +1216,9 @@ riscv64_vtop_4level_4k(ulong *pgd, ulong vaddr, physaddr_t *paddr, int verbose)
ulong pte_val, pte_pfn;
ulong pt_phys;
+ if (verbose)
+ fprintf(fp, "PAGE DIRECTORY: %lx\n", (ulong)pgd);
+
/* PGD */
pgd_ptr = pgd + pgd_index_l4_4k(vaddr);
FILL_PGD(pgd, KVADDR, PAGESIZE());
@@ -1289,6 +1295,9 @@ riscv64_vtop_5level_4k(ulong *pgd, ulong vaddr, physaddr_t *paddr, int verbose)
ulong pte_val, pte_pfn;
ulong pt_phys;
+ if (verbose)
+ fprintf(fp, "PAGE DIRECTORY: %lx\n", (ulong)pgd);
+
/* PGD */
pgd_ptr = pgd + pgd_index_l5_4k(vaddr);
FILL_PGD(pgd, KVADDR, PAGESIZE());
--
2.34.1
2 months, 2 weeks
[PATCH] mem: rename variable for clarity in get_kmem_cache_slub_data()
by liuye@kylinos.cn
From 33e22a832bdf79b032dd9d4ceac53fead5c2f552 Mon Sep 17 00:00:00 2001
From: Ye Liu <liuye(a)kylinos.cn>
Date: Wed, 3 Sep 2025 15:18:57 +0800
Subject: [PATCH] mem: rename variable for clarity in
get_kmem_cache_slub_data()
Rename 'cpu_slab_ptr' to 'cpu_slab_page_ptr' to better reflect that
it holds a pointer to a page structure rather than a generic slab pointer.
This improves code readability and consistency with related functions.
No functional changes.
Signed-off-by: Ye Liu <liuye(a)kylinos.cn>
---
memory.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/memory.c b/memory.c
index 400d31a04cd4..be5c590003a8 100644
--- a/memory.c
+++ b/memory.c
@@ -19426,7 +19426,7 @@ get_kmem_cache_slub_data(long cmd, struct meminfo *si)
{
int i, n, node;
ulong total_objects, total_slabs, free_objects;
- ulong cpu_slab_ptr, node_ptr, cpu_freelist, orig_slab;
+ ulong cpu_slab_page_ptr, node_ptr, cpu_freelist, orig_slab;
ulong node_nr_partial, node_nr_slabs, node_total_objects;
int full_slabs, objects, node_total_avail;
long p;
@@ -19445,12 +19445,12 @@ get_kmem_cache_slub_data(long cmd, struct meminfo *si)
node_total_avail = VALID_MEMBER(kmem_cache_node_total_objects) ? TRUE : FALSE;
for (i = 0; i < kt->cpus; i++) {
- cpu_slab_ptr = get_cpu_slab_ptr(si, i, &cpu_freelist);
+ cpu_slab_page_ptr = get_cpu_slab_ptr(si, i, &cpu_freelist);
- if (!cpu_slab_ptr)
+ if (!cpu_slab_page_ptr)
continue;
- if ((node = page_to_nid(cpu_slab_ptr)) < 0)
+ if ((node = page_to_nid(cpu_slab_page_ptr)) < 0)
goto bailout;
switch (cmd)
@@ -19458,15 +19458,15 @@ get_kmem_cache_slub_data(long cmd, struct meminfo *si)
case GET_SLUB_OBJECTS: {
/* For better error report, set cur slab to si->slab. */
orig_slab = si->slab;
- si->slab = cpu_slab_ptr;
+ si->slab = cpu_slab_page_ptr;
- if (!readmem(cpu_slab_ptr + OFFSET(page_inuse),
+ if (!readmem(cpu_slab_page_ptr + OFFSET(page_inuse),
KVADDR, &inuse, sizeof(short),
"page inuse", RETURN_ON_ERROR)) {
si->slab = orig_slab;
return FALSE;
}
- objects = slub_page_objects(si, cpu_slab_ptr);
+ objects = slub_page_objects(si, cpu_slab_page_ptr);
if (!objects) {
si->slab = orig_slab;
return FALSE;
--
2.43.0
2 months, 2 weeks
Re: [PATCH v2 1/2] vmware_vmss: support segment registers
by Lianbo Jiang
Hi, Ajay
Thank you for the update. For the v2: Ack.
On 8/30/25 21:32, devel-request(a)lists.crash-utility.osci.io wrote:
> Date: Sat, 30 Aug 2025 13:19:07 +0000
> From: Ajay Kaher<ajay.kaher(a)broadcom.com>
> Subject: [Crash-utility] [PATCH v2 1/2] vmware_vmss: support segment
> registers
> To:devel@lists.crash-utility.osci.io,lijiang@redhat.com,
> ltao(a)redhat.com
> Cc:alexey.makhalov@broadcom.com,
> vamsi-krishna.brahmajosyula@broadcom.com,tapas.kundu(a)broadcom.com,
> ajay.kaher(a)broadcom.com
> Message-ID:<20250830131908.1984311-1-ajay.kaher(a)broadcom.com>
>
> adding support for segment registers for vmware vmss dumps.
>
> diff from v1:
> - modified dump_registers_for_vmss_dump() to remove compiler warning.
>
> Signed-off-by: Ajay Kaher<ajay.kaher(a)broadcom.com>
> ---
> vmware_guestdump.c | 2 +-
> vmware_vmss.c | 116 +++++++++++++++++++++++++++++++++++----------
> vmware_vmss.h | 92 ++++++++++++++++++++++++-----------
> 3 files changed, 155 insertions(+), 55 deletions(-)
>
> diff --git a/vmware_guestdump.c b/vmware_guestdump.c
> index 1a6ef9b..dc10d42 100644
> --- a/vmware_guestdump.c
> +++ b/vmware_guestdump.c
> @@ -360,7 +360,7 @@ vmware_guestdump_init(char *filename, FILE *ofp)
> goto exit;
> }
>
> - vmss.vcpu_regs = malloc(vmss.num_vcpus * sizeof(uint32_t));
> + vmss.vcpu_regs = malloc(vmss.num_vcpus * sizeof(uint64_t));
> vmss.regs64 = calloc(vmss.num_vcpus, sizeof(void *));
> if (!vmss.vcpu_regs || !vmss.regs64) {
> error(INFO, LOGPRX"Failed to allocate memory\n");
> diff --git a/vmware_vmss.c b/vmware_vmss.c
> index 8121ab6..3f9ad33 100644
> --- a/vmware_vmss.c
> +++ b/vmware_vmss.c
> @@ -317,7 +317,7 @@ vmware_vmss_init(char *filename, FILE *ofp)
>
> vmss.num_vcpus = u.val32;
> vmss.regs64 = malloc(vmss.num_vcpus * sizeof(void *));
> - vmss.vcpu_regs = malloc(vmss.num_vcpus * sizeof(uint32_t));
> + vmss.vcpu_regs = malloc(vmss.num_vcpus * sizeof(uint64_t));
>
> for (k = 0; k < vmss.num_vcpus; k++) {
> vmss.regs64[k] = malloc(sizeof(vmssregs64));
> @@ -432,15 +432,65 @@ vmware_vmss_init(char *filename, FILE *ofp)
> int cpu = idx[0];
> vmss.regs64[cpu]->rflags |= u.val32;
> vmss.vcpu_regs[cpu] |= REGS_PRESENT_RFLAGS;
> + } else if (strcmp(name, "S.base64") == 0) {
> + int cpu = idx[0];
> + int seg_index = idx[1];
> + switch (seg_index) {
> + case SEG_FS:
> + vmss.regs64[cpu]->fs_base = u.val64;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_FS_BASE;
> + break;
> + case SEG_GS:
> + vmss.regs64[cpu]->gs_base = u.val64;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_GS_BASE;
> + break;
> + }
> + } else if (strcmp(name, "S") == 0) {
> + int cpu = idx[0];
> + int seg_index = idx[1];
> + switch (seg_index) {
> + case SEG_ES:
> + vmss.regs64[cpu]->es = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_ES;
> + break;
> + case SEG_CS:
> + vmss.regs64[cpu]->cs = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_CS;
> + break;
> + case SEG_SS:
> + vmss.regs64[cpu]->ss = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_SS;
> + break;
> + case SEG_DS:
> + vmss.regs64[cpu]->ds = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_DS;
> + break;
> + case SEG_FS:
> + vmss.regs64[cpu]->fs = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_FS;
> + break;
> + case SEG_GS:
> + vmss.regs64[cpu]->gs = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_GS;
> + break;
> + case SEG_LDTR:
> + vmss.regs64[cpu]->ldtr = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_LDTR;
> + break;
> + case SEG_TR:
> + vmss.regs64[cpu]->tr = u.val32;
> + vmss.vcpu_regs[cpu] |= REGS_PRESENT_TR;
> + break;
> + default:
> + error(INFO, "Unknown VMSS Segment [%d][%d]\n", cpu, seg_index);
> + }
> }
> }
> -
> DEBUG_PARSE_PRINT((ofp, "\n"));
> }
> }
> }
>
> -
> if (vmss.memsize == 0) {
> char *vmem_filename, *p;
>
> @@ -842,7 +892,7 @@ dump_registers_for_vmss_dump(void)
> fprintf(fp, "CPU %d:\n", i);
>
> if (vmss.vcpu_regs[i] != REGS_PRESENT_ALL) {
> - fprintf(fp, "Missing registers for this CPU: 0x%x\n", vmss.vcpu_regs[i]);
> + fprintf(fp, "Missing registers for this CPU: 0x%lx\n", vmss.vcpu_regs[i]);
> continue;
> }
>
> @@ -902,36 +952,50 @@ vmware_vmss_get_cpu_reg(int cpu, int regno, const char *name, int size,
> if (cpu >= vmss.num_vcpus)
> return FALSE;
>
> - /* All supported registers are 8 bytes long. */
> - if (size != 8)
> - return FALSE;
> -
> -#define CASE(R,r) \
> +#define CASE_32(R,r) \
> case R##_REGNUM: \
> + if (size != 4) \
> + return FALSE; \
> if (!(vmss.vcpu_regs[cpu] & REGS_PRESENT_##R)) \
> return FALSE; \
> memcpy(value, &vmss.regs64[cpu]->r, size); \
> break
>
> +#define CASE_64(R,r) \
> + case R##_REGNUM: \
> + if (size != 8) \
> + return FALSE; \
> + if (!(vmss.vcpu_regs[cpu] & REGS_PRESENT_##R)) \
> + return FALSE; \
> + memcpy(value, &vmss.regs64[cpu]->r, size); \
> + break
>
> switch (regno) {
> - CASE (RAX, rax);
> - CASE (RBX, rbx);
> - CASE (RCX, rcx);
> - CASE (RDX, rdx);
> - CASE (RSI, rsi);
> - CASE (RDI, rdi);
> - CASE (RBP, rbp);
> - CASE (RSP, rsp);
> - CASE (R8, r8);
> - CASE (R9, r9);
> - CASE (R10, r10);
> - CASE (R11, r11);
> - CASE (R12, r12);
> - CASE (R13, r13);
> - CASE (R14, r14);
> - CASE (R15, r15);
> - CASE (RIP, rip);
> + CASE_64 (RAX, rax);
> + CASE_64 (RBX, rbx);
> + CASE_64 (RCX, rcx);
> + CASE_64 (RDX, rdx);
> + CASE_64 (RSI, rsi);
> + CASE_64 (RDI, rdi);
> + CASE_64 (RBP, rbp);
> + CASE_64 (RSP, rsp);
> + CASE_64 (R8, r8);
> + CASE_64 (R9, r9);
> + CASE_64 (R10, r10);
> + CASE_64 (R11, r11);
> + CASE_64 (R12, r12);
> + CASE_64 (R13, r13);
> + CASE_64 (R14, r14);
> + CASE_64 (R15, r15);
> + CASE_64 (RIP, rip);
> + CASE_32 (ES, es);
> + CASE_32 (CS, cs);
> + CASE_32 (SS, ss);
> + CASE_32 (DS, ds);
> + CASE_32 (FS, fs);
> + CASE_32 (GS, gs);
> + CASE_64 (FS_BASE, fs_base);
> + CASE_64 (GS_BASE, gs_base);
> case EFLAGS_REGNUM:
> if (!(vmss.vcpu_regs[cpu] & REGS_PRESENT_RFLAGS))
> return FALSE;
> diff --git a/vmware_vmss.h b/vmware_vmss.h
> index 01d9446..5bc0370 100644
> --- a/vmware_vmss.h
> +++ b/vmware_vmss.h
> @@ -110,41 +110,77 @@ struct vmssregs64 {
> uint64_t r13;
> uint64_t r14;
> uint64_t r15;
> + uint64_t es;
> + uint64_t cs;
> + uint64_t ss;
> + uint64_t ds;
> + uint64_t fs;
> + uint64_t gs;
> + uint64_t ldtr;
> + uint64_t tr;
> +
> /* manually managed */
> uint64_t idtr;
> uint64_t cr[VMW_CR64_SIZE / 8];
> uint64_t rip;
> uint64_t rflags;
> + uint64_t fs_base;
> + uint64_t gs_base;
> };
> typedef struct vmssregs64 vmssregs64;
>
> -#define REGS_PRESENT_RAX 1<<0
> -#define REGS_PRESENT_RCX 1<<1
> -#define REGS_PRESENT_RDX 1<<2
> -#define REGS_PRESENT_RBX 1<<3
> -#define REGS_PRESENT_RBP 1<<4
> -#define REGS_PRESENT_RSP 1<<5
> -#define REGS_PRESENT_RSI 1<<6
> -#define REGS_PRESENT_RDI 1<<7
> -#define REGS_PRESENT_R8 1<<8
> -#define REGS_PRESENT_R9 1<<9
> -#define REGS_PRESENT_R10 1<<10
> -#define REGS_PRESENT_R11 1<<11
> -#define REGS_PRESENT_R12 1<<12
> -#define REGS_PRESENT_R13 1<<13
> -#define REGS_PRESENT_R14 1<<14
> -#define REGS_PRESENT_R15 1<<15
> -#define REGS_PRESENT_IDTR 1<<16
> -#define REGS_PRESENT_CR0 1<<17
> -#define REGS_PRESENT_CR1 1<<18
> -#define REGS_PRESENT_CR2 1<<19
> -#define REGS_PRESENT_CR3 1<<20
> -#define REGS_PRESENT_CR4 1<<21
> -#define REGS_PRESENT_RIP 1<<22
> -#define REGS_PRESENT_RFLAGS 1<<23
> -#define REGS_PRESENT_GPREGS 65535
> -#define REGS_PRESENT_CRS 4063232
> -#define REGS_PRESENT_ALL 16777215
> +typedef enum SegmentName {
> + SEG_ES,
> + SEG_CS,
> + SEG_SS,
> + SEG_DS,
> + SEG_FS,
> + SEG_GS,
> + SEG_LDTR,
> + SEG_TR,
> + NUM_SEGS
> +} SegmentName;
> +
> +#define REGS_PRESENT_RAX 1L<<0
> +#define REGS_PRESENT_RCX 1L<<1
> +#define REGS_PRESENT_RDX 1L<<2
> +#define REGS_PRESENT_RBX 1L<<3
> +#define REGS_PRESENT_RBP 1L<<4
> +#define REGS_PRESENT_RSP 1L<<5
> +#define REGS_PRESENT_RSI 1L<<6
> +#define REGS_PRESENT_RDI 1L<<7
> +#define REGS_PRESENT_R8 1L<<8
> +#define REGS_PRESENT_R9 1L<<9
> +#define REGS_PRESENT_R10 1L<<10
> +#define REGS_PRESENT_R11 1L<<11
> +#define REGS_PRESENT_R12 1L<<12
> +#define REGS_PRESENT_R13 1L<<13
> +#define REGS_PRESENT_R14 1L<<14
> +#define REGS_PRESENT_R15 1L<<15
> +#define REGS_PRESENT_IDTR 1L<<16
> +#define REGS_PRESENT_CR0 1L<<17
> +#define REGS_PRESENT_CR1 1L<<18
> +#define REGS_PRESENT_CR2 1L<<19
> +#define REGS_PRESENT_CR3 1L<<20
> +#define REGS_PRESENT_CR4 1L<<21
> +#define REGS_PRESENT_RIP 1L<<22
> +#define REGS_PRESENT_RFLAGS 1L<<23
> +
> +#define REGS_PRESENT_ES 1L<<24
> +#define REGS_PRESENT_CS 1L<<25
> +#define REGS_PRESENT_SS 1L<<26
> +#define REGS_PRESENT_DS 1L<<27
> +#define REGS_PRESENT_FS 1L<<28
> +#define REGS_PRESENT_GS 1L<<29
> +#define REGS_PRESENT_LDTR 1L<<30
> +#define REGS_PRESENT_TR 1L<<31
> +#define REGS_PRESENT_FS_BASE 1L<<32
> +#define REGS_PRESENT_GS_BASE 1L<<33
> +
> +#define REGS_PRESENT_GPREGS 0x000000000000FFFF
> +#define REGS_PRESENT_CRS 0x00000000003E0000
> +#define REGS_PRESENT_SEG 0x00000003FF000000
> +#define REGS_PRESENT_ALL 0x00000003FFFFFFFF
>
> #define MAX_REGIONS 3
> struct vmssdata {
> @@ -159,7 +195,7 @@ struct vmssdata {
> uint64_t memsize;
> ulong phys_base;
> int separate_vmem;
> - uint32_t *vcpu_regs;
> + uint64_t *vcpu_regs;
> uint64_t num_vcpus;
> vmssregs64 **regs64;
> };
> -- 2.40.4
2 months, 2 weeks