mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
govmm: Define the number of supported vCPUs per architecture
Based on qhe QEMU supports on those architectures. Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
This commit is contained in:
parent
77c29bfd3b
commit
a5f6df6a49
12
src/runtime/pkg/govmm/vmm_amd64.go
Normal file
12
src/runtime/pkg/govmm/vmm_amd64.go
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Copyright (c) 2018 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package govmm
|
||||
|
||||
// MaxVCPUs returns the maximum number of vCPUs supported
|
||||
func MaxVCPUs() uint32 {
|
||||
return uint32(240)
|
||||
}
|
25
src/runtime/pkg/govmm/vmm_arm64.go
Normal file
25
src/runtime/pkg/govmm/vmm_arm64.go
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// Copyright (c) 2018 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package govmm
|
||||
|
||||
//In qemu, maximum number of vCPUs depends on the GIC version, or on how
|
||||
//many redistributors we can fit into the memory map.
|
||||
//related codes are under github.com/qemu/qemu/hw/arm/virt.c(Line 135 and 1306 in stable-2.11)
|
||||
//for now, qemu only supports v2 and v3, we treat v4 as v3 based on
|
||||
//backward compatibility.
|
||||
var gicList = map[uint32]uint32{
|
||||
uint32(2): uint32(8),
|
||||
uint32(3): uint32(123),
|
||||
uint32(4): uint32(123),
|
||||
}
|
||||
|
||||
var defaultGICVersion = uint32(3)
|
||||
|
||||
// MaxVCPUs returns the maximum number of vCPUs supported
|
||||
func MaxVCPUs() uint32 {
|
||||
return gicList[defaultGICVersion]
|
||||
}
|
12
src/runtime/pkg/govmm/vmm_ppc64le.go
Normal file
12
src/runtime/pkg/govmm/vmm_ppc64le.go
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Copyright (c) 2018 IBM
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package qemu
|
||||
|
||||
// MaxVCPUs returns the maximum number of vCPUs supported
|
||||
func MaxVCPUs() uint32 {
|
||||
return uint32(128)
|
||||
}
|
15
src/runtime/pkg/govmm/vmm_s390x.go
Normal file
15
src/runtime/pkg/govmm/vmm_s390x.go
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// Copyright (c) 2018 IBM
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package govmm
|
||||
|
||||
// MaxVCPUs returns the maximum number of vCPUs supported
|
||||
func MaxVCPUs() uint32 {
|
||||
// Max number of virtual Cpu defined in qemu. See
|
||||
// https://github.com/qemu/qemu/blob/80422b00196a7af4c6efb628fae0ad8b644e98af/target/s390x/cpu.h#L55
|
||||
// #define S390_MAX_CPUS 248
|
||||
return uint32(248)
|
||||
}
|
Loading…
Reference in New Issue
Block a user