mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 01:02:33 +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"
|
revision = "2f1d1f20f75d5404f53b9edf6b53ed5505508675"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:6b643bd5e349019c33430301a3e5c38324c3014c423fe5e7cf857a8dd341efe2"
|
digest = "1:bba46c73858fda3e8066d66553615bd271f1ee811a0bf19f239ea2fb1e313f22"
|
||||||
name = "github.com/intel/govmm"
|
name = "github.com/intel/govmm"
|
||||||
packages = ["qemu"]
|
packages = ["qemu"]
|
||||||
pruneopts = "NUT"
|
pruneopts = "NUT"
|
||||||
revision = "52b2309a558fe89b3e81b85440144b535288ce4f"
|
revision = "e0505242c0670f1a522f5b2d827e4a7e4062a14d"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:36dfd4701e98a9d8371dd3053e32d4f29e82b07bcc9e655db82138f9273bcb0f"
|
digest = "1:36dfd4701e98a9d8371dd3053e32d4f29e82b07bcc9e655db82138f9273bcb0f"
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/intel/govmm"
|
name = "github.com/intel/govmm"
|
||||||
revision = "52b2309a558fe89b3e81b85440144b535288ce4f"
|
revision = "e0505242c0670f1a522f5b2d827e4a7e4062a14d"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/kata-containers/agent"
|
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 {
|
type CPUProperties struct {
|
||||||
Node int `json:"node-id"`
|
Node int `json:"node-id"`
|
||||||
Socket int `json:"socket-id"`
|
Socket int `json:"socket-id"`
|
||||||
|
Die int `json:"die-id"`
|
||||||
Core int `json:"core-id"`
|
Core int `json:"core-id"`
|
||||||
Thread int `json:"thread-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)
|
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.
|
// 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
|
// 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
|
// 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
|
// thread number within core the CPU belongs to. Note that socketID and threadID are not a requirement for
|
||||||
// architecures like ppc64le.
|
// 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{}{
|
args := map[string]interface{}{
|
||||||
"driver": driver,
|
"driver": driver,
|
||||||
"id": cpuID,
|
"id": cpuID,
|
||||||
"core-id": coreID,
|
"core-id": coreID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if socketID != "" {
|
if socketID != "" && isSocketIDSupported(driver) {
|
||||||
args["socket-id"] = socketID
|
args["socket-id"] = socketID
|
||||||
}
|
}
|
||||||
|
|
||||||
if threadID != "" {
|
if threadID != "" && isThreadIDSupported(driver) {
|
||||||
args["thread-id"] = threadID
|
args["thread-id"] = threadID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if q.isDieIDSupported(driver) {
|
||||||
|
if dieID != "" {
|
||||||
|
args["die-id"] = dieID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if isVirtioPCI[DeviceDriver(driver)] {
|
if isVirtioPCI[DeviceDriver(driver)] {
|
||||||
args["romfile"] = romfile
|
args["romfile"] = romfile
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user