[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: fix early boot output


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 19 Jul 2023 09:06:08 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iQxWbjEV3drKoWkfyCM++nGf9g/KbOq1967oth5Hpas=; b=gvFPBb/uaIrSiTJHZI7h+tBPpnx3iqvrTVIFeBKthShsoAd6jw0AtDDpnL1WRy6uVg20bzFcL39dskNlQwxw/0D7V/tX4a9yzoCClF2pamyLneqwo7dGEfZtbsgvqosm5BOSjqVqzI3jwHOYTY/pVmel9xbW8hhAl5u7Wt1DrYQoe7g59s0SziQRkvCmDLUohUnZnoJauBA3xYx4LAmlGrUxycHg4OYOTg3YhxfqSPrrB9R4SDG4FG3bpWmKu67WkYowvm5V1HVLt1CNET29yMK8MUEzIr7sUiULGep72mHC5TVCDlu81PXponfDu94FgfVW+NWv5gT3tXm0sOr3HA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GWuMx2O7cCHN3f0ZAa/lUG2l8QdVgypeZi6tZAWRGRMztPAvu5R7QwQAeR/eZ/Kfg33r2/d1Lct/PD4n+3cJc9A4DrzWxx9FbZhU8EjAdBWba03bAnzU5qS5zMMl0x9Y3JyDyhrUj5i8WRxnOwzg1d7csW5mC6FZLB1FiI9vUWm03HMb5959lbCJGIS2QbZZimAeAsNsiq2BHtJ+s/OX87JZ5W5cOxu7txDdzj1UXcGwJYP72+rZTRntoY0DjzOlk/Hi5Ch30DPwqzt2iHHRmHURiUZIhxL2l/0Nyb8zWoYvDfToBU3oE58SXewsRnDqMpNX29/V0fk3kwZvQaCliA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 19 Jul 2023 08:06:35 +0000
  • Ironport-data: A9a23:txBfG6kf7STrd7Z5IQSD6Pfo5gysJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIWWmrSbP6KZzChctEgYYy0o0sC6sPVn4VlSwc//CA0FiMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5Q6GzhH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 eM3DxMvN0iIvf/swPGeZPFP34cffPC+aevzulk4pd3YJdAPZMmaBo/stZpf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVw3iea9WDbWUoXiqcF9t0CUv G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTeDpp6c23Qf7Kmo7OQQJS1udrduFu22/RM5RD 0kfoyMchP1nnKCsZpynN/Gim1aGtBMBX9tbE8Uh9RqAjKHT5m6xFmUCCzJMdtEinMs3XiAxk E+EmcvzAj5iu6HTTmiSnp+LqRuiNC5TKnUNDRLoViMA6tjn5Ys13hTGS486FLbv14OlXzbt3 zqNsS4ywa0JitIG3Lm6+laBhC+wop/OTUg+4QC/sn+Z0z6VrbWNP+SAgWU3J94ZRGpFZjFtZ EQ5pvU=
  • Ironport-hdrordr: A9a23:mIEpd6Bt+4ibFOXlHem755DYdb4zR+YMi2TDsHoQdfU1SK2lfq WV954mPHDP+VQssQ4b6LW90cW7LE80lqQa3WByB8bAYOCOggLBEGgI1+TfKlPbdxEW/9QtsZ tdTw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/07/2023 8:38 am, Jan Beulich wrote:
> Loading the VGA base address involves sym_esi(), i.e. %esi still needs
> to hold the relocation base address. Therefore the address of the
> message to output cannot be "passed" in %esi. Put the message offset in
> %ecx instead, adding it into %esi _after_ its last use as base address.
>
> Fixes: b28044226e1c ("x86: make Xen early boot code relocatable")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

When I was doing the label cleanup, I did wonder how this worked, given
that it clobbered %esi.  I guess this is the answer...

Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Although it occurs to me that probably want to (optionally) use one of
the IO-port/Hypercall protocols too to get these messages in PVH boot
case too.

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -184,12 +184,15 @@ early_error: /* Here to improve the disa
>           * Here we are on EFI IA-32 platform. Then reliable vga_text_buffer 
> zap is
>           * impossible in Multiboot2 scanning loop and we have to zero %edi 
> below.
>           */
> -        add     $sym_offs(.Lbad_efi_msg), %esi
> +        mov     $sym_offs(.Lbad_efi_msg), %ecx
>          xor     %edi,%edi                       # No VGA text buffer
>          jmp     .Lprint_err
>  .Lget_vtb:
>          mov     sym_esi(vga_text_buffer), %edi
>  .Lprint_err:
> +        add     %ecx, %esi     # Add string offset to relocation base.
> +        # NOTE: No further use of sym_esi() till the end of the "function"!

Minor, but I'd phrase this as "Note: sym_esi() no longer useable".

It is obviously limited in scope, but "until the end of the function"
gives an implication that it's fine thereafter which isn't really true.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.