mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +00:00
vendor: update govmm
Shortlog:68cdf64
test: add cpu topology testse0cf9d5
qmp: add checks for the CPU toplogya5c1190
qemu: support x86 SMP die Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
4bd3ea848d
commit
104c04d28f
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -391,11 +391,11 @@
|
||||
revision = "2f1d1f20f75d5404f53b9edf6b53ed5505508675"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6b643bd5e349019c33430301a3e5c38324c3014c423fe5e7cf857a8dd341efe2"
|
||||
digest = "1:bba46c73858fda3e8066d66553615bd271f1ee811a0bf19f239ea2fb1e313f22"
|
||||
name = "github.com/intel/govmm"
|
||||
packages = ["qemu"]
|
||||
pruneopts = "NUT"
|
||||
revision = "52b2309a558fe89b3e81b85440144b535288ce4f"
|
||||
revision = "e0505242c0670f1a522f5b2d827e4a7e4062a14d"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:36dfd4701e98a9d8371dd3053e32d4f29e82b07bcc9e655db82138f9273bcb0f"
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/intel/govmm"
|
||||
revision = "52b2309a558fe89b3e81b85440144b535288ce4f"
|
||||
revision = "e0505242c0670f1a522f5b2d827e4a7e4062a14d"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/kata-containers/agent"
|
||||
|
37
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
37
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
@ -149,6 +149,7 @@ type QMPVersion struct {
|
||||
type CPUProperties struct {
|
||||
Node int `json:"node-id"`
|
||||
Socket int `json:"socket-id"`
|
||||
Die int `json:"die-id"`
|
||||
Core int `json:"core-id"`
|
||||
Thread int `json:"thread-id"`
|
||||
}
|
||||
@ -1157,26 +1158,56 @@ func (q *QMP) ExecutePCIVFIOMediatedDeviceAdd(ctx context.Context, devID, sysfsd
|
||||
return q.executeCommand(ctx, "device_add", args, nil)
|
||||
}
|
||||
|
||||
// isSocketIDSupported returns if the cpu driver supports the socket id option
|
||||
func isSocketIDSupported(driver string) bool {
|
||||
if driver == "host-s390x-cpu" || driver == "host-powerpc64-cpu" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// isThreadIDSupported returns if the cpu driver supports the thread id option
|
||||
func isThreadIDSupported(driver string) bool {
|
||||
if driver == "host-s390x-cpu" || driver == "host-powerpc64-cpu" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// isDieIDSupported returns if the cpu driver and the qemu version support the die id option
|
||||
func (q *QMP) isDieIDSupported(driver string) bool {
|
||||
if (q.version.Major > 4 || (q.version.Major == 4 && q.version.Minor >= 1)) && driver == "host-x86_64-cpu" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ExecuteCPUDeviceAdd adds a CPU to a QEMU instance using the device_add command.
|
||||
// driver is the CPU model, cpuID must be a unique ID to identify the CPU, socketID is the socket number within
|
||||
// node/board the CPU belongs to, coreID is the core number within socket the CPU belongs to, threadID is the
|
||||
// thread number within core the CPU belongs to. Note that socketID and threadID are not a requirement for
|
||||
// architecures like ppc64le.
|
||||
func (q *QMP) ExecuteCPUDeviceAdd(ctx context.Context, driver, cpuID, socketID, coreID, threadID, romfile string) error {
|
||||
func (q *QMP) ExecuteCPUDeviceAdd(ctx context.Context, driver, cpuID, socketID, dieID, coreID, threadID, romfile string) error {
|
||||
args := map[string]interface{}{
|
||||
"driver": driver,
|
||||
"id": cpuID,
|
||||
"core-id": coreID,
|
||||
}
|
||||
|
||||
if socketID != "" {
|
||||
if socketID != "" && isSocketIDSupported(driver) {
|
||||
args["socket-id"] = socketID
|
||||
}
|
||||
|
||||
if threadID != "" {
|
||||
if threadID != "" && isThreadIDSupported(driver) {
|
||||
args["thread-id"] = threadID
|
||||
}
|
||||
|
||||
if q.isDieIDSupported(driver) {
|
||||
if dieID != "" {
|
||||
args["die-id"] = dieID
|
||||
}
|
||||
}
|
||||
|
||||
if isVirtioPCI[DeviceDriver(driver)] {
|
||||
args["romfile"] = romfile
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user