diff options
| author | Ritesh Harjani (IBM) <ritesh.list@gmail.com> | 2026-11-01 20:58:10 +0530 |
|---|---|---|
| committer | Madhavan Srinivasan <maddy@linux.ibm.com> | 2026-11-20 13:25:18 +0530 |
| commit | b8c0f82d60c7d149b271cec9364ffb815866cc80 (patch) | |
| tree | dbc6d677b3b8954eb5c6ceaa3c70fa80439d0753 /include/linux | |
| parent | 2b1e236cb3dba4353feb9c77116645e57ba91669 (diff) | |
KVM: PPC: Book3S HV nestedv2: reject vCPU ids beyond the PAPR limit
The previous patch caps KVM_CAP_MAX_VCPU_ID at 2048 on nestedv2 but
nothing actually enforces it. The generic KVM_CREATE_VCPU path only
checks the id against KVM_MAX_VCPU_IDS, which is 8 * NR_CPUS on HV.
That means a VMM that ignores the capability can still pass a larger id.
That id goes all the way down to H_GUEST_CREATE_VCPU, where the L0
rejects it and prints, ...
KVM: Create Guest vcpu hcall failed, rc=-56
...for every such attempt before failing the ioctl with -EINVAL anyway.
Check the id in kvm_arch_vcpu_precreate() instead so it fails early with
the same -EINVAL. Note that PowerNV and nestedv1 are not affected.
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/3b233fa135d54d3ffb569d7febdc1cb8e0ed406a.1793546707.git.ritesh.list@gmail.com
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
