Skip to content

Commit 6d892d3

Browse files
committed
Minor improvements to remote IPRE resume
1 parent 09b7182 commit 6d892d3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/tinykvm/remote.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ void Machine::remote_update_gigapage_mappings(Machine& remote)
4545
const auto begin = remote_vmem.physbase >> 30;
4646
const auto end = (remote_vmem.remote_end + 0x3FFFFFFF) >> 30;
4747

48-
for (size_t i = begin; i < end; i++)
49-
{
50-
if (main_pdpt[i] != remote_pdpt[i]) {
51-
if constexpr (VERBOSE_REMOTE) {
48+
for (size_t i = begin; i < end; i++) {
49+
if constexpr (VERBOSE_REMOTE) {
50+
if (main_pdpt[i] != remote_pdpt[i]) {
5251
fprintf(stderr, "Updating remote PDPT entry %zu from 0x%lX to 0x%lX\n",
5352
i, main_pdpt[i], remote_pdpt[i]);
5453
}
55-
main_pdpt[i] = remote_pdpt[i];
5654
}
55+
main_pdpt[i] = remote_pdpt[i];
5756
}
5857

5958
if (this->memory.foreign_banks.size() < remote.memory.banks.size()) {
@@ -94,11 +93,11 @@ void Machine::remote_connect(Machine& remote, bool connect_now)
9493
{
9594
// Copy gigabyte entries covered by remote memory into these page tables
9695
this->remote_update_gigapage_mappings(remote);
96+
remote.m_remote = this; // Mutual
9797
}
9898

9999
// Finalize
100100
this->m_remote = &remote;
101-
remote.m_remote = this; // Mutual
102101
if constexpr (VERBOSE_REMOTE) {
103102
fprintf(stderr, "Remote connected: this VM %p remote VM %p (%s)\n",
104103
this, &remote, connect_now ? "just-in-time" : "setup");
@@ -110,7 +109,6 @@ static void copy_callee_saved_registers(bool save_all, tinykvm_regs& dest, const
110109
// Callee-saved registers: RBX, RBP, R12-R15 + arguments in RDI, RSI
111110
dest.rbx = src.rbx;
112111
dest.rdi = src.rdi;
113-
dest.rsi = src.rsi;
114112
dest.rsp = src.rsp;
115113
dest.rbp = src.rbp;
116114
dest.r12 = src.r12;

0 commit comments

Comments
 (0)