SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Keeping Coherency on Arm:
Reborn
Julien Grall <julien.grall@arm.com>
Xen Developer Summit 2019
© 2019 Arm Limited
Xen and Arm
Over the past years, a few architectural compliance issues where iden fied in Xen:
Boot code
Memory subsystem
Guest memory subsystem
Atomics helper
2 © 2019 Arm Limited
Xen runs fine for me.
What are you talking about?
3 © 2019 Arm Limited
Xen and Arm - 2
Some of the recent examples:
4.11 failing to boot on Thunder-X
https://lists.xenproject.org/archives/html/xen-devel/2019-06/msg00184.html
32-bit guest intermi ently failing to boot
https://lists.xenproject.org/archives/html/xen-devel/2017-09/msg03191.html
Assump on of system registers layout
https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg01210.html
XSA-295
https://xenbits.xen.org/xsa/advisory-295.txt
4 © 2019 Arm Limited
Why following the ARM ARM?
Reliability
Upgrading to a newer processor without Xen modifica ons
5 © 2019 Arm Limited
Scope
This talk is focusing on boot and memory handling.
Focussing on architectural guarantees.
The Architecture Reference Manual is authorita ve.
6 © 2019 Arm Limited
Page-table updates
7 © 2019 Arm Limited
Page table entry
An entry can point to either a block mapping, transla on table or a page descriptor.
Note that whilst Arm supports different granules (4KB, 16KB and 64KB), Xen only supports 4KB.
8 © 2019 Arm Limited
Page table entry - 2
Each block mapping and page descriptor contains informa on such as:
Access permission: read, write, execute never
Memory type: Device or Normal memory
Shareability: non-shareable, inner-shareable, outer-shareable
Cacheability
Access flag
Con guous bit
Non-Global bit
9 © 2019 Arm Limited
TLB entries
TLB is a structure which caches results of the transla on table walks.
Each TLB entry
contains data from the page descriptor.
is tagged by ASID and VMID.
10 © 2019 Arm Limited
Address Space Iden fier
The Address Space Iden fier (ASID)
iden fies pages associated to a single address space (e.g. a process).
applies for EL1 (kernel) and EL0 (userspace) transla on regime.
provides a mechanism for changing process-specific table without requiring TLB invalida on.
is cached by the TLB entries.
11 © 2019 Arm Limited
Virtual Machine Iden fier
The Virtual Machine Iden fier (VMID)
iden fies the current virtual machine (Non-Secure EL1 & EL0).
has its own independent ASID space.
is cached by the TLB entries so no TLB invalida on is required when switching between VM.
12 © 2019 Arm Limited
Con guous bit
It indicates whether the entry is one of a number of adjacent page table entries that point to a
con guous output address range.
The number of adjacent entries depends on the page size.
For instance with 4KB, it will be 16 entries.
The TLB is allowed to cache a con guous region in a single entry.
13 © 2019 Arm Limited
Non-Global (nG) bit
The non-Global bit applies only for Stage-1 page tables.
nG 0 means the region is available for all ASIDs.
nG 1 means the region is restricted to the current ASID.
Global mapping can be invalidated by using any ASID.
14 © 2019 Arm Limited
Special considera ons apply to
transla on table updates ...
ARM ARM
15 © 2019 Arm Limited
Page table updates
Page table updates may require one to use a break-before-make sequence.
It is a sequence required by the ARM ARM to update page table entries.
Required for certain update of the tables.
Ensures that a coherent view of the page tables is used by all observers.
16 © 2019 Arm Limited
Why do we care?
Page tables are used by different observers
HW transla on table walkers
Observers may be accessing the page-tables during updates
17 © 2019 Arm Limited
What could happen?
The TLB may hold two mappings for the same address and might lead to
CONSTRAINED UNPREDICTABLE behavior and break coherency
A processor may see access erroneous data
This may be either of the TLB entry or an amalgama on of the two
A TLB conflict abort
18 © 2019 Arm Limited
When to use it
Changing the size of the block
Replacing a block mapping with a transla on table
Replacing a transla on table with block mapping
Se ng/Unse ng the con guous bit
Changing the output address if one of the entry is writeable
Changing the memory type
Changing the cacheability a ributes
Crea ng global entry that might overlaps non-global entries
19 © 2019 Arm Limited
When it is not necessary
Changing the permission of an entry
Changing the access flag
20 © 2019 Arm Limited
Steps
It is a 4 steps approach:
1. Replace the old entry with an invalid entry
2. Invalidate the cached old entries with a broadcas ng TLB invalida on instruc on
3. Wait for the comple on of the TLB instruc on with a dsb followed by an isb
4. Write the new entry
21 © 2019 Arm Limited
Accessing Memory with MMU off
22 © 2019 Arm Limited
Cache architecture
(Modified) Harvard architecture
Mul ple levels of caching (with snooping)
Separate I-cache and D-cache (no snooping between I and D)
Either PIPT or non-aliasing VIPT for D-cache
Mee ng at the Point of Unifica on (PoU)
Controlled by a ributes in the page tables
Memory type (normal, device)
Cacheability, Shareability
Two Enable bits (I and C)
Actually not really an Enable switch
More like a global ”a ribute override”
Generally invisible to normal so ware
With a few key excep ons
An example is wri ng with MMU turned off
23 © 2019 Arm Limited
Accessing memory with MMU off/on
Memory can be wri en with MMU off and read with MMU on
An example is preparing the page-tables at boot
What could possibly go wrong?
24 © 2019 Arm Limited
Accessing memory with MMU off/on
Memory can be wri en with MMU off and read with MMU on
An example is preparing the page-tables at boot
What could possibly go wrong?
Write access with MMU off are non-cacheable
The state of the cache may be unknown
It may contain dirty/clean lines
Cache can specula vely load a line
Without proper cache maintenance:
Data may be overwri en
Old data may be read
24 © 2019 Arm Limited
Arm64 Image boot protocol
The Arm64 Image specifica on describes the state of the processor at boot
MMU will be turned off
Loaded Image will be cleaned to Point Of Coherency (PoC)
The state of cache for the rest of the RAM is unknown
This includes BSS
25 © 2019 Arm Limited
Wri ng in the loaded image
The loaded image is cleaned to PoC
The cache may contain clean line for the region modified
Steps required
1. Write the data
2. Invalidate to PoC the region modified
Remove any clean line
Avoid to read the wrong data
26 © 2019 Arm Limited
Wri ng outside of the loaded image
The state of the cache is not known for any RAM but the loaded image
The cache may contain clean or dirty line for the region modified
Steps required
1. Invalidate to PoC the region modified
Remove any line
Prevent dirty cache line to be evicted
Avoid to overwrite the data
2. Write the data
3. Invalidate to PoC the region modified
Remove any line that were specula vely loaded
Avoid to read the wrong data
27 © 2019 Arm Limited
Implica ons for Xen
28 © 2019 Arm Limited
Implica ons for Xen
Parts of the boot and memory code needs to be rewri en.
Memory wri en with MMU off
Se ng up page-tables
29 © 2019 Arm Limited
Memory wri en with MMU off
At the moment, Xen is modifying the following part with MMU off
Zeroing BSS
Required because boot page-tables are part of it
This can be moved later if page-tables are moved out
Se ng-up ini al page-tables
Ini al page-tables are always writen with MMU off
Cache maintenance is required
30 © 2019 Arm Limited
Se ng up page-tables
A 1:1 mapping is necessary to turn the MMU on
It may clash with part of memory layout
The memory layout is sta c
At the moment, Xen is avoiding the clash by switching page-tables
This is not safe to do with the MMU is turned on
31 © 2019 Arm Limited
Se ng up page-tables
A 1:1 mapping is necessary to turn the MMU on
It may clash with part of memory layout
The memory layout is sta c
At the moment, Xen is avoiding the clash by switching page-tables
This is not safe to do with the MMU is turned on
The 1:1 mapping needs to be kept for
CPU bring-up
Suspend/Resume
31 © 2019 Arm Limited
Se ng up page-tables
A 1:1 mapping is necessary to turn the MMU on
It may clash with part of memory layout
The memory layout is sta c
At the moment, Xen is avoiding the clash by switching page-tables
This is not safe to do with the MMU is turned on
The 1:1 mapping needs to be kept for
CPU bring-up
Suspend/Resume
The memory layout needs to be dynamic to avoid clash
31 © 2019 Arm Limited
Upstreaming
The work is split in mul ple series as it is quite consequent.
Part of the page-tables update has been merged
Boot code reworked is under review
Comments, reviews, tes ng, help are more than welcomed
32 © 2019 Arm Limited
Ques ons?
33 © 2019 Arm Limited
The Arm trademarks featured in this presenta on are registered trademarks or
trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights
reserved. All other marks featured may be trademarks of their respec ve owners.
www.arm.com/company/policies/trademarks
© 2019 Arm Limited

