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
79
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
110
あなたの知らないバージョン命名規則
sat
PRO
3
920
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
74
Machine Check Exception
sat
PRO
2
71
バイナリダンプの模様を読む
sat
PRO
0
110
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
110
114-ファイルのshallow_copy.pdf
sat
PRO
2
62
113-Btrfsのスナップショット.pdf
sat
PRO
0
47
Other Decks in Technology
See All in Technology
Rust で関数型ドメインモデリング
takonda
0
140
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
930
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
310
夫婦で子育てするための育児標準化
codmoninc
PRO
0
410
DBについての基礎説明(MySQL編) - コロプラ 2026年度 新卒研修
colopl
0
110
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
350
大型犬好きによるPugの紹介
yamanoku
1
160
Browser Spec: Testing Hotwire with Ruby
takahashim
1
130
How to Design Configuration for Rails Applications
willnet
1
820
Optunaの最新リリースv5.0について
pfn
PRO
0
120
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
730
会社説明資料
persolserverworks
0
9.8k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Mobile First: as difficult as doing things right
swwweet
225
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Limits of Empathy - UXLibs8
cassininazir
2
720
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Being A Developer After 40
akosma
92
590k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Paper Plane
katiecoart
PRO
5
54k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Designing Experiences People Love
moore
143
24k
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