From nobody Thu Nov 21 22:14:22 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=1725284002; cv=none; d=zohomail.com; s=zohoarc; b=cBjxZPoaQlxVFM+p5TOY8ulguF9lCrwR/YNry7D/PQIcxG5tbgsHCuNei4OhUjmba0AwOFj3R3pCyt8n2SCGACBtyvJ7vP3yYVORV681/cxZzHvlItY/eiCOOchKb85T0NEvkC734FdkWpA4uUFtQZ9cF3Er01huGtZByFVnzIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725284002; 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=HVSfpr2fa6TJfrTtjhxFl5r7Fd98sI0EkF9Wzth3+h0=; b=MR1JrO6GKM5jhUU5s2SlfElp7//m58dPRTwuj7VSIvGk+9imMbTbRS7/jNsRMvV4TlJubm8fSD+XT8Mqw8h17bpv31OcRZxaDqNJ5iPpZR0WWo8FqlLGoSvphChSrE7PTmym4Ztu+2bJY/Q+RXFCY7CMqBLAVBJ0YIld31BGU4Y= 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 1725284002731947.9606225353427; Mon, 2 Sep 2024 06:33:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.787952.1197434 (Exim 4.92) (envelope-from ) id 1sl7Aw-0001ck-Mz; Mon, 02 Sep 2024 13:32:58 +0000 Received: by outflank-mailman (output) from mailman id 787952.1197434; Mon, 02 Sep 2024 13:32:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sl7Aw-0001ak-Fi; Mon, 02 Sep 2024 13:32:58 +0000 Received: by outflank-mailman (input) for mailman id 787952; Mon, 02 Sep 2024 13:32:56 +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 1sl7Au-0000uL-RV for xen-devel@lists.xenproject.org; Mon, 02 Sep 2024 13:32:56 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id dc33a439-692f-11ef-99a1-01e77a169b0f; Mon, 02 Sep 2024 15:32:55 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a868b8bb0feso514405766b.0 for ; Mon, 02 Sep 2024 06:32:55 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8989196975sm562333666b.135.2024.09.02.06.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 06:32:53 -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: dc33a439-692f-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1725283974; x=1725888774; 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=HVSfpr2fa6TJfrTtjhxFl5r7Fd98sI0EkF9Wzth3+h0=; b=b5ilD2r6tCOeVJnHhw32XSZ1az1Zdk6Tn/TUcZcR6T2LWBjAt5B5QfEudvJgct2fVw PbD5NLfJNXE1fcNLfpYJzKBNoha3prTqLQibUhy2i0747QofegylK0OTNyCsHKYZUahE MuwkFD2Pe+9LDpOOCq/b+qIyBlnvChYVUkc/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725283974; x=1725888774; 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=HVSfpr2fa6TJfrTtjhxFl5r7Fd98sI0EkF9Wzth3+h0=; b=wJcnew18aCYQVxAByncqpZOQb3ppm17CE66VIp/YN0wivHPOJY+E05DDlk200qqutp jqPPqKYDGqrhFaBVP2qOt6I39EmBxM2qJV70ZEISr/rRuGmFyHTCwZ/JJpyXEw4leEW2 NqMREIj09Ki6uzX1oCFAFIz8/bGMsL1Qt0Gxbg2b5ufStiqyYFEusNhR/Q5ai+Q+1Ull 8NpcTAE8tph7JKy0SRnHVz7V0/XTg8iRpbLo+vrZnNtVGJAyAeUA7jQjnfINDQW4co0C ZhbkAYVBlq81hccyo2W7U16yjtKRuskfiUmAJRxJhdgZCCJvvxJK2j6fFt1+J7TqABef zdHQ== X-Gm-Message-State: AOJu0YyOC7aJ6Kl8B2t+jbgQDHgjpQ9m8FsHR772PzluB0xbI2DYgKno wCWOIriPw8NOFW2jrydNIqKPb0ZvMMq2WuQt5wZO5HUZ2Mkm0p6IXRcBnOwzwS9hXBbmqZxWQN/ v X-Google-Smtp-Source: AGHT+IF8I+a5pKvl+y6zQSzuoQKoJt6tDqoETst5kvCX0Rcy+oWXb32xqp32QR6ulU2uwfWAgw8vTg== X-Received: by 2002:a17:907:980c:b0:a86:8f57:7de0 with SMTP id a640c23a62f3a-a89a37aa9famr721201366b.49.1725283973599; Mon, 02 Sep 2024 06:32:53 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Frediano Ziglio Subject: [PATCH 4/4] x86/boot: Use fastcall for 32bit code Date: Mon, 2 Sep 2024 14:32:32 +0100 Message-Id: <20240902133232.3302839-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240902133232.3302839-1-andrew.cooper3@citrix.com> References: <20240902133232.3302839-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: 1725284004721116600 Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Frediano Ziglio RFC. This doesn't boot, but I haven't quite figured out where yet. --- xen/arch/x86/boot/Makefile | 2 +- xen/arch/x86/boot/cmdline.c | 7 +++---- xen/arch/x86/boot/head.S | 15 +++++++++------ xen/arch/x86/boot/reloc.c | 12 ++++++------ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index 03d8ce3a9e48..b327663fba94 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -13,7 +13,7 @@ $(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)) -CFLAGS_x86_32 +=3D -Werror -fno-builtin -g0 -msoft-float +CFLAGS_x86_32 +=3D -Werror -fno-builtin -g0 -msoft-float -mregparm=3D3 ifneq ($(abs_objtree),$(abs_srctree)) CFLAGS_x86_32 +=3D -I$(objtree)/include endif diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c index bdd5b95c224b..6eddbb37b5b9 100644 --- a/xen/arch/x86/boot/cmdline.c +++ b/xen/arch/x86/boot/cmdline.c @@ -20,8 +20,8 @@ =20 /* * This entry point is entered from xen/arch/x86/boot/head.S with: - * - 0x4(%esp) =3D &cmdline, - * - 0x8(%esp) =3D &early_boot_opts. + * - %eax =3D &cmdline, + * - %ecx =3D &early_boot_opts. */ asm ( " .text \n" @@ -347,8 +347,7 @@ static void vga_parse(const char *cmdline, early_boot_o= pts_t *ebo) #endif =20 /* SAF-1-safe */ -void __attribute__((__stdcall__)) -cmdline_parse_early(const char *cmdline, early_boot_opts_t *ebo) +void cmdline_parse_early(const char *cmdline, early_boot_opts_t *ebo) { if ( !cmdline ) return; diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index d867b015d961..b745a7cd3a26 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -613,10 +613,13 @@ trampoline_setup: =20 /* Save Multiboot / PVH info struct (after relocation) for later u= se. */ push %edx /* Boot video info to be filled from M= B2. */ - push %ecx /* Bottom-most low-memory stack addres= s. */ - push %ebx /* Multiboot / PVH information address= . */ - push %eax /* Magic number. */ + mov %ecx, %edx /* Bottom-most low-memory stack addres= s. */ + mov %ebx, %ecx /* Multiboot / PVH information address= . */ + /* Magic number. */ + /* reloc(magic, info, trampoline, video) using fastcall(a, c,= d, stk). */ call reloc + add $4, %esp + #ifdef CONFIG_PVH_GUEST cmpb $0, sym_esi(pvh_boot) je 1f @@ -848,9 +851,9 @@ trampoline_setup: testl $MBI_CMDLINE,MB_flags(%ebx) jz 1f =20 - lea sym_esi(early_boot_opts),%eax - push %eax - pushl MB_cmdline(%ebx) + lea sym_esi(early_boot_opts), %ecx + lea MB_cmdline(%ebx), %eax + /* cmdline_parse_early(cmdline, opts) using fastcall(a, c). */ call cmdline_parse_early =20 1: diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index 1e3a30fab0c6..32acded81d78 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -14,10 +14,10 @@ =20 /* * This entry point is entered from xen/arch/x86/boot/head.S with: - * - 0x04(%esp) =3D MAGIC, - * - 0x08(%esp) =3D INFORMATION_ADDRESS, - * - 0x0c(%esp) =3D TOPMOST_LOW_MEMORY_STACK_ADDRESS. - * - 0x10(%esp) =3D BOOT_VIDEO_INFO_ADDRESS. + * - %eax =3D MAGIC, + * - %ecx =3D INFORMATION_ADDRESS, + * - %edx =3D TOPMOST_LOW_MEMORY_STACK_ADDRESS. + * - 0x04(%esp) =3D BOOT_VIDEO_INFO_ADDRESS. */ asm ( " .text \n" @@ -353,8 +353,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, ui= nt32_t video_out) } =20 /* SAF-1-safe */ -void *__attribute__((__stdcall__)) -reloc(uint32_t magic, uint32_t in, uint32_t trampoline, uint32_t video_inf= o) +void *reloc(uint32_t magic, uint32_t in, uint32_t trampoline, + uint32_t video_info) { alloc =3D trampoline; =20 --=20 2.39.2