guest_memory: add fn to get memfd offset of addr
guest_memory: add fn to get memfd offset of addr

Add a function offset_from_base() which, given a GuestAddress, determines
the offset of that address within the backing memfd of the GuestMemory.

In other words, this lets you convert a GuestAddress into an offset that
can be understood by another process which has mapped the the memfd and
would like to read from that address.

BUG=chromium:968724
TEST=cargo test

Change-Id: I5b033ad29dd38090f74577c068cc62ee9c6effb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2015835
Tested-by: Fletcher Woodruff <98edc5f250b1510051c50f8d7b8e3061f58f8d5c@chromium.org>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Dylan Reid <c791bfe44996c1eed9c7149a0c5f12a86d58eb85@chromium.org>
Commit-Queue: Fletcher Woodruff <98edc5f250b1510051c50f8d7b8e3061f58f8d5c@chromium.org>

google/crosvm,google/crosvm,google/crosvm,google/crosvm