-
VMWare Workstation Setup
- Download and install VMware Workstation.
-
Create a Virtual Machine
- Download the Ubuntu ISO.
- Create a Virtual Machine in VMware Workstation for Ubuntu.
-
Enable Nested Virtualization
- In the VM settings, select nested virtualization capabilities.
-
Fork the Linux Repository
- Fork the original Linux repository from Linus Torvalds' GitHub.
-
Check VM's Virtualization Capabilities
- Inside the VM, check virtualization capabilities using the command
cat /proc/cpuinfo
.
- Inside the VM, check virtualization capabilities using the command
-
Install Git
- Install Git on the VM using the command
sudo apt-get install git
.
- Install Git on the VM using the command
-
Clone the Forked Repository
- Clone the forked Linux repository from your GitHub account.
-
Edit Source Code
- Navigate to the cloned repository using
cd linux
. - In
cmpe283-1.c
, add sections of code for primary procbased controls, secondary procbased controls, entry, and exit controls based on the SDM.
- Navigate to the cloned repository using
-
Create a Folder for Your Module
- Create a folder named
cmpe283
and place the modifiedcmpe283-1.c
file and the Makefile inside it.
- Create a folder named
-
Kernel Building and Installation
- Run the following commands in sequence:
make menuconfig
(do not save any changes in the UI and exit)cp /boot/config-<current version>
(replace<current version>
with the version fromuname -a
)make oldconfig
(press Enter to answer all questions)make prepare
make -j <number of cores>
(e.g.,make -j 4
)- If you encounter an error related to 'debian/canonical-certs.pem', edit the
.config
file and set the system trusted keys and revocation keys strings to empty. make -j <number of cores>
(e.g.,make -j 4
)sudo make INSTALL_MOD_STRIP=1 modules_install
sudo make install
sudo reboot
- Run the following commands in sequence:
-
Check Kernel Version
- After the reboot, run
uname -a
to check that the kernel version has changed.
- After the reboot, run
-
Load and Test Your Module
- Change directory to the
cmpe283
folder. - Run
make
to compile your module. - After a successful compile, check that the
.ko
file is created usinglsmod | grep cmpe283
. - Insert your module with
sudo insmod cmpe283-1.ko
.
- Change directory to the
-
View Module Information
- Run
dmesg
to view capability information for all the MSR defined incmpe283-1.c
under the heading "Module Start."
- Run
-
Remove Your Module
- To remove the module, run
sudo rmmod cmpe283-1
. - Check the exit message with
dmesg
("Module Exits").
- To remove the module, run
-
Start with Assignment 1 Setup
-
Modify the cpuid.c and vmx.c Files
- Make the necessary modifications to the
cpuid.c
andvmx.c
files based on the requirements for tracking exits.
- Make the necessary modifications to the
-
Compile and Install the Kernel
- Run the following commands:
make -j 4 modules
make INSTALL_MOD_STRIP=1 modules_install && make install
- Run the following commands:
-
Unload Existing KVM Modules
- Run
lsmod | grep kvm
. - If modules are loaded, run
rmmod kvm
andrmmod kvm_intel
.
- Run
-
Load KVM Module
- Run
modprobe kvm
.
- Run
-
Install Virtual Machine Manager
- Install Virtual Machine Manager from the Ubuntu Software Center.
-
Create an Inner VM
- Download an Ubuntu ISO and install an Ubuntu VM inside your existing VM (inner VM).
-
Install cpuid Package
- Inside the inner VM, install the
cpuid
package usingsudo apt-get install cpuid
.
- Inside the inner VM, install the
-
Test Modifications
- Use the
cpuid
commands to observe the total exits and exit reasons as described in Assignment 2.
- Use the
-
Start with Assignment 2 Setup
-
Modify Kernel Code
- Make edits to
linux/arch/x86/kvm/cpuid.c
andlinux/arch/x86/kvm/vmx/vmx.c
to add CPUID leaf nodes for reporting exit times.
- Make edits to
-
Compile and Install the Kernel
- Follow the steps to compile and install the modified kernel as described in Assignment 2.
-
Test Modifications
- Inside the inner VM, use the new CPUID leaf nodes to report exit times.
-
Start with Assignment 3 Setup
-
Run dmesg to Print Exit Counts
- Run
dmesg
to print counts for exit reasons.
- Run
-
Analyze Exit Counts
- Compare the exit counts between nested paging and shadow paging.
-
Record Observations
- Record any changes in exit counts and reasons between the two paging methods.