From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B9E726B97F for ; Fri, 28 Feb 2025 14:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740752124; cv=none; b=upwDETH3IUBwwB5PYCtif+Vl83RJfrhue9L7Dr1gr//1h6p0OWPwbNbbGuxoDGpqCRDQKEU2FF+aDbVLSc1DZMwaVZ3h4J0/4HxvxUf5wWhev1JuUToXEp2dHwiN3+dklL3JnMX1PY1N047gcZyWgnFGZVeq1sTal+ainwycJ+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740752124; c=relaxed/simple; bh=uI3gw1E4h1w8OZiZE65zRuvLc3js117NH0a6bu/n0Ms=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jPe3yqoz/thcqD0r8F83TGDZTglfFbjAVMtmW1ZwnX2++urjSqyXlhIJNG0J6im5TACkgNrOp3eQwEovZ2J2H4PohgzR87zTfwp55cKNZxTCwtufUTRsaXbiEqzZZUTWKF/SMuWfE7LqZCV6BkZZlDAEvoYWzWYACDtmhlvQVl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XtmBb5H8; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XtmBb5H8" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2217a4bfcc7so38877385ad.3 for ; Fri, 28 Feb 2025 06:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740752121; x=1741356921; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=K4n7HNs3ibqC0TSGgnmvAohC3oIZe4ftAirZaMZ4Klc=; b=XtmBb5H8jsRTV3GrexS+obCv0LYhJM6kkNtbqqqWk6pU1BavprVYD3+3TCjpZiJ3I5 18vpmpc2oI4yCN8sSWOLd6PBnFccwRipYevKO2mIqgWDT+zWmnDCPKw69WvPUWj/UniD rKIJLbeBff7uOiCHXpSMbk6QF8KWq5zQIMx3sOQY1v7EH9xqYBEzQcpvuS4uB55c523I 33/D6KuUs3MpBEYuff5ijUiZb21V7xiRA5dr4Ls1dObDt9zlsRjIvzqI97adjMc2VWYd 4Q7Hf6YiWah+vyiIndty0yzsWd37G/vN+VQq6KlTBjz9BT22wTv1+Rrn0Myn5xDuUfaC 5CDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740752121; x=1741356921; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=K4n7HNs3ibqC0TSGgnmvAohC3oIZe4ftAirZaMZ4Klc=; b=FeFikpbEU8aHOXRgmbDMZ+U7qpkeuMYuGGLsb4W68mso2i/mN8foBdqTCr2rwAZ8Yf GfZ1hBPRYa+9XuHTOwBC6EkTHcWUfMd+GfvKFwbXocOs9IXMXZ6t1XInqRAF+OkFjtcf ADrl5XXZYyAQGag4TSgMrzW1aM7IKEBHB6N8AM7NbN4DGScHEZp2vqiEbcsSjN7ObKna ghHI+FABM9PpZ3q9OXj7UZmhnLkvzFQuAMmLgfmeLLxLo1Kg2ZOoceWa1wMwk0DhORfd I01Y0hGsM5AIs85VvuoaGG1o1KtuDa+PDZSgJQngERiI7zn9BBtJ1vCTfi44r8ax7+Im fQAw== X-Forwarded-Encrypted: i=1; AJvYcCVh1IwtOUQDM6k8Q4a7Dlfk5VbvnJ1AoMD9DrzPjbr+IPRlM9Eq5EBYqIngPDGUVbSW1dJPbx4=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1ztHNfkE8Lc2muB9+KCGO1cFjXTAUM8i+itEtXA/BhhGesDFV 9EXUeP77jgZiqFlX4tadzjHLHswIT+WUGB/BnI+PnBogvdp+EtykFI36CR2uNVF3im5efZ4KnT6 8nw== X-Google-Smtp-Source: AGHT+IFY0wutMLV/vSJQL/rvmkdGeXbcSA+g8Izv57AkofI4AiY7LTCObNflznrkj5jSTghAERF/NgqP0cM= X-Received: from pfbdk18.prod.google.com ([2002:a05:6a00:4892:b0:730:7e2d:df66]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:2e88:b0:732:6222:9edf with SMTP id d2e1a72fcca58-734ac3311a7mr5471270b3a.5.1740752121585; Fri, 28 Feb 2025 06:15:21 -0800 (PST) Date: Fri, 28 Feb 2025 06:15:20 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250227230631.303431-1-kbusch@meta.com> Message-ID: Subject: Re: [PATCHv3 0/2] From: Sean Christopherson To: Lei Yang Cc: Keith Busch , pbonzini@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux.dev, x86@kernel.org, netdev@vger.kernel.org, Keith Busch Content-Type: text/plain; charset="us-ascii" On Fri, Feb 28, 2025, Lei Yang wrote: > Hi Keith > > V3 introduced a new bug, the following error messages from qemu output > after applying this patch to boot up a guest. Doh, my bug. Not yet tested, but this should fix things. Assuming it does, I'll post a v3 so I can add my SoB. diff --git a/include/linux/call_once.h b/include/linux/call_once.h index ddcfd91493ea..b053f4701c94 100644 --- a/include/linux/call_once.h +++ b/include/linux/call_once.h @@ -35,10 +35,12 @@ static inline int call_once(struct once *once, int (*cb)(struct once *)) return 0; guard(mutex)(&once->lock); - WARN_ON(atomic_read(&once->state) == ONCE_RUNNING); - if (atomic_read(&once->state) != ONCE_NOT_STARTED) + if (WARN_ON(atomic_read(&once->state) == ONCE_RUNNING)) return -EINVAL; + if (atomic_read(&once->state) == ONCE_COMPLETED) + return 0; + atomic_set(&once->state, ONCE_RUNNING); r = cb(once); if (r)