Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp382311pxb; Sat, 18 Sep 2021 05:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW5n1L0vLhR1QCaYAopGcR2NF2sI962vxGoLZGAkxYXZliCXyePWnBK+rC9G6ahPiAe+td X-Received: by 2002:a50:8163:: with SMTP id 90mr2222456edc.198.1631968809003; Sat, 18 Sep 2021 05:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631968808; cv=none; d=google.com; s=arc-20160816; b=eaTrxy8G2YELPLd6BQkuEo/GFE/dOxN4W+b8XP4yRytBYjCSiIlZPw21ElCfOqO8ZM 1/zMFYuK3lVK8qwWMHebGSfdLjYg4Q7tNI2o3fezqPcTIp8ahG1tWiKWPlb5DeFbUQ0F svVb86OzPnoKcrHEnzQ+D+4Q7c10j0hJYBwLtJL0Vu8LN4HECejBO4HDFm/G5F6N1Dkx xIJSZXbUM+1z1VsGcrSxFHIwn1bzN57iOsBYPpO3zOzQVoQ3RFlkjIbGw0UQd/JYjqat vDI3JOosPHBC+SHDw4qbBpWn1Sq9X1TwLa5gbZ/d068bOJHvXAPmU1qMF0rqzpnRiRDS cWLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=0+50dUuxxRYLMGa3YEi7k5DyCkJBq2kiKpQITaAaFAk=; b=XZOgESzMb6RZ0705U0/wiik8Mwz0smv/NCV3BLvnHEnAh1G0qBEtOvNItE2CbGt872 yJRIQ3sr419YG3/wkjNlpCniJfq4fM09h12oOTeIOdmi+7Zc8OyNuyNd0gCe8mwRLANK LLwt0xAIx5b2xZyKi0a6lTBenC2RT8aZ0XJrHZojP+c/AwsPOXuu2ulVlWhiyOEyNFPp FZxdg5wRbM94ZzitukfNpr5N5du6h1yohUXXRtUQRFSzUHKNCmQz12L8ofmdPs+gJEs8 5UDwmcDinZzVuFp6mAdtZYicAC7KOYYLPaWKCG5XpofehBq++4YvgdmBVN4ESFZaNs8g ejOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si9611884ejf.364.2021.09.18.05.39.32; Sat, 18 Sep 2021 05:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232301AbhIRBPc (ORCPT + 99 others); Fri, 17 Sep 2021 21:15:32 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9744 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbhIRBPb (ORCPT ); Fri, 17 Sep 2021 21:15:31 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HBCVk4hsxzWK5b; Sat, 18 Sep 2021 09:13:02 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 18 Sep 2021 09:14:06 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 18 Sep 2021 09:14:06 +0800 Subject: Re: [PATCH v2 0/2] riscv: improve unaligned memory accesses To: Jisheng Zhang , Chen Huang CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Darius Rad , , References: <20210916130855.4054926-1-chenhuang5@huawei.com> <20210917221429.4d3a15ca@xhacker> From: Kefeng Wang Message-ID: <9200c4c2-44b9-480e-6970-5188640fb00a@huawei.com> Date: Sat, 18 Sep 2021 09:14:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20210917221429.4d3a15ca@xhacker> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/17 22:14, Jisheng Zhang wrote: > On Thu, 16 Sep 2021 13:08:53 +0000 > Chen Huang wrote: > >> The patchset improves RISCV unaligned memory accesses, selects >> HAVE_EFFICIENT_UNALIGNED_ACCESS if CPU_HAS_NO_UNALIGNED not >> enabled and supports DCACHE_WORD_ACCESS to improve the efficiency >> of unaligned memory accesses. >> >> If CPU don't support unaligned memory accesses for now, please >> select CONFIG_CPU_HAS_NO_UNALIGNED. For I don't know which CPU >> don't support unaligned memory accesses, I don't choose the >> CONFIG for them. > This will break unified kernel Image for riscv. Obviously, we will have > two images for efficient unaligned access platforms and non-efficient > unaligned access platforms. IMHO, we may need alternative mechanism or > something else to dynamically enable related code path. it won't break unified kernel Image for riscv, if one SoC choose CPU_HAS_NO_UNALIGNED, the single Image won't support unaligned memory accesses, indeed, it depends on the CONFIG, and now, arm/powerpc/m68k has similar configuration. Yes,  it could be an optimization via alternative mechanism or something else to dynamically enable related code path later. > > Regards > >> Changes since v1: >> - As Darius Rad and Jisheng Zhang mentioned, some CPUs don't support >> unaligned memory accesses, add an option for CPUs to choose it or not. >> >> Chen Huang (2): >> riscv: support HAVE_EFFICIENT_UNALIGNED_ACCESS >> riscv: Support DCACHE_WORD_ACCESS >> >> arch/riscv/Kconfig | 5 ++++ >> arch/riscv/include/asm/word-at-a-time.h | 37 +++++++++++++++++++++++++ >> 2 files changed, 42 insertions(+) >> > > . >