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

Re: [PATCH v2] Arm32: correct string.h functions for "int" -> "unsigned char" conversion


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 24 Aug 2022 12:44:30 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=O7PuElJJfoj36hJl9Mz4yfwLddxvbytqe2alZtSlzcI=; b=hommLWrvURSt7a1FrR2Bda6hG3AghIXyKMhF6t9TL9uJkwKlfptYaPqEkMm2Lxo8mxkp+XtKj0kHfc3TUorPzga0FOKn4OrV7rwMR//ZzgCgwzD6UhjWm30bqDJzk3RoA+y+jSQ92mFwhiQoCRR7AprEPSIa80RejQ4cj8jzbULuHfK0JFt5JdVg6WzvS7ERv1jKRdtv1cBdbEWLr5pF6dM1K7RFkkCPs6QsCjOEzj2Ks8RhdcOtiDOI+Kb3/geD1jdv4WWvCEQhwjpY5Nsc+/NnhbvlDFXTLNrK7DN46XUZMR3n4IXsGC9SqofctEUpSsjkn7xsYScmfcNjXN3aMw==
  • 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=O7PuElJJfoj36hJl9Mz4yfwLddxvbytqe2alZtSlzcI=; b=VrSmUPfiLjfwkcHt209w5VGNWgCAWUCDHNXJ9BN7AgkqqKWH1w5FmwHUsTZEJDQi9QnDs9FVi6Di/99nCdekJ/LR5gGnBhhE1OIjxcoyz6qA5BA74nInPlukqA0HVK6WIG/u6Wvs8ahdzvchCM0CIa2JJ8YNjoQLHv1R/AfqzftsgQNeOGpK5TNi+ygFlSxlOLWRYRWdRrldq5Ef9NbNoSerTRyLgpNL/B5mvBd4LFRXRPyKXDFXdRWbDrFxRkWnF24/5i/iIdxNLahdX3DJe6IIa0PUPV35fU4h6rbenP6MOeJmYoywL1e3p29Ahra0yqZOiwLKcPaOgf2VsCdLlQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=oQ6Vy0XmPUr2ObCkMBtOmpYHamacD+ZJOl67Kd7dGSDkwzo9YNozZEtQ51orLrlEyKO6Bph4ZJVtioY4WjzK6MZN+oLbEOSX2qLq/on5DQ3OBX0v6Ucr5d3R5dAxBML6XYvOp866hOz7xJpFZBkc2p1eMLLg0uNKJ4Q/33cCbDb5otf6ILAAai0lIJT94iHMaub5a2rpfvIB6j7GeTNmAcC70Vq6d9GCWcoYAS3awdqJkbTB9BzfJEL7sQOsdXoujgbe2jO45V5gz29F8o/gperqcw/lBKrG6daFrzoSmhSLnPb8mV1kNW/pM2te1cmWZdXdDdbrtTKhRNnMnOOTtg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QJg06trULLtWw5/IWimYORM5pmNpgzKOzDU1wQnUurLD8Klbq8GTbzaGiw6nJ45oBDOkjpQ1pe3jU9WchmtXIj1xwa9NZOoZoOxDIQ5lfcgZl7xJV5h19rb8fNwyVzZjBgVUoke4HytTvNo4bPW4LykEZJuoWgdcg5iOK7Kaz6V4iaRN27iI0BycBZ++uHMNOSZMG1aI4NZ/tO1h6R9imx2+nQCWnKg6rwjd66JJ7mGpTkL6YdtwdyA249CVtGlIMzxghuOK8KNkfH9K172rBdn7U/GIdo6UyhG7CmGrJxQmbnlRcFD6eyUx4cyAjy4GDm8bcHpK0Ctb4AMIhPo4Wg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
  • Delivery-date: Wed, 24 Aug 2022 12:44:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYt7WvGsqPX36ID06vL1k4SyhAUK29/xSA
  • Thread-topic: [PATCH v2] Arm32: correct string.h functions for "int" -> "unsigned char" conversion

Hi Jan,

> On 24 Aug 2022, at 13:33, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> While Arm64 does so uniformly, for Arm32 only strchr() currently handles
> this properly. Add the necessary conversion also to strrchr(), memchr(),
> and memset().
> 
> As to the placement in memset(): Putting the new insn at the beginning
> of the function is apparently deemed more "obvious". It could be placed
> later, as the code reachable without ever making it to the "1" label
> only ever does byte stores.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand
> ---
> v2: For memset() use the "more obvious" adjustment.
> 
> --- a/xen/arch/arm/arm32/lib/memchr.S
> +++ b/xen/arch/arm/arm32/lib/memchr.S
> @@ -14,6 +14,7 @@
>       .text
>       .align  5
> ENTRY(memchr)
> +     and     r1, r1, #0xff
> 1:    subs    r2, r2, #1
>       bmi     2f
>       ldrb    r3, [r0], #1
> --- a/xen/arch/arm/arm32/lib/memset.S
> +++ b/xen/arch/arm/arm32/lib/memset.S
> @@ -15,6 +15,7 @@
>       .align  5
> 
> ENTRY(memset)
> +     and     r1, r1, #0xff
>       ands    r3, r0, #3              @ 1 unaligned?
>       mov     ip, r0                  @ preserve r0 as return value
>       bne     6f                      @ 1
> --- a/xen/arch/arm/arm32/lib/strrchr.S
> +++ b/xen/arch/arm/arm32/lib/strrchr.S
> @@ -14,6 +14,7 @@
>               .text
>               .align  5
> ENTRY(strrchr)
> +             and     r1, r1, #0xff
>               mov     r3, #0
> 1:            ldrb    r2, [r0], #1
>               teq     r2, r1




 


Rackspace

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