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

[PATCH] x86/HVM: drop stale check from hvm_load_cpu_msrs()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Nov 2022 15:51:08 +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=wKflOQr2l2Ku3B3wa6fmhkMpxp8G8wXgKeSq/bg7zl4=; b=QEdRW1aQkqVip3DTjhG4Nv5AWucLbH1Y2rkKa3MGYHvv2Sy7niWgh8vhc8TA3JAFhclAm1M2PnmVuwGN+4DRbrnL25Uc8yqXjsm9zxEa2XFs2I70W2Ox7rblrpIjcwYlwqjh7M8Kte67LRF/XzguKlvNFeaj0PqVDpFEwYnzKuSzPfXmzutcNJVUKXPZdNGw7KfEV6+ys8nTI3IkbgRnD3wwJvj7TkpOEgfltazPmn9foITyFxrUqmU3us3PSjvWvGhNY9Yxr1Bksi/n03a/gFDnK2qMqLFdelc1HS05bj0l+QHamxJdpDQpZX28rv+dlzQ5IKAKzXPXSJFe8yMXrg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+32Gj1PB7Ixdg1qC03zO+vCShEvDfMbIdvIDHX3QE8suu3dCSTzkjoHAscNVLt8kPYKeB89xpwbSurDmTrIPJAkI2J4dRszcDPpEzjYP2E8LTAIKkO1RqvWM1taQOFwEviXaaLWe03KD66SppElmLC74pRwBlxRSuLAxYM0sx67IANwGpOY1FTn3asH+gxNK9HRk3RaquI1YNF/f45L52pYYRxmn78xTE11891XiS5zmpVaqB+q4Eye55UVhCbymqTk7pdw2dbKNhlL2UTwbac9EbRocQTJ1QBNCN+m++pszQKPfq8bQg86v2g9NN8D83qQPsMOEL2xP8eXGh/ADg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 29 Nov 2022 14:51:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Up until f61685a66903 ("x86: remove defunct init/load/save_msr()
hvm_funcs") the check of the _rsvd field served as an error check for
the earlier hvm_funcs.save_msr() invocation. With that invocation gone
the check makes no sense anymore. While dropping it also merge the two
paths setting "err" to -ENXIO.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
We could go further here, removing the local "err" variable altogether,
by using "return -ENXIO". Thoughts.

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1494,13 +1494,12 @@ static int cf_check hvm_load_cpu_msrs(st
         case MSR_AMD64_DR1_ADDRESS_MASK ... MSR_AMD64_DR3_ADDRESS_MASK:
             rc = guest_wrmsr(v, ctxt->msr[i].index, ctxt->msr[i].val);
 
-            if ( rc != X86EMUL_OKAY )
-                err = -ENXIO;
-            break;
+            if ( rc == X86EMUL_OKAY )
+                continue;
 
+            fallthrough;
         default:
-            if ( !ctxt->msr[i]._rsvd )
-                err = -ENXIO;
+            err = -ENXIO;
             break;
         }
     }



 


Rackspace

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