From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755057AbcHAXZx (ORCPT ); Mon, 1 Aug 2016 19:25:53 -0400 Received: from exvmail3.hynix.com ([166.125.252.90]:57763 "EHLO invmail3.skhynix.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754380AbcHAXZU (ORCPT ); Mon, 1 Aug 2016 19:25:20 -0400 X-AuditID: a67dfc59-f790b6d000004b07-d3-579fda26000d From: "kwangwoo.lee@sk.com" To: Robin Murphy , Russell King - ARM Linux , Catalin Marinas , "Will Deacon" , Mark Rutland , "linux-arm-kernel@lists.infradead.org" CC: "hyunchul3.kim@sk.com" , "linux-kernel@vger.kernel.org" , "woosuk.chung@sk.com" Subject: RE: [PATCH v2] arm64: mm: convert __dma_* routines to use start, size Thread-Topic: [PATCH v2] arm64: mm: convert __dma_* routines to use start, size Thread-Index: AQHR5xBcaKHsJZrE6EmNL7MPsHijzaAp7/iAgAFuegCAABbLAIABfUjAgAIfcACABCpKgIAAUh6AgAAEywCAATXloA== Date: Mon, 1 Aug 2016 23:24:21 +0000 Message-ID: References: <1469518496-8177-1-git-send-email-kwangwoo.lee@sk.com> <15c12f9900fd4b31a875250c478023c6@nmail01.hynixad.com> <1c4ec01bd3594485b6a4b386994dc6ca@nmail01.hynixad.com> <21272fb2-bffb-15ee-41a9-af0251a33fd0@arm.com> In-Reply-To: Accept-Language: ko-KR, en-US Content-Language: ko-KR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.92.132.196] Content-Type: text/plain; charset="ks_c_5601-1987" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsXCNUdUWVf91vxwg+P1Fu+X9TBabHp8jdXi 8q45bBaHpu5ltFh6/SKTxcEPT1gtXn48weLA7rFm3hpGj8vXLjJ7bF5S7/F5k1wASxSXTUpq TmZZapG+XQJXxrtDe9gKTkhX9HQtYWxgfCPVxcjJISFgItEys4UdwhaTuHBvPVsXIxeHkMBq RomlOy6zQziLGCXm7XjPClLFJmAosffWPjBbRGAxk8T+ZTIgRcwCCxkltrZ9BEsICwRI/N2w mA2iKFDi2um7LF2MHEB2lkRbVx6IySKgIrG+RQakglfASWL1x6tMELseMUsc3nQLbAyngLXE zo2zGUHqGQVkJa5eA6tnFhCXWPz1GjPE0QISS/ach7JFJV4+/scKYStKfHv9nR2i3khiyer5 TBC2osSU7ofsEHsFJU7OfMICUS8pcXDFDZYJjOKzkKyYhaR9FpL2WUjaFzCyrGIUycwry03M zDHWK87OqMzLrNBLzs/dxAiMymW1fyJ3MPa06h9iFOBgVOLhZSiaHy7EmlhWXJl7iFGCg1lJ hPfBNaAQb0piZVVqUX58UWlOavEhRmkOFiVx3m//+8KFBNITS1KzU1MLUotgskwcnFINjFXV xQr7768qzz1bncWq8uOTJ3uE/8vv/K8tznNP0zly845TjilDSauwjkRYXoXkxKkztk3ZHXrt ibh7CWcA87k7znqqWqVhmglx0ly2EsaKNtsla7U1rwhEtndEB3lZ73LYI8Nazsrwi6Xk2dtD 1tcTU99tL7l78gwv88cUhdZb9+1ro6KVWIozEg21mIuKEwEBYrWDxgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u71NQ0Cp017039 > -----Original Message----- > From: Robin Murphy [mailto:robin.murphy@arm.com] > Sent: Monday, August 01, 2016 10:53 PM > To: À̱¤¿ì(LEE KWANGWOO) MS SW; Russell King - ARM Linux; Catalin Marinas; Will Deacon; Mark Rutland; > linux-arm-kernel@lists.infradead.org > Cc: ±èÇöö(KIM HYUNCHUL) MS SW; linux-kernel@vger.kernel.org; Á¤¿ì¼®(CHUNG WOO SUK) MS SW > Subject: Re: [PATCH v2] arm64: mm: convert __dma_* routines to use start, size > > On 01/08/16 14:36, Robin Murphy wrote: > > On 01/08/16 00:45, kwangwoo.lee@sk.com wrote: > > [...] > >>>>> -----8<----- > >>>>> diff --git a/arch/arm64/include/asm/assembler.h > >>>>> b/arch/arm64/include/asm/assembler.h > >>>>> index 10b017c4bdd8..1c005c90387e 100644 > >>>>> --- a/arch/arm64/include/asm/assembler.h > >>>>> +++ b/arch/arm64/include/asm/assembler.h > >>>>> @@ -261,7 +261,16 @@ lr .req x30 // link register > >>>>> add \size, \kaddr, \size > >>>>> sub \tmp2, \tmp1, #1 > >>>>> bic \kaddr, \kaddr, \tmp2 > >>>>> -9998: dc \op, \kaddr > >>>>> +9998: > >>>>> + .ifeqs "\op", "cvac" > >>>>> +alternative_if_not ARM64_WORKAROUND_CLEAN_CACHE > >>>>> + dc cvac, \kaddr > >>>>> +alternative_else > >>>>> + dc civac, \kaddr > >>>>> +alternative_endif > >>>>> + .else > >>>>> + dc \op, \kaddr > >>>>> + .endif > >>>>> add \kaddr, \kaddr, \tmp1 > >>>>> cmp \kaddr, \size > >>>>> b.lo 9998b > >>>> > >>>> I agree that it looks not viable because it makes the macro bigger and > >>>> conditional specifically with CVAC op. > >>> > >>> Actually, having had a poke around in the resulting disassembly, it > >>> looks like this does work correctly. I can't think of a viable reason > >>> for the whole dcache_by_line_op to ever be wrapped in yet another > >>> alternative (which almost certainly would go horribly wrong), and it > >>> would mean that any other future users are automatically covered for > >>> free. It's just horrible to look at at the source level. > >> > >> Then, Are you going to send a patch for this? Or should I include this change? > > > > I'll do a bit more testing just to make sure, then spin a separate patch > > (and try to remember to keep you on CC..) > > ...and said patch turns out to conflict with 823066d9edcd, since I > hadn't realised it's already been fixed! So you can go ahead with the > dcache_by_line_op cleanup as well, just rebase onto arm64/for-next/core > (or linux/master, since it's been pulled already). Thank you very much for the information! I'll rebase with it. > Robin. Best Regards, Kwangwoo Lee From mboxrd@z Thu Jan 1 00:00:00 1970 From: kwangwoo.lee@sk.com (kwangwoo.lee at sk.com) Date: Mon, 1 Aug 2016 23:24:21 +0000 Subject: [PATCH v2] arm64: mm: convert __dma_* routines to use start, size In-Reply-To: References: <1469518496-8177-1-git-send-email-kwangwoo.lee@sk.com> <15c12f9900fd4b31a875250c478023c6@nmail01.hynixad.com> <1c4ec01bd3594485b6a4b386994dc6ca@nmail01.hynixad.com> <21272fb2-bffb-15ee-41a9-af0251a33fd0@arm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > -----Original Message----- > From: Robin Murphy [mailto:robin.murphy at arm.com] > Sent: Monday, August 01, 2016 10:53 PM > To: ???(LEE KWANGWOO) MS SW; Russell King - ARM Linux; Catalin Marinas; Will Deacon; Mark Rutland; > linux-arm-kernel at lists.infradead.org > Cc: ???(KIM HYUNCHUL) MS SW; linux-kernel at vger.kernel.org; ???(CHUNG WOO SUK) MS SW > Subject: Re: [PATCH v2] arm64: mm: convert __dma_* routines to use start, size > > On 01/08/16 14:36, Robin Murphy wrote: > > On 01/08/16 00:45, kwangwoo.lee at sk.com wrote: > > [...] > >>>>> -----8<----- > >>>>> diff --git a/arch/arm64/include/asm/assembler.h > >>>>> b/arch/arm64/include/asm/assembler.h > >>>>> index 10b017c4bdd8..1c005c90387e 100644 > >>>>> --- a/arch/arm64/include/asm/assembler.h > >>>>> +++ b/arch/arm64/include/asm/assembler.h > >>>>> @@ -261,7 +261,16 @@ lr .req x30 // link register > >>>>> add \size, \kaddr, \size > >>>>> sub \tmp2, \tmp1, #1 > >>>>> bic \kaddr, \kaddr, \tmp2 > >>>>> -9998: dc \op, \kaddr > >>>>> +9998: > >>>>> + .ifeqs "\op", "cvac" > >>>>> +alternative_if_not ARM64_WORKAROUND_CLEAN_CACHE > >>>>> + dc cvac, \kaddr > >>>>> +alternative_else > >>>>> + dc civac, \kaddr > >>>>> +alternative_endif > >>>>> + .else > >>>>> + dc \op, \kaddr > >>>>> + .endif > >>>>> add \kaddr, \kaddr, \tmp1 > >>>>> cmp \kaddr, \size > >>>>> b.lo 9998b > >>>> > >>>> I agree that it looks not viable because it makes the macro bigger and > >>>> conditional specifically with CVAC op. > >>> > >>> Actually, having had a poke around in the resulting disassembly, it > >>> looks like this does work correctly. I can't think of a viable reason > >>> for the whole dcache_by_line_op to ever be wrapped in yet another > >>> alternative (which almost certainly would go horribly wrong), and it > >>> would mean that any other future users are automatically covered for > >>> free. It's just horrible to look at at the source level. > >> > >> Then, Are you going to send a patch for this? Or should I include this change? > > > > I'll do a bit more testing just to make sure, then spin a separate patch > > (and try to remember to keep you on CC..) > > ...and said patch turns out to conflict with 823066d9edcd, since I > hadn't realised it's already been fixed! So you can go ahead with the > dcache_by_line_op cleanup as well, just rebase onto arm64/for-next/core > (or linux/master, since it's been pulled already). Thank you very much for the information! I'll rebase with it. > Robin. Best Regards, Kwangwoo Lee