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

Re: [PATCH v4] gnttab: defer allocation of status frame tracking array


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 5 May 2021 11:49:18 +0100
  • 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=4sJlPosmIk4YYQxNqqdB7begx8Af51a7fFR4y6gxgBQ=; b=OUa4J3wordvsf5n7B8aFnvvbZ9rVCAPVNJyeINOtv/2ZBrWkkeXov22xTJLbmQFoKcummonlww+s6rf6QXfutdcHCg3vHWoCyfAHfc9RvfTNtWl9+z/Xvyb/RcBUJlp2SN5Uq/uhdM5YR9CQGI1XCb+ACsB7B4VcOFPQxHqy3w1qUiSqAk1NPpI+tw8TJv1Jy6yQ6nVT4L7eKTMxTwFwfDb8qVXObLG62+u0Nt6bzWLaBsdaUyXt3q+Dc4ArFQWmr7AL3rHes8nP81Km9RHgKUY1gLsPbgX/8kJeKos957YbeioUHb0HiNtCVbvtYgStyQNf8SeHkSy7AinSm5gnmQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJO1U1Cs20szntbCqI7+CeKW3v2dEp54NWc8MaF3VZbXfw3B2ozZ/9NjomWQ/v1kMSFVjk8wESXCumjfNHOEUyYlQrwK1BdUwmVGuwpfBeEyLbr0NFuQp6ojNrkzmtwguihz8Cdmao+zmGgDbrQIQxe64hGAi6NwP0DC0sNFYnowVs0EoRu/NxfA9Bz4H16P+STkYufklGpYTYgCoR2WziSBy0EMcWKlNlcWoSqxBpJfP18VNVNSzhRNYZ6vAQecvmY+y+SzEpdAoJUk7wWpee7LFbdcscuTX69QD4NrW+jZ6zaDUsXnhlv8yHuhgNZ6NI1X4vD00Yv9BYRrTbQdow==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 05 May 2021 10:49:47 +0000
  • Ironport-hdrordr: A9a23:ziIGH6xRtQkKr46dLyXIKrPxge4kLtp033Aq2lEZdDV8Sebdv9 yynfgdyB//gCsQXnZlotybJKycWxrnmqJdybI6eZOvRhPvtmftFoFt6oP+3ybtcheTysd07o 0lSaR3DbTLYGRSpdrm4QW+DtYryMSG9qftvuvF03JxV2hRCp1IxS0RMHf/LmRdQg5aCZ0lUL +V4cRarzStEE5nEfiTLH8DQuTFupn3j5rgexELHFoK7wOJgDOu5tfBYmSl9z0ZVC5CxqpnzH jdn2XCl9iemtyY6juZ7W/c6JxKhMDso+EsOOWggtUYQw+c8jqAS59mX9S5zVcIicGprG0nid zd5yonVv4DkU/5WkGQjV/T1xL70DAogkWSumOwpXf4u8T2SHYbJqN69PtkWyDU4UYho91wuZ gjtwny1+s1fGb9tR/w6NTSWxZhmlDcmwtHrccpg2FCSoxbUbdNrOUkjTNoOa0dFyH34p1PKp gJMOjg4p9tADGnRkzCsnIq6NKhWWlbJGb8fmEy/uaR0zRQgUljyVoZyME1jh47heMAYqgByO LePqtykrZSCucQcKJmHe8EBfC6E2rXXHv3QS2vCGWiMJtCF2PGqpbx7rlwzOa2eKYQxJ93vJ jaSltXuUM7ZkqGM7zB4LR7tjT2BEmtVzXkzc9To7JjvKfnebbtOSqfDHgzjsqJuZwkc47m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RWL6Z15akbdRmTHjgbDqUlzE82xwfyFk22 +Bx4QK5slyzCXKadHlL2RfMAeRfqS6Yb39bghqvlgn0kIUqRq9oPsA3JtAOuezJw5EQJfG/yfy 1w2GryGOBNRwJclwQiGQMZJs5Gy5lxnPxYind9Y0vZNxJmi0jPoUvt8r1lHNtSCmfBAnnCUGOA IlhFp24Bk3IlBnUu9t+//f2L1P9ebkHtwjG28ITft+7+4M9uXliN6Q7Mg2r15fpaSZHgwEUO1m NZA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/05/2021 09:42, Jan Beulich wrote:
> This array can be large when many grant frames are permitted; avoid
> allocating it when it's not going to be used anyway, by doing this only
> in gnttab_populate_status_frames(). While the delaying of the respective
> memory allocation adds possible reasons for failure of the respective
> enclosing operations, there are other memory allocations there already,
> so callers can't expect these operations to always succeed anyway.
>
> As to the re-ordering at the end of gnttab_unpopulate_status_frames(),
> this is merely to represent intended order of actions (shrink array
> bound, then free higher array entries). If there were racing accesses,
> suitable barriers would need adding in addition.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Nack.

The argument you make says that the grant status frames is "large
enough" to care about not allocating.  (I frankly disagree, but that
isn't relevant to my to my nack).

The change in logic here moves a failure in DOMCTL_createdomain, to
GNTTABOP_setversion.  We know, from the last minute screwups in XSA-226,
that there are versions of Windows and Linux in the field, used by
customers, which will BUG()/BSOD when GNTTABOP_setversion doesn't succeed.

You're literally adding even more complexity to the grant table, to also
increase the chance of regressing VMs in the wild.  This is not ok.

The only form of this patch which is in any way acceptable, is to avoid
the allocation when you know *in DOMCTL_createdomain* that it will never
be needed by the VM.  So far, that is from Kconfig and/or the command
line options.

~Andrew




 


Rackspace

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