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

[PATCH 1/3] x86/Viridian: fix error code use


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 18 Nov 2021 14:13:43 +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=eOVU/IktMNarHrzq1eR850T7kGTI+/Z3sQLri7a16Vs=; b=Ki9If9sbqdl0YYB0D2FmM5CYq7Oxzz1LoxOe1CugHheonvDGp8t/pY2VCAnE/sx3GC/m4p8dpHxJ7rp8hY5vG+9ssaS/PPYENpO/04vNtqx7A1fdEzI4/oNvkXQndAnjoXxxGJV0G7iTsuk//Y3cnb7sZSNryX/Nf5NSDQxVAvpNg6CLp2YvFDxrNctby1YccckM+F36WI9rpWF1fVcHi5itK/ye1ew4KOlqKxstdCT5JK9kDytHSwyKirday1zxDuf8fPzFFAGTNAwkDR/YbbblLppL6H7IHBrOuR5H13X549SecUR7B97RtMBwSMwOavVeI7HEqZDhwupu/pAGOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hL2b/G1b4jsYWi+4D8AsVEMaiKZgmyaap7qYxrNObjC7FrZpY7E2K8WDWVFVJ2iskLXxEMT9Cw7L04j2LVscS/MZQYOeZdptquudUmhAbnaXUq7YLihqZZjsGThKfflBHq8I8FvkBJXm9YHYdL0477IMhUYe6gy44DJ0owaB3RoWJZSJBNMGW6SdmHDVVgZJh/mgqHWUZX77SoCpCDkih74bPGSeWuGr3PUiC9P+LjbCaMuScVwVyaDrxUav3DZG5Zrqlgp3lyHLBVd391e7HM25cGVVX3dfkyRvjfNbndNAbBpyHOHAKJNIl2yTUFwHURihDfF3YD433WviRNlSng==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 18 Nov 2021 13:13:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Both the wrong use of HV_STATUS_* and the return type of
hv_vpset_to_vpmask() can lead to viridian_hypercall()'s
ASSERT_UNREACHABLE() triggering when translating error codes from Xen
to Viridian representation.

Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush 
hypercalls")
Fixes: 9afa867d42ba ("viridian: add ExProcessorMasks variant of the IPI 
hypercall")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -628,8 +628,8 @@ static unsigned int hv_vpset_nr_banks(st
     return hweight64(vpset->valid_bank_mask);
 }
 
-static uint16_t hv_vpset_to_vpmask(const struct hv_vpset *set,
-                                   struct hypercall_vpmask *vpmask)
+static int hv_vpset_to_vpmask(const struct hv_vpset *set,
+                              struct hypercall_vpmask *vpmask)
 {
 #define NR_VPS_PER_BANK (HV_VPSET_BANK_SIZE * 8)
 
@@ -919,10 +919,10 @@ static int hvcall_ipi_ex(const union hyp
          input_params.reserved_zero[0] ||
          input_params.reserved_zero[1] ||
          input_params.reserved_zero[2] )
-        return HV_STATUS_INVALID_PARAMETER;
+        return -EINVAL;
 
     if ( input_params.vector < 0x10 || input_params.vector > 0xff )
-        return HV_STATUS_INVALID_PARAMETER;
+        return -EINVAL;
 
     *set = input_params.set;
     if ( set->format == HV_GENERIC_SET_SPARSE_4K )




 


Rackspace

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