From nobody Fri Nov 22 08:01:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1727882884; cv=none; d=zohomail.com; s=zohoarc; b=MBGCEGIJO2qQkVv/1k6p7kzeMP8eyP7XFA1eenCA86Favwa3HZF5vlwUpXapkHIiu8+iL70fdHUmHq32d1m3rUWHzU/DGnGeNFRo8va3ZQDWvmolB8j1yFnLwqafzqoZRgTWLybd1qpNRQ/B7M7EFRV7tPfORs+nefQZlBCL0fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727882884; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5lEtOt7sJb/gqHGmXN1HeKQkSgPlz46zJUquNaFSqHg=; b=eR68BZ8ZtZjvF7CRPdXT+HsO3UdqjCGJtgjRfq4+x5173sfzURi2nImdXfI8Vkqe53mHJYBSm4AUccxzdelJ9BgQiaSbtyXOVkKDf5skPvlOLy/2+LcB+xcYReXpITkrO8pUKChkUeZhoRP3wxTQ4TAo87tH8YWUK7DcUzU1+ts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 172788288492044.64522396937184; Wed, 2 Oct 2024 08:28:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.808904.1221023 (Exim 4.92) (envelope-from ) id 1sw1GS-0000h4-4n; Wed, 02 Oct 2024 15:27:44 +0000 Received: by outflank-mailman (output) from mailman id 808904.1221023; Wed, 02 Oct 2024 15:27:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sw1GR-0000g7-V4; Wed, 02 Oct 2024 15:27:43 +0000 Received: by outflank-mailman (input) for mailman id 808904; Wed, 02 Oct 2024 15:27:42 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sw1GQ-00070n-E7 for xen-devel@lists.xenproject.org; Wed, 02 Oct 2024 15:27:42 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id dd84ee6f-80d2-11ef-a0ba-8be0dac302b0; Wed, 02 Oct 2024 17:27:42 +0200 (CEST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5389917ef34so8060512e87.2 for ; Wed, 02 Oct 2024 08:27:42 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c299ac8esm880024566b.222.2024.10.02.08.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:27:38 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: dd84ee6f-80d2-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1727882861; x=1728487661; darn=lists.xenproject.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=5lEtOt7sJb/gqHGmXN1HeKQkSgPlz46zJUquNaFSqHg=; b=IbFFFTol0BkenkkcaEl9GD18KalA1qN950jkkIiCGZBZLpQ1CgdChHaWMFoZ98poQa Msg/0RAktQZsO+mqeNsa6rbEAqKYE1dRSC36c+ySkBCSVc31UiHPp3aV5fiWH4VbVKt/ CmmZGLHLJqkzarLYyH+TXX22F2LRE6T6idtSM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727882861; x=1728487661; 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=5lEtOt7sJb/gqHGmXN1HeKQkSgPlz46zJUquNaFSqHg=; b=H32bKwzqbi61V65LLz099JrvCCu+s2SIoJNNmFYfihgmDn3mKcn4CRp/QroRqFlueH /DoaTLixsBBLYYGR157uZ0OO2Aj2VDTLDK1ChEISli7RrPReraVX51OZaqWjZ+QYL6oC bO7dFbz2mXGJ3L37Pf01gw/+s5V0vwKIhQaLecRO/aXuAT2KJpUu/X0/6+gV+31KZMTq Msalk85ynxWKmDSnUsbSIzATv3KE6GOAdkFxxIez8X3H9Y7vOGpRzD9yTHEZx0K5Qmof pMhsmMaoi1GsVvJUk0qxUNUSqnVsbXhkjMKD/OtyaUUMM0VgGAgQ8f4gNbP+VW9IyZhl 8a0w== X-Gm-Message-State: AOJu0Yxpn9LAlznVmOAjrmQdYINIwPYX+ABVfgQohZw8zyyHHlqaXrxY 8agYCsc+OeTehIHBcY6kzBqBUDv2QF17IJ6lu6Ow/PPFnWRZWRLe3gn+TU8XwDnpPSnRxyabwJ9 C4qg= X-Google-Smtp-Source: AGHT+IFMz20lzYRyDTFBCZuZGX8TbKWpGePrGdiPdDMdq/Mk7wnanI7JzKks4Wc91CB+zV8GtQaQpg== X-Received: by 2002:a05:6512:2245:b0:535:6cde:5c4d with SMTP id 2adb3069b0e04-539a065c3e0mr2158383e87.3.1727882860654; Wed, 02 Oct 2024 08:27:40 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 5/7] x86/alternative: Replace a continue with a goto Date: Wed, 2 Oct 2024 16:27:23 +0100 Message-Id: <20241002152725.1841575-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241002152725.1841575-1-andrew.cooper3@citrix.com> References: <20241002152725.1841575-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1727882886690116600 A subsequent patch is going to insert a loop, which interferes with the continue in the devirtualisation logic. Replace it with a goto, and a paragraph explaining why we intentionally avo= id setting a->priv =3D 1. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/alternative.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c index 5ea7f51b007c..b745f112154a 100644 --- a/xen/arch/x86/alternative.c +++ b/xen/arch/x86/alternative.c @@ -328,7 +328,15 @@ static int init_or_livepatch _apply_alternatives(struc= t alt_instr *start, buf[4] =3D 0xff; } else - continue; + { + /* + * The function pointer we're wanting to devirtual= ise + * is still NULL, and we're not sealing yet. Leave + * the alternative fully un-processed, in order to= try + * again next time around. + */ + goto skip_this_alternative; + } } else if ( force && system_state < SYS_STATE_active ) ASSERT_UNREACHABLE(); @@ -343,6 +351,7 @@ static int init_or_livepatch _apply_alternatives(struct= alt_instr *start, =20 add_nops(buf + a->repl_len, total_len - a->repl_len); text_poke(orig, buf, total_len); + skip_this_alternative:; } =20 /* --=20 2.39.5