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

Re: [PATCH v5 4/6] xen: Switch to byteswap


  • To: Julien Grall <julien@xxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Lin Liu (刘林) <lin.liu@xxxxxxxxxx>
  • Date: Tue, 24 May 2022 02:42:22 +0000
  • Accept-language: zh-CN, en-US
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=btQu1+JhWRACZ6gKW1IZmt0eOUl+jSSrhbLd3Y9cRRU=; b=fBD59Q5agODuWtIQ3E4HdBvgPE6c6AO9c/ogyMTwjWGwBb5FhJefDOWgQL9tvIZXfP/p9tcaRZNBo1rCc570zd7M+8EgNHPHEj+3vP/IPV7/T+LmUniIdS3rO26Kw9DaJ+0Vyaqoq9hZ4ZYrP2oiMZ31m4hdrlZ0kjCCIoKn8o2kTz1zTXSHckNYr/MVI6hvORXC7qEYv3/6kpMrR5F2R0Uo8gkpzC8iRt1hexpMLpansyPsW0167kPuypvoKPFUbKUPLC3eP2mJQbiP6yCq5TBd6nXl2owSZRCZSMZyKCTvekDCrh9AW4VTGBz6YZVWkLIiGwPNAAvvqC7+TA++JA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MaNYl8sI1bO5ibrjpwo5pEpCnzlSwUO/nEYXNOGS6I81YBlLPDcfQk6psIwyKAtJCirdIimdebaSNncP8DO3Cona/9AA6+9aoJXaqYmhanIxAdJh1FZ1M4tOLN9bSZ0G1x0as9OSSlW9a+z+D2SmpUJhr7bBl5xIc4qQHfOkJvEJ4FPqY3KkspFTCMHB9wTE2S41M15fYsDhFZJpzP2Bg8LlriansYeSs3hKWm8qehVzC6QWWir7bpP8o/E2C0CjTI8dkhYAAnOqFFtVR2smCu2HKHwwx0PZyn9mqV84U3+aFcs+hCiZD57E50ulUQSq34P685MmsCQKYKUlcw1JRw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 24 May 2022 02:42:40 +0000
  • Ironport-data: A9a23:vg7flaCuWHSHgRVW/xziw5YqxClBgxIJ4kV8jS/XYbTApD8m0jwGm jAZXD/TPK3cajT9eNx1aoy2px4OsMTczdE1QQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHGeIdA970Ug5w7Nj2dYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPh3y +lIv72TWT55BarSoO4tdSRTNiVhaPguFL/veRBTsOS15mifKT7J/K8rC0s7e4oF5uxwHGdCs +QCLywAZQyCgOTwx6+nTu5rhYIoK8yD0IE34yk8i22GS6h4B8ydK0nJzYYwMDMYgsFIW/Lfe uISaCZ1bQSGaBpKUrsSIM1kwL/z2CelG9FegFbO/LIHzFHa9TNSjeX2GdPqeoOoaOwAyy50o UqDpQwVGCoyNsGbyDeD2mKhgKnIhyyTcJIfEvi0++BnhHWXx3cPE1sGWF2ju/67h0WiHdVFJ CQ84TEypKI/8EiqSNjVXBCipnOA+BkGVLJ4GeAg9BuEzKaS5g+DH3UFVRZIctlgv8gzLRQo3 FKUm9LiBRR0raaYD3ma89+8sjeaKSUTa2gYakc5oRAt5tDipMQ2kUjJR9M6Sqqt1IWpR3f33 iyAqzU4i/MLl8kX2q6n/FfBxTWxupzOSQ1z7QLSNo640j5EiEeeT9TAwTDmATxode51knHpU KA4pvWj
  • Ironport-hdrordr: A9a23:7P0+Mq5TYlscS1if7APXwX2BI+orL9Y04lQ7vn2ZFiY5TiXIra qTdaogviMc0AxhI03Jmbi7Scq9qADnhORICOgqTP2ftWzd1FdAQ7sSircKrweAJ8S6zJ8k6U 4CSdkyNDSTNykdsS+S2mDRfLgdKZu8gdmVbIzlvhVQpHRRGsVdBnBCe2Om+yNNJDVuNN4cLt 6x98BHrz2vdTA8dcKgHEQIWODFupniiI/mSQRuPW9p1CC+yReTrJLqGRmR2RkTFxlVx605zG TDmwvloo2+rvCAzAPG3WO71eUZpDKh8KoDOCW/sLlXFtzesHfrWG2nYczGgNkBmpDu1L/tqq iJn/5vBbU115qbRBDJnfKk4Xid7N9p0Q6v9bbQuwqdneXpAD09EMZPnoRfb1/Q7Fchpsh11O ZR03uerIc/N2KIoM3R3am+a/hRrDvDnZPiq59hs1VPFY8FLLNBp40W+01YVJ8GASLh8YgiVO 1jFtvV6vpaeU6TKymxhBgl/PW8GnAoWhuWSEkLvcKYlzBQgXBi1kMdgMgShG0J+p4xQ4RNo+ 7ELqNrnrdTSdJ+V9M0OM4RBc+sTmDdSxPFN2yfZVzhCaEcInrI74X65b0kjdvaDKDgDKFC7a gpfGkoxFLaIXied/Fm9Kc7gizlUSG6QSnnzN1Y6txwpqD8LYCbQxG+dA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYbrSjsRt5f6mJt0SG0aSZHEYt8q0sjRSAgAALyQCAAAeDgIAAsawQ
  • Thread-topic: [PATCH v5 4/6] xen: Switch to byteswap

