From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 726E5EB64DC for ; Sat, 1 Jul 2023 17:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjGARmh (ORCPT ); Sat, 1 Jul 2023 13:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjGARmh (ORCPT ); Sat, 1 Jul 2023 13:42:37 -0400 Received: from out-43.mta0.migadu.com (out-43.mta0.migadu.com [IPv6:2001:41d0:1004:224b::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50AB31991 for ; Sat, 1 Jul 2023 10:42:35 -0700 (PDT) Date: Sat, 1 Jul 2023 10:42:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1688233353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tnh9qdBnPUJuyMP1cG7zLaM8l1NgjvNEN4PkBGU4vkU=; b=tdnWnAZcA7JaHuDZjJECWw7KaOiLwNknOOwUd0rW7qDnCpfJLQm7G9i6My3oi+x8p5zPUq 9aS1FqKNHFDZETcvrHeQ0BvwfUHFIAnGqsJGozHYTR+92Z6BmeEH7ycv3NWgNrn5xHAiiJ V5xSO2UCoDIumuHaArArEfScg+zmgmE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Kristina Martsenko Cc: Marc Zyngier , isaku.yamahata@intel.com, seanjc@google.com, pbonzini@redhat.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse Subject: Re: KVM CPU hotplug notifier triggers BUG_ON on arm64 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Kristina, Thanks for the bug report. On Sat, Jul 01, 2023 at 01:50:52PM +0100, Kristina Martsenko wrote: > Hi, > > When I try to online a CPU on arm64 while a KVM guest is running, I hit a > BUG_ON(preemptible()) (as well as a WARN_ON). See below for the full log. > > This is on kvmarm/next, but seems to have been broken since 6.3. Bisecting it > points at commit: > > 0bf50497f03b ("KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock") Makes sense. We were using a spinlock before, which implictly disables preemption. Well, one way to hack around the problem would be to just cram preempt_{disable,enable}() into kvm_arch_hardware_disable(), but that's kinda gross in the context of cpuhp which isn't migratable in the first place. Let me have a look... -- Thanks, Oliver