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

Road map #1

Open
2 tasks
Martins3 opened this issue Dec 17, 2020 · 11 comments
Open
2 tasks

Road map #1

Martins3 opened this issue Dec 17, 2020 · 11 comments

Comments

@Martins3
Copy link
Owner

Martins3 commented Dec 17, 2020

review mode

  • how kvm_main works

ideas

  • host should work in another thread, then anything did in host_loop just like another thread, so it works just like two threads run in parallel.
@Martins3
Copy link
Owner Author

Martins3 commented Dec 21, 2020

TODO

  • kvm_kick_many_cpus : how it works internally, it seems without any hardware support
  • some function is static, kvm_trap_vz_handle_tlb_st_miss e.g., but I changed in dune, may lead to compiling problem

@Martins3
Copy link
Owner Author

Until I have no ideas, no todo and no question, can I compile the code.

@Martins3
Copy link
Owner Author

  • 查看一下 access_ok 在 mips 上和 x86 上的不同。

@Martins3
Copy link
Owner Author

Martins3 commented Jan 12, 2021

  • use CMakelist
  • make these ioctl works
  • init
    • create CPU

@Martins3
Copy link
Owner Author

Martins3 commented Jan 13, 2021

  • /home/maritns3/core/tool/mips/kvm-cpu.c: kvm_cpu__set_debug_fd, so we can debug guset with debug_fd ?

@Martins3
Copy link
Owner Author

Martins3 commented Jan 14, 2021

  • Loongson sdm : gpsi 11.3.1

@Martins3
Copy link
Owner Author

Martins3 commented Jan 14, 2021

  • host has to map PROT_EXEC ?
// TODO why kvmtool ignored PROT_EXEC ?
#define PROT_RWX (PROT_READ | PROT_WRITE |PROT_EXEC)
#define MAP_ANON_NORESERVE (MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE)

static inline void *alloc_ebase()
{
	void * addr = mmap(NULL, 1 << PAGESIZE, PROT_RWX, MAP_ANON_NORESERVE, -1, 0);
  if(addr == NULL)
    die_perror("alloc_ebase");

  return addr;
}

@Martins3
Copy link
Owner Author

Martins3 commented Jan 14, 2021

  • TLB refill need page walk, in See MIPS Run, it's done by software, but with PW* registers, TLB refill can be done with hardware.

@Martins3
Copy link
Owner Author

Martins3 commented Jan 15, 2021

  • see 6.2.3 “Exception Vector Locations” on page 103)

@Martins3
Copy link
Owner Author

Martins3 commented Feb 2, 2021

We can do better

  • why I can't run continue the program in the guest syscall handler
  • guest and host share as minimal resources as possible
    • eg, guest can close any file descriptor?
  • I hope I can run the unmodified binary
  • We should share the same address space, so host and guest live in two threads
  • can I let it run in python / rust / go ?

@Martins3
Copy link
Owner Author

  • it's weird to ignore cause register on vcpu_put and vcpu_load
  • check vcpu_load, what if two vm use same physical in turn ?

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

1 participant