Giter Club home page Giter Club logo

bao-hypervisor's People

Contributors

afonsosantos96 avatar clachan avatar d3boker1 avatar danielrep avatar davidmcerdeira avatar diogo21costa avatar filippofontana avatar jianlongcao avatar joaopeixoto13 avatar jorgemvp avatar josecm avatar malejo97 avatar ninolomata avatar ruocco avatar sandro2pinto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bao-hypervisor's Issues

Failed to alloc

Update the latest change in main branch, got following error:

env
export CROSS_COMPILE=aarch64-none-elf-
export PLATFORM=qemu-aarch64-virt
export DEMO=linux+freertos

launch
=> go 0x50000000

Starting application at 0x50000000 ...

Bao Hypervisor
BAO INFO: parange_table[parange] = 40
BAO ERROR: Can't allocate address

I am trying to debug the problem, current find it will alloc 32768 pages, and got failed at core/mmu/mem.c:397
Just let you know if you can reproduce at your side

Share devices between guests

I noticed that the same topic about shared devices was launched 2 years ago. I wonder if there is anything new about shared devices.
I know the concern about isolation, but in some cases the hardware unit does not own enough specific I/O devices (e.g. disk, net) to support multiple guests if no sharing support.
Besides, virtio support is mentioned in this topic before, and I wonder how the virtio is supported and used in different platforms now.
Thanks for considering. Wish your reply!

Bitmap library throws error when compiled with optimizations level 2

There is an error when compiling Bao for RISC-V in sbi_ipi_handler function for gcc version 12.1.0

struct sbiret sbi_ipi_handler(unsigned long fid)
{
    if (fid != SBI_SEND_IPI_FID) return (struct sbiret){SBI_ERR_NOT_SUPPORTED};

    unsigned long hart_mask = vcpu_readreg(cpu()->vcpu, REG_A0);
    unsigned long hart_mask_base = vcpu_readreg(cpu()->vcpu, REG_A1);

    struct cpu_msg msg = {
        .handler = SBI_MSG_ID,
        .event = SEND_IPI,
    };

    for (size_t i = 0; i < sizeof(hart_mask) * 8; i++) {
        if (bitmap_get((bitmap_t*)&hart_mask, i)) {
            vcpuid_t vhart_id = hart_mask_base + i;
            cpuid_t phart_id = vm_translate_to_pcpuid(cpu()->vcpu->vm, vhart_id);
            if(phart_id != INVALID_CPUID) cpu_send_msg(phart_id, &msg);
        }
    }

    return (struct sbiret){SBI_SUCCESS};
}

The following error occurs:

In function 'bitmap_get',
    inlined from 'sbi_ipi_handler.part.0' at /media/ninolomata/Nino/bao-demos/wrkdir/srcs/bao/src/arch/riscv/sbi.c:260:13:
/media/ninolomata/Nino/bao-demos/wrkdir/srcs/bao/src/lib/inc/bitmap.h:43:16: error: 'hart_mask' is used uninitialized [-Werror=uninitialized]
   43 |     return (map[bit / BITMAP_GRANULE_LEN] & (ONE << (bit % BITMAP_GRANULE_LEN)))
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/media/ninolomata/Nino/bao-demos/wrkdir/srcs/bao/src/arch/riscv/sbi.c: In function 'sbi_ipi_handler.part.0':
/media/ninolomata/Nino/bao-demos/wrkdir/srcs/bao/src/arch/riscv/sbi.c:251:19: note: 'hart_mask' declared here
  251 |     unsigned long hart_mask = vcpu_readreg(cpu()->vcpu, REG_A0);
      |                   ^~~~~~~~~
cc1: all warnings being treated as errors

I tested running Bao demos Linux + Freertos in the following scenarios:

  • compile bao with optimization level 3 -> didn't compiled;
  • compile bao with optimization level 0 and 1 -> compiled and demo worked;
  • switch the bitmap_get function to non inline function -> -> compiled and demo worked;
  • suppress the error -> -> compiled with warnings and demo worked;

