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

Re: [PATCH] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled


  • To: Juergen Gross <jgross@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 25 Jan 2021 17:26:39 +0000
  • 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-SenderADCheck; bh=MtWEsjpWj2lQLxSmdtBBZE+KeHNYR/qf7aJEew4am/g=; b=IHsh0ZfCaApP40wa534jIYhIBo7dC2f02sIEu69DDWJe6jptUnggvTf+XpCWkbfKWj6Alk4dKs/5gmZ+WxEPZLX9/KHvcCvZACMuvjiyOFiJ+yJCek3A/JAerriUFVsmC74o7z8WMI4NEby1YXHssQC26YBeE6zojn+F6i6qtr488oDCkvbisFySjHwVkNWiFtpasvN8izFBa876wUiUIIKDEKJkPx4kDcppg2g1kkJ1wWX+2RDRT7TYH5JWdtolLwwBP/ndxPVAXXXY5xar/ZtwMqVGPWHh9C/2xy+ydemQitnf9Oam2GTV1d+Zh4L0GOUArXD8l/H9RDArgsiEag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZWgVTCUFSEPV85yn8HuesH2lPQ26qS5HKT/4MKmlTc7IfYNxqllSH+oGjjU/wP1EvCE9OveIDK9qYcr2jt5DAGeJEmecwDqpr/PfvTPA/CLU8qAuXujpVcvOFLr2I4E71QzYxhfla6PqzBP+3BLwpGleUIQaUWcBRroZ/D9k+DSB/3OrpBa7XQ8E3BMphA5/kq4r2iP/qacVblr5zZwZnmRSF4IwTRRJRQo6d2bOza17MESsH0Ud2mjITtwY4C715aHwP+DJNAHCxqU5WM/hA+YrXkcehn0EWoPzPPltoU9S4tpET689CXWKPa9HQi5m3eKYNxiRjGTDOUEM/vyWnQ==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, <stable@xxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 25 Jan 2021 17:26:55 +0000
  • Ironport-sdr: 7FOcANLGJDyH6fZ1sydwYetZd7Rm4dTbBYAFeqk0TY5NBUvbOYjwXZNnVa03bgGzoho2vhXF6U aiC1s3asoxsx0j+Ur5vodbCh9UI0Whv8AxHzSzgUV7AIfxU6qjmNzZUHIXzHBbvygRRuW3lRRj RWdUtbfWyWxMt+eIgz7yxQeMrUUhwHF/6stciQiuDxox77qhGkI+piQU85n5nc6GOXhVRxialz zHQ9gIdNby24GrKLzDIsVdjETzmskxla84vUannhOaXpW87T5Z2Nr2xj+QJ3qHTGQ3ZjkKLDBW zQ0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25/01/2021 14:00, Juergen Gross wrote:
> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
> index 4409306364dc..82948251f57b 100644
> --- a/arch/x86/xen/enlighten_pv.c
> +++ b/arch/x86/xen/enlighten_pv.c
> @@ -583,6 +583,14 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug)
>               exc_debug(regs);
>  }
>  
> +#ifdef CONFIG_AMD_MEM_ENCRYPT
> +DEFINE_IDTENTRY_RAW(xenpv_exc_vmm_communication)
> +{
> +     /* This should never happen and there is no way to handle it. */
> +     panic("X86_TRAP_VC in Xen PV mode.");

Honestly, exactly the same is true of #VE, #HV and #SX.

What we do in the hypervisor is wire up one handler for all unknown
exceptions (to avoid potential future #DF issues) leading to a panic. 
Wouldn't it be better to do this unconditionally, especially as #GP/#NP
doesn't work for PV guests for unregistered callbacks, rather than
fixing up piecewise like this?

~Andrew



 


Rackspace

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