Giter Club home page Giter Club logo

cmpe283_assigment-1's Introduction

How to discover VMX features using GCP VM

  1. Setup gcloud account

  2. Loign to console

  3. Create a VM ( for this project i created with following features machine type: n2-standard-2 OS: Ubntu )

  4. Connect to machine using either by Browser based SSH or your own machine

  5. Install gcloud CLI
    https://cloud.google.com/sdk/docs/install

  6. Once intsalled initialize gcloud CLI
    gcloud init

  7. We need to enable nested virtualization inorder to discover VMX features

  8. To enable nested virtualization
    https://cloud.google.com/compute/docs/instances/nested-virtualization/enabling

  9. In our case we already have a VM so we will export the property of the instance using

    • gcloud compute instances export instance-1 --destination=export.yaml --zone=us-west4-b

    • Add following text to export.yaml file if its not already there

      advancedMachineFeatures:
         enableNestedVirtualization: true
      
    • Update the VM with following command
      gcloud compute instances update-from-file instance-1 --source=export.yaml --most-disruptive-allowed-action=RESTART --zone=us-west4-b

  10. To check if nested virtualization is enabled, connect to VM and run the following command,it should any number other than 0
    grep -cw vmx /proc/cpuinfo

  11. Create a directory and add the files Makefile and .c file to find the features

  12. But first install dependencies
    sudo bash
    apt install gcc make
    exit
    sudo apt-get install linux-headers-$(uname -r)

  13. If some issue with gcc then run update command and install again
    update apt-get
    apt install gcc
    apt install make

  14. Run make to create output inside the directory
    make

  15. Once you see the autogenerated files to see the output load the .ko file in kernel and read
    sudo insmod cmpe283-1.ko
    dmesg

  16. To find about the MSR and controls that you want query
    https://www.intel.com/content/dam/develop/public/us/en/documents/325384-sdm-vol-3abcd.pdf

  17. For this project i have queried following 6 MSRs

    • IA32_VMX_PINBASED_CTLS (5 controls)
    • IA32_VMX_PROCBASED_CTLS (22 controls)
    • IA32_VMX_PROCBASED_CTLS2 (27 controls)
    • IA32_VMX_EXIT_CTLS (16 controls)
    • IA32_VMX_ENTRY_CTLS (13 controls)
    • IA32_VMX_PROCBASED_CTLS3 (4 controls)
  18. Some observations about the output

    • In primary procbased controls in my Vm the ability to set “Activate Secondary Controls” was true and for “Activate Tertiary Controls” was false.
    • In tertiary procbased control the ability to set for all 4 controls were false.

cmpe283_assigment-1's People

Contributors

raghavsharma1729 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.