Contenu connexe

Similaire à XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd

XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARMXPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARMThe Linux Foundation
 
Memory Management in Trading Platforms
Memory Management in Trading PlatformsMemory Management in Trading Platforms
Memory Management in Trading PlatformsIRJET Journal
 
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, Arm
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, ArmXPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, Arm
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, ArmThe Linux Foundation
 
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)Frazer Clement
 
HDT for Mainframe Considerations: Simplified Tiered Storage
HDT for Mainframe Considerations: Simplified Tiered StorageHDT for Mainframe Considerations: Simplified Tiered Storage
HDT for Mainframe Considerations: Simplified Tiered StorageHitachi Vantara
 
Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)Inductive Automation
 
Mainframe Fine Tuning - Fabio Massimo Ottaviani
Mainframe Fine Tuning - Fabio Massimo OttavianiMainframe Fine Tuning - Fabio Massimo Ottaviani
Mainframe Fine Tuning - Fabio Massimo OttavianiNRB
 
Cloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxCloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxemanamin19
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
Virtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfVirtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfChetanRaut43
 
z/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overviewz/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server OverviewzOSCommserver
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Web Services
 
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 FoldsA kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 FoldsMay Lau
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxAmanuelmergia
 
Management and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - SlidesManagement and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - SlidesSeveralnines
 

