Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interrupt support with Solo5 platform #27

Open
xiaobo55x opened this issue Apr 15, 2019 · 2 comments
Open

interrupt support with Solo5 platform #27

xiaobo55x opened this issue Apr 15, 2019 · 2 comments

Comments

@xiaobo55x
Copy link

Hi @anttikantee @mato @ricarkol ,

Could you guys help elaborate on how does rumprun implement the interrupt support with solo5 platform?

Regards,

Haibo

@ricarkol
Copy link
Contributor

Hi @xiaobo55x ,

Solo5 does not implement interrupt support. It just implements what's needed to implement an event loop: a poll call. The rumprun event loop (below netbsd) looks like this:

schedule() {
	...
	bmk_platform_splx
	for (;;) {
		curtime = bmk_platform_cpu_clock_monotonic();
		FOR thread in ALL_THREADS:
			if (thread->bt_wakeup_time <= curtime)
				bmk_sched_wake(thread);
 		bmk_platform_splhigh
		bmk_platform_cpu_block
		bmk_platform_splx
	}
	...
}

Those bmk_ functions are platform specific calls implemented for each platform
at platform/hw/, platform/xen/, and now platform/solo5/. In particular, the
functions implemented above are:

bmk_platform_splhigh		// enable interrupts
bmk_platform_splx		// disable interrupts
bmk_platform_cpu_block		// sleep until interrupt (or something happens)
bmk_platform_cpu_clock_monotonic // get monotonic time

It turns out that these functions can be trivially implemented in solo5. There are no interrupts
in solo5, so splhigh and splx are NOOPs. cpu_clock_monotonic and cpu_block map directly
to solo5 like this:

bmk_time_t
bmk_platform_cpu_clock_monotonic(void)
{
        return solo5_clock_monotonic();
}
 void bmk_platform_cpu_block(bmk_time_t until_ns)
{
        if (solo5_poll(until_ns)) // if there is pending work
                rumpcomp_ukvmif_receive();
}

Hope this helps,
Ricardo

@xiaobo55x
Copy link
Author

Hi @ricarkol,

Thanks very much for the help! It do give us a lot inspiration to add the solo5 support to the Unikraft project.

Regards,
Haibo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants