From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 DA14C34E74E for ; Wed, 11 Feb 2026 21:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770845755; cv=none; b=qkb+fGrrP2LJGIiZFRoFBpFx9LhbJlxqZM6OhRPs+zmpiExlfWouz73s9LvtsWNd07kFT8mpPLsHUc65KaFaIAz4gGrb2ysrpalfkzxW/yFqTQb0Bjf07eny1viPXQ5LTFyCeMEllvrpJ7T+D0h/IlAv40CgVAz7mOE8FGUJIi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770845755; c=relaxed/simple; bh=94VqIfxqkPdDfQLBDVIyUks085h2KPM8RIenb0Potxk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QzKaigdN/zzuSEyasu5WNOSZ4BSmZxf5Sjaoi64Ei3Cx4LUgG1EwrJeal/uaDBplvE7hbnAb3yS+fQ0WMPeOiUzIz0h/AlQfNwoXluW0qaaDpFqwOTeA/lj5ducWq7zbV2+bb+94d+xXKd9K91zmHyXLAqPrfNCbPEgRXTZesQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=StPnW2N2; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="StPnW2N2" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-48327b8350dso51949475e9.1 for ; Wed, 11 Feb 2026 13:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770845752; x=1771450552; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=+JId8paJjkJoCR3S5gRaKmlCqxgyyzCJ6RtqTjfKE0o=; b=StPnW2N2abUGCZ6BNw/U5m/8dnEs8Pvd6GVzvoXm02iAvI5AJOF1JP/4sJDi8trl55 SofAuU2nCTqIzhQGH0xtWjOYRxTHYfJ9sZtcNkPeaRoxbSOPQdkXqTU0s154z4iOfVxo RT9tmGLa2bIqLOX1VEA15JRXJ2TgcLmbF4C0PO/4rtp7ljkZ0ZyfD3vznCfjxnuk6fAs 8VSkRWTtMY6W/6SLZtWYIEhRzHQjvc1OCrKFNrG3u2KtKWZm7gpvgJa0ckIAgutU2EXU 7Uycg2KZiJqQMmB8zvhPHeIc9jhBAgln7rpQoP6vl/ZGQHpKb9+EpiWqYFCBXpC5mRFR eLaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770845752; x=1771450552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+JId8paJjkJoCR3S5gRaKmlCqxgyyzCJ6RtqTjfKE0o=; b=Lb5dvrM2Q7EpMuy8nNuvdTv5BKKJyvZHaYKLrFMWflJwGefkfwnQtTacYZpje8bXuG 2ugKEuhg9YXRUJcWYZJXpg2rtfUqrLl9klGv0fhP1+dsl/eSxSuwUAZUcp/eftnTaTHF lh/KfzcCeScEJgJBAIDUDD4kGxWY/Jq25Em8ydyIpk8MbpIEcB8f9SqzJeOjQp1xBVq3 X0HphJpZjdh1ftxuUtMdaBeBIsBBAP3B16Zgo1kUrPQA6L9w5cNF9LAGZctTuryZZxIv Hl8jMPcEEeHN/e1QgWjEx1VCh03EbvAHvbahBg/ZfwVe2ojqMTSonXVIOGyVbJtejEsk b5tw== X-Forwarded-Encrypted: i=1; AJvYcCUjudEOAZJFIaE2Kk0dK8hSIT8xQWD2BqHE5dZk1EWyldugVuutJWGYc8zmIv6J0ZXR+Js72Lg/KPkucD8=@vger.kernel.org X-Gm-Message-State: AOJu0YzNE+E+56f8sPpV26dtPgEf1NWDaDZVZzZut5Zcgku6NayO8hJK UXaB9bTXnGvjGoGAsETSqNK5OgZqrg+o9RmewOVQzXVNSwEp/3HHtqaj X-Gm-Gg: AZuq6aJXnyl7lWAzKLxcdx1gQunudvX4gZ7EHZrnpJMT1j16JSbmft1uSxKQmQG7udk dUaEMjqhu8/vGgwAhFnDTdiFYsrBn6hGxy+6JSGo9TjAiF+B/2D/5uIRZTUDh2ZTS2T1+6m6WFE E66Q32dT4bR0a5NuHeP9uX1j+bpGrAjAk+DRFxBUK8BPTOCAdXgZbonVBK1kXS6gFeFgT407yMB TTSIgqwhQcSYTwC+fGgN4arUxGjCQt5vB/bHFmHIjStgBXTrqfrL0DDcMdHdIsCwG5OilqJGKtl IH5XsmuIZ3uzS3xdDVz9CeQg9FDi61y4AKULfUuY9cKN7r5wNXDX0EvcbY0zg3dyvSZ+mez4Ktj jfbUu/8VTjoVLc+03n8Phv0njuLpxNHsWN2B14I/m4UjZU2u78KLjfPa4J6RTC+KmYxfkA7OU/O FRGS3YH7nkrIV+H2bhRUgwAQz//LLIOapAsuvq9N3KqIpqiECfbqMFgbgMTZGmXyhJ X-Received: by 2002:a05:600c:4694:b0:46e:49fb:4776 with SMTP id 5b1f17b1804b1-483656c1098mr6767475e9.11.1770845751996; Wed, 11 Feb 2026 13:35:51 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835ba506cesm35391085e9.6.2026.02.11.13.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 13:35:51 -0800 (PST) Date: Wed, 11 Feb 2026 21:35:49 +0000 From: David Laight To: Andrew Cooper Cc: ubizjak@gmail.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, pbonzini@redhat.com, seanjc@google.com, tglx@kernel.org, x86@kernel.org Subject: Re: [PATCH 1/2] KVM: VMX: Drop obsolete branch hint prefixes from inline asm Message-ID: <20260211213549.1837bb50@pumpkin> In-Reply-To: <5276256b-9669-46df-8fcd-b216f3d3e45b@citrix.com> References: <20260211102928.100944-1-ubizjak@gmail.com> <2af5e3a8-f520-40fd-96a5-28555c3e4a5e@citrix.com> <20260211134342.45b7e19e@pumpkin> <5276256b-9669-46df-8fcd-b216f3d3e45b@citrix.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 11 Feb 2026 13:55:35 +0000 Andrew Cooper wrote: > On 11/02/2026 1:43 pm, David Laight wrote: > > On Wed, 11 Feb 2026 10:57:31 +0000 > > Andrew Cooper wrote: > > =20 > >>> Remove explicit branch hint prefixes (.byte 0x2e / 0x3e) from VMX > >>> inline assembly sequences. > >>> > >>> These prefixes (CS/DS segment overrides used as branch hints on > >>> very old x86 CPUs) have been ignored by modern processors for a > >>> long time. Keeping them provides no measurable benefit and only > >>> enlarges the generated code. =20 > >> It's actually worse than this. > >> > >> The branch-taken hint has new meaning in Lion Cove cores and later, > >> along with a warning saying "performance penalty for misuse". > >> > >> i.e. "only insert this prefix after profiling". =20 > > Don't they really have much the same meaning as before? =20 >=20 > Architecturally yes, microarchitecturally very much not. >=20 > For a branch known to the predictor, there is no effect.=C2=A0 If a branch > unknown to the predictor gets decoded, it triggers a frontend flush and > resteer. That'll be 'decoded taken'. I suspect that it is less 'painful' than a normal mispredict since it happe= ns as lot earlier. Of course, if you get it wrong, there will be a mispredict penalty as well. David > It is only useful for programs large enough to exceed the working set of > the conditional predictor, and for which certain branches are known to > be ~always taken. >=20 > Putting the prefix on a branch that isn't ~always taken is worse than > not having the prefix in the first place, hence the warning. >=20 > ~Andrew >=20