Similaire à XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd (20)

XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARMXPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
 
Memory Management in Trading Platforms
Memory Management in Trading PlatformsMemory Management in Trading Platforms
Memory Management in Trading Platforms
 
Large and Giant Pages
Large and Giant PagesLarge and Giant Pages
Large and Giant Pages
 
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, Arm
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, ArmXPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, Arm
XPDDS18: The Art of Virtualizing Cache Maintenance - Julien Grall, Arm
 
ch9_virMem.pdf
ch9_virMem.pdfch9_virMem.pdf
ch9_virMem.pdf
 
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
 
HDT for Mainframe Considerations: Simplified Tiered Storage
HDT for Mainframe Considerations: Simplified Tiered StorageHDT for Mainframe Considerations: Simplified Tiered Storage
HDT for Mainframe Considerations: Simplified Tiered Storage
 
Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)
 
Mainframe Fine Tuning - Fabio Massimo Ottaviani
Mainframe Fine Tuning - Fabio Massimo OttavianiMainframe Fine Tuning - Fabio Massimo Ottaviani
Mainframe Fine Tuning - Fabio Massimo Ottaviani
 
Cloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxCloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptx
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
Virtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfVirtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdf
 
Virtual Memory (1).pptx
Virtual Memory (1).pptxVirtual Memory (1).pptx
Virtual Memory (1).pptx
 
z/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overviewz/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overview
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
 
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 FoldsA kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
 
Cs416 08 09a
Cs416 08 09aCs416 08 09a
Cs416 08 09a
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptx
 
Management and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - SlidesManagement and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - Slides
 
Boston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptxBoston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptx
 

Plus de The Linux Foundation

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleThe Linux Foundation
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...The Linux Foundation
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...The Linux Foundation
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...The Linux Foundation
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather ReportThe Linux Foundation
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...The Linux Foundation
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxThe Linux Foundation
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...The Linux Foundation
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderThe Linux Foundation
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...The Linux Foundation
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...The Linux Foundation
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixThe Linux Foundation
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...The Linux Foundation
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DThe Linux Foundation
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsThe Linux Foundation
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...The Linux Foundation
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...The Linux Foundation
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...The Linux Foundation
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEThe Linux Foundation
 
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityXPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityThe Linux Foundation
 

Plus de The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityXPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
 

