Skip to content

Commit

Permalink
sdm: interface change to support MemorySizeHint API
Browse files Browse the repository at this point in the history
Add MemorySizeHint API to allow user space client to request large
amount of memory in trusted VM.

Change-Id: I7708c3bcfc8f22005e5a8680ebb5ca8abdb688dc
  • Loading branch information
Ping Li authored and Gerrit - the friendly Code Review server committed Jul 31, 2022
1 parent eb978fe commit 1e59962
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/membuf_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ class MemBuf {
*/
virtual int Import(int64_t memparcel_hdl, const VmParams &vm_params, int *import_fd) = 0;

/*! @brief Allocate a file descriptor which represents a suggestion from
userspace that a large amount of memory will be needed in the near
future. If the kernel decides to honor this suggestion, there is no
guarantee of exclusive access to this memory by the requesting process
Closing the file descriptor indicates the memory is no longer required.
@param[in] size - The requested size of memory to be made free.
@param[in] name - A unique name for debug purposes.
@return fd on success otherwise errno
*/

virtual int MemorySizeHint(uint64_t size, const std::string& name) = 0;
virtual ~MemBuf() { }

static int GetInstance(MemBuf **mem_buf_hnd);
Expand Down

0 comments on commit 1e59962

Please sign in to comment.