Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
agent: add interface memHotplugByProbe for memory hotplug
Browse files Browse the repository at this point in the history
There are 2 phases in Memory Hotplug. 1) Physical Memory Hotplug phase.
2) Logical Memory Hotplug phase.
The First phase is to communicate hardware/firmware and
make/erase environment for hotplugged memory.
If firmware supports notification of connection of new memory to OS,
this phase is triggered automatically. ACPI can notify this event.
This also what kata supports on amd64, memory hotplug via acpi-driven.
But if not, there is another option, probe operation by hand.
And since memory hotplug via acpi is missing on qemu-system-aarch64,
we hope to support the other probe solution.
This whole implementation of memory hotplug via probe interface is
divided into two phases, the first is covered by former commit.
The second is to notify guest kernel about hot-added momery event
by echoing related addresses into /sys/devices/system/memory/probe.

Fixes: #442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
  • Loading branch information
Pennyzct committed Jan 29, 2019
1 parent 6007523 commit 96d7acb
Show file tree
Hide file tree
Showing 4 changed files with 414 additions and 171 deletions.
10 changes: 10 additions & 0 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,16 @@ func (a *agentGRPC) GetGuestDetails(ctx context.Context, req *pb.GuestDetailsReq
return &details, nil
}

func (a *agentGRPC) MemHotplugByProbe(ctx context.Context, req *pb.MemHotplugByProbeRequest) (*gpb.Empty, error) {
for _, addr := range req.MemHotplugProbeAddr {
if err := ioutil.WriteFile(sysfsMemoryHotplugProbePath, []byte(fmt.Sprintf("0x%x", addr)), 0600); err != nil {
return emptyResp, err
}
}

return emptyResp, nil
}

func (a *agentGRPC) haveSeccomp() bool {
if seccompSupport == "yes" && seccomp.IsEnabled() {
return true
Expand Down
Loading

0 comments on commit 96d7acb

Please sign in to comment.