Dernier

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Dernier (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd

  • 1. Keeping Coherency on Arm: Reborn Julien Grall <julien.grall@arm.com> Xen Developer Summit 2019 © 2019 Arm Limited
  • 2. Xen and Arm Over the past years, a few architectural compliance issues where iden fied in Xen: Boot code Memory subsystem Guest memory subsystem Atomics helper 2 © 2019 Arm Limited
  • 3. Xen runs fine for me. What are you talking about? 3 © 2019 Arm Limited
  • 4. Xen and Arm - 2 Some of the recent examples: 4.11 failing to boot on Thunder-X https://lists.xenproject.org/archives/html/xen-devel/2019-06/msg00184.html 32-bit guest intermi ently failing to boot https://lists.xenproject.org/archives/html/xen-devel/2017-09/msg03191.html Assump on of system registers layout https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg01210.html XSA-295 https://xenbits.xen.org/xsa/advisory-295.txt 4 © 2019 Arm Limited
  • 5. Why following the ARM ARM? Reliability Upgrading to a newer processor without Xen modifica ons 5 © 2019 Arm Limited
  • 6. Scope This talk is focusing on boot and memory handling. Focussing on architectural guarantees. The Architecture Reference Manual is authorita ve. 6 © 2019 Arm Limited
  • 7. Page-table updates 7 © 2019 Arm Limited
  • 8. Page table entry An entry can point to either a block mapping, transla on table or a page descriptor. Note that whilst Arm supports different granules (4KB, 16KB and 64KB), Xen only supports 4KB. 8 © 2019 Arm Limited
  • 9. Page table entry - 2 Each block mapping and page descriptor contains informa on such as: Access permission: read, write, execute never Memory type: Device or Normal memory Shareability: non-shareable, inner-shareable, outer-shareable Cacheability Access flag Con guous bit Non-Global bit 9 © 2019 Arm Limited
  • 10. TLB entries TLB is a structure which caches results of the transla on table walks. Each TLB entry contains data from the page descriptor. is tagged by ASID and VMID. 10 © 2019 Arm Limited
  • 11. Address Space Iden fier The Address Space Iden fier (ASID) iden fies pages associated to a single address space (e.g. a process). applies for EL1 (kernel) and EL0 (userspace) transla on regime. provides a mechanism for changing process-specific table without requiring TLB invalida on. is cached by the TLB entries. 11 © 2019 Arm Limited
  • 12. Virtual Machine Iden fier The Virtual Machine Iden fier (VMID) iden fies the current virtual machine (Non-Secure EL1 & EL0). has its own independent ASID space. is cached by the TLB entries so no TLB invalida on is required when switching between VM. 12 © 2019 Arm Limited
  • 13. Con guous bit It indicates whether the entry is one of a number of adjacent page table entries that point to a con guous output address range. The number of adjacent entries depends on the page size. For instance with 4KB, it will be 16 entries. The TLB is allowed to cache a con guous region in a single entry. 13 © 2019 Arm Limited
  • 14. Non-Global (nG) bit The non-Global bit applies only for Stage-1 page tables. nG 0 means the region is available for all ASIDs. nG 1 means the region is restricted to the current ASID. Global mapping can be invalidated by using any ASID. 14 © 2019 Arm Limited
  • 15. Special considera ons apply to transla on table updates ... ARM ARM 15 © 2019 Arm Limited
  • 16. Page table updates Page table updates may require one to use a break-before-make sequence. It is a sequence required by the ARM ARM to update page table entries. Required for certain update of the tables. Ensures that a coherent view of the page tables is used by all observers. 16 © 2019 Arm Limited
  • 17. Why do we care? Page tables are used by different observers HW transla on table walkers Observers may be accessing the page-tables during updates 17 © 2019 Arm Limited
  • 18. What could happen? The TLB may hold two mappings for the same address and might lead to CONSTRAINED UNPREDICTABLE behavior and break coherency A processor may see access erroneous data This may be either of the TLB entry or an amalgama on of the two A TLB conflict abort 18 © 2019 Arm Limited
  • 19. When to use it Changing the size of the block Replacing a block mapping with a transla on table Replacing a transla on table with block mapping Se ng/Unse ng the con guous bit Changing the output address if one of the entry is writeable Changing the memory type Changing the cacheability a ributes Crea ng global entry that might overlaps non-global entries 19 © 2019 Arm Limited
  • 20. When it is not necessary Changing the permission of an entry Changing the access flag 20 © 2019 Arm Limited
  • 21. Steps It is a 4 steps approach: 1. Replace the old entry with an invalid entry 2. Invalidate the cached old entries with a broadcas ng TLB invalida on instruc on 3. Wait for the comple on of the TLB instruc on with a dsb followed by an isb 4. Write the new entry 21 © 2019 Arm Limited
  • 22. Accessing Memory with MMU off 22 © 2019 Arm Limited
  • 23. Cache architecture (Modified) Harvard architecture Mul ple levels of caching (with snooping) Separate I-cache and D-cache (no snooping between I and D) Either PIPT or non-aliasing VIPT for D-cache Mee ng at the Point of Unifica on (PoU) Controlled by a ributes in the page tables Memory type (normal, device) Cacheability, Shareability Two Enable bits (I and C) Actually not really an Enable switch More like a global ”a ribute override” Generally invisible to normal so ware With a few key excep ons An example is wri ng with MMU turned off 23 © 2019 Arm Limited
  • 24. Accessing memory with MMU off/on Memory can be wri en with MMU off and read with MMU on An example is preparing the page-tables at boot What could possibly go wrong? 24 © 2019 Arm Limited
  • 25. Accessing memory with MMU off/on Memory can be wri en with MMU off and read with MMU on An example is preparing the page-tables at boot What could possibly go wrong? Write access with MMU off are non-cacheable The state of the cache may be unknown It may contain dirty/clean lines Cache can specula vely load a line Without proper cache maintenance: Data may be overwri en Old data may be read 24 © 2019 Arm Limited
  • 26. Arm64 Image boot protocol The Arm64 Image specifica on describes the state of the processor at boot MMU will be turned off Loaded Image will be cleaned to Point Of Coherency (PoC) The state of cache for the rest of the RAM is unknown This includes BSS 25 © 2019 Arm Limited
  • 27. Wri ng in the loaded image The loaded image is cleaned to PoC The cache may contain clean line for the region modified Steps required 1. Write the data 2. Invalidate to PoC the region modified Remove any clean line Avoid to read the wrong data 26 © 2019 Arm Limited
  • 28. Wri ng outside of the loaded image The state of the cache is not known for any RAM but the loaded image The cache may contain clean or dirty line for the region modified Steps required 1. Invalidate to PoC the region modified Remove any line Prevent dirty cache line to be evicted Avoid to overwrite the data 2. Write the data 3. Invalidate to PoC the region modified Remove any line that were specula vely loaded Avoid to read the wrong data 27 © 2019 Arm Limited
  • 29. Implica ons for Xen 28 © 2019 Arm Limited
  • 30. Implica ons for Xen Parts of the boot and memory code needs to be rewri en. Memory wri en with MMU off Se ng up page-tables 29 © 2019 Arm Limited
  • 31. Memory wri en with MMU off At the moment, Xen is modifying the following part with MMU off Zeroing BSS Required because boot page-tables are part of it This can be moved later if page-tables are moved out Se ng-up ini al page-tables Ini al page-tables are always writen with MMU off Cache maintenance is required 30 © 2019 Arm Limited
  • 32. Se ng up page-tables A 1:1 mapping is necessary to turn the MMU on It may clash with part of memory layout The memory layout is sta c At the moment, Xen is avoiding the clash by switching page-tables This is not safe to do with the MMU is turned on 31 © 2019 Arm Limited
  • 33. Se ng up page-tables A 1:1 mapping is necessary to turn the MMU on It may clash with part of memory layout The memory layout is sta c At the moment, Xen is avoiding the clash by switching page-tables This is not safe to do with the MMU is turned on The 1:1 mapping needs to be kept for CPU bring-up Suspend/Resume 31 © 2019 Arm Limited
  • 34. Se ng up page-tables A 1:1 mapping is necessary to turn the MMU on It may clash with part of memory layout The memory layout is sta c At the moment, Xen is avoiding the clash by switching page-tables This is not safe to do with the MMU is turned on The 1:1 mapping needs to be kept for CPU bring-up Suspend/Resume The memory layout needs to be dynamic to avoid clash 31 © 2019 Arm Limited
  • 35. Upstreaming The work is split in mul ple series as it is quite consequent. Part of the page-tables update has been merged Boot code reworked is under review Comments, reviews, tes ng, help are more than welcomed 32 © 2019 Arm Limited
  • 36. Ques ons? 33 © 2019 Arm Limited
  • 37. The Arm trademarks featured in this presenta on are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights reserved. All other marks featured may be trademarks of their respec ve owners. www.arm.com/company/policies/trademarks © 2019 Arm Limited