Debugging kext in lldb. Reading cpu_data_t offset 0x18 using %gs base address.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=XJ9+6R+Db1nDjc1/skFkYT6sB0EomS8BjZcskfbWC7k=; b=EM4usWT6nAQRDuo6ANJmPQENLqZnRNBF38MZioIcpwJLMb37l5YMVOL7ysRVwABIK4 EbbdxSetoM2AJ+5KV4LxKclvff6LztlTktm1GqywVOhovSjUj77l1Bx+bHle0dyveGCt IjvRBF/GKLtcR9cRfDZp8UhQdTmwiMYBwRBsscqaiXKNnAMWduMWLP/WVy2XLsedQ7Cr MXxA0unCg4qzCR1kEADuT3DOkl6qGvwwQjKnpmeCAPvtJD2vbOy2ss4G0w3Vn3lBJFoq a3mJHJte/7h+5CB3agecrrBoXYAhx95CSpLLUIudNIuhMwkKiLMGZW6iNCxCBS2UYSYQ ffWQ== Hi, I was wondering if you could give me some direction in lldb issue I'm currently struggling with ... I've got a kext that produce panic for "preemption level -1" in macOS Mojave (10.14), and I'd like to further investigate the issue. It looks like preemption_level is read from the per-cpu data which that be parsed using cpu_data_t struct (defined in xnu cpu_data.h). However, it seems like the memory is inaccessible using memory read of %gs+0x18: register read gs gs = 0x000000009da40000 memory read 0x000000009da40018 error: kdp read memory failed (error 4) perhaps there is another way of reading the cpu data ? I also tried another approach by looking how could the preemption level be negative. I guess that when using spin lock, it blocks the preemption of the cpu... however, I've tried to look for such locks in all threads (using `showallstacks` lldb command) but couldn't find any. Perhaps do you know better way to checking in lldb if spin lock is currently active on any cpu ? Thanks, Zohar _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Zohar Cabeli