GithubHelp home page GithubHelp logo

edwardt / memsharing-sgxcard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloud-security-research/memsharing-sgxcard

0.0 2.0 0.0 31.46 MB

Memory Sharing Library for Intel® SGX Card

License: Apache License 2.0

Makefile 0.64% C 50.48% C++ 0.53% Shell 0.86% Python 0.56% Batchfile 46.94%

memsharing-sgxcard's Introduction

Memory Sharing Library for Intel® SGX Card

contact: [email protected] or [email protected]

The underlying primitives of this library are described in the paper "Scaling Intel Software Guard Extensions Applications with Intel SGX Card" by Somnath Chakrabarti, Matthew Hoekstra, Dmitrii Kuvaiskii, and Mona Vij from HASP'19.

https://dl.acm.org/citation.cfm?id=3337173

Installation Guide

Prerequisite

In this version of the library, The memory map caching types are controlled using MTRR and not PAT. But since PAT takes precedence over MTRR, we have to disable using PAT for the card the CARD OS.

Here are the steps

  1. losetup loop0
  2. partprobe /dev/loop0
  3. mount /dev/loop0p1 /mnt
  4. open /mnt/grub.cfg
  5. add the kernel command line parameter "nopat" at the end of kernel command line options
  6. save and umount /mnt
  7. partx -d /dev/loop0
  8. losetup -d loop0
  9. vcactl boot 0 0 vcablk0

Ensure can build kernel modules on your host OS

if you are using 3.10.0-514.el7.centos.2.1.13.VCA.x86_64 kernel then you will need the kernel headers to build kernel modules. The correct host kernel source package is 3.10.0-514.el7.centos.2.1.13.VCA.x86_64.tgz. It is now available in syncplicity share

Please extract it under /usr/src/kernels/ and create a softlink from /lib/modules/uname –r/build to this newly extracted kernel source folder.

INSTALLATION

  1. download the stack into a base folder on both host and vca node
  2. On host go to folder <base_folder>/host-drivers/base-drivers then execute: ./build_and_install.sh
  3. On node go to folder <base_folder>/node-drivers/base-drivers then execute: tar zxf initrd.tgz and then ./build_and_install.sh
  4. reboot system
  5. Check dmesg and look for message "g_vca_xdev"
  6. DO NOT PROCEED if step above is not successful
  7. if on host then go inside <base_folder>/host-drivers/dma-mapping-driver
  8. if on node then go inside <base_folder>/node-drivers/dma-mapping-driver
  9. execute: make clean ; make
  10. execute: find ./ -name "*.ko" -exec insmod {} ;
  11. go inside <base_folder>/mem-sharing-library
  12. if on host then execute: make clean ; make MODE=HOST_MODE
  13. if on node then execute: make clean ; make MODE=NODE_MODE
  14. Installation of Drivers and Library is Done at this point

BUILD EXAMPLES

  1. if on host then go inside <base_folder>/host-examples
  2. if on node then go inside <base_folder>/node-examples
  3. execute: make clean ; make

TESTING

  1. on node execute : ./write

  2. on host execute : ./read

  3. on node execute : ./read

  4. on host execute : ./write

  5. on node execute : ./enqueue

  6. on host execute : ./dequeue

  7. on node execute : ./dequeue

  8. on host execute : ./enqueue

  9. on node execute : ./thread_enqueue

  10. on host execute : ./thread_dequeue

  11. on node execute : ./thread_dequeue

  12. on host execute : ./thread_enqueue

NFV POC

  1. NFV POC Host side code base is located inside nfv/host folder. Follow the README to setup host packet capture application
  2. NFV POC VCA side code base is located inside nfv/node folder. Follow the README to setup enclave based packet processing on the VCA node

COMMUNICATION LIBRARY FOR TRANSPARENT MEMORY SHARING AND SOCKET COMMUNICATION

To allow Intel® VCA/SGX card nodes and external entities to communicate transparently the com-library implements a routing host gateway and a library for node applications and clients. This provides node applications the ability to to use memory sharing for communication when possible and regular network sockets when necessary. For more information and examples we refer you to the README in com-library.

memsharing-sgxcard's People

Contributors

vahldiek avatar

Watchers

James Cloos avatar  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.