<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">On Sat, Feb 9, 2019 at 9:11 PM Liu Jiang <<a href="mailto:liuj97@gmail.com">liuj97@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div style="overflow-wrap: break-word;">On Feb 9, 2019, at 2:10 AM, Zach Reizner <<a href="mailto:zachr@google.com" target="_blank">zachr@google.com</a>> wrote:<br><div><blockquote type="cite"><br class="gmail-m_6083191624342946991Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">On Fri, Feb 8, 2019 at 2:18 AM Liu Jiang <<a href="mailto:liuj97@gmail.com" target="_blank">liuj97@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>Hi all,<div><span class="gmail-m_6083191624342946991gmail-m_-6324568620085656860Apple-tab-span" style="white-space:pre-wrap">     </span>As we have discussed during the meeting, I have created a memory-model repository under rust-vmm project and  posted the initial version at <a href="https://github.com/rust-vmm/memory-model" target="_blank">https://github.com/rust-vmm/memory-model</a> .</div><div>The initial version tries to merge current code from the upstream crosvm and firecracker projects. And the most sensitive user visible change is changing from u64 to usize for memory related data fields.</div></div></div></div></blockquote><div><div style="font-family:arial,helvetica,sans-serif">On 64-bit arm devices, we usually run a 32-bit userspace with a 64-bit kernel. In this case, the machine word size (usize) that crosvm is compiled with (32-bit) isn't the same as the one the guest kernel, host kernel, hardware is using (64-bit). We used u64 to ensure that the size was always at least as big as needed.</div></div></div></div></div></blockquote><div>Hi Zach,</div><div><span class="gmail-m_6083191624342946991Apple-tab-span" style="white-space:pre-wrap">    </span>Good point. So seems that the AddressSpace abstraction may help to solve this conflict. </div><div>1) The AddressSpace represents virtual machine physical address space, which contains memory and MMIO regions. For simplicity, u64 will be used here for both 32-bits and 64-bits virtual machines. And GuestAddress should be u64 too.</div><div>2) The GuestMemory represents partial or full mapping of an AddressSpace into current process, so usize should be used here for memory related fields because they are used to save pointer/size in current process. And MemoryMapping should be usize too.</div><div>What’s your thoughts?</div></div></div></div></blockquote><div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">That seems like a good solution. As long as GuestAddress can be used with GuestMemory methods automatically, independent of the compiled word size, then this will be suitable. </span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div style="overflow-wrap: break-word;"><div><div>Thanks,</div><div>Gerry</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div><div>So please help to comment on whether this is the right way to go, and next step plan is:</div><div>1) import <a href="http://endian.rs/" target="_blank">endian.rs</a> from crosvm</div><div>2) add address space abstraction for virtual machine</div><div>Thanks,</div><div>Gerry</div></div></div></div>_______________________________________________<br>
Rust-vmm mailing list<br>
<a href="mailto:Rust-vmm@lists.opendev.org" target="_blank">Rust-vmm@lists.opendev.org</a><br>
<a href="http://lists.opendev.org/cgi-bin/mailman/listinfo/rust-vmm" rel="noreferrer" target="_blank">http://lists.opendev.org/cgi-bin/mailman/listinfo/rust-vmm</a><br>
</blockquote></div></div>
</div></blockquote></div><br></div></div></blockquote></div></div>