Page MenuHomeFreeBSD

md: use prestaged mfs_root
ClosedPublic

Authored by breno.leitao_gmail.com on May 30 2018, 7:53 PM.

Details

Summary

On PowerNV systems, the rootfs is passed through kexec, which loads the rootfs
into memory and set two fdt entries to describe where the file is located in
the memory;

I need to pass this memory region to the md device as a mfs_root, but, current
md driver does not support two things:

  • Just getting a pointer from an external (bootloader) memory. If I need to workaround it, I would need to declare a static array and memcopy from this external memory to this static variable.
  • The size of the image. The usage of mfs_root_end, which is not a pointer, seems to be not possible for this prestaged scenario.

This patch simply adds a new way to load mfs_root from memory.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ian accepted this revision.May 30 2018, 10:31 PM
This revision is now accepted and ready to land.May 30 2018, 10:31 PM
kib added a comment.Jun 1 2018, 4:19 PM

Who sets up the vars ?

sys/dev/md/md.c
185 ↗(On Diff #43165)

Why do you declare the vars volatile only to use __DEVOLATILE ugliness in the only place where they are used ?

ian added inline comments.Jun 1 2018, 4:34 PM
sys/dev/md/md.c
185 ↗(On Diff #43165)

Doing so was my advice, because I don't understand why volatile is used in the case where the data is in a module or compiled-in, so it seemed safest to me to just keep it for the new case as well.

Removing the volatile qualifier for mfs_root and mfs_root_size.

This revision now requires review to proceed.Jun 6 2018, 7:52 PM
kib accepted this revision.Jun 6 2018, 8:46 PM
kib added inline comments.
sys/dev/md/md.c
185 ↗(On Diff #43165)

I think volatile can be removed from the other case as well, in the follow-up commit.

This revision is now accepted and ready to land.Jun 6 2018, 8:46 PM
jhibbits accepted this revision.Jun 7 2018, 1:32 PM
This revision was automatically updated to reflect the committed changes.