Porting FreeBSD on Xen on ARM
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Subtitle |
| |
Title of Series | ||
Number of Parts | 199 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/32608 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
ArmGoodness of fitBitMiniDiscPoint (geometry)Execution unitData storage deviceResultantKernel (computing)Metropolitan area networkDot productRoundness (object)Gamma functionInterface (computing)InformationMereologySimulation1 (number)Line (geometry)Extension (kinesiology)Computer-generated imageryInsertion lossContext awarenessVideo gameOrder (biology)Menu (computing)SummierbarkeitSubsetState of matterMonoidSpeech synthesisWeightBefehlsprozessorText editorNichtlineares GleichungssystemView (database)Functional (mathematics)Greatest elementUsabilityPlateau's problemPhysical systemVertex (graph theory)Dependent and independent variablesAutonomic computingSoftwareINTEGRALWordBootingEntire functionWeb browserRing (mathematics)Serial portEvent horizonComputer fileSystem callLatent heatCache (computing)VirtualizationComputer hardwareSpacetimeAttribute grammarComputer architectureBuffer solutionSemiconductor memoryDifferent (Kate Ryan album)Pivot element32-bitMechanism designMobile appFile systemDescriptive statisticsDevice driverArithmetic progressionProcess capability indexInterrupt <Informatik>Interactive televisionServer (computing)Virtual machineSeitentabelleAddress spaceFront and back endsCommunications protocolPointer (computer programming)Game controllerType theoryOperating systemNumberLecture/ConferenceXML
07:25
Right angleSystem callCodeCASE <Informatik>Process capability indexContent (media)BefehlsprozessorDenial-of-service attackForm (programming)Coefficient of determinationKey (cryptography)Semiconductor memoryShared memoryBootingTable (information)Interrupt <Informatik>DialectVirtual machineEvent horizonSource codeJSON
08:58
Physical systemKeyboard shortcutAttribute grammarSemiconductor memoryCodeMobile appOperating systemCore dumpLatent heatCache (computing)Web browserAddress spaceStapeldateiWebsiteQuery languageCodeLoginWordMenu (computing)Data miningMusical ensembleOrder (biology)XML
10:36
Letterpress printingDevice driverExecution unitNatural languagePhysicalismIn-System-ProgrammierungSystem callString (computer science)Event horizonBlock (periodic table)Video game consoleDatabaseCore dumpSoftwareData structureTable (information)Lecture/Conference
11:58
Order (biology)CASE <Informatik>Form (programming)Dependent and independent variablesExecution unitNetwork topologyUniform boundedness principleMenu (computing)Slide ruleDirected graphVotingPhysical systemComputer hardwareCommunications protocolFile systemDevice driverData structureSoftwareWhiteboardBootingDifferent (Kate Ryan album)Hard disk driveBlock (periodic table)BitCodeLecture/Conference
14:18
Direction (geometry)Complete metric spaceWhiteboardInterface (computing)Device driverBuildingComputer fileTable (information)EmailCodeElectronic mailing listKeyboard shortcutDifferent (Kate Ryan album)Configuration spaceSemiconductor memoryType theoryCuboidComputing platformMereologySerial port2 (number)Patch (Unix)Binary codeGame controllerEndliche ModelltheorieServer (computing)Attribute grammarCache (computing)ArmAddress spacePhysicalismNumberCellular automatonMathematicsComputer hardwareEvent horizonVirtualizationWeb pageInterrupt <Informatik>Computer clusterFunctional (mathematics)Information securityBootingOnline helpNetwork topologyBefehlsprozessorDampingSoftware developerOcean currentVideo game consoleLine (geometry)Demo (music)Finite differenceOrder (biology)Sheaf (mathematics)Uniformer RaumLevel (video gaming)Form (programming)Multiplication signOperating systemPhysical systemMultiplicationOpen sourceView (database)Point (geometry)PressureDirected graphContext awarenessState of matterDataflowBlogGroup actionFood energyFrictionGradientRule of inferenceAreaTraffic reportingExecution unitSpacetimeResultantWordSet (mathematics)Open setBus (computing)Right angleEvoluteFrame problemCASE <Informatik>Boss CorporationSinc functionResidual (numerical analysis)Survival analysisAmenable groupMathematical singularityTheoryKeilförmige AnordnungTotal S.A.Series (mathematics)TupleDensity of statesInstance (computer science)Service-oriented architectureSystem callThomas BayesGraph coloringSampling (statistics)OntologySummierbarkeitDigital photographyQuicksortFunction (mathematics)FrequencyRow (database)WeightCategory of beingFluidInheritance (object-oriented programming)PlanningFigurate numberMusical ensembleNeuroinformatikLecture/Conference
Transcript: English(auto-generated)
00:01
So, good morning everyone. So, I'm working for Linao on Citrix on Xenon Arm. During this talk, I will explain a bit what is Xenon Arm, and explaining what is the requirements to be able to start a new guest, to have a new guest on U.S. supporting on Xenon Arm.
00:21
Just giving some example with Freebase Day. So, I've started to port Freebase Day last September, and I will be able to show you that it's very easy to port a new guest. If Arm is already supported on Xenon Arm. So, what is Xen? Xenon is a type one app browser.
00:41
That means that Xenon is running directly on the bare metal. We support ARM 27 on ARM V8, so with virtualization extensions. We already have a bunch of hardware support, so we start support with Phasmodel on Versatile Express Cortex-A15.
01:02
We did some port on different board, on that board, all winner at 2021. TI OMAP5 on also on some servers. So, apply micro-engine, it's ARM 64-bit servers, on Calcida Midway, it's ARM 32-bit server. And there is new port server
01:21
that would be in Xenon in the next few months. So, as I said, Xenon is directly running on bare metal. Well, every operating system is a guest. So, the first guest we start is DOM0. DOM0 is the main guest which has every device,
01:40
which is on the device, and under the creation of every guest, removing every guest. So, we manage the browser. When we start a DOMU, the DOMU doesn't have any emulation, so he needs to have a parameterized driver. So, the parameterized driver is used for block, so for the hard drive, and for the network.
02:00
So, there is a front-end, so a driver in the guest, which talk to the DOM0, will have the backend. So, it's a ring buffer. So, the guest will just ask the DOM0 to have some data, and DOM0 will just give the data to the guest. And to be able to say there is an event,
02:23
we have some event channel, it's then events to say there is a new information, so you can read the ring buffer. So, there are much selector. On ARM, so, everything is described by the device way. Device way is a hierarchical description of the hardware.
02:42
So, it's displaying what is the network card, what is the memory region, what is the interaction for the interrupt. It describes also few hardware which will be used by Xen, the general timer. The geek, it's the internal controller on the MMU to be able to have page table.
03:05
So, as you can see, Xen is directly designed for ARM architecture. That means that Xen will just get the general timer, get the internal controller, the MMU,
03:21
and it will just hide a few hardware, and just give every hardware to DOM0. So, DOM0 will be as another guest running as bare metal, but it will just see a subset of hardware. So, we can hide some device like the serial port
03:42
which is used by Xen, the ARM MMU, et cetera. So, if we want to put a guest on Xen on ARM, there is few requirements. The first thing is guest boot IVI. So, I will explain quick after, so I'm just giving the requirements right now.
04:03
The second thing is to have a device way support, so to be able to describe the hardware. We request some specific memory attributes. Of course, if you want to create a guest, you need to have pivot drivers to be able to have the network on file system on a disk. You also need to have a copy of Xen Pubbikid Earth.
04:23
So, Xen Pubbikid Earth is the interface between the guest on Xen with the Power Virtual protocol. So, you just need to copy this on your OS and use it, so you will be able to communicate with the other guests on DOM0 on the app browser.
04:44
The main important file is rsharm, which provides the packer functions. So, how do you call function on mechanisms to then the mechanism to call to ask for memory, to ask for, I don't know,
05:01
to ask for everything to the app browser. So, the guest boot IVI. So, this is the interface to boot virtual machine. Without that, you won't be able to boot the guest on ARM. So, we already support Linux that has emerged. So, Linux has created a boot protocol,
05:24
specifically for Linux. The first thing is that there is specific values on different registers. So, r0 register always contain zero. r1 will contain FFFF. r2 will contain a pointer to the device three.
05:42
So, this is the address of the start of the device three. The MMU on the data cache will be disabled. So, the start will start without space shabbles. On the instantiation cache, it's in the state we can't say if we'll be enabled or disabled. This is only the support for Linux dead image.
06:03
On, there is also the support for ELF, which is in progress. I think, so, when I did the port for Freebase Day, I chose to use the same value as Linux dead image, but it's not fixed on, we still need to decide for the next release of then, if we will use the same boot API.
06:22
If you want to start a second ICPU, we use PCI. So, it's a firmware interface to say, I want to boot the CPU. I want to shut down the CPU. I want to suspend, to resume, et cetera. So, we use a common protocol and we don't need specific hardware bring up.
06:51
So, once you have start your guests, you need to discover the hardware. So, to discover the hardware, we use device tray. Then, when you will create a new guest,
07:03
it will create, generate a small device tray, which contain some information like the CPUs, so the number of CPUs, the memory, where is the memory, the timer, the gig, so the entire controller, and other nodes that describe what needs to be done for Foxen.
07:41
So, Foxen we use to boot a guest. So, the first thing, important thing is that we describe what is the model. So, we choose to create a new machine that is called then VM. So, we create a chosen node, which contains the Linux boot tags. Here, it's the different CPUs.
08:02
So, in this case, we have two CPUs that is Corte-F15. This is the node to describe the PICI. So, we say what is the method to call PICI. What is how to start a CPU, how to shut down a CPU.
08:26
Here, we describe the memory regions. So, we say it starts at 800 and we have 32 megabyte of RAM. Here, we describe the gig, the timer.
08:41
This is the Linux which is created for XEN. So, we ask for an interrupt. So, the interrupt will be used for the event channel and the region will be used for ground tables. Ground tables is a way to share memory between guests. So, all these values should be used by your OS.
09:07
If your OS decides to hard code the value, even if for now we have recorded the value in XEN, we should not assume that it will be through for the next release of XEN. So, this can be modified and the guest
09:21
should only rely on the device tray. All the binding was decided on with, there is a working room to decide what is a core binding. So, we don't decide, we don't choose how our own binding is, was already used by some operating system.
09:41
So, when you have start to have your, discover your hardware, you need to have, when you need to talk with XEN, you need to have some memory attributes, specific memory attributes. The first thing is before calling any epochal, so calling the app browser, you must enable the MMU on the data instruction cache, on the instruction cache.
10:00
Without that, as we use cache in, as we enable caching XEN, when the data will be shared, we can lose data, it's an arm-wrecker amount to have the same cache memory attributes between the app browser on the operating system.
10:21
So, we also asked for the RAM which is used by XEN. So, when you ask for an epochal, you need to give sometimes a physical address or a virtual address of the guest. So, this memory should be right through and right back. If it's not right through and right back, your guest can maybe crash and you will never see the data
10:41
from XEN or from the guest. The next thing is, so you have the memory, you have the device tray, but you can't print anything for now because you didn't have any PV drivers. So, there is two important things to the PV driver. So, we can divide it with the XEN core structure.
11:01
So, it's the main things used by every driver. So, there is XEN star, there is a ground table on the event channel. So, XEN star, it's a way to, it's like a database which contain string data to know where is live in, for example, your console, where is, what is your physical address,
11:22
what is the event channel, et cetera. The ground table is used for sharing data, as I said earlier. On the event channel is used to send an event to the guests, or the guests send an event to dump their own and other guests.
11:41
Then, when you have the XEN core architecture, you need to create device. The first device, the most important thing is to have the console. If you want to debug, if you want to see if your guest has started. So, you need to create the console. Then, you need to have block on network if you want to have normal guests.
12:01
So, with these three drivers, you can start a guest on having, doing nearly everything. If you want to have graphics, you can create the frame buffer drivers. But in this case, we need to recompile the QEMU. It's not on, yes.
12:26
The protocol is common with X86. We don't, I think it's a bit different for block protocol, but every structure is the same.
12:46
I think he's using the X86-64. So, all these driver, you don't need to rewrite the driver you can directly use the driver available in BSE, Lissent, in FreeBSD. So, you just need to,
13:02
you have the command code and you just need to put the FreeBSD-specific things to your OS. So, with the device tree, with the memory, and with Zenpv drivers, you can have a normal guest. So, you can start your guest on every board supported by Zen. So, you don't need to support the hardware
13:23
from the board. Now, if you want to handle, to boot your guest as DOM0, you need different things. This is a QEMU I showed you a few minutes ago. As you see, DOM0 has all the drivers.
13:45
So, you don't use hardware, you don't use PV drivers. So, if you directly access to the hard drive or to the network for the file system. So, in this case, so as I said, it's a first guest to boot.
14:01
So, every device is given to DOM0, is assigned to DOM0. There is some device which is used by Zen. For example, the serial, if you want to have consoling Zen. The IOMMU, if you want to support, to protect your device to,
14:21
sorry. Sorry. The IOMMU, if you want to support your, to give your device to DOM0 or to another guest, the timer on the geek also is used by Zen. And there is some device which choose to blacklist
14:42
in Zen. For instance, on the QV board, all the UARTs use the same page. So, if you give a page to DOM0, if you give, you can only give page by page to DOM0. You can't say, I want to give only this part of the page.
15:04
So, we choose for security issue to not give this UART for DOM0 now. So, DOM0, as the other guest, should use the device tree. So, if you don't use the device tree on your OS, assume that the hardware, for instance, on the handle, you have the serial ports.
15:21
But the serial port does not exist. It will likely crash. So, you need to have an OS that is able to say, to discover the hardware via the device tree. So, this is the main requirements to have your OS. When I started Freebase, to plot Freebase then,
15:42
there was already a support for LIX86, PVHVM. So, I didn't start from scratch. The support for ARM was still experimental. That means that most of the thing is made, but there is some missing SMP support for Cortex-A15 or missing some device rebinding.
16:04
So, I start the ports in September. I sent a patch here a few weeks ago on the main list. So, we have a support for Xenon ARM guest. It's based on a different config file. So, Freebase Day, you can build Freebase Day with a different config file to say,
16:21
I want this diverse for Freebase Day. But the way I choose to build Freebase Day is that you can only start Freebase Day on Xen, if you compile with XenHVM config file. So, you can't say, I want to take my Freebase Day port from Andel binary and put to the Xen guest.
16:45
So, there is another thing is that the guest configuration is not modular. So, the memories are coded. Some interrupt also is not coded. I will explain a bit later why. There is also only support for guest with one vCPU
17:02
because I'm suffering a section of Freebase on ARM. But I think in the next few weeks, we can have multiple vCPU support. So, from the point of view of the device three, I choose to hard code the device three. For multiple reasons, the first reason is that,
17:23
as I said earlier, I choose to use a specific boot protocol, the Linux boot protocol. This is not yet implemented in Freebase Day. That means that you can't start your Freebase Day without any out of box. So, you need to have the device three happen to Freebase Day.
17:42
The second thing is Freebase Day, it's a different device in the device three order. So, that means if you have a device which should interrupt, before the interrupt controller is initialized, the Freebase Day will likely crash because the driver is not initialized,
18:02
so it won't be able to enable the IRQ. This discussion was already made a few weeks ago on the Freebase Day mailing list. They are planning to handle in different ways the device. So, they will do multiple paths
18:22
on the device three, and then, I think, we'll be starting by initializing the boost, then initializing the interrupt controller, then the different device. The second thing is that the bindings are different. So, Freebase Day binding was created like two years ago,
18:41
and there was no common binding between the different operating system. So, the current code of Freebase Day is only under two cells for the interrupts. So, only the number of interrupts on the configurations. The binding we choose for them,
19:02
we choose to have three cells. The first cell is saying if we have, is the IRQ is provided or shared between these CPUs. The second cell is the number of the IRQ on the third cell is giving configurations. There is some work to standardize the binding and as the discussion was made,
19:22
we think that Freebase Day will use the same binding. So, if we don't use the same bindings, that means that then we'll have to support different bindings. I don't think it's the solution for the future. So, that was the device three. For the memory, the Freebase Day memory
19:44
always start with, always use write back. Except on the early patch table. So, when Freebase Day boot, you use an early patch table with write to memory attribute. In this case, with the current XAML versions,
20:01
it will likely fail. We are working on the patch to fix this issue. So, for now, I've chose to use write back when I start Freebase Day, but I think in XAML 4 through the next release, we will be able to use write through form to start the guest.
20:21
The second thing is that Freebase on Arm, assuming that every device is map with cache disabled, there is no function to say, I want to map a physical address to a virtual address with cache enabled. So, I've created a new function to say,
20:43
I can map the memory cacheable. Otherwise, you won't be able to use in defense the PV driver because PV driver is assuming cache enable. The last thing is, I've not yet decided what to do is, Freebase Day is requesting to start at a specific physical address.
21:02
So, if it's not starting as a physical address, Freebase Day won't be able to start. But as I said a few minutes before, the device tree, the guest should not assume that the memory region is at this address. So, I think either Freebase Day should support,
21:24
should be able to start anywhere in the memory, or either then we'll have to deal with that on creating, to decide where is the memory in the guest following the Freebase Day request.
21:41
For the PV driver, so PV drivers have already made by 4x86 on Freebase Day. So, that means that there was not much modifications. The main modification is that Freebase Day was based on, for the two headers, on Xenon hardware just at the beginning. So, the interface was not set in stone.
22:01
We made important changes on the interface between two headers. So, for the drivers, that was fine because I just have to take the drivers and complete it. There was only a few issues because some place on the driver, we used directly the C type instead of the Xenon type.
22:25
So, for example, for the PFN, we directly used anything long instead of the white tab. On now, we decide to use another type for the PFN. The other thing I have added is the support for HVM console.
22:42
So, the current support for HVM console only support PV console. So, I've added a few support for that. The last thing, and it was a big change of Freebase Day, it was the event channel. So, the event channel was x86-specific. That means that the code was using only x86 functions.
23:05
So, if you want to use the same code on ARM, I had to rewrite everything. I rewrote most of the code, but it's still missing some feature, like being able to suspend or resume the guest,
23:21
or being able to assign physical IRQ to the event channel to the guest. So, that's part of most of my, I did all of the job, and even with that, it's still missing some feature
23:41
on Freebase Day. So, first thing is, be able to start with device three out of box. So, I think this feature is not only for XAML, but for every platform. The second thing is to finish to uniform XAML drivers across every platform. So, XAML drivers is not x86 or ARM-specific.
24:01
It should be used, we should be able to use the same drivers on every architecture. The second thing is to be able to support SMP guest. There is also DOM0 support, so to be able to use Freebase Day as DOM0. The last thing is stability. So, I'm able to start with Freebase Day,
24:21
but there is still some crash few times. I need to investigate if it's, why it's crashing. So, any help from the Freebase Day community is welcome. So, the difference OS supported by Xen is Linux,
24:42
of course, Freebase Day. We started to add a port on Erika OS, it's an open source on built-in OS, and we hope to see any BSD operating system supporting Xen on ARM in the next couple of months.
25:05
So, this was my talk. So, as I show, it's not really difficult to port a new OS on Xen on ARM. If you have any question, you can use Xen develop
25:20
for any development requests on Xen, or any question about how to, any difficulties on how to boot your OS on Xen. You can also use Xen ARM, it's an ERC channel of Reno, and we are, every Xen ARM people are using this channel
25:42
to talk about Xen on the defense OS on Xen. Do we have any questions? So, Xen support in NetBSD is very good on x86,
26:04
is there anything that's being done for Xen on ARM on NetBSD? If NetBSD already supports ARM on Xen,
26:21
it should matter of one or 2,000 line of code, just to be able to say, we need to, the memory is here, the gig is here, and that's all, it's not difficult because everything is emulated by the hardware, so you just need to have PV supports
26:42
and device-free support.
27:30
Don't have a demo here, sorry. I've sent every instruction on the Xen mailing list
27:41
on FreeBSD ARM mailing list also, so you should be able to start a guest on your board directly. You, of course, you need to have a board which supports Xen on ARM.
28:00
The most important is handle on QB board. So, there is a spot for TI-OMAP, but I didn't try it yet, and otherwise, it's like fast model on some servers like Midway or Nick Gen.
28:51
I think there is a part of MiniOS on ARM. I didn't try it. I think it's basically able to start a guest on it to have device-free support.
29:04
I don't know much about the part.