Corrected Machine Check Interrupt (CMCI) can be configured via the per Machine Check bank registers: IA32_MCI_CTL2. To emulate IA32_MCI_CTL2 registers, it's necessary to introduce another array mci_ctl2_banks in analogy to the mce_banks array under struct kvm_vcpu_arch. This patch updates the allocation of mce_banks with the array allocation API (kcalloc) as a precedent for the later mci_ctl2_banks. Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx> Signed-off-by: Jue Wang <juew@xxxxxxxxxx> --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4790f0d7d40b..0e839077ce52 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -11224,7 +11224,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) goto fail_free_lapic; vcpu->arch.pio_data = page_address(page); - vcpu->arch.mce_banks = kzalloc(KVM_MAX_MCE_BANKS * sizeof(u64) * 4, + vcpu->arch.mce_banks = kcalloc(KVM_MAX_MCE_BANKS * 4, sizeof(u64), GFP_KERNEL_ACCOUNT); if (!vcpu->arch.mce_banks) goto fail_free_pio_data; -- 2.36.1.124.g0e6072fb45-goog