Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
仮想アドレスと物理アドレスの対応を実機確認してみよう
Search
Satoru Takeuchi
PRO
June 15, 2024
Technology
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
仮想アドレスと物理アドレスの対応を実機確認してみよう
以下動画のテキストです
https://youtu.be/o1gRyW8U3dA
Satoru Takeuchi
PRO
June 15, 2024
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
74
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
100
あなたの知らないバージョン命名規則
sat
PRO
3
910
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
67
Machine Check Exception
sat
PRO
2
68
バイナリダンプの模様を読む
sat
PRO
0
100
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
96
114-ファイルのshallow_copy.pdf
sat
PRO
2
59
113-Btrfsのスナップショット.pdf
sat
PRO
0
42
Other Decks in Technology
See All in Technology
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
410
【Findyテック文化祭ワークショップ】新卒エンジニア&採用担当と作る、 なりたい姿と今やるべき一歩
dip_tech
PRO
0
150
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
110
企業の現実世界をグラフで写し取る
sansantech
PRO
0
240
The seven pitfalls of AI (revised version)
ufried
0
190
営業オントロジーの作り方と、エージェントからの辿り方 ── ナレッジワークの現場から
kworkdev
PRO
1
230
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
leveragestech
PRO
0
130
セルフサービスのオブザーバビリティ基盤をOpenTelemetryで作る / Building a Self-Service Observability Platform with OpenTelemetry
ymotongpoo
3
510
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
340
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
190
Codex概要
ymiya55
0
220
『GOエコノミー 』(相乗りサービス) におけるスペック駆動開発
mot_techtalk
1
190
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Optimizing for Happiness
mojombo
378
71k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Claude Code のすすめ
schroneko
67
230k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Statistics for Hackers
jakevdp
799
230k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
260
Transcript
仮想アドレスと 物理アドレスの対応を 実機確認してみよう Jun. 15th, 2024 Satoru Takeuchi X: satoru_takeuchi
1
はじめに • プロセスの仮想アドレスと物理アドレスがどう対応しているかはユーザ空間から確 認できる • 実際に実機確認してみよう • 環境 ◦ CPUアーキテクチャ:
x86_64 ◦ カーネル: 5.15.0-107-generic • 📝 x86_64以外でできるかどうかは確認していないので知らないです 2
確認方法 • /proc/<pid>/pagemapに各プロセスのページテーブル相当の情報がある • ページ(4KiB)単位で8バイトのデータがメモリアドレス0から並んでいる • 主なデータ: ◦ bit 0
~ bit 54: page frame number: 4KiBをかけると物理メモリアドレスになる ◦ bit 63: present bit • 読み出すにはCAP_SYS_PTRACE capabilityが必要 ◦ Ubuntu 22.04.5のデフォルト設定なら rootならOK ◦ 権限が無ければzero fillされる • 📝 詳細は man procfsを参照 3
実機確認 • vp-conversion.py ◦ sudo ./vp-conversion.py <pid> <仮想アドレス> • 仮想端末上で動いているbashの実行ファイルをmapしている領域がどの物理アド
レスにマップされているか確認 ◦ cat /proc/$$/maps を実行してbashのメモリマップを確認 ◦ sudo ./vp-conversion.py $$ <仮想アドレス> を実行してアドレスの対応を見る • 📝 ある瞬間にページがメモリ上にあったとしても次の瞬間には無くなっているかも しれない。それはまた別動画で 4
まとめ • /proc/<pid>/pagemapを読めばプロセスの仮想アドレスと物理アドレスの対応がわ かる • かっこいい 5