From patchwork Mon Jan 20 06:13:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944776 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 5E5C42770C for ; Mon, 20 Jan 2025 06:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353603; cv=none; b=lydCIG/5CSJEvSJoZwwR9F5kd2HZJ7nJuHogdD6efFo/IidfPA9V8ae4IS1lqkSuPt/Pk366KGDY4Cv07fr03+MdPvVGI10hwrwwX3EvIBkae7XRhCLRTSOvzESsBChitHeziD95FNcU2FbUiIuZamefQ/f1eo3wJyI4jkk3mfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353603; c=relaxed/simple; bh=nBm5pU1gzAxoC2u1NtkzEOYzWlZNkb3YdQBF/KeGaho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EO/q1EWX3L+jJK2SW2jgudnuVkbVTmjtOTZWzs+W8AaepygPPYV5oLOQ2vFXekTuq735geWbK4n/wlvTQvbygL61ANP78jWUgL6PJOhcq2qigNpIJ3f3uRxWNbk24blF4bf5wzM+QqMpKk4h7RNxr4pDPiV0pGYl1eoeFO/UXWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kFTVmkgw; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kFTVmkgw" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso27419435e9.3 for ; Sun, 19 Jan 2025 22:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353598; x=1737958398; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PVL2az4j7grkf0qpeZ/bU6JW0afYQ4Cxffri4sj4Phk=; b=kFTVmkgwZ2QgUGCqpBOoiZ6D7YRBvDOVLAd3U6AOg2ppgDjPHIzs9QaGTCQ76emmk/ cwLDnYrsfu8X2dBlYFIWfyb7TVq4yai56jI37LO8fQpr2oULuIa4vaa5rPIsBezANYzx sGvz6yiozOhDSk+Ou5rqp3ZWAg4wI9o0TKClBWprYQI5O4AT1e7lZf4g8c6l8PUzs4i4 vzrE8vf1Dzj/QTNGAsq9uz2t5R16CUZNPfaQnB9RUPVDHzqiVR3cL90+k88v/VT6twV3 Ht7O8XFTOrUHmYmMCwnDsiFMyYun0z7wZ1Gv0W3IWuGiCCFo9k+9kXi6VhVWNZVeQhX+ gB1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353598; x=1737958398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PVL2az4j7grkf0qpeZ/bU6JW0afYQ4Cxffri4sj4Phk=; b=XyjQuK4JTD4qygkGZWZ11qp9Dd7VjrZr5HbgKS1dl3UrM/f6rzEi4RQ94fM2Cjodm7 4TJtfqB4j99YtUCrkuehXiexbFrDyVA0UMxFDWxSd8k0J3dEzvf/D3K7AbcRRg5iG0sl X33t4FIQNyMxdRSmRfMkG7rvLIcoNnWeYXqdPR4FOusgRZQ1uXZFmbqwE5dkn/kT5SZC zFW9Ls6jGmzigafA5OeYIMZSoTqziicHcr9zwBqdCrd6DZlVWRLczH1YRSiGk5G2vQkh g3R0RWuGCa93gKMtedpNOO8pZSLEdBg+icFdITBKrTsMND8erIfOVunoKlg+1auM5kFL RIcA== X-Forwarded-Encrypted: i=1; AJvYcCWXSFj8vKzie2sU5WO7J6SVhvftFCy19bGSUPX4GqqYsHA/ou5v3mRXRtZMuJvddhmMobw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0FYkvZY7mwv9/rjcH6HMGSfTGkLF5cGSyRXhs8No5Jh1T8Lds PaDt/OCwYR/CI7cdthFeM+Hg21gUx/ibTQp0Wt1IMtLSg4FX4QVmlUVsUnO7jQM= X-Gm-Gg: ASbGnctUGZJeCSuTpw1xA0uokNfY/nnmuKckLs0HhmgGg3KBTuHYy8n+/kSmAfrZlP5 walQKeYzHsmgyOW2lr0albwatpCg2aJAKxiQZap9iPU/6owA+NUel75b/SnY9m6ZmJ3gapr3iVz MvAHlFN5ehyJPrE0KFAl5aQL7/NmKn5zsfr+TRxtrt/bKD0WaIyH/NTtmnTPsGo54xaeOP8SGjd 6Uc/rngHKJduQQ3c4Ohho3MoQ/ABTr9hihfLa0eKNJl7kWr08vn+KXsSLyX2v/B5ju0rqf6R04o TKhMUUyT/baAJI8NvSoLH7bbolcpDzl77HAXOGAHofdB X-Google-Smtp-Source: AGHT+IElhXM/cZbYJG22wApGe0jXZ0HnvOE8NRrV4VhWeR5vhlK+q5cpTVUzAya0a0V/IceREZwvnA== X-Received: by 2002:a05:600c:5486:b0:434:a10f:c3 with SMTP id 5b1f17b1804b1-438913cae48mr96975745e9.9.1737353598565; Sun, 19 Jan 2025 22:13:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c7499884sm189455365e9.5.2025.01.19.22.13.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 1/7] qemu/thread: Constify qemu_thread_get_affinity() 'thread' argument Date: Mon, 20 Jan 2025 07:13:04 +0100 Message-ID: <20250120061310.81368-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 QemuThread structure is not modified, only read. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/thread.h | 4 ++-- util/qemu-thread-posix.c | 4 ++-- util/qemu-thread-win32.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 7eba27a7049..d4f44241ef0 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -191,8 +191,8 @@ void qemu_thread_create(QemuThread *thread, const char *name, void *arg, int mode); int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, unsigned long nbits); -int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, - unsigned long *nbits); +int qemu_thread_get_affinity(const QemuThread *thread, + unsigned long **host_cpus, unsigned long *nbits); void *qemu_thread_join(QemuThread *thread); void qemu_thread_get_self(QemuThread *thread); bool qemu_thread_is_self(QemuThread *thread); diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 6fff4162ac6..0fc3003ec46 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -617,8 +617,8 @@ int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, #endif } -int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, - unsigned long *nbits) +int qemu_thread_get_affinity(const QemuThread *thread, + unsigned long **host_cpus, unsigned long *nbits) { #if defined(CONFIG_PTHREAD_AFFINITY_NP) unsigned long tmpbits; diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index a7fe3cc345f..0d512c0188e 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -513,8 +513,8 @@ int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, return -ENOSYS; } -int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, - unsigned long *nbits) +int qemu_thread_get_affinity(const QemuThread *thread, + unsigned long **host_cpus, unsigned long *nbits) { return -ENOSYS; } From patchwork Mon Jan 20 06:13:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944777 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 DCA832770C for ; Mon, 20 Jan 2025 06:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353606; cv=none; b=TdEPltj85cTwBOh0vJOHCo3mBHv27P+ZBkxPmee3eIFTiI0zq7y/j/4WrZvWG1Nv68DQ5c9aQ1BhUfzFVWjExcgTZm0ZVQD3gDaUQGEp/yqH3KCNNVqxw6+ZsGkYJJMNq3OC6qj7t+Hrx23VuKfUfRCBGnXe/CMa6tfysV3/Wjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353606; c=relaxed/simple; bh=yTWCY5k3QG3uCP8nBjEF23kcnm2Rje4eSnFKVIQtXLw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rVocDbL+qHtKyPWNu9g5Pqcweam3z6ZJPa/ZEpyEarYTFosb9oNXw3GleBTzJ5Ec/mzz0FSWgmWLPu1WnsfLKdIKre/5jzBUvn0sjQOBFOiWfm8glfONtIzG07Ff4giKLaGQDDdcZ+JRx3nyasrYkZNVHLjD5S+OaB+A3j/+ZVU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UrDVwYe6; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UrDVwYe6" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4361815b96cso27296865e9.1 for ; Sun, 19 Jan 2025 22:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353603; x=1737958403; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xZ4bgqHK4U63ZyF21ovjhIWwkMXyj56njZ/a/NkbEaQ=; b=UrDVwYe6QvRqeXKIFCM86VbctT6IkdfktJ6ru/9F5BRF9QHRcSdWOJ1Nw6nXALK6rI LfTF8XHKgzusBZA1gfDkdhsEU53WoH1PZDO+vZc67bvMaLQo3/c1Q15XmSQMdRuAhAhj QVhysGIKgCuWJgHvT86N+xlERuF4g52nHqJb3Iot+bH18kw9cSUar2oOcDq4UcTZSdMV NnJ8CO6BZWRed2oDjM/ffW3Q4GHfdmyAOt1ALPHC1Y+p3sswwBv1xMl/d5KhYypflfCn 4/+i1ShkdZBFsVaDKFL/UFEB1RZCHwSJBEUXBr1cQBed0Eh25fu9sQyOl943mVwDK9Wz tqSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353603; x=1737958403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xZ4bgqHK4U63ZyF21ovjhIWwkMXyj56njZ/a/NkbEaQ=; b=H58+Gwu2WRXcscjzkGHCjoX6XnxT5Lmc+gycTEZ97N6zqz4eGAJVI/7ez0PBreiDmC 1GK748iMZwFMXPy7VT9p/GINCEkNfm6NksdUctr0l/qnLDu8A0uLzQgW8tye+z77Db3X mWmSNyVdfqLSbOf5Rjhza19PpRydIL41rOdvH0Fk8I7F+ASKuEyuiONf7cMmdv+eCnLu jswnPj4OnIjnognE4Q589gmciAlkNEnXKDZQIYuOf0YXJ3LCRQXnddboOE9braFut2j0 WieZkb85AvuYhW17DWyuEDx9gU9zWADfpqmIsfe692Jo6TIzDZKW8Q9mok9uTie9PQxK lCxg== X-Forwarded-Encrypted: i=1; AJvYcCX0x4fdFHrUgfsFnnSLv3YJO8jIWAkRDcv6qhueWUDrHaS9HcMp/xIPrGi3sLml5d4IlwE=@vger.kernel.org X-Gm-Message-State: AOJu0YzR3Ih1qqbx5hnwoOrx5VHEoHD6g/Vngy3BjLMiWCrICWv84IBt rRiEw00h9qvJns4O2+96Jbo8TZWcfs4Ff1KDc28Y5uzMah35D/IpiZhHbc8GM7k= X-Gm-Gg: ASbGncsULEuB4CdUkE2xvGbTjjS3+qsgLgkykJX8ypiimZ5cZJaM/vE8dbHVq5yMVY3 Bjdr+JjUZIT2MTdOgm4S2ivOneddbVcuPhpy9hjYI11GLv/uiJWYymWyGRi1D0eJSe8ZXjYMxR2 Dt74jfpszn6GZnL+jMsuFMaPHTzPAVRCBij9qTsATCYVkyywx3ZwYqdrJGAa0ZW8dlzSGYQ0dUe dK3ZxRYu38YE+U9Y8LnieydL+DBLha0jyFTMqedsMM4EiSRLJXoBB6EnZpkMkD20QzkukfQ9g2b Bt2Du4A6crBJewuxql62ax/WsCLDp6T0x/PEFRc1CFM/ X-Google-Smtp-Source: AGHT+IHsLn5UQ2lGNTqaVfR9uW+ill/b230kCe9JxeG+TeBCDdW/xZDrF+sTByfZht58mwD8OlFP8Q== X-Received: by 2002:a05:600c:1f10:b0:434:ff9d:a370 with SMTP id 5b1f17b1804b1-438912d1d49mr114113545e9.0.1737353603317; Sun, 19 Jan 2025 22:13:23 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c7499942sm185021665e9.6.2025.01.19.22.13.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 2/7] qemu/thread: Constify qemu_thread_is_self() argument Date: Mon, 20 Jan 2025 07:13:05 +0100 Message-ID: <20250120061310.81368-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 QemuThread structure is not modified, only read. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/thread.h | 2 +- util/qemu-thread-posix.c | 2 +- util/qemu-thread-win32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/thread.h b/include/qemu/thread.h index d4f44241ef0..d3027c843bc 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -195,7 +195,7 @@ int qemu_thread_get_affinity(const QemuThread *thread, unsigned long **host_cpus, unsigned long *nbits); void *qemu_thread_join(QemuThread *thread); void qemu_thread_get_self(QemuThread *thread); -bool qemu_thread_is_self(QemuThread *thread); +bool qemu_thread_is_self(const QemuThread *thread); G_NORETURN void qemu_thread_exit(void *retval); void qemu_thread_naming(bool enable); diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 0fc3003ec46..c85421f1a0f 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -664,7 +664,7 @@ void qemu_thread_get_self(QemuThread *thread) thread->thread = pthread_self(); } -bool qemu_thread_is_self(QemuThread *thread) +bool qemu_thread_is_self(const QemuThread *thread) { return pthread_equal(pthread_self(), thread->thread); } diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 0d512c0188e..08c6543fe51 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -546,7 +546,7 @@ HANDLE qemu_thread_get_handle(QemuThread *thread) return handle; } -bool qemu_thread_is_self(QemuThread *thread) +bool qemu_thread_is_self(const QemuThread *thread) { return GetCurrentThreadId() == thread->tid; } From patchwork Mon Jan 20 06:13:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944778 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 D0E69183CD1 for ; Mon, 20 Jan 2025 06:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353611; cv=none; b=iITkHTE+qjyKogoTYeKbzAhDQA2WjXS/+I4Rb59zlia/44CE18/kK/qbREojb9AoQlpv4tTQ8EHwT2mMdNFcdRT+aaW418vJ3zICs31WKaBOFyJSJrXdrQZOtKnh2IGaOA4FndqceNQJPXPLOQmmsJx1bu9vmtITF78OevjnCx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353611; c=relaxed/simple; bh=K1Wcn8Ucet0XH8q61Ezq7T9/YZboaMm8yYJX3EBE8kw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pyUmUIloISfhPpoiFjSi7yo6lKrU3n4jxyss/pc/eUrlAECSV8wncZBRsgZOAFu6RhvrVVxREDiPW0whUSB78u8hkBEEfiI75H+d/v66sAp/RwByh5N2bIO+HdEwyZHCchttiQ4dGq6IR0b3KFjAhKN1gIx+uDpJ4xDSgpRp0Co= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=d4Hrz7NA; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d4Hrz7NA" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4362f61757fso41739315e9.2 for ; Sun, 19 Jan 2025 22:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353608; x=1737958408; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/LgmFzZPaYXd/oFrcsNkEtO3/uWCAUa12Q0VDnBXMJM=; b=d4Hrz7NANHWsPgWk0+4jCNWG2/t8QLP1rlXdFPf9MwuU3ux6AkVIfHCek4Mnz5xj0P QOr+knsDR4NjyZF23REkE7uyqo1LcLaS0a9L/KHc/8EWUjMbfh7Wrzp14B3XxBTtAgFx sRPhy8+VyoUfioFxn3OdfFGWiBXeR+splMiGEX0h4//woPgTy4g7ZEFq7sOdGn0bnBC9 Kuyt41RFl8E+ULYy6y5XAdCyA+kpURQso1kLhw3+Zf6zcTzuWPOJ3a7HLhJXKq9Kx+pX YWo9lUd8awrL8kQYDbl2sAHXrKkH7fEXCzevFp6I3sa4pblK41AAPO+Q3NVMGiZu+NIn 1vhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353608; x=1737958408; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/LgmFzZPaYXd/oFrcsNkEtO3/uWCAUa12Q0VDnBXMJM=; b=nfFZj88cVF5Umyo77l8KSf+Gp7UdNX0lSXVyZWs5nfwe3ImqfbftFwig//lPJL3D97 puZ2/vV3Vfe9jNaHN+JGr0/vcRlQxklCvAdlSWEdwEhguLzLg2RsSGzQH5DUUiPKQzBx rWBPFO52cq9F133vhD2M69XaxT9l9u5KIV2Y6LjBg8lH+mlZLyWgc6VaAWey8+C7A5id UqaINZ6qv+CAEztGGhGSovo8MHYi+CnufOOavTnQ8QGLA/yF2Sv+ljmYFJRl267v8eGI YZ6pQL4obtmE/ABRapRqVxyUzyJfW6VOJ7R9oqjQ2+mMt77uge0JI65d2dKwgBDtpFf8 wByA== X-Forwarded-Encrypted: i=1; AJvYcCVdWGdYzs7eFJx0I/7RZ1JpwFiswe9uHXu4HV/biiT7Rjf2Mn0DuT9d0WfNrnALaHmNlK0=@vger.kernel.org X-Gm-Message-State: AOJu0YwGdhV1C3LgdEqNTw1Q99qfUaDkkq+N2hq7kpypxmvldHCaQvF/ K++omGcDbRG9lGJiuaL1Mx9dV8vANWweMLlH3zTG9HE3do3ldNm5HlIJonDVKYc= X-Gm-Gg: ASbGncuh+KO43GKM8CnASoVMfqdqQrkrP+Tu/CqkochB41sQ2QwxZB2/jMYEVmymdL8 bi3gKHGFJ5ILkI4wElgJ5pov6gIvgLv+hKiTUE870lablc8uUmoODOzC2lmvSIF1TP9bMAaXpaq jSReR95WKWBeUXMOec7bZ4VnzxTh2kh0k1g6PDO9DcUgZpzctPWgjZB4isxYqLz1a9y5CTjrVHZ dVB37NBtvA9crFUwScCyoNjLYctacQglJJHNxHuGs6bInE/j5tCxSeX/92d+jlePj4fNXetQl0t ZgyFTlM+Zbv2d2N9ihJfnX/zvz62yD4trtr4UJYxEBQW X-Google-Smtp-Source: AGHT+IFQxWOYTXhmRmfNHYvquVRicISruZz1w3PMDmGF59CMccSZ+zar5LZzshebqb/yaVzBLo/diw== X-Received: by 2002:a05:600c:19cc:b0:436:fb9e:26c with SMTP id 5b1f17b1804b1-438913de937mr105007685e9.17.1737353608127; Sun, 19 Jan 2025 22:13:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438904087cbsm127685485e9.3.2025.01.19.22.13.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 3/7] cpus: Constify qemu_cpu_is_self() argument Date: Mon, 20 Jan 2025 07:13:06 +0100 Message-ID: <20250120061310.81368-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CPUState structure is not modified, make it const. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- system/cpus.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index fb397cdfc53..782c43ac8b3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -838,7 +838,7 @@ static inline bool cpu_has_work(CPUState *cpu) * * Returns: %true if called from @cpu's thread, %false otherwise. */ -bool qemu_cpu_is_self(CPUState *cpu); +bool qemu_cpu_is_self(const CPUState *cpu); /** * qemu_cpu_kick: diff --git a/bsd-user/main.c b/bsd-user/main.c index b2f6a9be2f2..6dc4512cebf 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -205,7 +205,7 @@ void stop_all_tasks(void) start_exclusive(); } -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return thread_cpu == cpu; } diff --git a/linux-user/main.c b/linux-user/main.c index 7198fa0986b..104704ace96 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -181,7 +181,7 @@ void fork_end(pid_t pid) __thread CPUState *thread_cpu; -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return thread_cpu == cpu; } diff --git a/system/cpus.c b/system/cpus.c index 37e5892c240..e4910d670cf 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -502,7 +502,7 @@ void qemu_cpu_kick_self(void) cpus_kick_thread(current_cpu); } -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return qemu_thread_is_self(cpu->thread); } From patchwork Mon Jan 20 06:13:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944779 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 91108183CA6 for ; Mon, 20 Jan 2025 06:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353616; cv=none; b=F+q20egkQEu/JmuLMOPsg5jSSRI/IhhO9LP25B3f86LqRKjpO8XK+5WYR5klRtDV9+iPlIoJSeeCYTubggkRJuOlODfZ0/TgUmHfFx/BrenCi+gik46lZwmUTvlw3r83nGRXOHHR48efsXo3jro2/JeOVWKz7QIGQzgMJ+LnMwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353616; c=relaxed/simple; bh=CYhXwgGa4X22iwL0OCe5p6nuIsa6FmpfTmFp/kvJIGE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sT4Ip5KrFwdzjn/00mKxN6qjoed3WJAKEvhTwhXvR3N3FDbUQIrnVrNbzITnPtLX6AzHRt1V67sSoKwRo3kzznD5Tks38QPy7xn57SxOXznxNmnLqIr6TWEJVetOxo0TYaFhJ6Diyez6zgJ481lq2FcsTyR2wvNrvRxlDR8Nzj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FKkMdwRI; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FKkMdwRI" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso28153805e9.2 for ; Sun, 19 Jan 2025 22:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353613; x=1737958413; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xht6F+Bfddgo3PrucGv//ZpFrfS6UZc2/xGuv7FMfr4=; b=FKkMdwRIdOAOpGUtBvzcKiJoW4dVunxyKsLOoWzIfe9ERx9XxBgdcavBEWC4nrQnKk XjZbWjp3VZQFtN8m+NVfeiCQ/lspBjvyLQXRV15yfLuDBP4sRf/WKH93hfOa2NyKb0/F +Wzbo0yfpVmmD6ed1oHMxXolVsu1GsEmi0Es4w3MYGrgYIzmxY2/Q0pHUz6n+eyr1Aug km7zn1H7WrTwc023iLJxMbiFdmqZljlUxYfDVOjAJycUvp60vicVRHURhslomOwRMy1S RTQONX5B0LBdhrDMrFq6RfDRtyhYs/ZWGA0YT9neN6HcbKv76IxMoBoT2gychEzQ4mWs /TPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353613; x=1737958413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xht6F+Bfddgo3PrucGv//ZpFrfS6UZc2/xGuv7FMfr4=; b=pblteaaEw0n5GX1IXkFGjSaugHZO/0URCTHYmfVljbGb+elp/0tff4b0sab+HkZC+o r/uUZfnmU+oMYLtCb30iJXRe7skwCXFcYH7BWPG0oZ08fHy4QBhvQTFSIphStqmKfooW iIUArbGSaDLZ8TEgIpyn5RwzCw8q4e+5gwZgEPYejU4OCloit7SpnHTTHr758njMLHFZ qsLI0NCwgMm184gxpoABklBnb3L7Jd+lkTWc67X4d7MTfxojAW18ide5apMcPwX6o2Mx qWGndL/0amsuMYR3owqTrwMC/wkizxvP0o7RVN9RDGAE7VyaXAYLNbKrqTNEPq3aV/nM slxA== X-Forwarded-Encrypted: i=1; AJvYcCW9x/w+/qRSzT6mm0AaiqSY4bGVpaauI3UWkHyCVdaUExMcoHmexY2y90filEIL9NqrPxQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwPd7nEu/lsUdPPS4LWcv0qlmPpQTQi4el4YNTsMVwbX3tTCpdb N0Abu7n8iQP2Tofr86XJsp8RFPTculxUYgaQDhLUhLrT5TUN7vs4US9dMMIRLEc= X-Gm-Gg: ASbGncvO0SqkUJ2AaSArE/Dt5BPgxPCjU1b8Q//g1XoPXvY5N2FGXu4jZGLJJbGWMUk +4m8C96O75UUSxsNK7aCl99/Sudkl2SBDpp06Ye0OneO2AWt9GetiEmbJ0EZWUQEFwZIAD4FPUs xZP0wgQZx46v1XdE7TefSp6SJinSo1J/wXuiNcMj9Sbul7MeH1keYPPXTpw0ZNTRqjAj74h7lCt 7KACqWbZUbdZXtpssX+V4L/VIfDquwI9yreeGXAvwc/6IehFNXRrHqunluBKuvrt3FWoFROvv/u XJY7kiBcKsaF13j88lyXv0F1c407f225/HyReSzPGNIC X-Google-Smtp-Source: AGHT+IF+TJkrPn7eE3Okqh3EvtF88mvEqTvQGYIM33ZG3vLFVo2jCll9ng09trmhL1noLdq3Lbecvg== X-Received: by 2002:a05:600c:138a:b0:435:194:3cdf with SMTP id 5b1f17b1804b1-438914292demr100258335e9.19.1737353612858; Sun, 19 Jan 2025 22:13:32 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c7499821sm186147275e9.2.2025.01.19.22.13.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 4/7] cpus: Constify cpu_get_address_space() 'cpu' argument Date: Mon, 20 Jan 2025 07:13:07 +0100 Message-ID: <20250120061310.81368-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CPUState structure is not modified, make it const. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- system/physmem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 782c43ac8b3..04fede0e69a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1155,7 +1155,7 @@ void cpu_watchpoint_remove_all(CPUState *cpu, int mask); * Return the requested address space of this CPU. @asidx * specifies which address space to read. */ -AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx); +AddressSpace *cpu_get_address_space(const CPUState *cpu, int asidx); G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...) G_GNUC_PRINTF(2, 3); diff --git a/system/physmem.c b/system/physmem.c index c76503aea82..0ac6acb9764 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -805,7 +805,7 @@ void cpu_address_space_destroy(CPUState *cpu, int asidx) } } -AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx) +AddressSpace *cpu_get_address_space(const CPUState *cpu, int asidx) { /* Return the AddressSpace corresponding to the specified index */ return cpu->cpu_ases[asidx].as; From patchwork Mon Jan 20 06:13:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944780 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 41EBD183CA6 for ; Mon, 20 Jan 2025 06:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353623; cv=none; b=m7uKJkWk+AZ49HHxfAcD7RRkBYNJT3maBdkZO1uykhKf5HLellGOMwGOIXm7Gu0Jb+kMKTFY795ZVVdrOd0sq/x57UbaLdlyjgFuOw2Waz9Cyl8TJRIB2zqnSMvpUbcgkKGBXYjUjbMjPwEaJSKgbaSoqSApUtnJfeXSMW+DMKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353623; c=relaxed/simple; bh=QnSpFRyKWMt39XVVx2ELFJMiClQemrEIudYmDiEkT6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=canLkyVambpx4pJt35xq7s75hBMZ7Z3JP1z1FTrmEtJvpikj5VKqKQ8L+rQmEHOUwmJQ7U+jx8TJvx9z+xGK0F42vSqMr8ylEkNcxD34kgF5fHyv6WnrKnijhYiUDfh67fr0VfkwQ3D7MhoaalbOVgk5/caqjlPqgyjJ3VL38Gs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GWAPetPo; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GWAPetPo" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so2169307f8f.0 for ; Sun, 19 Jan 2025 22:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353618; x=1737958418; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zrM4ECk8Y4tTKYauXOgMnvdhb7JSom/rYyhvfhnsqZM=; b=GWAPetPoBEM+xV0Zx7KvGqkfpT8GBZXtFfd40dWKu/KjHxCtBYv43gJjcQuFBeOPCX 222xhoNC9Q930OKxns1z8JD9SJ+JxD3HqY2tkoQd6RYZUasYM/iFi9UPfJffLvoQ7muJ rlzyIeS/sf0VY5rVfYxiRr8fAc4yakgI3xJ78lDKIpXTl3tnGAhsHJCKgIbBrKFiJgtM 7j5GKdOgGX7YARnoXjhqhxUKQuq8lLdCnVtu0ue4HyJXMDsggpWz1g6LzVDVZ+dBPptb jeAB36YPnXo/EzB1TSCIowd1Ksl69CMdc/0M5b/WmfRQmE14aaghjqkCXVNaSGYrLvIs 1ymw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353618; x=1737958418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zrM4ECk8Y4tTKYauXOgMnvdhb7JSom/rYyhvfhnsqZM=; b=CCE1HATtTItZ6riryo6Gpt0J+OPH4wqe/ViQma52QCBh0B4CE2izjg/wLrqUcUBzgb aLjPM2VFjtm2grTSM/XNm92YPnjmnabzTkxOPG9lGRb5SK5Dvh9F+qPzjENGUIhHKnEw +RAS8wShtlSan0xq7z+LJjaJLXRJx0/Q/Vy4ZUBR1M5hPLAQXe+JR6BrfpktIi1c5Iq5 TkfH1orXV17ORVpc33tSlVVk0rd24l+8g6RarCYwnxrIBCac0wuPq8zZiU0BDjIMN2mb 1jua4zFlld/Kz8XANea5uhYKZ3ajOvIEJk5ofDsvRxgV1wr7iNWe29R+njOJSbculrVU SoEg== X-Forwarded-Encrypted: i=1; AJvYcCXEy3hj8l9JRWhcjUzRkkJWuRS2/eh/aZOYd9Rrc77hnAabrgZQBOeWyeHI+AuSE5Zp15U=@vger.kernel.org X-Gm-Message-State: AOJu0YwQzwJ1xLSG6LIXwBCU9GrxS4EfQq2xgIboa0liB3nPWXJ0Ksf4 6Ec16d4M+40656Loj0hCPyPlxlxiE+lpt4CEtU3dX5XtlRLEy1ICindUbF+ADec= X-Gm-Gg: ASbGncsfqL+TLYVmfZUD8CA++01oqoRrmqj7eK3t3dwdHLSqcQ/HIzfOorePGPLQjET 5DpAzssxw+bTA9L9r74RRajkWvD3KpTAd/ozi5XaQ2tNS3Qg+FGIaxJxyq+stdFv0NQwIJgC+Pn 38zJkDO9RGaQe8aX6ultQtXKg2wE09FeMGBnhmo9QQOT4hmG4FUHl3Bc9uPQiZZPIOozDYnFMf6 j/Znpt1TNTlt4YQu96YRSgBtq/smYvPQllE3zFd8VxNTPac4UJRcBrNBmaDWGthH8JxB+b6NIry 1cvcWQ6R+sY+zVxiCOEzjnJ7e2NjWR6FfSh7pDgq6BS9 X-Google-Smtp-Source: AGHT+IFpRrXKHsSHrGRf1/tQTx4ulvm5uan5qSrL2gEPeDMmiy4K8PABoDPo6hPEEcNwmESkC+jhcQ== X-Received: by 2002:a05:6000:1fa8:b0:386:32ca:9e22 with SMTP id ffacd0b85a97d-38bf57a9b6cmr12043649f8f.41.1737353618483; Sun, 19 Jan 2025 22:13:38 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf322b51bsm9514651f8f.60.2025.01.19.22.13.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 5/7] cpus: Constify cpu_is_stopped() argument Date: Mon, 20 Jan 2025 07:13:08 +0100 Message-ID: <20250120061310.81368-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CPUState structure is not modified, make it const. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- system/cpus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 04fede0e69a..00c16081396 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -857,7 +857,7 @@ void qemu_cpu_kick(CPUState *cpu); * Returns: %true if run state is not running or if artificially stopped; * %false otherwise. */ -bool cpu_is_stopped(CPUState *cpu); +bool cpu_is_stopped(const CPUState *cpu); /** * do_run_on_cpu: diff --git a/system/cpus.c b/system/cpus.c index e4910d670cf..5ea124aed0b 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -73,7 +73,7 @@ static QemuMutex bql; */ static const AccelOpsClass *cpus_accel; -bool cpu_is_stopped(CPUState *cpu) +bool cpu_is_stopped(const CPUState *cpu) { return cpu->stopped || !runstate_is_running(); } From patchwork Mon Jan 20 06:13:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944781 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 05881170A26 for ; Mon, 20 Jan 2025 06:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353626; cv=none; b=lgYbpbmokhyuAB8FfA9muTrt9Q/q8B/6VaVPLJGSSwviEb+FXuRN2X3AVvoX/+IxlDKXS/tIzsMWru9/CWQ5HZbbHB1Zem83cBcaaACfRNjhY6KkHodFIW06m8SDwjHSo76eHzEXDS76aZdCaVc3JrYTriZ9Ut2bWUcsTVmYRIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353626; c=relaxed/simple; bh=UbcHt2LwLMDBmggxq09TlgZnkfoc/PlJS6gnNXquNYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QMI5lOuPU7KRiW6gzh5vdoDgXf7CUDC7eG8rqs2HQ8JmKiqgCAA4K8WivgIuACaOcO5tCqrChuPSAqU6Ds+Xkf1VC+CXjvyvzhr4OjoWQv02KqMkqDDzVLm6tcSoEr+QPgcg6bfD4LraDTubgEuB9wB+wA6DDz/vP7aVooYatn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=yegHqPlF; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yegHqPlF" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-38637614567so1941955f8f.3 for ; Sun, 19 Jan 2025 22:13:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353623; x=1737958423; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Ird8d05maqbGTncIK0+WT8YB4xxN+Zqrhp58nPfLG0=; b=yegHqPlFiI3wffbndooyufepv5l5EHjlSvNoWR+Y+k+FQ6+TzRgaazUxTVsLO1yoga OpT1er7LCvHQiMxg3JclVpfOZ45GN7E9Mj7lxdveJFBsAIVH5P6FtmAbXBMLuEGu29QX eLsFgXGY6e1zs4BJtKq908OxZoGw7l6cD4A38NB+LwfX+cqPGFVJkbJgkCl8qHik/O0X zETm5I7AtfZPtyOt6os4nSmcEnse0Mtnxa9oxddflIBHG5ZL6/X4Jc2ONUNU1p1oGq/q U0D5y7QzQ2njzKVWsMndICe7+YABOU12LZpfNE+UC/QbVftb0SIVS7nUzqNXfYU7iEhQ i7ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353623; x=1737958423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Ird8d05maqbGTncIK0+WT8YB4xxN+Zqrhp58nPfLG0=; b=q1t1NTT0XQUHaTO6kCHZQt6F06pVWgEninUNnNEcIhmVYgi4tIb/CwbIXzqmrq02f4 K/WO31W7T7RfHxXU6NWyuujQRq2bmWnoAPT3k5WfZpehkGXWcs08FFc+zrHotthUC29m A5ZTtbWgssfPw+C2jbJOwJX7+A7GQ360Oj2V/d98z4cZnQX9WvzEmFpK3v1fMsgwCpPT /FzM3YV55hQgMBH23bnSu4hPobgLb8GazIcLzahb3S1b+yqvoONWn0WzFb6HCwK/8Kf2 qBDfKy3qJ5z0IBKHDEL/uf+yblelFqdn4IGRbKYC7eFLu+SSOko83P8IevP44xyaPKuu bSPg== X-Forwarded-Encrypted: i=1; AJvYcCW21c0hhNq1TjXIxq+Op0vP1Dtxwc+SEjkJPgfssFWwVC/c9dTaNddSWRtzRQj8qK6oUZY=@vger.kernel.org X-Gm-Message-State: AOJu0YxV2u4f/SnNBM0WvPAIzjRxP9cH4SevCVr7neNgc+tYcHu36c+y FIhNc6FORR1YgaWJmOuVovlFKwJjocVM63OJqvqEHJAVkRRPOkSfmr+BeR8Pq3E= X-Gm-Gg: ASbGncupMAvCS4h90c4fXfiogPFl8cuWi4r3BcczISY4x6Cr/Zh0usQefpi3vAsWN1+ X3C9YYQR9kZn7rEjEcV8XXLOqApbzq83GwoP8ugb1yY0JIOOC4sgTuAf5RASjgTn4xId3nKMMbU X1opcqBsBdl5J42k6b8ZIp0q94NXxEj/V6XYBlZXOR9jsArAtbXeN+QokCsJlCx+Rwf0xx00ePa NCjddlcu8nc65Bbrq4s2m+wxFTqgUqgpxzp0uwXlFXR3iyM5g1umySb2uB9brJ1JZ+YCkFn3H8B fTT6b23tIPt59DuOEXDQZlQDt9/6uXh5AlY55xk+UaZZ X-Google-Smtp-Source: AGHT+IFU8hm9zhcDunTQJAahNQInd7mdsTjIr3cotSxPYman6nDyWYKdsiEJQfH03ZjnJdvFUnFK2g== X-Received: by 2002:adf:f64f:0:b0:388:da10:ea7e with SMTP id ffacd0b85a97d-38bf5674abcmr8385804f8f.24.1737353623326; Sun, 19 Jan 2025 22:13:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438a46b0497sm58187035e9.28.2025.01.19.22.13.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 6/7] cpus: Constify cpu_work_list_empty() argument Date: Mon, 20 Jan 2025 07:13:09 +0100 Message-ID: <20250120061310.81368-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CPUState structure is not modified, make it const. Signed-off-by: Philippe Mathieu-Daudé --- include/system/cpus.h | 2 +- system/cpus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/system/cpus.h b/include/system/cpus.h index 3d8fd368f32..3a364fe61b4 100644 --- a/include/system/cpus.h +++ b/include/system/cpus.h @@ -20,7 +20,7 @@ void dummy_start_vcpu_thread(CPUState *); #define VCPU_THREAD_NAME_SIZE 16 void cpus_kick_thread(CPUState *cpu); -bool cpu_work_list_empty(CPUState *cpu); +bool cpu_work_list_empty(const CPUState *cpu); bool cpu_thread_is_idle(CPUState *cpu); bool all_cpu_threads_idle(void); bool cpu_can_run(CPUState *cpu); diff --git a/system/cpus.c b/system/cpus.c index 5ea124aed0b..68add85bdc7 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -78,7 +78,7 @@ bool cpu_is_stopped(const CPUState *cpu) return cpu->stopped || !runstate_is_running(); } -bool cpu_work_list_empty(CPUState *cpu) +bool cpu_work_list_empty(const CPUState *cpu) { return QSIMPLEQ_EMPTY_ATOMIC(&cpu->work_list); } From patchwork Mon Jan 20 06:13:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13944782 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 4E4E017B500 for ; Mon, 20 Jan 2025 06:13:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353632; cv=none; b=SZw4qiiULTAJ5p3g+OPed5esG64r/pdH31vOS0friEyZm/v/am1k+EYSETU1VmTf5bhuhyBeAlFL8Wt/A83zOcTjY3dXQfjzHZ8aBqRP58eI0Q0+2EWXoD6io7FwPYUQzQWuspHqxIHFw1+oviOEcjHDy1UvGQT/3MOvK5F5UE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737353632; c=relaxed/simple; bh=jXFvW8XudiOgqLJlxmJ8GiuJEXdXvfm/Zc0Q4NP5Ef8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GGmW5hzRFw5o2dEQAyo9O2sCudILMEqeNMvHNjvq3j2qlzk9Es7d6CdmelLbmLJOAWT6+6deC+LeVr0ro/Mimm+wkuTI12lwPnmx3wLk9PtE5ddcs4brVByhvZr5v63YBaNQX4dq3OosSz2F9ysHhDeQawzdmjldleFASgieobY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gWolf4mS; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gWolf4mS" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43675b1155bso46964135e9.2 for ; Sun, 19 Jan 2025 22:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737353629; x=1737958429; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wKEZ5Gc0MaEdPP/MbnZX7nNPxiya+TPlVmj68CfFcS4=; b=gWolf4mSUGi6Z4stj3P/VIoOOqIi1pcFu7NUjfMc1zBxy5ZjRMLlRm8Lqtf9eiWcQN u4fwVQGEtezHWtbCbgwQ9UNnv+BoYIqNhzbrSABB3mgdbViDH6BaN6MY6R4+sJM4dYBD nbJpByNg3+wpRYvGomEmoYBhjc/N4IIhxroASUqsPiJS/DF46fOI8zwv/Uxf/fzZblUi L4/n8i7AKSJoM7ykmxriUD6FcZ6fF1MJ8fYvq4ijx17mY4DU1v3k8GVkaYbKQI5AsEQU 3eu5RX0d/TFxlWoUTdWv4DIdPALUC0+LVZbPVr8B7DnMeeeMttMjOLTvZCuXcBlvomYo nDtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737353629; x=1737958429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wKEZ5Gc0MaEdPP/MbnZX7nNPxiya+TPlVmj68CfFcS4=; b=OelRmq8srNnKVa5sQYLMTViKp4MDna1DIQ30KVCitFcgEHEsv/2HgFsQGgB6FkayrJ wU7WpB7ZE0ayIv3jNwqSKABbB+LrpQgxtcN7vMyDlT3zApT0XUD9ey4gkqFTceYcSmAr CyJ8xneXCRCs9g9/dws99VQcG5J5fSuMKL/v4QoxwlepKtnffqG5UF7QFLIs9C21JV/6 g9erq4+rhN5S9j2aJmCNM4wo+qW19oRAbuJPKLIt1DpBwRH12M8z5o1YBfuk51eynpKE wj+8AsGdsKKgnF5QBMPzSfaqaFNWR+VmgXmWK1i6IL5BfUq9IcC5sPUFFlq0ENsIpZX0 Zupg== X-Forwarded-Encrypted: i=1; AJvYcCWMh5qcsZw77qurKdwy/xJI7/tah8tv3w8poXTK9+86e1l75bdyMewWrEHnPbZFVVxrvG0=@vger.kernel.org X-Gm-Message-State: AOJu0YzifOsZRBMaanpL8R7PeM7jUfEufk8ZgIinDkpSdR7OgM7mMqWp Ng60jTwDuBRRCgkVgDgAJkj5GGKTGWmNdAoJb3rd+qi/2b5560bdy3xcUnnq40zno2moJSyhdil 4ZPE= X-Gm-Gg: ASbGncsYgnhRvmNWwoPnMCJjv9bergVDJeo2SxNEyF6tDRxAIwpuV9/HjymCnnjGAWv uRFCZl71qr3SiGkeZkdVSadz+HdCVtEkJSSu3BcLWr7bvlAj8Sw/xM/KdxnEK6lWkjPyq1Y0s3b SHvClijOxIQFRJ9ywQEyhPojgYTrhysG+qVWax9zs/5fRTN286jt59Mw0Cj5kJB3SIBtu7uS5jL 0xvxR2r4S9oko5Oy3frGIBwJOku+qmDtKustTzlfoWYrbC76zaY7fPso28vH1ZRi1tyiobPatVu F9CXcj/DUDY0fcYnWGbUzFMw26xjKELGfL0cauaBbbug X-Google-Smtp-Source: AGHT+IF3ZixHgb9kVDxTB3w0WdS8jdw4KJ6vkxB5hgsmoOroKPAlcnW8aEEI/4k9aD5KloGvvlrCZw== X-Received: by 2002:a05:600c:ccc:b0:434:e9ee:c3d with SMTP id 5b1f17b1804b1-4389141c1e5mr91481345e9.20.1737353628808; Sun, 19 Jan 2025 22:13:48 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3282a63sm9465662f8f.96.2025.01.19.22.13.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 19 Jan 2025 22:13:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , kvm@vger.kernel.org, Laurent Vivier Subject: [PATCH 7/7] accels: Constify AccelOpsClass::cpu_thread_is_idle() argument Date: Mon, 20 Jan 2025 07:13:10 +0100 Message-ID: <20250120061310.81368-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250120061310.81368-1-philmd@linaro.org> References: <20250120061310.81368-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If a cpu_thread_is_idle() implementation accesses @cpu fields, it shouldn't modify them. Make the argument const in preparation. Signed-off-by: Philippe Mathieu-Daudé --- include/system/accel-ops.h | 2 +- accel/kvm/kvm-accel-ops.c | 2 +- target/i386/whpx/whpx-accel-ops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 137fb96d444..8cf353105e2 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -39,7 +39,7 @@ struct AccelOpsClass { void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ void (*kick_vcpu_thread)(CPUState *cpu); - bool (*cpu_thread_is_idle)(CPUState *cpu); + bool (*cpu_thread_is_idle)(const CPUState *cpu); void (*synchronize_post_reset)(CPUState *cpu); void (*synchronize_post_init)(CPUState *cpu); diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index a81e8f3b03b..3fe26f54d30 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -72,7 +72,7 @@ static void kvm_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } -static bool kvm_vcpu_thread_is_idle(CPUState *cpu) +static bool kvm_vcpu_thread_is_idle(const CPUState *cpu) { return !kvm_halt_in_kernel(); } diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index ab2e014c9ea..ae4f1282801 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -77,7 +77,7 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) } } -static bool whpx_vcpu_thread_is_idle(CPUState *cpu) +static bool whpx_vcpu_thread_is_idle(const CPUState *cpu) { return !whpx_apic_in_platform(); }