From nobody Sun May 19 03:12:49 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=1713779565; cv=none; d=zohomail.com; s=zohoarc; b=T2rT34vKN7Gi2NEggWjjAp8kYvp/UlMEDUnS2dy4mKWodLmaSyYDHYdRGniWwlusG7cx1f54lFMhwjF4KLWfYQJCxlYLO76HnXbtFZ4DTKKixydEz+NQwDrDarxL61GbDfp0N1+ddoI1uqpAfVFb/u7C3qMOE6H5+jtfB9WrX0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713779565; 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=QhEkgYuK+r1ELgYSSGiiXM5uV0+14tGLsKjiIz9KioU=; b=MNb6O313l5lp/QIHjGyKAEjDlvoafTnncm/qlMTBaS3JDgWf1eZkjjJTtsMl/rts1ubMX30IG+2Yu/NIzgho5qkBtUBJe2iK2NmpxrXge74dJhpT3zQw/iAE0+Br8uEi7kPzjj5Urz2C/qLbcG75QZML4PjgulvEHFVXDmXkDik= 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 1713779565158665.9523360874063; Mon, 22 Apr 2024 02:52:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.709845.1108854 (Exim 4.92) (envelope-from ) id 1ryqLb-0001on-Qh; Mon, 22 Apr 2024 09:52:27 +0000 Received: by outflank-mailman (output) from mailman id 709845.1108854; Mon, 22 Apr 2024 09:52:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ryqLb-0001oP-Lj; Mon, 22 Apr 2024 09:52:27 +0000 Received: by outflank-mailman (input) for mailman id 709845; Mon, 22 Apr 2024 09:52:26 +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 1ryqLa-0001iC-9G for xen-devel@lists.xenproject.org; Mon, 22 Apr 2024 09:52:26 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 04eefaef-008e-11ef-b4bb-af5377834399; Mon, 22 Apr 2024 11:52:24 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-419fc79e4dcso8530035e9.1 for ; Mon, 22 Apr 2024 02:52:24 -0700 (PDT) Received: from localhost ([85.31.135.62]) by smtp.gmail.com with ESMTPSA id bg5-20020a05600c3c8500b00419f419236fsm7698672wmb.41.2024.04.22.02.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:52:23 -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: 04eefaef-008e-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1713779543; x=1714384343; 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=QhEkgYuK+r1ELgYSSGiiXM5uV0+14tGLsKjiIz9KioU=; b=F41F2J3iof6EXvjDF+0UzOXTHYl7FpT7EhG5XWHppig56gNL9Xs5z40tvkgLgc3uAs 63MGvGGLnGqC4//B2Vyus0ry4HIx/q/ZWv8+MX39setTaUW6k6WkL2nj8uJnI9TAJg3u YLR+UUj5hgPWYq1WQph2ydmIN9JZke90erwAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713779543; x=1714384343; 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=QhEkgYuK+r1ELgYSSGiiXM5uV0+14tGLsKjiIz9KioU=; b=v8W1g6WuwK+6d+cOIjHlIdwWD1847ToT0+fyvzoOXkdEOsB4RK3ME4EyVdJf+RR6vN Ow5Jahvw4sRlVL+//9HoLU1HyV7wS7rIXFawV3a62rfCAeeytFU/M2Z4G6yH9ZGOqy7t MZjjXQsX4WISbhw6B8sRMDu31mFi5ri6wVsOBb5wU1gvYXLQDGiUa/mEDtF8JyMrJcqB 3lLSiKJSJ5m5gURaY4oGPiDP9Fut1UgGVAw325oFjQuHwR9RfWeMEke5fVDpCL90v2Ld Ghi5qyfhdGMxG8uy2MbCeGlVBq4TcCdTvrYGLeg0o/RmJ3pSWafAr/8i0M4K1E3zc1/X CBtA== X-Gm-Message-State: AOJu0YzPus8ZDbDkQjGz6zUReT6Ixi0eQ1x7AqNpyEa85pERA0qlbo0Z 76ThtYQuBdz8fxAJTbfhv0tEdXrbSzLJFfM4u3gav6WuWZ4r49JyFObYNcijGD2gbXmtkcRitkf P X-Google-Smtp-Source: AGHT+IGY/uyF9bFwXpOVTURJt4E4Mj/8mD9HBd5Tk1KUZCIxt2bebkwvsxsbZYzpWzki2upMTKOqhg== X-Received: by 2002:a05:600c:4fd2:b0:418:969b:cb46 with SMTP id o18-20020a05600c4fd200b00418969bcb46mr6539040wmq.28.1713779543245; Mon, 22 Apr 2024 02:52:23 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 1/2] x86/video: add boot_video_info offset generation to asm-offsets Date: Mon, 22 Apr 2024 11:52:15 +0200 Message-ID: <20240422095216.20211-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240422095216.20211-1-roger.pau@citrix.com> References: <20240422095216.20211-1-roger.pau@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: 1713779566560100003 Currently the offsets into the boot_video_info struct are manually encoded = in video.S, which is fragile. Generate them in asm-offsets.c and switch the current code to use those instead. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Andrew Cooper --- Changes since v1: - Style changes. - Calculate remaining BVI size without referencing specific fields. --- xen/arch/x86/boot/video.S | 83 ++++++++++++------------------- xen/arch/x86/x86_64/asm-offsets.c | 26 ++++++++++ 2 files changed, 58 insertions(+), 51 deletions(-) diff --git a/xen/arch/x86/boot/video.S b/xen/arch/x86/boot/video.S index 0ae04f270f8c..f78906878a16 100644 --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -26,32 +26,13 @@ /* Force 400 scan lines for standard modes (hack to fix bad BIOS behaviour= */ #undef CONFIG_VIDEO_400_HACK =20 -/* Positions of various video parameters passed to the kernel */ -/* (see also include/linux/tty.h) */ -#define PARAM_CURSOR_POS 0x00 -#define PARAM_VIDEO_MODE 0x02 -#define PARAM_VIDEO_COLS 0x03 -#define PARAM_VIDEO_LINES 0x04 -#define PARAM_HAVE_VGA 0x05 -#define PARAM_FONT_POINTS 0x06 -#define PARAM_CAPABILITIES 0x08 -#define PARAM_LFB_LINELENGTH 0x0c -#define PARAM_LFB_WIDTH 0x0e -#define PARAM_LFB_HEIGHT 0x10 -#define PARAM_LFB_DEPTH 0x12 -#define PARAM_LFB_BASE 0x14 -#define PARAM_LFB_SIZE 0x18 -#define PARAM_LFB_COLORS 0x1c -#define PARAM_VESAPM_SEG 0x24 -#define PARAM_VESAPM_OFF 0x26 -#define PARAM_VESA_ATTRIB 0x28 #define _param(param) bootsym(boot_vid_info)+(param) =20 video: xorw %ax, %ax movw %ax, %gs # GS is zero cld call basic_detect # Basic adapter type testing (EGA/VGA/MDA/= CGA) - cmpb $0,_param(PARAM_HAVE_VGA) + cmpb $0, _param(BVI_have_vga) je 1f # Bail if there's no VGA movw bootsym(boot_vid_mode), %ax # User selected video mode cmpw $ASK_VGA, %ax # Bring up the menu @@ -69,7 +50,7 @@ vid1: call store_edid =20 # Detect if we have CGA, MDA, EGA or VGA and pass it to the kernel. basic_detect: - movb $0, _param(PARAM_HAVE_VGA) + movb $0, _param(BVI_have_vga) movb $0x12, %ah # Check EGA/VGA movb $0x10, %bl int $0x10 @@ -79,7 +60,7 @@ basic_detect: int $0x10 cmpb $0x1a, %al # 1a means VGA... jne basret # anything else is EGA. - incb _param(PARAM_HAVE_VGA) # We've detected a VGA + incb _param(BVI_have_vga) # We've detected a VGA basret: ret =20 # Store the video mode parameters for later usage by the kernel. @@ -92,57 +73,57 @@ mode_params: movb $0x03, %ah # Read cursor position xorb %bh, %bh int $0x10 - movw %dx, _param(PARAM_CURSOR_POS) + movw %dx, _param(BVI_cursor_pos) movb $0x0f, %ah # Read page/mode/width int $0x10 - movw %ax, _param(PARAM_VIDEO_MODE) # Video mode and screen wi= dth + movw %ax, _param(BVI_video_mode) # Video mode and screen wi= dth movw %gs:(0x485), %ax # Font size - movw %ax, _param(PARAM_FONT_POINTS) # (valid only on EGA/VGA) + movw %ax, _param(BVI_font_points) # (valid only on EGA/VGA) movw bootsym(force_size), %ax # Forced size? orw %ax, %ax jz mopar1 =20 - movb %ah, _param(PARAM_VIDEO_COLS) - movb %al, _param(PARAM_VIDEO_LINES) + movb %ah, _param(BVI_video_cols) + movb %al, _param(BVI_video_lines) ret =20 mopar1: movb %gs:(0x484), %al # On EGA/VGA, use the EGA+= BIOS incb %al # location of max lines. -mopar2: movb %al, _param(PARAM_VIDEO_LINES) +mopar2: movb %al, _param(BVI_video_lines) ret =20 # Fetching of VESA frame buffer parameters mopar_gr: movw $vesa_mode_info, %di - movb $0x23, _param(PARAM_HAVE_VGA) + movb $0x23, _param(BVI_have_vga) movw 16(%di), %ax - movw %ax, _param(PARAM_LFB_LINELENGTH) + movw %ax, _param(BVI_lfb_linelength) movw 18(%di), %ax - movw %ax, _param(PARAM_LFB_WIDTH) + movw %ax, _param(BVI_lfb_width) movw 20(%di), %ax - movw %ax, _param(PARAM_LFB_HEIGHT) + movw %ax, _param(BVI_lfb_height) movzbw 25(%di), %ax - movw %ax, _param(PARAM_LFB_DEPTH) + movw %ax, _param(BVI_lfb_depth) movl 40(%di), %eax - movl %eax, _param(PARAM_LFB_BASE) + movl %eax, _param(BVI_lfb_base) movl 31(%di), %eax - movl %eax, _param(PARAM_LFB_COLORS) + movl %eax, _param(BVI_lfb_colors) movl 35(%di), %eax - movl %eax, _param(PARAM_LFB_COLORS+4) + movl %eax, _param(BVI_lfb_colors+4) movw 0(%di), %ax - movw %ax, _param(PARAM_VESA_ATTRIB) + movw %ax, _param(BVI_vesa_attrib) =20 # get video mem size movw $vesa_glob_info, %di movzwl 18(%di), %eax - movl %eax, _param(PARAM_LFB_SIZE) + movl %eax, _param(BVI_lfb_size) =20 # store mode capabilities movl 10(%di), %eax - movl %eax, _param(PARAM_CAPABILITIES) + movl %eax, _param(BVI_capabilities) =20 # switching the DAC to 8-bit is for <=3D 8 bpp only - cmpw $8, _param(PARAM_LFB_DEPTH) + cmpw $8, _param(BVI_lfb_depth) jg dac_done =20 # get DAC switching capability @@ -160,16 +141,16 @@ mopar_gr: dac_set: # set color size to DAC size movzbw bootsym(dac_size), %ax - movb %al, _param(PARAM_LFB_COLORS+0) - movb %al, _param(PARAM_LFB_COLORS+2) - movb %al, _param(PARAM_LFB_COLORS+4) - movb %al, _param(PARAM_LFB_COLORS+6) + movb %al, _param(BVI_lfb_colors + 0) + movb %al, _param(BVI_lfb_colors + 2) + movb %al, _param(BVI_lfb_colors + 4) + movb %al, _param(BVI_lfb_colors + 6) =20 # set color offsets to 0 - movb %ah, _param(PARAM_LFB_COLORS+1) - movb %ah, _param(PARAM_LFB_COLORS+3) - movb %ah, _param(PARAM_LFB_COLORS+5) - movb %ah, _param(PARAM_LFB_COLORS+7) + movb %ah, _param(BVI_lfb_colors + 1) + movb %ah, _param(BVI_lfb_colors + 3) + movb %ah, _param(BVI_lfb_colors + 5) + movb %ah, _param(BVI_lfb_colors + 7) =20 dac_done: # get protected mode interface information @@ -180,8 +161,8 @@ dac_done: cmp $0x004f, %ax jnz no_pm =20 - movw %es, _param(PARAM_VESAPM_SEG) - movw %di, _param(PARAM_VESAPM_OFF) + movw %es, _param(BVI_vesapm_seg) + movw %di, _param(BVI_vesapm_off) =20 no_pm: pushw %ds popw %es @@ -1018,7 +999,7 @@ GLOBAL(boot_vid_info) .byte 80, 25 /* 80x25 */ .byte 1 /* isVGA */ .word 16 /* 8x16 font */ - .fill 0x28,1,0 + .space BVI_size - (. - boot_vid_info) GLOBAL(boot_edid_info) .fill 128,1,0x13 GLOBAL(boot_edid_caps) diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-of= fsets.c index 3fe21c21b95c..630bdc39451d 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -16,6 +16,10 @@ #include #include =20 +#ifdef CONFIG_VIDEO +# include "../boot/video.h" +#endif + #define DEFINE(_sym, _val) = \ asm volatile ( "\n.ascii\"=3D=3D>#define " #_sym " %0 /* " #_val " */<= =3D=3D\""\ :: "i" (_val) ) @@ -208,4 +212,26 @@ void __dummy__(void) =20 OFFSET(DOMAIN_vm_assist, struct domain, vm_assist); BLANK(); + +#ifdef CONFIG_VIDEO + OFFSET(BVI_cursor_pos, struct boot_video_info, orig_x); + OFFSET(BVI_video_mode, struct boot_video_info, orig_video_mode); + OFFSET(BVI_video_cols, struct boot_video_info, orig_video_cols); + OFFSET(BVI_video_lines, struct boot_video_info, orig_video_lines); + OFFSET(BVI_have_vga, struct boot_video_info, orig_video_isVGA); + OFFSET(BVI_font_points, struct boot_video_info, orig_video_points); + OFFSET(BVI_capabilities, struct boot_video_info, capabilities); + OFFSET(BVI_lfb_linelength, struct boot_video_info, lfb_linelength); + OFFSET(BVI_lfb_width, struct boot_video_info, lfb_width); + OFFSET(BVI_lfb_height, struct boot_video_info, lfb_height); + OFFSET(BVI_lfb_depth, struct boot_video_info, lfb_depth); + OFFSET(BVI_lfb_base, struct boot_video_info, lfb_base); + OFFSET(BVI_lfb_size, struct boot_video_info, lfb_size); + OFFSET(BVI_lfb_colors, struct boot_video_info, colors); + OFFSET(BVI_vesapm_seg, struct boot_video_info, vesapm.seg); + OFFSET(BVI_vesapm_off, struct boot_video_info, vesapm.off); + OFFSET(BVI_vesa_attrib, struct boot_video_info, vesa_attrib); + DEFINE(BVI_size, sizeof(struct boot_video_info)); + BLANK(); +#endif /* CONFIG_VIDEO */ } --=20 2.44.0 From nobody Sun May 19 03:12:49 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=1713779565; cv=none; d=zohomail.com; s=zohoarc; b=K5Q+TgyBlBBL7jo9jRUbSXpZ4aBWLQJ3bD8MfXRlSSF0V2vidTYHXGTxoOG/GsM9dwd+WUL7gThzpfKg97h2MCa06qrTuK69ORqY6yplwXhwyQILMZqaosgIat0VeAAgVlDKh7MApV83DacwzJKqvyyLNDlf5lv+86ePyqemNsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713779565; 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=drPZty86Abw56CZZyAdI896Rwj7S92fYFAWqWuFlrdo=; b=cadl6JzeHT8isGz1zD6ZxxkYjZVrIrZWQlGCn56rjD9UtgKyBwvAQOXOGY4Uq02ENRQwghfORLw/BejXmTYE3wdyRp312DsFXRu3XZIXlYQDUeQfeOSMJRB2jn7nJnOWPb8t0Nuvp1sYfKehhPySeyy60URL4C68yHAgMFiI0xs= 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 171377956509238.191457446231084; Mon, 22 Apr 2024 02:52:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.709844.1108849 (Exim 4.92) (envelope-from ) id 1ryqLb-0001m9-HI; Mon, 22 Apr 2024 09:52:27 +0000 Received: by outflank-mailman (output) from mailman id 709844.1108849; Mon, 22 Apr 2024 09:52:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ryqLb-0001m2-EW; Mon, 22 Apr 2024 09:52:27 +0000 Received: by outflank-mailman (input) for mailman id 709844; Mon, 22 Apr 2024 09:52:26 +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 1ryqLZ-0001X4-VS for xen-devel@lists.xenproject.org; Mon, 22 Apr 2024 09:52:25 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 05b2b778-008e-11ef-909a-e314d9c70b13; Mon, 22 Apr 2024 11:52:25 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-343d7ff2350so3080018f8f.0 for ; Mon, 22 Apr 2024 02:52:25 -0700 (PDT) Received: from localhost ([85.31.135.62]) by smtp.gmail.com with ESMTPSA id v10-20020a5d590a000000b003437ad152f9sm11472139wrd.105.2024.04.22.02.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:52:24 -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: 05b2b778-008e-11ef-909a-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1713779544; x=1714384344; 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=drPZty86Abw56CZZyAdI896Rwj7S92fYFAWqWuFlrdo=; b=irnFghkAxR7Y89jmIUcAuiGXdCTrcIbe0X5qLDAe2oSIfLlPtaZcCZhg69Hqaner1g BojaK/fAcx/O4w1s7AGZnR1Ip+lg+vW3kYDuI/W7z9k8ZkMJAdNLxM03sK9bP1foQOMR MBfn1muLwkvKmTbBUurowt6x8WtPZ+eRyJT84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713779544; x=1714384344; 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=drPZty86Abw56CZZyAdI896Rwj7S92fYFAWqWuFlrdo=; b=qnin4EjR0Euv8EGIa0L91weWZfyvzivK18kArdxzPbfc85lXTe3b3pOIaXNRgIxApv X3MtXtxijvx0/mVoNZhX+rnXz6F1jdaAQjmP+1k9HQSH2LGIRryVDFfGKjmxDtatklS3 QY46YyZT2ldJSueWFzy2H60fL0PYeLsR5VZRUs3Suag4/K7PUERMsnXp0EFIPhoZJMrg 4YAeZlnGzq0IkcY8oXSGpTPqqEdVdc+qW1xqVROYhwLLlw/Q9uKSeCdwE6K4H8hYeUq5 Jij7mGBc+SL2K9cQ6BYcjFj432t0Yj+3ifrkBULRpNqKwUngGj28z4qkplW7ICqTFFFh juYg== X-Gm-Message-State: AOJu0YxdrY5nzStREdT0bijLO+Nowl3lt3kzjzT8aNsB8CJpILRVU1ac dnlVsOSxIvWvmiZ+FtWtAvPFUmzrqWb+4knsce0zFs3UcA4kQLJgM85v1I2IhEkaUPeAKE0/5SX l X-Google-Smtp-Source: AGHT+IHaacB3gnriuYoV81Ftcrmt/1jSPI6rxCA91xh9nnjUzmgGFQT/8T0/SK3E6Y4BDkRW/B2kIQ== X-Received: by 2002:a5d:63cf:0:b0:343:eb6c:ae80 with SMTP id c15-20020a5d63cf000000b00343eb6cae80mr6257299wrw.28.1713779544276; Mon, 22 Apr 2024 02:52:24 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 2/2] x86/pvh: zero VGA information Date: Mon, 22 Apr 2024 11:52:16 +0200 Message-ID: <20240422095216.20211-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240422095216.20211-1-roger.pau@citrix.com> References: <20240422095216.20211-1-roger.pau@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: 1713779566529100001 PVH guests skip real mode VGA detection, and never have a VGA available, he= nce the default VGA selection is not applicable, and at worse can cause confusi= on when parsing Xen boot log. Zero the boot_vid_info structure when Xen is booted from the PVH entry poin= t. This fixes Xen incorrectly reporting: (XEN) Video information: (XEN) VGA is text mode 80x25, font 8x16 When booted as a PVH guest. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- xen/arch/x86/boot/video.h | 2 ++ xen/arch/x86/guest/xen/pvh-boot.c | 9 +++++++++ xen/arch/x86/setup.c | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/boot/video.h b/xen/arch/x86/boot/video.h index 6a7775d24292..1203515f9e5b 100644 --- a/xen/arch/x86/boot/video.h +++ b/xen/arch/x86/boot/video.h @@ -67,6 +67,8 @@ struct boot_video_info { } vesapm; uint16_t vesa_attrib; /* 0x28 */ }; + +extern struct boot_video_info boot_vid_info; #endif /* __ASSEMBLY__ */ =20 #endif /* __BOOT_VIDEO_H__ */ diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh= -boot.c index 9cbe87b61bdd..cc57ab2cbcde 100644 --- a/xen/arch/x86/guest/xen/pvh-boot.c +++ b/xen/arch/x86/guest/xen/pvh-boot.c @@ -15,6 +15,10 @@ =20 #include =20 +#ifdef CONFIG_VIDEO +# include "../../boot/video.h" +#endif + /* Initialised in head.S, before .bss is zeroed. */ bool __initdata pvh_boot; uint32_t __initdata pvh_start_info_pa; @@ -95,6 +99,11 @@ void __init pvh_init(multiboot_info_t **mbi, module_t **= mod) ASSERT(xen_guest); =20 get_memory_map(); + +#ifdef CONFIG_VIDEO + /* No VGA available when booted from the PVH entry point. */ + memset(&bootsym(boot_vid_info), 0, sizeof(boot_vid_info)); +#endif } =20 void __init pvh_print_info(void) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 86cd8b999774..449a3476531e 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -646,7 +646,6 @@ static struct e820map __initdata boot_e820; =20 #ifdef CONFIG_VIDEO # include "boot/video.h" -extern struct boot_video_info boot_vid_info; #endif =20 static void __init parse_video_info(void) --=20 2.44.0