about multi core and vt

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
watermirror
Member
Member
Posts: 25
Joined: Tue Nov 05, 2013 4:06 am

about multi core and vt

Post by watermirror »

Hi, i know maybe this is not the right place to ask my question, but i have been stuck for a long time, still do not know how to solve and where to ask.

my projectis to develop a Virtualization system base on Intel-VT. now, my purpose is run Ubuntu 14.04 on one core(BSP), a another Real Time OS on another(AP).
Both OS share the same VMM.

I can run Ubuntu 14.04 on BSP correctly,here is my steps:
1)boot with Ubuntu 14.04
2)start my char device driver.
3)initialize VMCS;set guest to Ubuntu, host to my VMM;enable EPT with 1-to-1 map, set ept memory type according to the MTRR.
4)execute vmlaunch.
At this time, Ubuntu seems OK, and VMM can handle a lot of VM-Exit.

My next step is run Real Time OS and Ubuntu simultaneously,here is my steps.
1)boot with Ubuntu 14.04
2)start my char device driver.
3)initialize VMCS;enable EPT with 1-to-1 map, set ept memory type according to the MTRR.
4)execute vmlaunch.
when cpu 0(which run Ubuntu) exit to VMM, I start to initialize the cpu 1(which i want to run real time os):
1)send a IPI to cpu1
2)initialize the cpu1, copy the MTRR and PAT from CPU 0.
3)initialize VMCS;set guest to RTOS, host to my VMM(the same with Ubuntu, but with different stack);enable EPT with 1-to-1 map, set ept memory type according to the MTRR.
4)execute vmlaunch.
At this time, my problem came out, I can see the RTOS runs correctly, but Ubuntu hangs(No any response on the screen).

I can assure the Two OS in different memory section, and the RTOS do not modify any hardware settings.

hope some one could give me some tips.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: about multi core and vt

Post by Brendan »

Hi,

Does "enable EPT with 1-to-1 map for Ubuntu" combined with "enable EPT with 1-to-1 map for the real-time OS" mean that you want both guest OSs to trash each other's RAM?


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: about multi core and vt

Post by alexfru »

Looks like you're swapping the roles (host vs guest) of the two systems.

What about hardware interrupts? Do you still "forward" them to Ubuntu or simulate them for Ubuntu somehow?
watermirror
Member
Member
Posts: 25
Joined: Tue Nov 05, 2013 4:06 am

Re: about multi core and vt

Post by watermirror »

Hi
Does "enable EPT with 1-to-1 map for Ubuntu" combined with "enable EPT with 1-to-1 map for the real-time OS" mean that you want both guest OSs to trash each other's RAM?
Both OS's EPT structures use the different space. The Ubuntu can access all of the guest-phisical-address from 0 to 4G,; RTOS can only access the guest-physical-address from 0x46400000 to 0x56400000, 0xFEE00000(Local APIC). from now on, the RTOS did not access any other hardware, include the IOAPIC.
What about hardware interrupts? Do you still "forward" them to Ubuntu or simulate them for Ubuntu somehow?
yes.i do inject the interrupt to both of them.
watermirror
Member
Member
Posts: 25
Joined: Tue Nov 05, 2013 4:06 am

Re: about multi core and vt

Post by watermirror »

Hi, I think I have found one reason cause this problem.
when RTOS in AP set the CR0.CD bit, which disable the cache, the Ubuntu in BSP hangs.
If i clear the CR0.CD bit when RTOS write to CR0, it seems OK.

But I can not understand how could this happen? can any one explain this?
Post Reply