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

Re: [PATCH] x86/hvm: Improve hvm_set_guest_pat() code generation


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jan 2022 15:38:04 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=o5l7mYvMRindQ5jgt2KWQXZ2pHbCUeMeGbQPS1Rqtcc=; b=YDsF4O3oJfB6RS9S2nv9N3pn+t3ikEcxVnygvZO/Egz4BoNWIAqKoC05FeQ7yNkyk2ZGAr31KA6t9X9/MEDbT+ou1Ed/y07zQl+oAflARSYanpMF+wIaUAEAyanhVcBT5eOGR9scGnIzX4RyFpGz75+aHLoIx7dRhYXR/OtG6ZKH8Q8/7FI26zqG+Bx96kjjUHAZ7eFnaryPyiAAhXaxFwPlELoGeZNI68N7MbsJXlZI7dBtrf82nHWo3nCRzHqh9udibCzaZVOmGObfOFuortHvdVg2PBBN9isRW1HlcpcNIBDxhfex9fb9m7J/TazVC1u54FESVaf1VoFxnDgbtQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7/t61jJw5tZOjHSMF6rAF09JAyPXCcMijSuXr4O2dPFJzEVOs3vVt4nfjRVlal+KYIWu/3wNn7SBnufX77jYsn8uN581UXVid8GSjj+NOLBOIQDLwr6l4REA/Y7VOkW4Ffa1OF//tP8iEc+2oxSUZHwGD7IiuU5DjyH9qMoHMyGP4DG5HZE4wC7El1kj0mTKkv+MWkA/IjSdiqCFdcnsNihsTuCc4CoZJHq9eriDnx2k5e+PsUYvEO2oCczyhJN761/ctCu2M2PH+0NLLHs8KUFarYi7LPVlTM4+DYZVNcjUibVhVlbGtf2xyQUldSi7IC1HzisVPxBnJB+exL8og==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Jan 2022 14:38:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.01.2022 14:50, Andrew Cooper wrote:
> This is a fastpath on virtual vmentry/exit, and forcing guest_pat to be
> spilled to the stack is bad.  Performing the shift in a register is far more
> efficient.
> 
> Drop the (IMO useless) log message.  MSR_PAT only gets altered on boot, and a
> bad value will be entirely evident in the ensuing #GP backtrace.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

I'm curious though why ...

> @@ -313,10 +313,9 @@ int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
>          case PAT_TYPE_WRCOMB:
>          case PAT_TYPE_WRPROT:
>          case PAT_TYPE_WRTHROUGH:
> -            break;
> +            continue;

... you're going from "break" to "continue" here.

Jan




 


Rackspace

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