From nobody Sun Dec 22 11:38:01 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=1728310583; cv=none; d=zohomail.com; s=zohoarc; b=dr4E1DtkvKPi2/ei9cEkbA+9X+QMijc5P/nu0xtIhZkEx5oxIU/SNrSSGc42YHUqKcVz3bg3w7XhlMKHw5L01PMa5CkHQivzyd3BJYmeVaYNjZI99x/bW8J3YWkFHw3UWC9ECXqfF+SmZJ/XDErG2sEimrH74Z9FwXDx6qVaakY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310583; 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=MRy9E4WznSom1/J2SL1lqN+BMsNpK3QJfQzYcePqKBM=; b=DrrHgrHAllxPC4p6WHmareE7ngyasG0YG0dV/czftyP4Wf8eZzyeByTMPaZeyvPC3EswtcIQL22sHgjLXSq9IqYstdomRx6LsMrlsPBUJQoKj4akq7w2D/iG9taDf2l5klLwKopRMG++PZIFZHvxmyOqbvIrjrWwHsLP0i1rN6k= 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 1728310583876282.937919317812; Mon, 7 Oct 2024 07:16:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812034.1224708 (Exim 4.92) (envelope-from ) id 1sxoWn-0003Pp-F6; Mon, 07 Oct 2024 14:16:01 +0000 Received: by outflank-mailman (output) from mailman id 812034.1224708; Mon, 07 Oct 2024 14:16:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWn-0003PJ-7q; Mon, 07 Oct 2024 14:16:01 +0000 Received: by outflank-mailman (input) for mailman id 812034; Mon, 07 Oct 2024 14:16:00 +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 1sxoWm-0002dC-Bi for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:00 +0000 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [2a00:1450:4864:20::52d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ac8acb83-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:15:58 +0200 (CEST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c88e45f467so7377292a12.1 for ; Mon, 07 Oct 2024 07:15:58 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8e05c119esm3386204a12.55.2024.10.07.07.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 07:15:57 -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: ac8acb83-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310558; x=1728915358; 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=MRy9E4WznSom1/J2SL1lqN+BMsNpK3QJfQzYcePqKBM=; b=U0BRj+1EFayGnxqF3DrtI/WXWs7JsnXjt9SIqL5tx9A6hWVJToBJUXtxZDzlb2Y1XL wv5y5kdd0asreaKdP1pOnDi4ltcL0lr1JDK9kbiG9cyQIdV8joJ5+XK3MJ532PFtmGcJ EomCUbiPZZW/t4rudu9DfirJWkd3V23Lf8/Qs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310558; x=1728915358; 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=MRy9E4WznSom1/J2SL1lqN+BMsNpK3QJfQzYcePqKBM=; b=obqZxP91uS0+tONWi+PxpsnK+OeW4QpTEFc6BsS5Mprx8V3dXsIBMtimROas6Vh8Bn JYkbLu/NBgvhmSxKJaxW3bFv6fSFiVjy4hrni8JvbsNAy162Sw4yIvjH/dyE28l0431S 62a48EArqBTsgEeWynOBDyMXRHWrf2wj3urkkfUVitQ1ByLfyaDQISTwPf9mgBZvvlAa HzCA5aDNijeoq/fLvK4PLJrOvleZdZXifbuwz9D1+/t1DuzK6we0QvOf+t3gKBv3elbG scDMGZ2HZG+PHgVdBmT9He0A7XaEaMq4Iw+9yycghbG2sHsRSC4TamAZNHzwqEO2Y+ux Jy0A== X-Gm-Message-State: AOJu0Yw8wj0DDanLn0hrDsECU2weptln2mWT4UnSZUd4BK+AhNFeu7vV i/Wv6w8DcVghOnGdMpIG5Rn+gBJ4hIknEVGsnDS8CrQ1nhhWBJhiyYgpheAj88kS1Sc6GYntPoq 8 X-Google-Smtp-Source: AGHT+IFvMZ3MdnMKNmBIXqM2N3QWIBgPc3V0XUJuKrj9sTyeYf5AjCIfkMr96MfWko9Ru+iosrKe+w== X-Received: by 2002:a05:6402:13c1:b0:5c8:a023:6b8b with SMTP id 4fb4d7f45d1cf-5c8d2f7d4bbmr14029909a12.15.1728310557854; Mon, 07 Oct 2024 07:15:57 -0700 (PDT) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v2 1/6] .gitignore: Remove not generated files Date: Mon, 7 Oct 2024 15:15:34 +0100 Message-Id: <20241007141539.1899350-2-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: 1728310585436116600 Content-Type: text/plain; charset="utf-8" Both reloc.S and cmdline.S are not generated since commit d58a509e01c4833515a9a8340706d1a23bef168b ("build,x86: remove the need for build32.mk"). Signed-off-by: Frediano Ziglio --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index d88be80b28..5a75b204f7 100644 --- a/.gitignore +++ b/.gitignore @@ -248,8 +248,6 @@ xen/.config.old xen/.xen.elf32 xen/System.map xen/arch/x86/boot/mkelf32 -xen/arch/x86/boot/cmdline.S -xen/arch/x86/boot/reloc.S xen/arch/x86/boot/*.bin xen/arch/x86/boot/*.lnk xen/arch/x86/efi.lds --=20 2.34.1 From nobody Sun Dec 22 11:38:01 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=1728310577; cv=none; d=zohomail.com; s=zohoarc; b=NNnLsRlcR7L7dqj0Xg9G2q2p08DiYJuGMVIDTxexgiG9c9w9cUlvrHSM3LwWvuBOhtHPKMLFdm+PA/Mi7N2VOSkBmvDIQ/mU+YJOAMdml7dzhMVEZ7R+DKev9nWtPNd4pSFGlb5ql67lOED+9E7QAIHudMsrJQHm9k1wLLTCB5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310577; 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=qIJLH+pNn+xqq0KYYUmnx97/J/kG6GN6HUy92X5OMa0=; b=NvfxOOQUGJKU1eo1gg2ksfHTPm/MpMCEsh09ar3h4CouTZDYSbaWNp4vYij0yQIr3xoj+zzDdXgXutdqHB+cPubvEwdO282pBDObivPh4vIlyu5d5E41NtV9sTLkKPij5Mcn+3zd+bhqCUuShCOW5GWq1wZLiySbyywcqmqHVNw= 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 172831057732716.908419626027808; Mon, 7 Oct 2024 07:16:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812033.1224701 (Exim 4.92) (envelope-from ) id 1sxoWn-0003MK-2P; Mon, 07 Oct 2024 14:16:01 +0000 Received: by outflank-mailman (output) from mailman id 812033.1224701; Mon, 07 Oct 2024 14:16:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWm-0003M9-Vt; Mon, 07 Oct 2024 14:16:00 +0000 Received: by outflank-mailman (input) for mailman id 812033; Mon, 07 Oct 2024 14:16:00 +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 1sxoWm-0002yM-0e for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:00 +0000 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [2a00:1450:4864:20::234]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ad1e8014-84b6-11ef-a0bb-8be0dac302b0; Mon, 07 Oct 2024 16:15:59 +0200 (CEST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2f7657f9f62so43340481fa.3 for ; Mon, 07 Oct 2024 07:15:59 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8e05c119esm3386204a12.55.2024.10.07.07.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 07:15:58 -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: ad1e8014-84b6-11ef-a0bb-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310559; x=1728915359; 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=qIJLH+pNn+xqq0KYYUmnx97/J/kG6GN6HUy92X5OMa0=; b=Cenvume+/1eXLkAOGI8TFA2+yxll8HKGlSohKjhNQ3JHfXXSZu1OCLKXxSKHbCbg3k UN3aCk1GO5kNfJdER1uW4zC66qlb43gr+adpGXfmI9DFbezXuSMKWAqz/5szn0fpJfhz H31wkAuMnRLshRQP8Oc3K/oa5pgq5nxnBeuAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310559; x=1728915359; 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=qIJLH+pNn+xqq0KYYUmnx97/J/kG6GN6HUy92X5OMa0=; b=BKefQE2d4hv5YSqvUzH480/kp1eLrQOwkcsZpuAyMsxjDIusN5444kU6nXFKJlI6rQ ReZV0hDNW+NiD2lkibeXGb1nkZcz+plWWa12zC7CNhDFUSFi6gQGYMmfpUw0ec21I2wj KddRwrkjSyAGFw9y2g3Eh7Ve3DIta9g1tz0qx15WA/BKIyJIun3XAMBePCAYz9dcVdst aBSiSZC52Gg2QXMGJy4MRKET2nKPCiPvFuukii/N1+uZbu93017m/bQ0AZ02arJLhbTT EassB7GRF9Nm28zmkIvt3q1XCgIj4GQozMwfzIDbSem88oFfNtl46lCWyvCsZ2OlCwgp m8Ww== X-Gm-Message-State: AOJu0YzAGhjiWZ1aTnRQoIycO7Wlw7jMUXRrmWTp5cuLq1ovnLda+AAp 2Do/rePpkx6b0m8RRSXv2Iagx7QDyXFS9ImPRVKrkV89DjhczAhvmX/wHDQi1PCVFVhGGjVKKMR j X-Google-Smtp-Source: AGHT+IFNbTQpUUEqggAFsPrlPpU+tdz/i1iNVix2p3NCtxBXowfuW1xn2FiwJJO1fIXkltbQdVMzQw== X-Received: by 2002:a05:651c:210e:b0:2f9:cf64:aaf6 with SMTP id 38308e7fff4ca-2faf3c30324mr51177771fa.17.1728310558686; Mon, 07 Oct 2024 07:15:58 -0700 (PDT) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 2/6] x86/boot: Rationalise .gitignore Date: Mon, 7 Oct 2024 15:15:35 +0100 Message-Id: <20241007141539.1899350-3-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: 1728310579494116600 Content-Type: text/plain; charset="utf-8" Strip all related content out of the root .gitignore, and provide a more local .gitignore's with up-to-date patterns. Signed-off-by: Frediano Ziglio --- .gitignore | 3 --- xen/arch/x86/boot/.gitignore | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 xen/arch/x86/boot/.gitignore diff --git a/.gitignore b/.gitignore index 5a75b204f7..dae97ebfd7 100644 --- a/.gitignore +++ b/.gitignore @@ -247,9 +247,6 @@ xen/.config xen/.config.old xen/.xen.elf32 xen/System.map -xen/arch/x86/boot/mkelf32 -xen/arch/x86/boot/*.bin -xen/arch/x86/boot/*.lnk xen/arch/x86/efi.lds xen/arch/x86/efi/check.efi xen/arch/x86/efi/mkreloc diff --git a/xen/arch/x86/boot/.gitignore b/xen/arch/x86/boot/.gitignore new file mode 100644 index 0000000000..a379db7988 --- /dev/null +++ b/xen/arch/x86/boot/.gitignore @@ -0,0 +1,3 @@ +/mkelf32 +/*.bin +/*.lnk --=20 2.34.1 From nobody Sun Dec 22 11:38:01 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=1728310589; cv=none; d=zohomail.com; s=zohoarc; b=eY987S936zgoHmVZZ71+3tgz/Wo++EdY377WGBjpUbeavLc6DOco5nabx8wQBSZ9u1EGvmIuqdBAKDNvGK82D/els+5aWfTR/ibNLLjHkmlQIeOQb5w9mCJnm/piIjkXpo3OaF6wvl67hfqx2BmwDHtpH25MJwP5eiaagkLn7zc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310589; 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=kevqHPlOngQuOmstH4bxiNiM3x5PtCpRDsAd+HUlWeY=; b=B9eBuPWRVyhxDdBb6RcHi1Z84gFiODLjjZXS3oWNS90dGFUzYuhjYmsv57YIHUxIzidpNOVNb6w2jZ7Lh4n3a505LTZoH7+fuR/GhPeyR5jzVGJvd6CJqSJdc1i5J/RGzHqFmmMC3TjCWkn6YgzTDzs4xAJjNo7OBC6cS2PFQIM= 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 1728310589461308.8668067070955; Mon, 7 Oct 2024 07:16:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812035.1224721 (Exim 4.92) (envelope-from ) id 1sxoWp-0003sP-Nh; Mon, 07 Oct 2024 14:16:03 +0000 Received: by outflank-mailman (output) from mailman id 812035.1224721; Mon, 07 Oct 2024 14:16:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWp-0003sE-IS; Mon, 07 Oct 2024 14:16:03 +0000 Received: by outflank-mailman (input) for mailman id 812035; Mon, 07 Oct 2024 14:16:02 +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 1sxoWo-0002dC-Eu for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:02 +0000 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [2a00:1450:4864:20::22f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id adbff330-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:00 +0200 (CEST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2fad100dd9eso43570731fa.3 for ; Mon, 07 Oct 2024 07:16:00 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8e05c119esm3386204a12.55.2024.10.07.07.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 07:15:59 -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: adbff330-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310560; x=1728915360; 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=kevqHPlOngQuOmstH4bxiNiM3x5PtCpRDsAd+HUlWeY=; b=Z1vaYX1/CBgJ6kccOX7CDSYKJJauOIY/4LJs9nbk5CrQ2TmKbdBn7d6DLvfdOsQkob Uj+ma+mBwCFUPsuCoDCx7+IlHPYhv1WERczCUWUbDI1eGzhLRBBkP+LjxcxPUjemqJNn +1ePrSx+MEjgBMi4qZs63Ln8A4BOi0ISCgk5k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310560; x=1728915360; 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=kevqHPlOngQuOmstH4bxiNiM3x5PtCpRDsAd+HUlWeY=; b=tOvXF0N1W9t0shcu1DKUTcXRlVainPlNdNEc7tlklb9yV4ioUGAFSoiTEHcvMjW5Et OUQoRg3dZg/kNffDHugQ4i87Mg8Uysv2jXlbQxEizjODws0N6aF/tgYsKrvUkhz2aDq6 ld6i3b0s9F35MITqJO19YxhzztbtcV50sRGe01WZJot21fYZhRB6henEnr50F1bqpCSK 2hBScurrIdBzX5wENwlzynfZ0SpxfRAf07RQ91BZS72poCBXW1bnKiltXhTrs7OIk2nV qt1DVvkeArILoumM0mNKMTSmGOadh4swJHsg1HTq24Tan9XtgkX/n9K7wF6TN+lQqj0A hSpg== X-Gm-Message-State: AOJu0YyQiOn2w3GA5aMd1pBbEB4NBh9JQj0c4ZD/ArIqT4x8qpA9k41z 512t34mOH3dDyjmqSv1MG1xpxolRn7hRaugENgrwiXmwkrMRo2Z68xlzvAe8Zo/0PqKWzLHAO6V K X-Google-Smtp-Source: AGHT+IHw20XEq5ecpCu6XjF/82Itx+TwEG2127ZTLEGPT+LIXZIPw4moIGX/J/LwktozDD77sKAIAQ== X-Received: by 2002:a05:651c:501:b0:2f3:f4e2:869c with SMTP id 38308e7fff4ca-2faf3dac8edmr55377141fa.44.1728310559658; Mon, 07 Oct 2024 07:15:59 -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?= , Julien Grall , Stefano Stabellini Subject: [PATCH v2 3/6] x86/boot: create a C bundle for 32 bit boot code and use it Date: Mon, 7 Oct 2024 15:15:36 +0100 Message-Id: <20241007141539.1899350-4-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: 1728310591580116600 Content-Type: text/plain; charset="utf-8" The current method to include 32 bit C boot code is: - compile each function we want to use into a separate object file; - each function is compiled with -fpic option; - convert these object files to binary files. This operation removes GOP which we don't want in the executable; - a small assembly part in each file add the entry point; - code can't have external references, all possible variables are passed by value or pointer; - include these binary files in head.S. There are currently some limitations: - code is compiled separately, it's not possible to share a function (like memcpy) between different functions to use; - although code is compiled with -fpic there's no certainty there are no relocations, specifically data ones. This can lead into hard to find bugs; - it's hard to add a simple function; - having to pass external variables makes hard to do multiple things otherwise functions would require a lot of parameters so code would have to be split into multiple functions which is not easy; - we generate a single text section containing data and code, not a problem at the moment but if we want to add W^X protection it's not helpful. Current change extends the current process: - all object files are linked together before getting converted making possible to share code between the function we want to call; - a single object file is generated with all functions to use and exported symbols to easily call; - variables to use are declared in linker script and easily used inside C code. Declaring them manually could be annoying but makes also easier to check them. Using external pointers can be still an issue if they are not fixed. If an external symbol is not declared this gives a link error; - linker script put data (bss and data) into a separate section and check that that section is empty making sure code is W^X compatible; Some details of the implementation: - C code is compiled with -fpic flags (as before); - object files from C code are linked together; - the single bundled object file is linked with 2 slightly different script files to generate 2 bundled object files; - the 2 bundled object files are converted to binary removing the need for global offset tables; - a Python script is used to generate assembly source from the 2 binaries; - the single assembly file is compiled to generate final bundled object file; - to detect possible unwanted relocation in data/code code is generated with different addresses. This is enforced starting .text section at different positions and adding a fixed "gap" at the beginning. This makes sure code and data is position independent; - to detect used symbols in data/code symbols are placed in .text section at different offsets (based on the line in the linker script). This is needed as potentially a reference to a symbol is converted to a reference to the containing section so multiple symbols could be converted to reference to same symbol (section name) and we need to distinguish them; - to avoid relocations - --orphan-handling=3Derror option to linker is used to make sure we account for all possible sections from C code; Current limitations: - the main one is the lack of support for 64 bit code. It would make sure that even the code used for 64 bit (at the moment EFI code) is code and data position independent. We cannot assume that code that came from code compiled for 32 bit and compiled for 64 bit is code and data position independent, different compiler options lead to different code/data. Signed-off-by: Frediano Ziglio --- Changes since v1: - separate lines adding files in Makefile; - remove unneeded "#undef ENTRY" in build32.lds.S; - print some information from combine_two_binaries only passing --verbose; - detect --orphan-handling=3Derror option dynamically; - define and use a LD32; - more intermediate targets to build more in parallel; - use obj32 in Makefile to keep list of 32 bit object files; - 32 bit object files are now named XXX.32.o; - rename "cbundle" to "built_in_32". --- xen/arch/x86/boot/.gitignore | 5 +- xen/arch/x86/boot/Makefile | 58 +++-- .../x86/boot/{build32.lds =3D> build32.lds.S} | 43 +++- xen/arch/x86/boot/cmdline.c | 12 -- xen/arch/x86/boot/head.S | 12 -- xen/arch/x86/boot/reloc.c | 14 -- xen/tools/combine_two_binaries | 198 ++++++++++++++++++ 7 files changed, 283 insertions(+), 59 deletions(-) rename xen/arch/x86/boot/{build32.lds =3D> build32.lds.S} (63%) create mode 100755 xen/tools/combine_two_binaries diff --git a/xen/arch/x86/boot/.gitignore b/xen/arch/x86/boot/.gitignore index a379db7988..ebad650e5c 100644 --- a/xen/arch/x86/boot/.gitignore +++ b/xen/arch/x86/boot/.gitignore @@ -1,3 +1,4 @@ /mkelf32 -/*.bin -/*.lnk +/build32.*.lds +/built_in_32.*.bin +/built_in_32.*.map diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index ff0f965876..4cf0d7e140 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -1,15 +1,18 @@ +obj32 :=3D cmdline.o +obj32 +=3D reloc.o + obj-bin-y +=3D head.o +obj-bin-y +=3D built_in_32.o =20 -head-bin-objs :=3D cmdline.o reloc.o +obj32 :=3D $(patsubst %.o,%.32.o,$(obj32)) =20 -nocov-y +=3D $(head-bin-objs) -noubsan-y +=3D $(head-bin-objs) -targets +=3D $(head-bin-objs) +nocov-y +=3D $(obj32) +noubsan-y +=3D $(obj32) +targets +=3D $(obj32) =20 -head-bin-objs :=3D $(addprefix $(obj)/,$(head-bin-objs)) +obj32 :=3D $(addprefix $(obj)/,$(obj32)) =20 $(obj)/head.o: AFLAGS-y +=3D -Wa$(comma)-I$(obj) -$(obj)/head.o: $(head-bin-objs:.o=3D.bin) =20 CFLAGS_x86_32 :=3D $(subst -m64,-m32 -march=3Di686,$(XEN_TREEWIDE_CFLAGS)) $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS)) @@ -17,17 +20,46 @@ CFLAGS_x86_32 +=3D -Werror -fno-builtin -g0 -msoft-floa= t -mregparm=3D3 CFLAGS_x86_32 +=3D -nostdinc -include $(filter %/include/xen/config.h,$(XE= N_CFLAGS)) CFLAGS_x86_32 +=3D $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__ =20 +LD32 :=3D $(LD) $(subst x86_64,i386,$(LDFLAGS_DIRECT)) + # override for 32bit binaries -$(head-bin-objs): CFLAGS_stack_boundary :=3D -$(head-bin-objs): XEN_CFLAGS :=3D $(CFLAGS_x86_32) -fpic +$(obj32): CFLAGS_stack_boundary :=3D +$(obj32): XEN_CFLAGS :=3D $(CFLAGS_x86_32) -fpic =20 LDFLAGS_DIRECT-$(call ld-option,--warn-rwx-segments) :=3D --no-warn-rwx-se= gments LDFLAGS_DIRECT +=3D $(LDFLAGS_DIRECT-y) =20 -%.bin: %.lnk - $(OBJCOPY) -j .text -O binary $< $@ +$(obj)/%.32.o: $(src)/%.c FORCE + $(call if_changed_rule,cc_o_c) + +$(obj)/build32.final.lds: AFLAGS-y +=3D -DFINAL +$(obj)/build32.other.lds $(obj)/build32.final.lds: $(src)/build32.lds.S + $(call if_changed_dep,cpp_lds_S) + +orphan-handling-$(call ld-option,--orphan-handling=3Derror) :=3D --orphan-= handling=3Derror + +# link all object files together +$(obj)/built_in_32.tmp.o: $(obj32) + $(LD32) -r -o $@ $(obj32) + +$(obj)/built_in_32.%.bin: $(obj)/build32.%.lds $(obj)/built_in_32.tmp.o +## link bundle with a given layout + $(LD32) $(orphan-handling-y) -N -T $< -Map $(obj)/built_in_32.$(*F).map -= o $(obj)/built_in_32.$(*F).o $(obj)/built_in_32.tmp.o +## extract binaries from object + $(OBJCOPY) -j .text -O binary $(obj)/built_in_32.$(*F).o $@ + rm -f $(obj)/built_in_32.$(*F).o =20 -%.lnk: %.o $(src)/build32.lds - $(LD) $(subst x86_64,i386,$(LDFLAGS_DIRECT)) -N -T $(filter %.lds,$^) -o = $@ $< +# generate final object file combining and checking above binaries +$(obj)/built_in_32.o: $(obj)/built_in_32.other.bin $(obj)/built_in_32.fina= l.bin + $(PYTHON) $(srctree)/tools/combine_two_binaries \ + --script $(obj)/build32.final.lds \ + --bin1 $(obj)/built_in_32.other.bin --bin2 $(obj)/built_in_32.final.bin \ + --map $(obj)/built_in_32.final.map \ + --exports cmdline_parse_early,reloc \ + --section-header '.section .init.text, "ax", @progbits' \ + --output $(obj)/built_in_32.s + $(CC) -c $(obj)/built_in_32.s -o $@.tmp + rm -f $(obj)/built_in_32.s $@ + mv $@.tmp $@ =20 -clean-files :=3D *.lnk *.bin +clean-files :=3D built_in_32.*.bin built_in_32.*.map build32.*.lds diff --git a/xen/arch/x86/boot/build32.lds b/xen/arch/x86/boot/build32.lds.S similarity index 63% rename from xen/arch/x86/boot/build32.lds rename to xen/arch/x86/boot/build32.lds.S index 56edaa727b..72a4c5c614 100644 --- a/xen/arch/x86/boot/build32.lds +++ b/xen/arch/x86/boot/build32.lds.S @@ -15,22 +15,52 @@ * with this program. If not, see . */ =20 -ENTRY(_start) +#ifdef FINAL +# define GAP 0 +# define MULT 0 +# define TEXT_START +#else +# define GAP 0x010200 +# define MULT 1 +# define TEXT_START 0x408020 +#endif +# define DECLARE_IMPORT(name) name =3D . + (__LINE__ * MULT) + +ENTRY(dummy_start) =20 SECTIONS { - /* Merge code and data into one section. */ - .text : { + /* Merge code and read-only data into one section. */ + .text TEXT_START : { + /* Silence linker warning, we are not going to use it */ + dummy_start =3D .; + + /* Declare below any symbol name needed. + * Each symbol should be on its own line. + * It looks like a tedious work but we make sure the things we use. + * Potentially they should be all variables. */ + DECLARE_IMPORT(__base_relocs_start); + DECLARE_IMPORT(__base_relocs_end); + . =3D . + GAP; *(.text) *(.text.*) - *(.data) - *(.data.*) *(.rodata) *(.rodata.*) + } + + /* Writeable data sections. Check empty. + * We collapse all into code section and we don't want it to be writeabl= e. */ + .data : { + *(.data) + *(.data.*) *(.bss) *(.bss.*) } - + /DISCARD/ : { + *(.comment) + *(.comment.*) + *(.note.*) + } /* Dynamic linkage sections. Collected simply so we can check they're e= mpty. */ .got : { *(.got) @@ -64,3 +94,4 @@ ASSERT(SIZEOF(.igot.plt) =3D=3D 0, ".igot.plt non-empt= y") ASSERT(SIZEOF(.iplt) =3D=3D 0, ".iplt non-empty") ASSERT(SIZEOF(.plt) =3D=3D 0, ".plt non-empty") ASSERT(SIZEOF(.rel) =3D=3D 0, "leftover relocations") +ASSERT(SIZEOF(.data) =3D=3D 0, "we don't want data") diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c index fc9241ede9..196c580e91 100644 --- a/xen/arch/x86/boot/cmdline.c +++ b/xen/arch/x86/boot/cmdline.c @@ -18,18 +18,6 @@ * Linux kernel source (linux/lib/string.c). */ =20 -/* - * This entry point is entered from xen/arch/x86/boot/head.S with: - * - %eax =3D &cmdline, - * - %edx =3D &early_boot_opts. - */ -asm ( - " .text \n" - " .globl _start \n" - "_start: \n" - " jmp cmdline_parse_early \n" - ); - #include #include #include diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index c4de1dfab5..e0776e3896 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -759,18 +759,6 @@ trampoline_setup: /* Jump into the relocated trampoline. */ lret =20 - /* - * cmdline and reloc are written in C, and linked to be 32bit PIC = with - * entrypoints at 0 and using the fastcall convention. - */ -FUNC_LOCAL(cmdline_parse_early) - .incbin "cmdline.bin" -END(cmdline_parse_early) - -FUNC_LOCAL(reloc) - .incbin "reloc.bin" -END(reloc) - ENTRY(trampoline_start) #include "trampoline.S" ENTRY(trampoline_end) diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index 8c58affcd9..94b078d7b1 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -12,20 +12,6 @@ * Daniel Kiper */ =20 -/* - * This entry point is entered from xen/arch/x86/boot/head.S with: - * - %eax =3D MAGIC, - * - %edx =3D INFORMATION_ADDRESS, - * - %ecx =3D TOPMOST_LOW_MEMORY_STACK_ADDRESS. - * - 0x04(%esp) =3D BOOT_VIDEO_INFO_ADDRESS. - */ -asm ( - " .text \n" - " .globl _start \n" - "_start: \n" - " jmp reloc \n" - ); - #include #include #include diff --git a/xen/tools/combine_two_binaries b/xen/tools/combine_two_binaries new file mode 100755 index 0000000000..ea2d6ddc4e --- /dev/null +++ b/xen/tools/combine_two_binaries @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 + +from __future__ import print_function +import argparse +import re +import struct +import sys + +parser =3D argparse.ArgumentParser(description=3D'Generate assembly file t= o merge into other code.') +parser.add_argument('--script', dest=3D'script', + required=3DTrue, + help=3D'Linker script for extracting symbols') +parser.add_argument('--bin1', dest=3D'bin1', + required=3DTrue, + help=3D'First binary') +parser.add_argument('--bin2', dest=3D'bin2', + required=3DTrue, + help=3D'Second binary') +parser.add_argument('--output', dest=3D'output', + help=3D'Output file') +parser.add_argument('--map', dest=3D'mapfile', + help=3D'Map file to read for symbols to export') +parser.add_argument('--exports', dest=3D'exports', + help=3D'Symbols to export') +parser.add_argument('--section-header', dest=3D'section_header', + default=3D'.text', + help=3D'Section header declaration') +parser.add_argument('-v', '--verbose', + action=3D'store_true') +args =3D parser.parse_args() + +gap =3D 0x010200 +text_diff =3D 0x408020 + +# Parse linker script for external symbols to use. +symbol_re =3D re.compile(r'\s+(\S+)\s*=3D\s*\.\s*\+\s*\((\d+)\s*\*\s*0\s*\= )\s*;') +symbols =3D {} +lines =3D {} +for line in open(args.script): + m =3D symbol_re.match(line) + if not m: + continue + (name, line_num) =3D (m.group(1), int(m.group(2))) + if line_num =3D=3D 0: + raise Exception("Invalid line number found:\n\t" + line) + if line_num in symbols: + raise Exception("Symbol with this line already present:\n\t" + lin= e) + if name in lines: + raise Exception("Symbol with this name already present:\n\t" + nam= e) + symbols[line_num] =3D name + lines[name] =3D line_num + +exports =3D [] +if args.exports is not None: + exports =3D dict([(name, None) for name in args.exports.split(',')]) + +# Parse mapfile, look for ther symbols we want to export. +if args.mapfile is not None: + symbol_re =3D re.compile(r'\s{15,}0x([0-9a-f]+)\s+(\S+)\n') + for line in open(args.mapfile): + m =3D symbol_re.match(line) + if not m or m.group(2) not in exports: + continue + addr =3D int(m.group(1), 16) + exports[m.group(2)] =3D addr +for (name, addr) in exports.items(): + if addr is None: + raise Exception("Required export symbols %s not found" % name) + +file1 =3D open(args.bin1, 'rb') +file2 =3D open(args.bin2, 'rb') +file1.seek(0, 2) +size1 =3D file1.tell() +file2.seek(0, 2) +size2 =3D file2.tell() +if size1 > size2: + file1, file2 =3D file2, file1 + size1, size2 =3D size2, size1 +if size2 !=3D size1 + gap: + raise Exception('File sizes do not match') + +file1.seek(0, 0) +data1 =3D file1.read(size1) +file2.seek(gap, 0) +data2 =3D file2.read(size1) + +max_line =3D max(symbols.keys()) + +def to_int32(n): + '''Convert a number to signed 32 bit integer truncating if needed''' + mask =3D (1 << 32) - 1 + h =3D 1 << 31 + return (n & mask) ^ h - h + +i =3D 0 +references =3D {} +internals =3D 0 +while i <=3D size1 - 4: + n1 =3D struct.unpack('=3D 10: + break + continue + # This is a relative relocation to a symbol, accepted, code/data is + # relocatable. + if diff < gap and diff >=3D gap - max_line: + n =3D gap - diff + symbol =3D symbols.get(n) + # check we have a symbol + if symbol is None: + raise Exception("Cannot find symbol for line %d" % n) + pos =3D i - 1 + if args.verbose: + print('Position %#x %d %s' % (pos, n, symbol), file=3Dsys.stde= rr) + i +=3D 3 + references[pos] =3D symbol + continue + # First byte is the same, move to next byte + if diff & 0xff =3D=3D 0 and i <=3D size1 - 4: + continue + # Probably a type of relocation we don't want or support + pos =3D i - 1 + suggestion =3D '' + symbol =3D symbols.get(-diff - text_diff) + if symbol is not None: + suggestion =3D " Maybe %s is not defined as hidden?" % symbol + raise Exception(("Unexpected difference found at %#x " + "n1=3D%#x n2=3D%#x diff=3D%#x gap=3D%#x.%s") % \ + (pos, n1, n2, diff, gap, suggestion)) +if internals !=3D 0: + raise Exception("Previous relocations found") + +def line_bytes(buf, out): + '''Output an assembly line with all bytes in "buf"''' + if type(buf) =3D=3D str: + print("\t.byte " + ','.join([str(ord(c)) for c in buf]), file=3Dou= t) + else: + print("\t.byte " + ','.join([str(n) for n in buf]), file=3Dout) + +def part(start, end, out): + '''Output bytes of "data" from "start" to "end"''' + while start < end: + e =3D min(start + 16, end) + line_bytes(data1[start:e], out) + start =3D e + +def reference(pos, out): + name =3D references[pos] + n =3D struct.unpack('=3D (1 << 31): + n -=3D (1 << 32) + n +=3D pos + if n < 0: + n =3D -n + sign =3D '-' + print("\t.hidden %s\n\t.long %s %s %#x - ." % (name, name, sign, n), + file=3Dout) + +def output(out): + prev =3D 0 + exports_by_addr =3D {} + for (sym, addr) in exports.items(): + exports_by_addr.setdefault(addr, []).append(sym) + positions =3D list(references.keys()) + positions +=3D list(exports_by_addr.keys()) + for pos in sorted(positions): + part(prev, pos, out) + prev =3D pos + if pos in references: + reference(pos, out) + prev =3D pos + 4 + if pos in exports_by_addr: + for sym in exports_by_addr[pos]: + print("\t.global %s\n\t.hidden %s\n%s:" % (sym, sym, sym), + file=3Dout) + part(prev, size1, out) + +out =3D sys.stdout +if args.output is not None: + out =3D open(args.output, 'w') +print('\t' + args.section_header, file=3Dout) +output(out) +print('\n\t.section\t.note.GNU-stack,"",@progbits', file=3Dout) +out.flush() --=20 2.34.1 From nobody Sun Dec 22 11:38:01 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=1728310583; cv=none; d=zohomail.com; s=zohoarc; b=cdkmAa00zjg9/Gfv+XiWIQ3g/Pk0HKIb7QWFNLq00feqNoB9dcTDAHvozfmdnIlrSeO1nP0vS+ZzqEM1iPyZHmCkT9xpk2bE0QkVhfs6pvEzTdg5f1RpjM0nG9hAzKk0o31dTZBdriR43xvxhor9DAxYwMbnTVx2N/+fbBHU9F8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310583; 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=q5/3n16EnUjBRG5AvCw7/t22OjOl8ho/k7P3Cayw7x4=; b=kiSijpKNTSQ0K3LLtHo453v9r+8GGowHeUEIQ0urf6S25Q2pXs0F4Quc7fihSpnVIsMwSB3C8Dz/Dpzo1XbBU5A4r43johDW8dxn/u7kxanLYL1mqG5zYHP2ke5nQp+2iaNX7uBnjEI7LxABUhaj1cWB0iEFJ0xI9SiGRzZ4oog= 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 1728310583023939.0283746698689; Mon, 7 Oct 2024 07:16:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812036.1224728 (Exim 4.92) (envelope-from ) id 1sxoWq-0003yd-Bx; Mon, 07 Oct 2024 14:16:04 +0000 Received: by outflank-mailman (output) from mailman id 812036.1224728; Mon, 07 Oct 2024 14:16:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWq-0003xR-3f; Mon, 07 Oct 2024 14:16:04 +0000 Received: by outflank-mailman (input) for mailman id 812036; Mon, 07 Oct 2024 14:16:02 +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 1sxoWo-0002dC-Sm for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:02 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ae238ce7-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:01 +0200 (CEST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5c89bdb9019so5457342a12.0 for ; Mon, 07 Oct 2024 07:16:01 -0700 (PDT) Received: from fziglio-desktop.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8e05c119esm3386204a12.55.2024.10.07.07.15.59 (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: ae238ce7-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310560; x=1728915360; 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=q5/3n16EnUjBRG5AvCw7/t22OjOl8ho/k7P3Cayw7x4=; b=JMotmb1zXRpyEXRBchG+DiWRiJ66nUNB07SzW6pOc3fGZgD3ORIe3IHJ8I+9n0Irbe 6/5Xt2G5U+xBocjNfbOIPzRV7k6Z9SCFnuSv1qs3+ynlm5dm6i56Ocb1LiRZauZpDucX joEpFnVBF4a/idQILV5X3SkAy/fJKYBBTmUtM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310560; x=1728915360; 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=q5/3n16EnUjBRG5AvCw7/t22OjOl8ho/k7P3Cayw7x4=; b=wAlbi2HXjH557nKDyp8ZZYP7cbuBmj4X1thne8i9N0sPermzt0ZWiaQ36akPAO2S2h XNSNuYaXBD/N1KJZyRIdG48LZXYCOYtgRrzZQ7PLRtGJi27nNDDUxOlbBbhZ2bCFoj19 EhWi/d1csQLBroVmoU4KPbdEQDOZac9g6CmeiLJ9zTSEZP8bBwSkIGF4a15CxWLAo9Jh 6Z/wJzZBUQMfVT3xpD0/lpmMmDn+sZenfL2iHm182PeBGWGyadgcnTdmObvcOLUpfqfD m2fdsImQfBmbtzuyTjKjAMWj+NtTcYx+YUcBMHGZooEP4wGyYlSxNSGs0PlUmIcJIlIt YDng== X-Gm-Message-State: AOJu0Yx8DhKD6qm71Q/jlBi6VMAFy2CEeaohy6ffI7eNlJFxR+9SlQwv DJWw4IxDYkMiH59OEe9JBZKj1zbm09PgMdfoxQ/XzUSi1so737NGAs0uhH8gO/o7cGeJDHtayVW h X-Google-Smtp-Source: AGHT+IHhLmA9sj29joNRSENtbo+EU9iWrDMzaKaKjUrgFrbDBZuEVwcfQuKSr9IZpyP9F4R+RHO9WQ== X-Received: by 2002:a05:6402:3582:b0:5c8:9515:cbe with SMTP id 4fb4d7f45d1cf-5c8d2dfbf42mr9281339a12.3.1728310560431; Mon, 07 Oct 2024 07:16:00 -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?= , "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [PATCH v2 4/6] x86/boot: Reuse code to relocate trampoline Date: Mon, 7 Oct 2024 15:15:37 +0100 Message-Id: <20241007141539.1899350-5-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: 1728310583526116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/Makefile | 12 ++++++---- xen/arch/x86/boot/build32.lds.S | 5 ++++ xen/arch/x86/boot/head.S | 23 +----------------- xen/arch/x86/boot/reloc-trampoline.c | 36 ++++++++++++++++++++++++++++ xen/arch/x86/efi/efi-boot.h | 15 ++---------- 5 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 xen/arch/x86/boot/reloc-trampoline.c diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index 4cf0d7e140..24b4b0cb17 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -1,14 +1,18 @@ obj32 :=3D cmdline.o obj32 +=3D reloc.o +obj32 +=3D reloc-trampoline.o + +obj64 :=3D reloc-trampoline.o =20 obj-bin-y +=3D head.o obj-bin-y +=3D built_in_32.o +obj-bin-y +=3D $(obj64) =20 obj32 :=3D $(patsubst %.o,%.32.o,$(obj32)) =20 -nocov-y +=3D $(obj32) -noubsan-y +=3D $(obj32) -targets +=3D $(obj32) +nocov-y +=3D $(obj32) $(obj64) +noubsan-y +=3D $(obj32) $(obj64) +targets +=3D $(obj32) $(obj64) =20 obj32 :=3D $(addprefix $(obj)/,$(obj32)) =20 @@ -55,7 +59,7 @@ $(obj)/built_in_32.o: $(obj)/built_in_32.other.bin $(obj)= /built_in_32.final.bin --script $(obj)/build32.final.lds \ --bin1 $(obj)/built_in_32.other.bin --bin2 $(obj)/built_in_32.final.bin \ --map $(obj)/built_in_32.final.map \ - --exports cmdline_parse_early,reloc \ + --exports cmdline_parse_early,reloc,reloc_trampoline32 \ --section-header '.section .init.text, "ax", @progbits' \ --output $(obj)/built_in_32.s $(CC) -c $(obj)/built_in_32.s -o $@.tmp diff --git a/xen/arch/x86/boot/build32.lds.S b/xen/arch/x86/boot/build32.ld= s.S index 72a4c5c614..9d09e3adbd 100644 --- a/xen/arch/x86/boot/build32.lds.S +++ b/xen/arch/x86/boot/build32.lds.S @@ -41,6 +41,11 @@ SECTIONS * Potentially they should be all variables. */ DECLARE_IMPORT(__base_relocs_start); DECLARE_IMPORT(__base_relocs_end); + DECLARE_IMPORT(__trampoline_rel_start); + DECLARE_IMPORT(__trampoline_rel_stop); + DECLARE_IMPORT(__trampoline_seg_start); + DECLARE_IMPORT(__trampoline_seg_stop); + DECLARE_IMPORT(trampoline_phys); . =3D . + GAP; *(.text) *(.text.*) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index e0776e3896..ade2c5c43d 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -706,28 +706,7 @@ trampoline_setup: mov %edx, sym_offs(l1_bootmap)(%esi, %ecx, 8) =20 /* Apply relocations to bootstrap trampoline. */ - mov sym_esi(trampoline_phys), %edx - lea sym_esi(__trampoline_rel_start), %edi - lea sym_esi(__trampoline_rel_stop), %ecx -1: - mov (%edi), %eax - add %edx, (%edi, %eax) - add $4,%edi - - cmp %ecx, %edi - jb 1b - - /* Patch in the trampoline segment. */ - shr $4,%edx - lea sym_esi(__trampoline_seg_start), %edi - lea sym_esi(__trampoline_seg_stop), %ecx -1: - mov (%edi), %eax - mov %dx, (%edi, %eax) - add $4,%edi - - cmp %ecx, %edi - jb 1b + call reloc_trampoline32 =20 /* Do not parse command line on EFI platform here. */ cmpb $0, sym_esi(efi_platform) diff --git a/xen/arch/x86/boot/reloc-trampoline.c b/xen/arch/x86/boot/reloc= -trampoline.c new file mode 100644 index 0000000000..c899e99b08 --- /dev/null +++ b/xen/arch/x86/boot/reloc-trampoline.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +extern const int32_t __trampoline_rel_start[], __trampoline_rel_stop[]; +extern const int32_t __trampoline_seg_start[], __trampoline_seg_stop[]; + +#if defined(__i386__) +void reloc_trampoline32(void) +#elif defined (__x86_64__) +void reloc_trampoline64(void) +#else +#error Unknow architecture +#endif +{ + unsigned long phys =3D trampoline_phys; + const int32_t *trampoline_ptr; + + /* + * Apply relocations to trampoline. + * + * This modifies the trampoline in place within Xen, so that it will + * operate correctly when copied into place. + */ + for ( trampoline_ptr =3D __trampoline_rel_start; + trampoline_ptr < __trampoline_rel_stop; + ++trampoline_ptr ) + *(uint32_t *)(*trampoline_ptr + (long)trampoline_ptr) +=3D phys; + + for ( trampoline_ptr =3D __trampoline_seg_start; + trampoline_ptr < __trampoline_seg_stop; + ++trampoline_ptr ) + *(uint16_t *)(*trampoline_ptr + (long)trampoline_ptr) =3D phys >> = 4; +} diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index 94f3443364..1acceec471 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -103,27 +103,16 @@ static void __init efi_arch_relocate_image(unsigned l= ong delta) } } =20 -extern const int32_t __trampoline_rel_start[], __trampoline_rel_stop[]; -extern const int32_t __trampoline_seg_start[], __trampoline_seg_stop[]; +void reloc_trampoline64(void); =20 static void __init relocate_trampoline(unsigned long phys) { - const int32_t *trampoline_ptr; - trampoline_phys =3D phys; =20 if ( !efi_enabled(EFI_LOADER) ) return; =20 - /* Apply relocations to trampoline. */ - for ( trampoline_ptr =3D __trampoline_rel_start; - trampoline_ptr < __trampoline_rel_stop; - ++trampoline_ptr ) - *(u32 *)(*trampoline_ptr + (long)trampoline_ptr) +=3D phys; - for ( trampoline_ptr =3D __trampoline_seg_start; - trampoline_ptr < __trampoline_seg_stop; - ++trampoline_ptr ) - *(u16 *)(*trampoline_ptr + (long)trampoline_ptr) =3D phys >> 4; + reloc_trampoline64(); } =20 static void __init place_string(u32 *addr, const char *s) --=20 2.34.1 From nobody Sun Dec 22 11:38:01 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 From nobody Sun Dec 22 11:38:01 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=1728310591; cv=none; d=zohomail.com; s=zohoarc; b=RdB8VQzJVn2/1Xlo57dI1x3Pf1sFJ3HIK+j9HyrNdZlYgCxWJtT6MhUatxEGrBlrts5ScWCSrdBmBGTvgS2li6Gilg6r3WWoNypeAYNpmGLQIEPdxJZ97HEsf+N7+6OuDq2sonMclANinVxnbkBNW/cR1Qtp9XjZ9MtSYvEgaFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728310591; 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=jmMdYCt1I0XZA3ClyzHKp7S/KpmvK5I8XHuXhKfs8dM=; b=N5xd7Hnlxe+PqpR6cME0J2ocO2qubidZgT3hIHCYmgS6evauPhBMTZ2LVUjgl06swx1T3gRAvJi8OymAJHUtzNeKklHoMzKovcpsHQv0qM/l4CrfoyoO2IN5ZlypmRxZbE1KuIBKct13LtDuF8X+8bJTIOdy+9qVCJGxJgV5q/k= 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 172831059106521.598654261660727; Mon, 7 Oct 2024 07:16:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812037.1224732 (Exim 4.92) (envelope-from ) id 1sxoWq-000436-K9; Mon, 07 Oct 2024 14:16:04 +0000 Received: by outflank-mailman (output) from mailman id 812037.1224732; Mon, 07 Oct 2024 14:16:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoWq-00041v-De; Mon, 07 Oct 2024 14:16:04 +0000 Received: by outflank-mailman (input) for mailman id 812037; Mon, 07 Oct 2024 14:16:03 +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 1sxoWp-0002yM-JU for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:03 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id af1ecbae-84b6-11ef-a0bb-8be0dac302b0; Mon, 07 Oct 2024 16:16:03 +0200 (CEST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so8749903a12.0 for ; Mon, 07 Oct 2024 07:16:03 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 07:16:01 -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: af1ecbae-84b6-11ef-a0bb-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1728310562; x=1728915362; 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=jmMdYCt1I0XZA3ClyzHKp7S/KpmvK5I8XHuXhKfs8dM=; b=QQHoR0UXxrdhfBXf1bycse/+4+40fS+x4bO8xs1rmoGDsdZ8O98y6OPqCFliyoJa+W saixbiEQATQLtZcgxuSmP3vWQ/2BThuAU6Mbe7ulorqxs8b2Sr4mE7kiEjJIz/1YpzSS QY9JNuGar0zNtTU5VBf1aoanUOadTYASlPvAQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728310562; x=1728915362; 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=jmMdYCt1I0XZA3ClyzHKp7S/KpmvK5I8XHuXhKfs8dM=; b=HARfZtmUPFzxP9+KU/cqvG0LGXZQ/0z1FjNI9rcUfOYaJDJe7Q5UpD5h55DwOuh4/9 dp4JgimBcSvnR2stJTIxSSOvkMKrt5uif+0w5U/eB5PPlDHSBsTewuC45mPYk9AP8wut sk9V8i52zLdueIpluRuXdEl8ieGmq19EYBXAwzEaQXOPOumfMsT38MXdT0o+JBWmFpyA N0DY/KNr1LApKXvR4T56jJsV57UKLaPeSKz0GjerK7KEpX2yrR/NSmnCwu5CJrllPZjo n6JLL7VJrPcgxBQar+ClQW1oPxWt+Ge4aRrHY70gko7Tz1xISeR2a3JJcC7s2pDm3aFJ zniQ== X-Gm-Message-State: AOJu0YzLretnQVwUDIqtV4jBvm8OxoTwU4p/ZwKjYveTqX7QxORwrdlO Di8JBXgyOCzHeyL2adY/nRGRCOuY9qCzT79F/+njT6M71MuyCxYcQTWe8j4i/6THRbpGRSzBZD0 j X-Google-Smtp-Source: AGHT+IFPRmj/tcAamcM2IaLVdwc5e0ZRbueK5DWj7yl1eChU2Au+DckDwtKwMAHqsfJe28ghGrgmww== X-Received: by 2002:a05:6402:5250:b0:5c5:c444:4e3a with SMTP id 4fb4d7f45d1cf-5c8d2e5523bmr13554093a12.0.1728310562231; Mon, 07 Oct 2024 07:16:02 -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 6/6] x86/boot: Use boot_vid_info variable directly from C code Date: Mon, 7 Oct 2024 15:15:39 +0100 Message-Id: <20241007141539.1899350-7-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: 1728310591509116600 Content-Type: text/plain; charset="utf-8" No more need to pass from assembly code. Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/build32.lds.S | 1 + xen/arch/x86/boot/head.S | 9 +-------- xen/arch/x86/boot/reloc.c | 12 +++++------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/boot/build32.lds.S b/xen/arch/x86/boot/build32.ld= s.S index 9d09e3adbd..26ef609523 100644 --- a/xen/arch/x86/boot/build32.lds.S +++ b/xen/arch/x86/boot/build32.lds.S @@ -46,6 +46,7 @@ SECTIONS DECLARE_IMPORT(__trampoline_seg_start); DECLARE_IMPORT(__trampoline_seg_stop); DECLARE_IMPORT(trampoline_phys); + DECLARE_IMPORT(boot_vid_info); . =3D . + GAP; *(.text) *(.text.*) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 32b658fa2b..dcda91cfda 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -510,16 +510,9 @@ trampoline_setup: mov %esi, sym_esi(xen_phys_start) mov %esi, sym_esi(trampoline_xen_phys_start) =20 - /* Boot video info to be filled from MB2. */ -#ifdef CONFIG_VIDEO - lea sym_esi(boot_vid_info), %ecx -#else - xor %ecx, %ecx -#endif - /* Save Multiboot / PVH info struct (after relocation) for later u= se. */ mov %ebx, %edx /* Multiboot / PVH information address= . */ - /* reloc(magic/eax, info/edx, video/stk) 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 4cca61adec..8527fa8d01 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -179,7 +179,7 @@ static multiboot_info_t *mbi_reloc(uint32_t mbi_in, mem= ctx *ctx) return mbi_out; } =20 -static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out, m= emctx *ctx) +static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, memctx *ctx) { const multiboot2_fixed_t *mbi_fix =3D _p(mbi_in); const multiboot2_memory_map_t *mmap_src; @@ -188,7 +188,7 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, ui= nt32_t video_out, memctx memory_map_t *mmap_dst; multiboot_info_t *mbi_out; #ifdef CONFIG_VIDEO - struct boot_video_info *video =3D NULL; + struct boot_video_info *video =3D &boot_vid_info; #endif uint32_t ptr; unsigned int i, mod_idx =3D 0; @@ -293,12 +293,11 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, = uint32_t video_out, memctx =20 #ifdef CONFIG_VIDEO case MULTIBOOT2_TAG_TYPE_VBE: - if ( video_out ) + if ( video ) { const struct vesa_ctrl_info *ci; const struct vesa_mode_info *mi; =20 - video =3D _p(video_out); ci =3D (const void *)get_mb2_data(tag, vbe, vbe_control_in= fo); mi =3D (const void *)get_mb2_data(tag, vbe, vbe_mode_info); =20 @@ -324,7 +323,6 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, ui= nt32_t video_out, memctx if ( (get_mb2_data(tag, framebuffer, framebuffer_type) !=3D MULTIBOOT2_FRAMEBUFFER_TYPE_RGB) ) { - video_out =3D 0; video =3D NULL; } break; @@ -349,7 +347,7 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, ui= nt32_t video_out, memctx } =20 /* SAF-1-safe */ -void *reloc(uint32_t magic, uint32_t in, uint32_t video_info) +void *reloc(uint32_t magic, uint32_t in) { /* Get bottom-most low-memory stack address. */ memctx ctx =3D { (uint32_t)((long)trampoline_phys + TRAMPOLINE_SPACE) = }; @@ -360,7 +358,7 @@ void *reloc(uint32_t magic, uint32_t in, uint32_t video= _info) return mbi_reloc(in, &ctx); =20 case MULTIBOOT2_BOOTLOADER_MAGIC: - return mbi2_reloc(in, video_info, &ctx); + return mbi2_reloc(in, &ctx); =20 case XEN_HVM_START_MAGIC_VALUE: if ( IS_ENABLED(CONFIG_PVH_GUEST) ) --=20 2.34.1