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

RE: [XEN PATCH v8 05/22] xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 13 Apr 2023 13:53:11 +0000
  • Accept-language: zh-CN, en-US
  • 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=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=X/IiZS1H1pLzzQw8lxikRzQ5nWgyR1+jPu0WKdMTNjc=; b=K1DNe5MeToeS+KC6X7aLaxxxgf0D+cw+mHJnraTnUgtI0HNT9jbBbhgG/5tQiIuXOdmNpIGOfHQDdVfy8aBp+RrrWfH70sQ10XjQLFlZe9vA1PceeA3k1EmJGr6VHjh/1O7ObHoQISrq0xACj/KS4YdGBmZGtxt3aqlyFI6mRcV1uhgyV9KD/fk01H5ezfSzjUFUZX0+VT/e+9j9i/R3yx9KxVjcR88aGjKnLlLtdlh24W1hK7Yzppra5P/BBxkSB/Xi+iARG1Ok9l2IiH9wesP/MdHVpUlJG/MDhU9BtIpwuqLcL78aUQTrPaLuCj4Nr1JTuTQS8LiYmzPMCeKIUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gy6uKaLkpLZXAJKeAF+RACDIQioF8CPa7zV+125vQUYtFzkOmF3AlflQAe8CWbUMick//9uECIVrBlDALhwJjMQTjR3lYnUZTvJKbsf87xWYJpSpnNikbyiHnhNNRjij9l/l7N765H4HDwWBEMCdmqw/Mxlu7StsjP+gxhg9CInb+uCqNaCqo6tfEFn4K3Kv/fZyxLwRw/thQNJNOgXwnjPzioFHIbAxBvAnLj+hhZbF1mpaIBvlx0hsQvno/J62CZskY+OEZug5EKrSLwpS6qGVvFbMloKQzmeiaG4lPKLrq8sTdpgyNjRWOZNy4ITZgw+03Wsjps+fuUhOqawPiA==
  • 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>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Marc Bonnici <Marc.Bonnici@xxxxxxx>, Achin Gupta <Achin.Gupta@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 13 Apr 2023 13:53:40 +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: AQHZbdfQYdI+Ke10g0y9D6f6Y8dBZq8pCBXggAA4ogCAAAB2UA==
  • Thread-topic: [XEN PATCH v8 05/22] xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET

Hi Jens,

> -----Original Message-----
> From: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> Subject: Re: [XEN PATCH v8 05/22] xen/arm: ffa: add flags for
> FFA_PARTITION_INFO_GET
> > > +#define FFA_PART_PROP_DIRECT_REQ_RECV   BIT(0, U)
> > > +#define FFA_PART_PROP_DIRECT_REQ_SEND   BIT(1, U)
> > > +#define FFA_PART_PROP_INDIRECT_MSGS     BIT(2, U)
> > > +#define FFA_PART_PROP_RECV_NOTIF        BIT(3, U)
> > > +#define FFA_PART_PROP_IS_MASK           (3U << 4)
> >
> > I am a bit confused here, here (3U<<4) is "IS_MASK" but...
> >
> > > +#define FFA_PART_PROP_IS_PE_ID          (0U << 4)
> > > +#define FFA_PART_PROP_IS_SEPID_INDEP    (1U << 4)
> > > +#define FFA_PART_PROP_IS_SEPID_DEP      (2U << 4)
> > > +#define FFA_PART_PROP_IS_AUX_ID         (3U << 4)
> >
> > ...here the same value is used for "IS_AUX_ID". According to
> > the spec that I referred to, bit[5:4] has the following encoding:
> > b'11: Partition ID is an auxiliary ID. Hence I guess the above
> > "IS_MASK" should be removed?
> 
> FFA_PART_PROP_IS_MASK is supposed to be used when extracting the bits
> to compare with one of the other  FFA_PART_PROP_IS_* defines. For
> example:
> if ((props & FFA_PART_PROP_IS_MASK) == FFA_PART_PROP_IS_PE_ID)

Ohh I now understand, the naming does not mean it "is a mask" but actually
means "this is a mask for FFA_PART_PROP_IS_". That makes a lot of sense.

To avoid this kind of ambiguity, do you think changing the name to something
like "FFA_PART_PROP_IS_TYPE_MASK" makes sense here? Note that this
is just my suggestion, you can decide to change or not, I am asking just
because I downloaded the whole series and found that currently
FFA_PART_PROP_IS_MASK is not used anywhere, so before it is used everywhere
in the code, it might be good to use a more clear name.

> 
> using
> if ((props & FFA_PART_PROP_IS_AUX_ID) == FFA_PART_PROP_IS_PE_ID)
> 
> doesn't seem right.

Indeed. Please see my above reply.

Personally after the above clarification, I am good with the patch, so:

Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry

> 
> >
> > I confirm the values of other fields are consistent with the spec.
> 
> Thanks,
> Jens
> 
> >
> > Kind regards,
> > Henry

 


Rackspace

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