Feature request: Option to force copy of binary image

I ran into a hard to debug situation: In a config.c I specified the same VM_IMAGE for multiple VMs, assuming this would be copied into an allocated memory region. However if the memory region where the entry address lies is not physically placed, the image will be mapped to the image in the config blob instead. So my two VMs where sharing the data sections in the binary and strange side effects started to appear.

Feature request: When running identical binaries on different cores the binary has to be included in the config multiple times, which bloats the config binary (e.g., 4x identical Linux kernel binary). Introducing a flag to force a copy would reduce the size of the config blob drastically in those cases.

I tried to implement that in vm_map_img_rgn but it didn't seem to work like this (freeze after boot):

if (reg->place_phys) {
->
if (reg->place_phys || config->image.force_copy) {

I guess I'm missing something, but couldn't figure out what.

Shared memory between hypervisor and Baremetal VM

Hi,

I was wondering how would one implement a shared memory region between hypervisor and VM?

I am basically trying to profile a few things with bao and baremetal VM and my code would work out quite well if I can share an object between hypervisor and Baremetal VM. Any suggestions would be helpful.

Thanks.

Adding a hardware device in Bao

Hi.

I am trying to add a custom device to Bao Hypervisor which I have to read and write to. What is the best way to doing so?

Having a look at src/platform/xyz/xyz_desc.c file, it seems that the struct used is called platform. Looking into the definition of the struct platform, it seems that it does have a element for specifying devices. Specifically platform.dev_num and platform.devs elements. I do not yet have an understanding of how mapping is done for Bao's VAS itself. Would simply specifying device in this struct work.

P.S: I have been able to add a device and get it working by using mem_map_dev function and I am able to read and write to the device registers. But I am wondering if the authors implemented the functionality of adding device through config file?

x86_64 Plans?

Hello,

I am researching separation kernels as well as other Type-1 hypervisors and came across Bao.

Was wondering if there were any plans to support the x86_64 platform or how hard it might be to add that in?

Thanks and have a great day

linux+freertos demo, how to know Linux run rightly?

I use TX2 board.
I use TFTP in uboot to download bao.bin. The uboot IP is set as below:
setenv serverip 192.168.42.16
setenv ipaddr 192.168.42.15

The UART log is:
tftp 0xa0000000 bao.bin;go 0xa0000000

Starting application at 0xA0000000 ...

Bao Hypervisor
BAO WARNING: smmuv2 does not support coherent page table walks
Bao FreeRTOS guest
Task1: 0
Task2: 0
Task1: 1
Task2: 1
Task1: 2
Task2: 2
Task1: 3

So,it looks like that the FreeRTOS run OK. But I dont know if the Linux run OK too. In README.md, it said that Linux has the static IP(192.168.42.15), but I cant ping it sucessfully and cant ssh it too.
So ,what's wrong with Linux? How to debug?

vGICv3 potential Issue and Improvement

@josecm @sandro2pinto
I was reading the code, and got the impression the Underflow condition of the Maintenance IRQ is not being used. Instead it is using this one:

  • ICH_HCR_EL2:
    image

  • ICH_MISR_EL2:
    image

Does this mean we are having a VM exit per EOId vIRQ which might be ineficient.

Can we improve it by dynamically changing the settings of ICH_HCR_EL2 with U bit ?

Example: Max 4 LRs supported.

  • Case1: When we have up to 4 vIRQs injected, we have the U bit cleared. No traps!

  • Case2: If there are more than 4 vIRQs, example 5 vIRQs. We add the 5th vIRQ to a sw pending list and set the U bit. This will trap when 3 vIRQs of the 4 LRs get deactivated. The hardware will automatically generate a maintenance IRQ to be possible for the hypervisor to inject the 5th vIRQ in a LR free room.

What do you think? Would that reduce the number of hypervisor traps?

SR-IOV support

Is SR-IOV technology supported by Bao for direct assignment of virtual functions to VMs? If yes, is there any demo or anything else?

How to configure the device in a easy way?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.