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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
76
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
100
あなたの知らないバージョン命名規則
sat
PRO
3
920
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
70
Machine Check Exception
sat
PRO
2
68
バイナリダンプの模様を読む
sat
PRO
0
110
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
100
114-ファイルのshallow_copy.pdf
sat
PRO
2
59
113-Btrfsのスナップショット.pdf
sat
PRO
0
43
Other Decks in Technology
See All in Technology
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
2
4.2k
Kernel testing frameworks
ennael
PRO
0
110
The seven pitfalls of AI (revised version)
ufried
0
280
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
購入ドメインでの課題と取り組み
ykagano
0
150
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
190
LLM機能を自作して分かるSnowflake Cortex AIの強み
nayuts
0
310
自分で立ててみるLLMサービス
y_sera15
0
140
メルペイ 会計システム概要と歴史
mewuto
0
190
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
140
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Agile that works and the tools we love
rasmusluckow
331
22k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
530
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
310
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Statistics for Hackers
jakevdp
799
230k
Building Applications with DynamoDB
mza
96
7.2k
Automating Front-end Workflow
addyosmani
1369
210k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
930
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