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

Re: [RFC PATCH] Added the logic to decode 32 bit ldr/str post-indexing instructions


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 09:12:02 +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=mFkw2et8qdxmeLhhN6v/KQ5SW+Y1viEB5bxI7tM5hEo=; b=frE9DUM1ukcPsnaK2c9LdeKbCtoBbVSGN5JMQChbh4Xjfji0vzNSO6ONX4XrPU1O0dnbB/9/hE+CElYIK4+qAjKFYeE28uvhyeQnbJNCdtKeQCx9A27rKmBVpG2iTwe+k44Mqi8/kZI0PO07kzg3Ys1g5z05EfiAkjTNSfqOdtT1eVXHiWe6UiCRSYK0JHlCTm5hvoru6hwmogBC756JARsYqgdFEHGwx5MXDjtg8LohevrJS3uVlth5CcuUTvXX2Ok62KzkcQdgl5T6r4XU21U/X7r27GToH0OXzIAqqmicckIq0fYTtal8sFUpDzOp0JHlQhcNgeHbSL2qEFiM3w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YDV1vJKJdZciZZSXoKkvsbWQlXUQF3S7nC+4cKY8QAMacFSsQlL/cWlboSjmr1xPmg9JSiW1c5NKGkOjzqHOjdu2mCteT1kDhHHPX7dcvhjeRBpX0cXR/jnysy9oY3EDBJz/t+60wWZQNFlTGQ/DY6FKs8UB/4USKX58s94THjgDPANgjvQzDT6e3l8rkKiUpk6/MiZM/cM+j4J62cRcseFsWopOjCMwr0YvYKxQtW53lvH1athnJqJ3dXH2xtKv7lE8d2ZxJoPV0/hAqVmY3CEngvxj8gTaiRu3LeK8nHwKzyTpB433XtqsiD/D9E6reM2DHGTTBhJ5QHyT19/M1g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, stefano.stabellini@xxxxxxxxxx, julien@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, ayankuma@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 22 Nov 2021 08:12:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.11.2021 17:52, Ayan Kumar Halder wrote:
> --- a/xen/arch/arm/decode.c
> +++ b/xen/arch/arm/decode.c
> @@ -84,6 +84,80 @@ bad_thumb2:
>      return 1;
>  }
>  
> +static inline int32_t extract32(uint32_t value, int start, int length)
> +{
> +    int32_t ret;
> +
> +    if ( !(start >= 0 && length > 0 && length <= 32 - start) )
> +        return -EINVAL;
> +
> +    ret = (value >> start) & (~0U >> (32 - length));
> +
> +    return ret;
> +}

In addition to Julien's comment regarding the function parameters - why
is the return type int32_t and not uint32_t? Plus as per ./CODING_STYLE
it really shouldn't be a fixed width type anyway, but e.g. unsigned int.

Jan




 


Rackspace

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