Received: by 10.223.164.202 with SMTP id h10csp2905530wrb; Tue, 28 Nov 2017 03:18:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMZrgmc7fLDYHp/RPlbiwacjgNMwy63n7Xs7A+yPwWXg1B869K68f5KNKR9tjIWYRLFGOOXj X-Received: by 10.84.129.228 with SMTP id b91mr41299561plb.56.1511867937875; Tue, 28 Nov 2017 03:18:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511867937; cv=none; d=google.com; s=arc-20160816; b=TkFrMEgJs/0WpvRNmOvSafkZxSUDAqzUtrlhkwH7vHebZiqR/RRPsT7IHK4jtYIUaZ EVznMyUV5nf8LhPOy26g7RxQy9VGpFkI58YKQz0SXOQ7+aUVE13zM2TklGy1LRAiVr9o e2ddYVVLIGGYbB4AUxmTXD9cm0b5BX1at4GxHS0rZ9zB2oouEIkkmPDBF/TnY+re1GzE x5gkHk5fvAKMeuHRhR+j7yJHZxRx6i0xJ9WSnOSpKikEhclCU+V8NEuSzeNr3Bk61BGP GXi4zs3x6il0eYadH+1N1qchUrcj/IdIUgu+7Z9X6KLdkfqTUbBYiWqgg/KzT90ca70e TwuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:to:arc-authentication-results; bh=7Y8cMjiEm1WoOOY9v590x2J0ZQz4wATxu3HkTqnofI8=; b=zoasPak1h+mfp8pHhHTTf9oAPA1iAy0PFviKLtUyYTNlpdnL0tX47r0nZBBEdwSEtq 5MnkWzg9NA0/SyplAntReWM/WAX7a6mJtOrrq3hnp5eTdqIG//pWSbtmCXOESxLtc/Jv KZnKqsVoteRA2+L8iQZDwZOqjBdgX2bAGZuJISA56NVgBVEgkcxgnnzV8+Z1MSBLcal5 ke90d5+DThPzKnXBSYQzt0TP1M7Qx6c0jNSE6rrDPlZRYOVfz8YxnG5wbXc3XR/LvO4g 5UU9lP0WRPJOQLaW7ZBh7Hh68bxbPY6ZMduMv/O+7hUacP8uTBbu8ZNNTv1f76GmGhnt eG/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n61si24969523plb.221.2017.11.28.03.18.46; Tue, 28 Nov 2017 03:18:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755038AbdK1LSN (ORCPT + 78 others); Tue, 28 Nov 2017 06:18:13 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11445 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754993AbdK1LR6 (ORCPT ); Tue, 28 Nov 2017 06:17:58 -0500 Received: from 172.30.72.59 (EHLO DGGEMS414-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DLN94844; Tue, 28 Nov 2017 19:17:49 +0800 (CST) Received: from [127.0.0.1] (10.142.68.147) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Tue, 28 Nov 2017 19:17:43 +0800 To: , "mark.rutland@arm.com" , Linux Kernel Mailing List From: gengdongjiu Subject: [question] extract the feature bits width to 4 Message-ID: <17ab0a11-7ca2-ff22-35d6-7446dbccc3ea@huawei.com> Date: Tue, 28 Nov 2017 19:17:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.68.147] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.5A1D45DD.00DA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 24d2561595709058c0aca30a936eaf60 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi,suzuki/mark, very sorry to disturb you, I have a question that want to consult with you. For the CPU feature detection, why we use extract 4 bits width for the feature match instead of the actual bits number[1]? may be the actual hardware feature bit more than 4 bits. thanks! static inline int __attribute_const__ cpuid_feature_extract_field(u64 features, int field, bool sign) { return cpuid_feature_extract_field_width(features, field, 4, sign); } static bool feature_matches(u64 reg, const struct arm64_cpu_capabilities *entry) { int val = cpuid_feature_extract_field(reg, entry->field_pos, entry->sign); return val >= entry->min_field_value; } From 1585345036808627898@xxx Tue Nov 28 21:00:44 +0000 2017 X-GM-THRID: 1585224683401482111 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread