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

vmtag is inconsistent in Minos, mvm and Linux #43

Open
ghost opened this issue Jan 22, 2021 · 2 comments
Open

vmtag is inconsistent in Minos, mvm and Linux #43

ghost opened this issue Jan 22, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 22, 2021

#40 changed Minos' struct vmtag, but did not change mvm's and Linux's. This leads to a problem that when creating a guest VM instead of a native VM, Minos gets a vmtag in a different format.

I think we need some mechanism to mark the version of vmtag, such as vmtag_size. And we need to ensure that new members are added to the end of vmtag.

By the way, I recommend maintaining the kernel mode code in this project, just like mvm.

@lemin9538
Copy link
Contributor

#40 changed Minos' struct vmtag, but did not change mvm's and Linux's. This leads to a problem that when creating a guest VM instead of a native VM, Minos gets a vmtag in a different format.

I think we need some mechanism to mark the version of vmtag, such as vmtag_size. And we need to ensure that new members are added to the end of vmtag.

By the way, I recommend maintaining the kernel mode code in this project, just like mvm.

Very good suggestion.

For vmtag, may be we need a better way to replace it. We can brainstorm.

I already have related plans to make the kernel related code can be compiled into a kernel module. In addition, mvm and kernel module can be separated into separate git.

@lemin9538
Copy link
Contributor

lemin9538 commented Jan 25, 2021

I think we can move below content from ramdisk.h to hypervisor.h. the definition of ramdisk may used in other tools or code, the purpose of hypervisor.h is used to share with different module (such as mvm and kernel), then other module only need copy the hypervisor.h to its code base.

#define RAMDISK_MAGIC	"MINOSRAMDISK...."
#define RAMDISK_MAGIC_SIZE 16

#define RAMDISK_FNAME_SIZE 32

struct ramdisk_inode {
	char fname[RAMDISK_FNAME_SIZE];
	uint64_t f_offset;	// data offset from ramdisk_start.
	uint64_t f_size;	// data size of this file
}__packed__;

struct ramdisk_sb {
	uint32_t file_cnt;
	uint32_t block_size;	// reserved
	uint64_t inode_offset;
	uint64_t data_base;	// reserved
};

struct ramdisk_file {
	struct ramdisk_inode *inode;
	unsigned long pos;	// reserved
};

lemin9538 pushed a commit that referenced this issue Jan 30, 2021
- changes vmtag
- changes __packed

This may fix that the guest VM can't be created.

Related to #40, #43

Signed-off-by: Lei Feng <[email protected]>
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