AMD64??????????? ??????????? - PowerPoint PPT Presentation

About This Presentation
Title:

AMD64??????????? ???????????

Description:

Title: PowerPoint Presentation Last modified by: kaneda Created Date: 1/1/1601 12:00:00 AM Document presentation format: Other titles – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 45
Provided by: webYlIs
Category:
Tags: amd64

less

Transcript and Presenter's Notes

Title: AMD64??????????? ???????????


1
AMD64??????????????????????
  • ?? ??

2
?????
  • AMD64???????????(??????)?????????????
  • ?????????????????????
  • 3000?????C?????????
  • ? ?????????????????????????????

3
??VMM???
  • ????????
  • c.f.) Xen????????100,000???
  • ? ???????(??)
  • ????????
  • ???????????
  • ??(???????????)
  • ????????(Cyclone?TAL?Haskell)?????

4
VMM?????
  • VGA???????????????????????
  • ?AMD64???????SimNow????

5
????????
  • (Part 1) AMD64 Secure Virtual Machine
  • (Part 2) VMM????

6
(Part 1)AMD64 Secure Virtual Machine
7
VMM???????????
  • ?????????
  • Sensitive?????
  • ???????
  • ???????
  • ?????????????VM???

8
IA-32??VMM???????
  • ?????????
  • Sensitive?????
  • ???????
  • ???????
  • ?????????????VM???
  • ?????????
  • ????????
  • ?????????
  • Shadow page table

?????? (c.f., VMware?Xen)
9
AMD64??VMM???????
  • ?????????
  • Sensitive?????
  • ???????
  • ???????
  • ?????????????VM???
  • VMRUN??
  • VMEXIT??
  • Nested paging

?????? (???????????)
10
VMRUN?????
  • VMM??VM???????????
  • ???????????????VM???????????????????VMM??????

VMM
VM
. VMRUN

11
VMM??VM?????????
????????
Virtual Machine Control Block
VM_HSAVE_AREA
RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

MSR
? ?????????????????????
12
VM??VMM?????????
VMEXIT?????
????????
Virtual Machine Control Block
VM_HSAVE_AREA
RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

RIP RAX
RSP CR0
CS CR3
DS CR4
ES IDTR
RFLAGS GDTR

MSR
13
????????
  • VM??????????????
  • VMEXIT???????????????????
  • or
  • VM?????????????
  • ?VMRUN????????

14
VMRUN??????
  • for ()
  • / VMM ??VM?????? /
  • VMRUN
  • / VMEXIT ??? /
  • switch (error code)
  • / sensitive?????????????? /

15
Nested Paging???
  • VM?????????????????????????
  • ???VM???????????????????????

0xffffffff
0
0xffffffff
0
VM???????
0
0x100
0
0x100
VM???????
?????????
0
0x10000
16
Nested Paging?????????? (1/4)
  • 2?????????????
  • VM??????? ? VM???????
  • VM??????? ? ?????????

VM???????
VM?CR3
VM???????
vPT
?????????
pPT
???CR3
17
Nested Paging?????????? (2/4)
  • 2?????????????
  • VM??????? ? VM???????
  • VM??????? ? ?????????

VM???????
VM?CR3
VM???????
vPT
?????????
pPT
vPT
???CR3
18
Nested Paging?????????? (3/4)
  • 2?????????????
  • VM??????? ? VM???????
  • VM??????? ? ?????????

VM???????
VM?CR3
VM???????
vPT
?????????
pPT
vPT
???CR3
19
Nested Paging?????????? (4/4)
  • 2?????????????
  • VM??????? ? VM???????
  • VM??????? ? ?????????

VM???????
VM?CR3
VM???????
vPT
?????????
pPT
vPT
???CR3
20
?????????????
  • CR0?CR3???????????????
  • VMRUN???????????????????????????????????

21
???????????
  • ????????????????VMEXIT???????????

VM???????
VM???????
vPT
EXCP
NPF
?????????
pPT
vPT
22
AMD64???????????
  • VMSAVE?VMLOAD
  • VMRUN?????????????????
  • ?)???????????????
  • VMMCALL
  • ????VM??VMM??????
  • STGI?CLGI
  • Global Interrupt Flag (GIF)???????
  • VMRUN??????

23
(Part 2) VMM????
24
VMM????????
  • VMM???????????????

???OS
???OS
VM
VM
VMM
???????(AMD64 SVM)
25
VMM??????
  • ??????????
  • OS????????????
  • VM???
  • Nested paging?????
  • ???OS???
  • VMRUN?????

????????????????????????
26
??????????
  • ?????????
  • ???????????????????????
  • ??????????????
  • CPU??????

27
VMM???
  • GRUB????VMM??????????????

1 MB
2 MB
0 MB
Reserved
VMM(text)
VMM(data)
28
???????????????????????
  • ???????????
  • 64??????
  • ???????01 GB??2????????????

0xffff830000000000
0xffffffffffffffff
0xffff830000000000
??????
0
1 GB
2 MB
??????
Reserved
VMM
29
??????????????
  • ?????????????????????
  • GRUB????????????????????
  • ???????????????????????

?????????
??????
1 MB
2 MB
0 MB
Reserved
VMM(text)
VMM(data)
30
CPU????
  • ???????
  • AMD?????????
  • ??????????
  • ??????????????????
  • VMM????????????????
  • ?????????????????
  • ?????????????MSR???????

31
VM???
  • VM?????????
  • ???OS????
  • Nested paging???
  • ????????

32
VM?????????
  • VM????????????????????????????????
  • ????????????

B 0x400000
B
VMM
VM??????
33
???OS????
  • ELF???????????????????VM??????????

???OS (text)
???OS (data)
B 0x400000
B
VMM
34
Nested Paging???
  • ????????????
  • VM??????? (x) ? ????????? (B x)
  • ? ????????VGA?????????

0
0x400000
???????
VM???????
B 0x400000
B
VMM
?????????
35
????????
  • ELF?????RIP?????

36
???OS???
  • VMRUN?????
  • VMEXIT???????????????

37
????VMM???
  • ????
  • I/O??????????
  • ?????????????
  • ? VM??Windows?Linux???????????????????????

38
????
  • Xen virtual machine monitor
  • ??????????????
  • ????????????????????????
  • Nested paging?????
  • Research Hypervisor
  • http//www.research.ibm.com/hypervisor/

39
???
  • AMD64??????????? (??????)?????????????
  • http//web.yl.is.s.u-tokyo.ac.jp/tvmm????
  • ??????????

40
???
41
SimNow
  • AMD64??????AMD64???????
  • ??????????????
  • ?)???????????????????
  • ????????????????

42
?????
  • ???????????????????
  • Long mode (64-bit mode, Compatibility mode),
    Legacy mode (Physical-address extension,
    Page-size extension),
  • ??????????????????????????????????????????????
  • Web???????????????

43
???? (1/2)
  • X86-64 Linux
  • http//www.x86-64.org
  • AMD64 Architecture Programmer's Manual
  • http//www.amd.com/us-en/Processors/TechnicalResou
    rces/0,,30_182_739_7044,00.html
  • Volume 3 General-Purpose and System
    Instructions, Section 15 Secure Virtual Machine

44
???? (2/2)
  • SimNow
  • http//developer.amd.com/login.aspx?msgsimnow
  • Xen virtual machine monitor
  • http//www.cl.cam.ac.uk/Research/SRG/netos/xen
  • Multiboot Specification Manual
  • http//www.gnu.org/software/grub/manual/multiboot
Write a Comment
User Comments (0)
About PowerShow.com