SRKV
SRKV

Reputation: 161

QEMU adding new arguments to qemu binary

I am new to qemu development. I am trying to modify qemu to emulate some features of SGX processor on x86 machines using QEMU emulator. Here is what I want to do.

I want to add the following to qemu. I want to start a qemu process with a new argument EECREATE. This when given to qemu-i386 binary should create an encrypted space in memory with few new data structures inside. Like for example,

qemu-system-i386 -hda ubuntu.img -eecreate -m 2G

This command should boot an ubuntu.img and create a encrypted space (need not be big) of memory for the image (In this case create an encrypted space within 2G that is assigned to the ubuntu-img. Basically, the encrypted space should be within a address space of the image.)

Can anyone please let me know the process involved as what needs to be followed to get it working? What files I need to modify? A brief explaination of how the flow of code will be? I am not able to get any documentation on web and am stuck as where and how to begin.Any help is greatly appreciated.

Thanks

Upvotes: 0

Views: 2222

Answers (1)

abligh
abligh

Reputation: 25119

The short answer is "modify vl.c and qemu-options.hx". The latter is there as all the options processing is integrated into the help provision and so forth - i.e. the code is built dynamically. My normal approach is to pick a similar option and see how it's done.

The longer answer is that if you want the code upstreamed, you should probably discuss your proposal on the qemu-devel mailing list.

The #qemu IRC channel on on irc.oftc.net is also helpful. You will no doubt get some feedback. However, I'd suggest you might consider implementing this as a machine parameter rather than a command line option, unless you are going to make it work for all virtual machine types.

Upvotes: 4

Related Questions