Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp204641pxk; Wed, 16 Sep 2020 02:07:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3aHYyaPmD3ThSaKJv9gLslXrEouPqqL0jhopb6NZhCaM3iKf2E4M4GSZh/9ZQEXXSvuZs X-Received: by 2002:a17:906:2c04:: with SMTP id e4mr23846175ejh.147.1600247236825; Wed, 16 Sep 2020 02:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600247236; cv=none; d=google.com; s=arc-20160816; b=cpoUE2TjQVj4m5+aAEKhUFsoSOaFy1X9t2l65uzt8xHTiwencL23ZRuLp2g9kwdNOQ 9xGoR9zDTfaWJMa2xITbGZH6k6Iui2yHPhK4+SRdXoKyxffJcujQgjd7MHRijDbWcSC7 hysZGh2Nhs7Qe09AYCQgJADWCJF+SUkax1pgmjKPT7xadZXNqU049bdiW/OLH7i8NaKU S5Eryzxk36d8pB7C3JWZUyw1gXg2COQ91vXZJ09JOvjdfD9qlU7GaHum161OKQS/yDsn m7aJqs0+KkfqdohwJwxxZBwX2pHRJ/NdEFMjvKlRcvgWBU3UkRBGgoeJjF1MzRNT1Jkv O7Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=k1t3aEF1OX+VjrQN9WEWMI8c1AvBflhlomB9um5hxKk=; b=A8R8CnmlRnYnRBoLnKwKxFAaZUsYKD7UibrUpC1diS0vQpHyNdF+IA7TaYdRUvNlGs En5UwqsJApt2afZ3xUVS15EUGXkj5fYowJluEjEa1X1vXm2EokG309c8h4jEV61hk+75 lEnBcfWoqOVKAmdvvWJI422ZD4rNzzoc1SEoJEVbU3vh2H/pp8pV19tyI3TYvIRSpMXq TcDe2QUTjD3p9gLYXxiONWH04H5k+rjbsISjXPoYAJEnFIcngq7tEr1gSG68A7JT9MYe 0f7gggmc3VWKSA66GsVbHpv9E7JOAtUocPF40PLuKu1dv/X9GtiD7nlBxVbY1SezH/ng 2xzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d8zM/AUu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si10613486ejg.255.2020.09.16.02.06.53; Wed, 16 Sep 2020 02:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d8zM/AUu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbgIPJDz (ORCPT + 99 others); Wed, 16 Sep 2020 05:03:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49505 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbgIPJDx (ORCPT ); Wed, 16 Sep 2020 05:03:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600247031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=k1t3aEF1OX+VjrQN9WEWMI8c1AvBflhlomB9um5hxKk=; b=d8zM/AUuOyKv7qVnrbYYYB3kZIK/9uOgThZi5ns86Fy4DnSE3A5doSP4zBSNj48LMV/sGG 4O6q2IwP+2hH/VdORDwyAPSBrbx5mjCgYWFj6fneiVn0M9iwgRpfyQcuBt6WI/tVKwTymu BmhuKCNQ1siag6BUR1ayos2zW1VfxyI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-8tOYClDzM0itUWfAY2fe4A-1; Wed, 16 Sep 2020 05:03:48 -0400 X-MC-Unique: 8tOYClDzM0itUWfAY2fe4A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5981A1005E72; Wed, 16 Sep 2020 09:03:46 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.192.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id E040278808; Wed, 16 Sep 2020 09:03:43 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Haiwei Li , linux-kernel@vger.kernel.org, x86@kernel.org Subject: [PATCH] Revert "KVM: Check the allocation of pv cpu mask" Date: Wed, 16 Sep 2020 11:03:42 +0200 Message-Id: <20200916090342.748452-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 0f990222108d ("KVM: Check the allocation of pv cpu mask") we have in 5.9-rc5 has two issue: 1) Compilation fails for !CONFIG_SMP, see: https://bugzilla.kernel.org/show_bug.cgi?id=209285 2) This commit completely disables PV TLB flush, see https://lore.kernel.org/kvm/87y2lrnnyf.fsf@vitty.brq.redhat.com/ The allocation problem is likely a theoretical one, if we don't have memory that early in boot process we're likely doomed anyway. Let's solve it properly later. This reverts commit 0f990222108d214a0924d920e6095b58107d7b59. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kernel/kvm.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 1b51b727b140..9663ba31347c 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -652,6 +652,7 @@ static void __init kvm_guest_init(void) } if (pv_tlb_flush_supported()) { + pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others; pv_ops.mmu.tlb_remove_table = tlb_remove_table; pr_info("KVM setup pv remote TLB flush\n"); } @@ -764,14 +765,6 @@ static __init int activate_jump_labels(void) } arch_initcall(activate_jump_labels); -static void kvm_free_pv_cpu_mask(void) -{ - unsigned int cpu; - - for_each_possible_cpu(cpu) - free_cpumask_var(per_cpu(__pv_cpu_mask, cpu)); -} - static __init int kvm_alloc_cpumask(void) { int cpu; @@ -790,20 +783,11 @@ static __init int kvm_alloc_cpumask(void) if (alloc) for_each_possible_cpu(cpu) { - if (!zalloc_cpumask_var_node( - per_cpu_ptr(&__pv_cpu_mask, cpu), - GFP_KERNEL, cpu_to_node(cpu))) { - goto zalloc_cpumask_fail; - } + zalloc_cpumask_var_node(per_cpu_ptr(&__pv_cpu_mask, cpu), + GFP_KERNEL, cpu_to_node(cpu)); } - apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself; - pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others; return 0; - -zalloc_cpumask_fail: - kvm_free_pv_cpu_mask(); - return -ENOMEM; } arch_initcall(kvm_alloc_cpumask); -- 2.25.4