aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorAaron Sawdey <acsawdey@linux.vnet.ibm.com>2020-02-18 14:16:07 -0600
committerOliver O'Halloran <oohall@gmail.com>2020-02-24 12:56:09 +1100
commitf123417068e51842004bdc047c8c5107b70442ef (patch)
tree626c102cd91fc556f0bcdbbf73ebc7866a31ec9e /external
parentab1b05d29f5e9715a754a68bcb565e29cee0e48a (diff)
downloadskiboot-f123417068e51842004bdc047c8c5107b70442ef.zip
skiboot-f123417068e51842004bdc047c8c5107b70442ef.tar.gz
skiboot-f123417068e51842004bdc047c8c5107b70442ef.tar.bz2
external/mambo: support mambo COW mode for PMEM disk
I've added support in mambo's "memory mmap" command to have a "cow" mode which just uses MAP_PRIVATE instead of MAP_SHARED on the file so that writes to the memory region are not sent back to the file. This allows multiple mambo instances to share the same filesystem image. This is implemented by having a PMEM_MODES environment variable. If this is set, it is expected to contain a comma separated list of modes (rw or cow) for the list of files in PMEM_DISK. If there are fewer modes than files, the remaining files default to "rw". Signed-off-by: Aaron Sawdey <acsawdey@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'external')
-rw-r--r--external/mambo/skiboot.tcl13
1 files changed, 12 insertions, 1 deletions
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 8d1cfc6..07c38ab 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -300,20 +300,31 @@ set pmem_sizes ""
if { [info exists env(PMEM_VOLATILE)] } {
set pmem_sizes [split $env(PMEM_VOLATILE) ","]
}
+set pmem_modes ""
+if { [info exists env(PMEM_MODES)] } {
+ set pmem_modes [split $env(PMEM_MODES) ","]
+}
set pmem_root [mysim of addchild $root_node "pmem" ""]
mysim of addprop $pmem_root int "#address-cells" 2
mysim of addprop $pmem_root int "#size-cells" 2
mysim of addprop $pmem_root empty "ranges" ""
# Start above where XICS normally is at 0x1A0000000000
set pmem_start [expr 0x20000000000]
+set pmem_file_ix 0
foreach pmem_file $pmem_files { # PMEM_DISK
set pmem_file [string trim $pmem_file]
set pmem_size [file size $pmem_file]
- if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file rw}]} {
+ if { [expr [llength $pmem_modes] > $pmem_file_ix] } {
+ set pmem_mode [lindex $pmem_modes $pmem_file_ix]
+ } else {
+ set pmem_mode "rw"
+ }
+ if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file $pmem_mode}]} {
puts "ERROR: pmem: 'mysim mmap' command needs newer mambo"
exit
}
set pmem_start [pmem_node_add $pmem_root $pmem_start $pmem_size]
+ set pmem_file_ix [expr $pmem_file_ix + 1]
}
foreach pmem_size $pmem_sizes { # PMEM_VOLATILE
set pmem_start [pmem_node_add $pmem_root $pmem_start $pmem_size]