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

[PATCH 0/2] Arm32: memset() & friends


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 19 Aug 2022 09:48:22 +0200
  • 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=IINQmZD7SAqioJfykJlPHHVBkvs9TlWVDAVi2OGY9ko=; b=PC1nzzDdiDh4MqC7+kpMxvZoXc+H6h73myQvBSOzEPSH8AOInAVz4YGvtCYS/ZZ7WgpSQDksW91XPnaQrU+ebfxCTXbvkYaQsthBYkHs+Y8Pw9qQrWnHPgD8OufS5HVZNB2zwHoLHQH+oHHa1XkgS7K/o1g9H3sP7paE6XtYD93vaW+A8kAOjynW0jffIrEnuEWARZWe/DRxztzA+bdmrO+1mUQ2wgngs3UPa9nwOanHd0ZCTEGvvHbD1tTpynHrAcjwxSWD9Ziza4Fn+WCSOn1ZLs9MfS4HnbJ8QxUyWc0LbSC5B5QCwZjkZlggXW/Trj2Ea+o5vWjHFWx07WKL2w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXBPRWsnhk3UcpL7DqOXNLwGN9kyRkZmIVzxLr7EPeAKsQx5kC9+GlcsqLjDaDQbMKlAzgYlxk5Gbx5ElzG08qOdE/BF7Dyt4Wh+kLZhBOkoBD+DPlcM52sykFnSXlPkCWqTqcgdiTuhNECMJ4bF4BXKg9c8d7gTv8VgEVUpBPq8Vc4XWdiShEV4j2PbeLJDLHDyYb09Y9USMrrfxxRNL2JpTbTbQYNcygQX7Vp/vUJNtOa8wxiYxTFatj0r+QB703wW9Gmim8VwX9c5hSfbAoTbGybtYHdHtRMy9PtiNuafIPHSQfsOblzf8pU0treiOm/U8214JxZEV7JlkdbeAQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Fri, 19 Aug 2022 07:48:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Note that while the original Linux code has the same issue, I don't
really fancy sending there a patch similar to patch 1. That's because
my XSA-307 related "make find_next_{,zero_}bit() have well defined
behavior" was entirely ignored, so I would expect nothing better here.

1: correct string.h functions for "int" -> "unsigned char" conversion
2: tidy the memset() macro

Really I happened to be looking at the memset() macro, being a little
surprised of the special casing of 0 there. As a result I was curious to
see how much more efficient __memzero() really was compared to memset().
The first thing which actually caught my attention is that part of
__memzero()'s code lives outside of the function (i.e. ahead of
ENTRY()). This saves a branch (and interestingly memset() does _not_ do
the same), but (a) renders the ELF symbol table somewhat wrong and (b)
leaves debug info generated with gas 2.39 not covering the entire
function in the new subprogram DIE that it generates (line number info
and .debug_ranges are correct nevertheless).

Jan



 


Rackspace

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