From nobody Sun Dec 22 16:42:29 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=1728310594; cv=none; d=zohomail.com; s=zohoarc; b=EJE2x7ozcCH7Fxdns5SUnTi4OybXh6JrzQBG+Oo9LsRqjSqdFUJGzPP3s9JXZ17ABLLpaSlq4WjgEY+BupDEDmrD+LegUeguX6hUmor81DYtJdegSAmbFIdX8Hp+TmpsPLl17lu1Fi2WdcI5+aIt+voMLh+IDKSz71jsvWTmA1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310594; 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=tpfgwl9+LkPM73G0fVQDQXvT2n2qaAQPOJ+RtwChmH0=; b=Ue5DTlLdmoKexolXf1ee/SZ6ssMiKr98NLSsd1z+vI5rh5YXsbMUbrjVBW6xjGpmpPESzuy4BEkYLbfkX8XwkjeNI4r+q9q4epTEhrzcIIX33fCB+zC9Qjhk6BiHZ74s+DBIa9jQ4eLhqsISCODvl7l6wKcdw4mwZJuG5yAFkPM= 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 1728310594184332.22353480757033; Mon, 7 Oct 2024 07:16:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812038.1224749 (Exim 4.92) (envelope-from ) id 1sxoWs-0004YA-2t; Mon, 07 Oct 2024 14:16:06 +0000 Received: by outflank-mailman (output) from mailman id 812038.1224749; Mon, 07 Oct 2024 14:16:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWr-0004Vq-Q3; Mon, 07 Oct 2024 14:16:05 +0000 Received: by outflank-mailman (input) for mailman id 812038; Mon, 07 Oct 2024 14:16:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWp-0002dC-KI for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:03 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id aea8827a-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:02 +0200 (CEST) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2fad15b3eeeso47337221fa.2 for ; Mon, 07 Oct 2024 07:16:02 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8e05c119esm3386204a12.55.2024.10.07.07.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 07:16:00 -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: aea8827a-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310561; x=1728915361; 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=tpfgwl9+LkPM73G0fVQDQXvT2n2qaAQPOJ+RtwChmH0=; b=eIgGHE2YFTf0f7wq7yvQ6ztv3EUjegLUvcaB59N2JIxNkJtPLt8WVcJVXzeVrU9/jL YV7vKWyU15mtpHde3lSIN9pGjZslQGtlhO0I0eTRrJ3HHdDm9N+ozHiOfCNWqubnrjIr 0J+uQR3b04WreMNgYY1msP6WfK0P8b/rYntoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310561; x=1728915361; 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=tpfgwl9+LkPM73G0fVQDQXvT2n2qaAQPOJ+RtwChmH0=; b=cGmHVgdbwTCsNPPdRvDGf2VEPPrka3ROSaDL2k4xbToJlQd3doo2nFk2JPsbPuQZV+ qJN8kM/OXEIbRhxrTzuk7NeZVSHcqACo/oXc1bbKcuoAvQ6ZDvNPjt/U4l+7nCdNW1Au 3BlvWxnqFUgtFZNfBaIVi4HZG1aEEQTR2TmABuLQ//HCITeLx+E9voFQOTgsVqJvOnNL o7LelKxjEJvSJYusOa3ch69khyd5Hv98YEE/K4VRBBHRfNdcKxKO5cTCfawy9o943JPp o99tfixy0BJ1Z4qMlHTCz6KKVT1a9IrieJpWm/fXgEejfr7rTowkF7HHtdQuvLfbNEDm kdGA== X-Gm-Message-State: AOJu0Ywda0T2yn7L+IoiZJnzxHDbZ++cUysWl++n+2JUFK2lP8JBgCMZ tHzjmAVilYDbPLs8JDik7G1DqRNvi3KZKLkbYUNsJuViQPzmcxIBQZdMKrEuJ1Nmjetp56XnYB0 p X-Google-Smtp-Source: AGHT+IEF0VnaL/GsX6YzvLTL6b7/rr5ZLQnGRRxavwji5QCpcOUL3lClS1wbCjiH2SxtHUBATOzmmQ== X-Received: by 2002:a05:651c:19a2:b0:2fa:c60a:ce6f with SMTP id 38308e7fff4ca-2faf3c1cf0emr57552911fa.16.1728310561379; Mon, 07 Oct 2024 07:16:01 -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 v2 5/6] x86/boot: Use trampoline_phys variable directly from C code Date: Mon, 7 Oct 2024 15:15:38 +0100 Message-Id: <20241007141539.1899350-6-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241007141539.1899350-1-frediano.ziglio@cloud.com> References: <20241007141539.1899350-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1728310595480116600 Content-Type: text/plain; charset="utf-8" No more need to pass from assembly code. Signed-off-by: Frediano Ziglio --- Changes since v1: - split the 2 variable changes into 2 commits. --- xen/arch/x86/boot/head.S | 13 ++++--------- xen/arch/x86/boot/reloc.c | 9 ++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index ade2c5c43d..32b658fa2b 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -510,22 +510,17 @@ 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 - + /* Boot video info to be filled from MB2. */ #ifdef CONFIG_VIDEO - lea sym_esi(boot_vid_info), %edx + lea sym_esi(boot_vid_info), %ecx #else - xor %edx, %edx + xor %ecx, %ecx #endif =20 /* Save Multiboot / PVH info struct (after relocation) for later u= se. */ - push %edx /* Boot video info to be filled from M= B2. */ mov %ebx, %edx /* Multiboot / PVH information address= . */ - /* reloc(magic/eax, info/edx, trampoline/ecx, video/stk) usin= g fastcall. */ + /* reloc(magic/eax, info/edx, video/stk) using fastcall. */ call reloc - add $4, %esp =20 #ifdef CONFIG_PVH_GUEST cmpb $0, sym_esi(pvh_boot) diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index 94b078d7b1..4cca61adec 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 @@ -346,10 +349,10 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, = uint32_t video_out, memctx } =20 /* SAF-1-safe */ -void *reloc(uint32_t magic, uint32_t in, uint32_t trampoline, - uint32_t video_info) +void *reloc(uint32_t magic, uint32_t in, uint32_t video_info) { - memctx ctx =3D { trampoline }; + /* Get bottom-most low-memory stack address. */ + memctx ctx =3D { (uint32_t)((long)trampoline_phys + TRAMPOLINE_SPACE) = }; =20 switch ( magic ) { --=20 2.34.1