From patchwork Mon Aug 26 05:40:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cade Richard X-Patchwork-Id: 1976568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kH8AHuZ9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=TDhN2EKo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wsffj2tS9z1yYl for ; Mon, 26 Aug 2024 15:41:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/A6Zdgj45ZFUyLbJJ1qZMTAeovik2xnPMNdkIa+nQM8=; b=kH8AHuZ9oiQQJB VKk7eSgK4MOmcEfmE8BjlqjdvAmW979FzvSyN2lHqGWdD2nFQ5egv06+31RXMztuYlqp/kHfPrjH2 5SbldrYjf5F//NNWlQS/QTzPzLE/vYIkBPrfYMTbuvbiwwqfPSb3XdMzv6tSWUgtYcHhxyeZBqEi8 xoLLdb72zDiHQdx6muOU6MRAh/Rg+1Uv8KPWIzEXw5WGPfcbFrmJfWbAaoPGuunSfano9Tw6G33fe 7ZOD9bY3RCN0veNWRiNAxkDPqxfQZc8J2NNpS0vyyXJRJYA6BZ8dhQllNGcBKQz/KtHbnvQ7dC2pZ SLjmgEiYtAVj5JQDmfjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siSTL-00000005uE2-2oJG; Mon, 26 Aug 2024 05:40:59 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siSTJ-00000005uDV-1vSu for kvm-riscv@lists.infradead.org; Mon, 26 Aug 2024 05:40:59 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2d3c4d47c65so395029a91.3 for ; Sun, 25 Aug 2024 22:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724650856; x=1725255656; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b5cTDvXzTrF2BAOmNZXpI33rXK3/Os3EG5NCOfWTdTA=; b=TDhN2EKogy7Cn/VI/QO7Z0m5HRvY+TUn3PJhdLUngKMBLiqhp/Lbi/PzXhwKIjF7Mi aK4bFB6uVwOfSwf0wbTy5OnKpAIpg29ymx5Ce4Qnoz4yI1CVXXSCgf7THsbaYxcAkyYL jEofyTk5xsYq4l4LFlonDhlywT6XvBG8oPoz19OYkqlVECfwk0zqZYINpagtGYXtcDe7 HY1Y6X0+k8VVi3tgzavztpf51B296rNuAM0ZQWfy/umx+xdKqXmDC+gm4uEmdL44EukK QcD5w8WFPEcM7PumocBeaLiEtnCqG/pbi4SZvz2Uwg9k5RYpafwYFwmfG5B8cpM/eIlr XjuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724650856; x=1725255656; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b5cTDvXzTrF2BAOmNZXpI33rXK3/Os3EG5NCOfWTdTA=; b=XsHQSVMVluKCCUsLPR+XhJcGG/AwS62gPGFzuBtdUzzA+yQZbgrE8a6rlyyRFkplU8 bj0RXyFPPy7ibljkSaWDTjfSAVc07WTNkJXxqS+YwcAT73rbnK90gPc6mcX+T9n8qFqN SsNFDpTtTbbbMHEBFjYYnIJmUS0xM5vZqkdDC15i35C5N8b7lrPPMAVA5MimeiNmMRWe 2wivA9NjJqrp7GslvY4iaeOaG+wRpDD0Blq7dAWFp8QSMUVdkhw2lAM4wRfHIhzgy7Js D/7ufarnABUgTGifuh/Yq7AnIf3hR8MH7zBTrAqOSo0KTRMCs2/mdycbqQtYDvEapu7k nLTQ== X-Forwarded-Encrypted: i=1; AJvYcCWFthm/YbsNzMmbdmDiOlwWY7aqDU4Eqbnd65bHzP09elQMLYB0WB7BHA0VCkfNkNa85yxEBeXnoyg=@lists.infradead.org X-Gm-Message-State: AOJu0YxGu0o4ch5o5oPRqfqdmlTxz2NdGUwDDrT2NGoA3wwBQu8Kd6Y+ jmbtGRb1enmg9BsZK2K1i5ZtkgnNZyayOhcEKT3EM7fo5/mtOqqk X-Google-Smtp-Source: AGHT+IEeBG5qw9lysmT9wcg70xc3DzOrv7ZbFD9jlHjRf0cjH4SmCtBrPprLNb3V7Ws5zsPmpdBgsQ== X-Received: by 2002:a05:6a21:3295:b0:1c4:c402:8189 with SMTP id adf61e73a8af0-1cc89d29fa9mr6158828637.2.1724650856160; Sun, 25 Aug 2024 22:40:56 -0700 (PDT) Received: from localhost.localdomain (c-73-185-75-144.hsd1.ca.comcast.net. [73.185.75.144]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038560eef3sm61341645ad.204.2024.08.25.22.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 22:40:55 -0700 (PDT) From: Cade Richard X-Google-Original-From: Cade Richard To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: andrew.jones@linux.dev, atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com Subject: [kvm-unit-tests PATCH] Changed cpumask_next to wrap instead of terminating after nr_cpus. Date: Sun, 25 Aug 2024 22:40:38 -0700 Message-ID: <20240826054038.11584-1-cade.richard@berkeley.edu> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_224057_517769_1FFCB260 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Changed cpumask_next() to wrap instead of terminating after nr_cpus. Signed-off-by: Cade Richard --- lib/cpumask.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cpumask.h b/lib/cpumask.h index be191923..5105c3bd 100644 --- a/lib/cpumask.h +++ b/lib/cpumask.h @@ -109,8 +109,10 @@ static inline void cpumask_copy(cpumask_t *dst, const cpumask_t [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cade.richard(at)gmail.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Changed cpumask_next() to wrap instead of terminating after nr_cpus. Signed-off-by: Cade Richard --- lib/cpumask.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cpumask.h b/lib/cpumask.h index be191923..5105c3bd 100644 --- a/lib/cpumask.h +++ b/lib/cpumask.h @@ -109,8 +109,10 @@ static inline void cpumask_copy(cpumask_t *dst, const cpumask_t *src) static inline int cpumask_next(int cpu, const cpumask_t *mask) { - while (++cpu < nr_cpus && !cpumask_test_cpu(cpu, mask)) - ; + do { + if (++cpu > nr_cpus) + cpu = 0; + } while (!cpumask_test_cpu(cpu, mask)); return cpu; }