There was an additional 7 bytes of compiler-inserted padding at the
end of the structure visible via 'ptype /o' in gdb.
Obtained from: CheriBSD
Differential D25867
Correct padding length for RISC-V PCPU data. Authored by jhb on Jul 28 2020, 6:17 PM. Tags None Referenced Files
Subscribers
Details
There was an additional 7 bytes of compiler-inserted padding at the Obtained from: CheriBSD
Diff Detail
Event TimelineComment Actions Before: (gdb) ptype /o struct pcpu
/* offset | size */ type = struct pcpu {
/* 0 | 8 */ struct thread *pc_curthread;
/* 8 | 8 */ struct thread *pc_idlethread;
/* 16 | 8 */ struct thread *pc_fpcurthread;
/* 24 | 8 */ struct thread *pc_deadthread;
/* 32 | 8 */ struct pcb *pc_curpcb;
/* 40 | 16 */ void *pc_sched;
/* 48 | 8 */ uint64_t pc_switchtime;
/* 56 | 4 */ int pc_switchticks;
/* 60 | 4 */ u_int pc_cpuid;
/* 64 | 8 */ struct {
/* 64 | 8 */ struct pcpu *stqe_next;
/* total size (bytes): 8 */
} pc_allcpu;
/* 72 | 8 */ struct lock_list_entry *pc_spinlocks;
/* 80 | 40 */ long pc_cp_time[5];
/* 120 | 8 */ struct device *pc_device;
/* 128 | 16 */ void *pc_netisr;
/* 136 | 4 */ int pc_unused1;
/* 140 | 4 */ int pc_domain;
/* 144 | 16 */ struct rm_queue {
/* 144 | 8 */ struct rm_queue * volatile rmq_next;
--Type <RET> for more, q to quit, c to continue without paging--
/* 152 | 8 */ struct rm_queue * volatile rmq_prev;
/* total size (bytes): 16 */
} pc_rm_queue;
/* 160 | 8 */ uintptr_t pc_dynamic;
/* 168 | 8 */ uint64_t pc_early_dummy_counter;
/* 176 | 8 */ uintptr_t pc_zpcpu_offset;
/* 184 | 8 */ struct pmap *pc_curpmap;
/* 192 | 4 */ uint32_t pc_pending_ipis;
/* 196 | 4 */ uint32_t pc_hart;
/* 200 | 49 */ char __pad[49];
/* XXX 7-byte padding */
/* total size (bytes): 256 */
}after: (gdb) ptype /o struct pcpu
/* offset | size */ type = struct pcpu {
/* 0 | 8 */ struct thread *pc_curthread;
/* 8 | 8 */ struct thread *pc_idlethread;
/* 16 | 8 */ struct thread *pc_fpcurthread;
/* 24 | 8 */ struct thread *pc_deadthread;
/* 32 | 8 */ struct pcb *pc_curpcb;
/* 40 | 8 */ void *pc_sched;
/* 48 | 8 */ uint64_t pc_switchtime;
/* 56 | 4 */ int pc_switchticks;
/* 60 | 4 */ u_int pc_cpuid;
/* 64 | 8 */ struct {
/* 64 | 8 */ struct pcpu *stqe_next;
/* total size (bytes): 8 */
} pc_allcpu;
/* 72 | 8 */ struct lock_list_entry *pc_spinlocks;
/* 80 | 40 */ long pc_cp_time[5];
/* 120 | 8 */ struct device *pc_device;
/* 128 | 8 */ void *pc_netisr;
/* 136 | 4 */ int pc_unused1;
/* 140 | 4 */ int pc_domain;
/* 144 | 16 */ struct rm_queue {
/* 144 | 8 */ struct rm_queue * volatile rmq_next;
--Type <RET> for more, q to quit, c to continue without paging--
/* 152 | 8 */ struct rm_queue * volatile rmq_prev;
/* total size (bytes): 16 */
} pc_rm_queue;
/* 160 | 8 */ uintptr_t pc_dynamic;
/* 168 | 8 */ uint64_t pc_early_dummy_counter;
/* 176 | 8 */ uintptr_t pc_zpcpu_offset;
/* 184 | 8 */ struct pmap *pc_curpmap;
/* 192 | 4 */ uint32_t pc_pending_ipis;
/* 196 | 4 */ uint32_t pc_hart;
/* 200 | 56 */ char __pad[56];
/* total size (bytes): 256 */
}Comment Actions
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||