Replies: 8 comments
-
You don't need to do it one by one, you can actually group them by large MMIO regions. Only the interrupts you will need to add one by one. You are not the first to want to do this. We've discussed changing the interrupt configuration to be a struct representing a range instead of a simple array of ids, but never got to it. |
Beta Was this translation helpful? Give feedback.
-
Just considering the scenario in bao useage, mostly there will be two types of OS: big system(Linux or Android etc.) and RTOS. And the big system would use most hardware devices and the RTOS use a little(even not use any). |
Beta Was this translation helpful? Give feedback.
-
That is an interesting idea that seems indeed very useful for many use cases. The only obvious issue I see here is that Bao is blind regarding the MMIO regions and associated interrupts existent in the platform, so we would have to add this information to the platform descriptions. I will add this to my TODO list. However, I probably won't have the time to work on it in the near future. You would be most welcome to submit a PR even if with only a draft implementation. We could collaborate on it from your start point. |
Beta Was this translation helpful? Give feedback.
-
Your concern is right, the Bao hard code should not know the IO config dietails which is according to different hardware. At first, there should be global discriptor to cover the whole IO region, just like: Second, there should be some excluded discriptors to indicate that the devices are removed for other OS use, just like: At last, just the config has "include" and "exclude", which makes the config layout more complex. So the hypervisor need to do some conflicting checking for IO mapping in different OS. |
Beta Was this translation helpful? Give feedback.
-
I'm not saying it should not, just that it currently does not have that information and adding it wouldn't be trivial.
As you point out, defining interrupts as ranges can indeed be easily implemented. However, I'd suggest to implement the Regarding the rest of your proposal: you are suggesting that each IO resource description in a given VM's
I don't understand what is the alternative you are suggesting here.
Also, I'm not clear on what you mean here. Nevertheless, excluding interrupts is also simple because this is implemented just by flipping bits in a bitmap part the vm management structures. As for the "holes" in the IO regions, it might get tricky. I'd suggest having the configuration in such a format that wouldn't force the hypervisor to look at other VM configurations while setting up a given VM. This would help minimize the overall logic added to the hypervisor. Right now it is not obvious to me how we'd implement this in a straightforward way. |
Beta Was this translation helpful? Give feedback.
-
Yes, right. But if there has a global discriptor which already cover the whole IO region, you dont need
I mean there could be a sub field, in which all the discriptors are excluded, without adding .excluded flag in every discriptor. Anyway, this suggest is only a style issue, not important. Whatever, I dont know the code in details, so the suggestions is only based on useage view, only for your reference, and the implementaion would think more. But anyway, if there is a way to configure the whole IO in a easy way, which would help a big. |
Beta Was this translation helpful? Give feedback.
-
The easiest way to do this right now is something like this (excerpt):
This creates a hole in the MMIO range to allow bao to emulate the interrupt controller, but otherwise gives full control of other hardware devices to the guest.
This way Bao could punch the holes in the MMIO region itself, and it is easier to give a guest access to all devices. |
Beta Was this translation helpful? Give feedback.
-
I've started working on this by implementing support for interrupt ranges in the config at wip/default-vm. Regarding the MMIO regions: I'm still ruminating on which of the ideas would be the best, mainly from a user's (both configuration writer and reader) perspective. Having the A third idea would be to add information about all the MMIO regions to the platforms' descriptions and have a |
Beta Was this translation helpful? Give feedback.
-
Hi, I want to run Linux+RTOS on bao。The Linux will use all the hardware devices, and the RTOS don't use hardware device, only do some numerical calculations on CPU。
Now I have to add the device configuration into config file one by one, which is really troublesome and easy to go wrong. So if there some easy way that can configure the whole hardware devices to Linux? Can you give a example config file?
Very thanks.
Beta Was this translation helpful? Give feedback.
All reactions