>Hi Andrew,

> 

>On 23/05/2022 16:38, Andrew Cooper wrote:

>> On 23/05/2022 15:56, Julien Grall wrote:

>>> Hi,

>>> 

>>> On 23/05/2022 15:50, Lin Liu wrote:

>>>> Update to use byteswap to swap bytes

>>>> be*_to_cpup(p) is short for be*to_cpu(*p), update to use latter

>>>> one explictly

>>> 

>>> But why?

>>

>> Because deleting code obfuscation constructs *is* the point of the cleanup.

>>

>>> I really don't have a suggestion on the comment because I disagree

>>> (and AFAICT Jan as well) with the approach.

>>

>> Dropping the obfuscation has uncovered pre-existing bugs in the

>> hypervisor.  The series stands on its own merit.

> 

>I am guessing you mean that we don't handle unaligned access? If so, yes

>I agree this helped with that.

> 

>>

>> While I can't help if you like it or not, it really does bring an

>> improvement to code quality and legibility.

>>

>> If you have no technical objections, and no suggestions for how to do it

>> differently while retaining the quality and legibility improvements,

>> then "I don't like it" doesn't block it going in.

> 

>And you don't like the existing code :). I am willing to compromise, but

>for that I need to understand why the existing code is technically not

>correct.

> 

>So far, all the arguments you provided in v3 was either a matter of

>taste or IMHO bogus.

> 

>Your taste is nor better nor worse than mine. At which, we need someone

>else to break the tie.

> 

>If I am not mistaken, Jan is also objecting on the proposal. At which

>point, we are 2 vs 1.

> 

>So there are three choices here:

>   1) You find two others maintainers (including on Arm maintainer) to

>agree with you

>   2) You provide arguments that will sway one of us in your side

>   3) We keep be32_cpu*() (they are simple wrapper and I am willing to

>write the code).

 

Personaly, I agree with Andrew Copper to remove the be*_to_cpup helpers as current

implemetation is just a wrapper, like

 

#ifndef __arch__swab16p

#  define __arch__swab16p(x) __arch__swab16(*(x))

#endif

 

With be*_to_cpup been removed, the interface keeps simple and clear, and callers

are dereference the pointer explictly.

 

I am very happy to see the three choices, hope we can reach an agreement about this soon.

 

Cherrs,

---

Lin


 


Rackspace

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