From nobody Wed Feb 11 03:02:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694597498; cv=none; d=zohomail.com; s=zohoarc; b=Bs8phBUvcg85dPm/tcuQTp+x7nWfa1VwYF+cLX2nuslcSb+BRTDSA1Yif14k7yIfImDCRyCzlmm6d9V/bvsVRRaArGu4mJh/ug29ojx5DXFF3O/nZwUZJw+w7UJzOLK3dOJgG+5vaSMgqnXzcmGvAaF5sX15LTrksVXR/Fh2gnA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694597498; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4Qlz4UlYziPNq8F2NThvhMEsqE2XcvVN84mcny9xQ0s=; b=e0WXArvhLlL0y4lgIWjbkZiHGfD2QO4WM3hzZyaSJ9e8m+2F8LHg9bwlClvszq/K26wIbLntNmgmRIZrSj5tpOpZVVec3JiGKIB5j5cPS9g1N2H3yZOW0zrFCtzCljD632YbMGUXgFMWIsXfpnjEUCjrjg8CLJowCOJM8FkoXnA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694597498039132.69763182380768; Wed, 13 Sep 2023 02:31:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgMCr-0001FB-Nx; Wed, 13 Sep 2023 05:30:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgMCq-0001Di-8U for qemu-devel@nongnu.org; Wed, 13 Sep 2023 05:30:44 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgMCm-0002JY-DE for qemu-devel@nongnu.org; Wed, 13 Sep 2023 05:30:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-402cc6b8bedso74613855e9.1 for ; Wed, 13 Sep 2023 02:30:38 -0700 (PDT) Received: from m1x-phil.lan (176-131-211-241.abo.bbox.fr. [176.131.211.241]) by smtp.gmail.com with ESMTPSA id x20-20020a05600c2a5400b003fe601a7d46sm1452383wme.45.2023.09.13.02.30.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 13 Sep 2023 02:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694597437; x=1695202237; darn=nongnu.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=4Qlz4UlYziPNq8F2NThvhMEsqE2XcvVN84mcny9xQ0s=; b=StI41PZpsGof1u6ic0imNlFMajuNiHlWROgMEep7VDj4TXwcRMamR5f4CGDKsJlTnw K5QKBYzQOuPl9Vja6/MeTf7CB1UhaiZZpeuqlFdlJzGAszxgvttC7Y+CaidTXECM5ePf Tceqrk7fK/Zh+Ts7jgT/cBgeGMxu689TpnWVwRrDHgzX7cljCH748yX9Qj1FAUuCc+4D 84iMOtoC/V19K9k7PfBegkgSlM8NgZ+2hjFi6FKkdwx4JyKd5QztGPTOOiWYFy1/upv5 un9BQ8Rt/58Fz9wOkSxGb6sDb6cTRAbBqjirdvAJNgwpC36baGeruxMT5DUAQUqytdjI xd5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694597437; x=1695202237; 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=4Qlz4UlYziPNq8F2NThvhMEsqE2XcvVN84mcny9xQ0s=; b=YhOvbRKvfFq0EoPyKObcwKisaehwst5TjcCD8UsSrkQ2kugXF2xlNFdEfhZGsk/Sbj 2p/yfQdUmavsHYSki6xUMVP+3kHg1X8HuAOKk1+jhzzCFtqg3V09O5ChJZtKUa5Mbak6 TIhbx3XQZCP5QCbAqdJWLfLB7sevDLLMFdxJPAwjNM9C7xzI07VZfKYoF5dSciTIQ2QG 0vLiD3uUtDprHbHIrVl/0La0RK8siSty5Xn8Ogpk8pE7rLpDOW2wrCDasYDQ+D3RjtTi JyYWrM/hA3wrKBgaaUgLnsu6r5HHiFfUABgCuaiU5pr2YRZLy/Em9MCXxrgS3WMD9265 FWUQ== X-Gm-Message-State: AOJu0Yzh7+TFFWXJp6zHlmlc7Zf0kB9qQxkRPrU4Tkh3ZUGEtFo5ir5d dRuKtDvToGjMN4nsIGfVgTYG3KBKBJHL8CwmAJg= X-Google-Smtp-Source: AGHT+IEWpdoM+WDhrPjgODkxBAhlOnSq5m//vf86ss/9hM1maxstZ2t2i4/KaLoJUfi0o2DpthLKLQ== X-Received: by 2002:a05:600c:1c89:b0:402:cf9f:c02d with SMTP id k9-20020a05600c1c8900b00402cf9fc02dmr1480014wms.8.1694597437459; Wed, 13 Sep 2023 02:30:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , kvm@vger.kernel.org, Paolo Bonzini , Stefan Hajnoczi , Michael Tokarev , Kevin Wolf , Richard Henderson , Daniel Henrique Barboza , Marcelo Tosatti , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 4/6] target/i386: Move x86_cpu_get_migratable_flags() around Date: Wed, 13 Sep 2023 11:30:06 +0200 Message-ID: <20230913093009.83520-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230913093009.83520-1-philmd@linaro.org> References: <20230913093009.83520-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694597500343100003 x86_cpu_get_migratable_flags() is only used once in x86_cpu_get_supported_feature_word(). Move it the code just before its caller, to reduce #ifdef'ry in the next commit, when we restrict both functions to system emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b2a20365e1..3df85a6347 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1664,29 +1664,6 @@ static inline uint64_t x86_cpu_xsave_xss_components(= X86CPU *cpu) cpu->env.features[FEAT_XSAVE_XSS_LO]; } =20 -/* - * Returns the set of feature flags that are supported and migratable by - * QEMU, for a given FeatureWord. - */ -static uint64_t x86_cpu_get_migratable_flags(FeatureWord w) -{ - FeatureWordInfo *wi =3D &feature_word_info[w]; - uint64_t r =3D 0; - int i; - - for (i =3D 0; i < 64; i++) { - uint64_t f =3D 1ULL << i; - - /* If the feature name is known, it is implicitly considered migra= table, - * unless it is explicitly set in unmigratable_flags */ - if ((wi->migratable_flags & f) || - (wi->feat_names[i] && !(wi->unmigratable_flags & f))) { - r |=3D f; - } - } - return r; -} - void host_cpuid(uint32_t function, uint32_t count, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { @@ -5679,6 +5656,29 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Err= or **errp) =20 #endif /* !CONFIG_USER_ONLY */ =20 +/* + * Returns the set of feature flags that are supported and migratable by + * QEMU, for a given FeatureWord. + */ +static uint64_t x86_cpu_get_migratable_flags(FeatureWord w) +{ + FeatureWordInfo *wi =3D &feature_word_info[w]; + uint64_t r =3D 0; + int i; + + for (i =3D 0; i < 64; i++) { + uint64_t f =3D 1ULL << i; + + /* If the feature name is known, it is implicitly considered migra= table, + * unless it is explicitly set in unmigratable_flags */ + if ((wi->migratable_flags & f) || + (wi->feat_names[i] && !(wi->unmigratable_flags & f))) { + r |=3D f; + } + } + return r; +} + uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, bool migratable_only) { --=20 2.41.0