Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp25585lqe; Fri, 5 Apr 2024 11:22:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUganG74BtDlfxfMAqOOVtxZG5xbgx5CtHwoL1XGKRz69RVhn+L3eWQazo7pbAtI79nEcdN0E0Z2P9rWX1MFRSvdWScbBR61QGw08OQag== X-Google-Smtp-Source: AGHT+IHXgmRNXCOH9bA90iTbOvkh/YWtVvP4qJeMVYji9bfN0s9W/H/i2WY/l6JmniuzTKIFCDl9 X-Received: by 2002:a05:6808:4a:b0:3c3:e7f8:be73 with SMTP id v10-20020a056808004a00b003c3e7f8be73mr2311452oic.59.1712341330906; Fri, 05 Apr 2024 11:22:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712341330; cv=pass; d=google.com; s=arc-20160816; b=IPw64rn6dYxSVUwDIOYkScV/9fXRP2Tdn2t+KndyMkT1s1BgAwViQl/RabbTxQbkU5 tadbLwkG9athYr1ksCcxY1xl1rbIjPe9Lwb7XWaP0PCMmcpEg7fi3KjNOWgKu3su1FkR O1RE1Iu29U6tO3QExOm15dHwAD+FUfZOBcXm9CWqCyuLwJUdwPOQ01uAiggAwbut7tQn LnOoUSiCGUbF9nPUwKVKrx4jS8nV3xmytQ9GTsH/PZvX1csDmJyisWDKYLtFhj5DfR4O 2y4nqor3Ms5yJLpVJ2l3bbDYG7FUnoAnUX5wTE9yvqQojWLQRntYO6ImgDmhZIhVi/i4 uVDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IxuFl2XWPTfRqfAaidn2Y3M1WCJ1BA9h8wdt5THF5h0=; fh=Q3Xn3m8MwQzAMvi5ssmKmW9+qsAgUDqKxQ4bIwprgew=; b=JbcHOVphRDhgVKrBEJA1m3x5iGoXOCr+7KcdYRMpOkie2HVo07SCnzsr2GU/WIP3nL u8MWRJFm3y2QWPYjg/KxyzhXD+wuBklprPkji+wXsRe+Lp5Q/wF47z2peqnT3mtopq0w JQmQWP+/whIPdRlckYBHKmgdJr15P650tFENXFSGZI7iWunY7hivH1iSjMunSyHI4ETO Qv7+f+PhMEij44/3jV1vgXF7vT4ignIprxTFiZQcco4TVChF88jMrOS4vpOHnwzM2Vcc 0BzSFRhqmFDZcVFXXqsBDqR6RbWwYcJ36DUd5qOCnbX654zfMApuFjXHTvEGQ9vOl2B8 Pc8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yu2jtznq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f22-20020a05622a1a1600b0043162b4be3dsi2406710qtb.694.2024.04.05.11.22.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 11:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yu2jtznq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 482961C22D17 for ; Fri, 5 Apr 2024 17:05:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B1EA171665; Fri, 5 Apr 2024 17:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Yu2jtznq" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62DD0171645 for ; Fri, 5 Apr 2024 17:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712336728; cv=none; b=ZkRPRRCQr8PeDMtgzD+25Sk3qZUcfYvvNCpoztgiz7AnrEtPGu0/BHNYByDu7H5CkJJlHZFj7X/WPYcNlxy9P+O+z4J2GaqeQ353na+8U/vQviX9DZMvG17utNH1cone6+DoFkfGBHa+X/Sn+NuBaM4KRJuu3L3GfhG6rHSlc40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712336728; c=relaxed/simple; bh=/AEsABMgIL9oKeChIdc/eQy55s/yNzx6q1zHRQyyKiI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BfC6S01JSbisraJOQwqNVPNf1jJw+cU7QNSHRSQ+HWWaaqA4373QhEKGpm6/x7GkRpIre7bmuMDQspbJPHhWSz/Pt0OgNGXCCiIHNrk4OlKIJdCVD1QiV0RmkkuQeujgmEm2aBdM3yLuNKK4Q2gDoLxI43pMyeqoxXZKsGXhztw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Yu2jtznq; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712336726; x=1743872726; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=/AEsABMgIL9oKeChIdc/eQy55s/yNzx6q1zHRQyyKiI=; b=Yu2jtznqHUwMkZG96jcpuNusGlgFDV1Hi9US78/DmaegWr/6F6GROIHK OrVpmCNdFHsGEfWQ3w8CxmG2omIHFJVdz/D34pPHcfJwBa4K/1w1iIM8h frS2utrEvBdVICAcsqstEo0NXJJBmhtb4/ynQTJHs4N4HMGPOJcImyxYr QTIKH7KCGdXSxni7E4VImsiLblFf9PoHTu2hyoWK1wh1H9bN6Arf2Q02R wweR921hE+9dlKztT6bfJNC4aEebaauji5DzY7vzJkH/iXkVFMBE311Dj Xhca6njpSFIFIX8PhN8qvlWMxaCfEBU1mQTvSczH3up4JJLvo/4+6zBPG A==; X-CSE-ConnectionGUID: G1BlriSRSf+UWGE9W7LNMw== X-CSE-MsgGUID: 1SSUMdA+Rp+ar1yvta5dQw== X-IronPort-AV: E=McAfee;i="6600,9927,11035"; a="18284819" X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="18284819" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 10:05:26 -0700 X-CSE-ConnectionGUID: +MFNCUHzRv2kuSn9OWymFg== X-CSE-MsgGUID: prsXshp8Tu6fZbMcXuf3OQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="19659692" Received: from twwright-mobl1.amr.corp.intel.com (HELO [10.209.65.212]) ([10.209.65.212]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 10:05:25 -0700 Message-ID: <7cd4b4d5-a7b4-41d9-8bd3-ad41401fec61@linux.intel.com> Date: Fri, 5 Apr 2024 10:05:24 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/4] x86/boot/compressed: Skip Video Memory access in Decompressor for SEV-ES/SNP. To: Ashish Kalra , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org Cc: rafael@kernel.org, peterz@infradead.org, adrian.hunter@intel.com, jun.nakajima@intel.com, rick.p.edgecombe@intel.com, thomas.lendacky@amd.com, michael.roth@amd.com, seanjc@google.com, kai.huang@intel.com, bhe@redhat.com, kirill.shutemov@linux.intel.com, bdas@redhat.com, vkuznets@redhat.com, dionnaglaze@google.com, anisinha@redhat.com, jroedel@suse.de, ardb@kernel.org, kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240325103911.2651793-1-kirill.shutemov@linux.intel.com> <1027427fafa350a41234f5061c8c48fc77c58326.1712270976.git.ashish.kalra@amd.com> Content-Language: en-US From: Kuppuswamy Sathyanarayanan In-Reply-To: <1027427fafa350a41234f5061c8c48fc77c58326.1712270976.git.ashish.kalra@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/4/24 4:11 PM, Ashish Kalra wrote: > From: Ashish Kalra > > Accessing guest video memory/RAM during kernel decompressor > causes guest termination as boot stage2 #VC handler for > SEV-ES/SNP systems does not support MMIO handling. > > This issue is observed with SEV-ES/SNP guest kexec as > kexec -c adds screen_info to the boot parameters > passed to the kexec kernel, which causes console output to > be dumped to both video and serial. > > As the decompressor output gets cleared really fast, it is > preferable to get the console output only on serial, hence, > skip accessing video RAM during decompressor stage to > prevent guest termination. > > Serial console output during decompressor stage works as > boot stage2 #VC handler already supports handling port I/O. > > Suggested-by: Thomas Lendacy > Signed-off-by: Ashish Kalra > --- Looks good to me. Reviewed-by: Kuppuswamy Sathyanarayanan > arch/x86/boot/compressed/misc.c | 6 ++++-- > arch/x86/boot/compressed/misc.h | 1 + > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c > index b70e4a21c15f..47b4db200e1f 100644 > --- a/arch/x86/boot/compressed/misc.c > +++ b/arch/x86/boot/compressed/misc.c > @@ -427,8 +427,10 @@ asmlinkage __visible void *extract_kernel(void *rmode, unsigned char *output) > vidport = 0x3d4; > } > > - lines = boot_params_ptr->screen_info.orig_video_lines; > - cols = boot_params_ptr->screen_info.orig_video_cols; > + if (!sev_es_enabled()) { > + lines = boot_params_ptr->screen_info.orig_video_lines; > + cols = boot_params_ptr->screen_info.orig_video_cols; > + } > > init_default_io_ops(); > > diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h > index b353a7be380c..3c12ca987554 100644 > --- a/arch/x86/boot/compressed/misc.h > +++ b/arch/x86/boot/compressed/misc.h > @@ -37,6 +37,7 @@ > #include > > #include "tdx.h" > +#include "sev.h" > > #define BOOT_CTYPE_H > #include -- Sathyanarayanan Kuppuswamy Linux Kernel Developer