From nobody Sun Nov 24 06:45:31 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=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1728896063; cv=none; d=zohomail.com; s=zohoarc; b=RseQwPrE9JaEa4vF0XjZjt4iOp2610XpDh2hB/9nl4uyBWeatH2uBRx0iZLnGztn1DNGhA83Y0U12ik05nynkmt5Xp1KegUVz8lPQohHtn8v2XaFqdRQA4ETRwjDgpnD2jaReJUX2wE6eL4JxrllQtQn1f6eN75pkGWHXt68fhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728896063; h=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=tUEXdxMnhhDzo/2gzjHB2TfqPR4THpXflyTPiqcQYhg=; b=YuGzSgDF2OJbRJUuvCWhhLoFkhLNYQAEDCgnRe8B2k68MQT0BEv6wdwHQEkktpGML8TzsGNxETq9os43tCA6U45Tu1OebsLEulQHB6COox8qG+ALOtdqo38mUANEwYw7yFiCJ5ykC16PljB+Ri48kWu6ml0kK9mN/IkhOE6DCHs= 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 172889606333443.71119014566489; Mon, 14 Oct 2024 01:54:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.818523.1231855 (Exim 4.92) (envelope-from ) id 1t0Gpq-0000Vd-Sj; Mon, 14 Oct 2024 08:53:50 +0000 Received: by outflank-mailman (output) from mailman id 818523.1231855; Mon, 14 Oct 2024 08:53:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0Gpq-0000Uw-Mm; Mon, 14 Oct 2024 08:53:50 +0000 Received: by outflank-mailman (input) for mailman id 818523; Mon, 14 Oct 2024 08:53:49 +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 1t0Gpo-000862-WA for xen-devel@lists.xenproject.org; Mon, 14 Oct 2024 08:53:48 +0000 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [2a00:1450:4864:20::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d3e625df-8a09-11ef-a0be-8be0dac302b0; Mon, 14 Oct 2024 10:53:48 +0200 (CEST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a99ebb390a5so291037566b.1 for ; Mon, 14 Oct 2024 01:53:48 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80f2446sm551817766b.206.2024.10.14.01.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 01:53:47 -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: d3e625df-8a09-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728896028; x=1729500828; 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=tUEXdxMnhhDzo/2gzjHB2TfqPR4THpXflyTPiqcQYhg=; b=VZASOegr+0HPihLAeEU+kxpkZVIQ+yKWy96TH932Z58r+OKxuVRKJ5UjPsvQqmX/bt t62mn39jCTNwZQE2mS+mFFwVPuaLLbVU9UB5F56BRn5/V5yvj2SpNLeI646YQqwEQl/F UrbtxIIqypQitUjktuMjA4WT5D2Zq0AQv5o2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728896028; x=1729500828; 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=tUEXdxMnhhDzo/2gzjHB2TfqPR4THpXflyTPiqcQYhg=; b=H3vK+N/FxhfXo2+OL1Z0HDZ4izsbbHbhS0fjgRMMYYnQy7NhVyOJNTphZKDUBo2yau Ou0ODyw7MhaJpyLx16HRTCO5rEtCMayN8tSdrIt2/5UUMLm/dtYsAyYDpHHYgWmjNCHr PzrXg0D88yqYixyOKRv+EZnQhDYmZb55YaQXug92SPhmxoTbG15ux2mmlRny7dP2VLvE xdeD7IcW0e2+csJKzkQlw+bJMcOTy7/x8APHlTGm77p0rHvkbk85gewH4yUyq1HcCJim vCkWhjB8CyGFgiKtsCiw5O4/6w39epMsNs4VPS7qDUoFZa+QM3fRp4Xvt7qlmQ7uVxZ0 pH7Q== X-Gm-Message-State: AOJu0Yw7kxRTkAHmpbs22+yp7UGDOTryR0BslO+r4KR56zdfEnb2m1jH YhIgP2K7GrpJFrJqJ9hcM1/DvNS5DKcfqy/Qm3koI2y7di3vlllSrIkxPa/z1DdeJdbE230FF43 u X-Google-Smtp-Source: AGHT+IFj+V1uiM2hGVgK8TpUoL7Vy0uU8dQnXhBfw/jVVNHHTVFzCF12fB6dz2k1PZfFxGX1yqzZdw== X-Received: by 2002:a17:906:6a01:b0:a99:ee26:f416 with SMTP id a640c23a62f3a-a99ee270d76mr517229666b.14.1728896027803; Mon, 14 Oct 2024 01:53:47 -0700 (PDT) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v4 5/6] x86/boot: Use trampoline_phys variable directly from C code Date: Mon, 14 Oct 2024 09:53:31 +0100 Message-Id: <20241014085332.3254546-6-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241014085332.3254546-1-frediano.ziglio@cloud.com> References: <20241014085332.3254546-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1728896065433116600 Content-Type: text/plain; charset="utf-8" No more need to pass from assembly code. Signed-off-by: Frediano Ziglio Reviewed-by: Andrew Cooper --- Changes since v1: - split the 2 variable changes into 2 commits. Changes since v2: - revert commit order; - avoid useless casts. --- xen/arch/x86/boot/head.S | 6 +----- xen/arch/x86/boot/reloc.c | 8 ++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 5da7ac138f..dcda91cfda 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -510,13 +510,9 @@ trampoline_setup: mov %esi, sym_esi(xen_phys_start) mov %esi, sym_esi(trampoline_xen_phys_start) =20 - /* Get bottom-most low-memory stack address. */ - mov sym_esi(trampoline_phys), %ecx - add $TRAMPOLINE_SPACE,%ecx - /* Save Multiboot / PVH info struct (after relocation) for later u= se. */ mov %ebx, %edx /* Multiboot / PVH information address= . */ - /* reloc(magic/eax, info/edx, trampoline/ecx) using fastcall.= */ + /* reloc(magic/eax, info/edx) using fastcall. */ call reloc =20 #ifdef CONFIG_PVH_GUEST diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index 707d9c5f15..e50e161b27 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -19,6 +19,9 @@ #include #include #include +#include + +#include =20 #include =20 @@ -344,9 +347,10 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, m= emctx *ctx) } =20 /* SAF-1-safe */ -void *reloc(uint32_t magic, uint32_t in, uint32_t trampoline) +void *reloc(uint32_t magic, uint32_t in) { - memctx ctx =3D { trampoline }; + /* Get bottom-most low-memory stack address. */ + memctx ctx =3D { trampoline_phys + TRAMPOLINE_SPACE }; =20 switch ( magic ) { --=20 2.34.1