From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FAAAC2BBCA for ; Fri, 28 Jun 2024 07:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sAPPLocrk0akGLbIs6vBokbwHD75KDojomyd+ZE6ADI=; b=47s58251GuJQVPDX2bBYSgDOud RWK1ZE2YRFki6boMWnXSGhzfHLUkyAP0XvZ+m9NmAgI4K2+VhWAGHPRRqk+SuNmkcDBH1aHOewtpt n61ejLvdnOkwlbGJRoUSAYoC/xsiu6bEQmOexg9rZid0GSck+RVZpospXHsuEMvgh9K75DK1KQK7H MkF0vg7aUTViyRsG0xD9ZKyA/aOcwqbIo/yiP+EbWPjLe0Cl99iasbDx0hhnMqasR3vSpyjrTP647 Sbfv59908DDOpkiN6zI91F5qg2lgK5Ju36BJKVIVgDyquJx366ysg6zbmhaZtK/ELMSw9u2MhNvpS HsFVSw+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5gP-0000000CqYj-2cfe; Fri, 28 Jun 2024 07:06:09 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5gF-0000000CqTc-2HsA for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 07:06:01 +0000 Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4W9RDd2thNzZgfq; Fri, 28 Jun 2024 15:01:21 +0800 (CST) Received: from kwepemi100008.china.huawei.com (unknown [7.221.188.57]) by mail.maildlp.com (Postfix) with ESMTPS id 1D3A8180087; Fri, 28 Jun 2024 15:05:48 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi100008.china.huawei.com (7.221.188.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 28 Jun 2024 15:05:46 +0800 Message-ID: <3fed5533-47e7-d927-14e6-2f42eead47d8@huawei.com> Date: Fri, 28 Jun 2024 15:05:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v2 3/3] arm64: entry: Convert to generic entry Content-Language: en-US To: Kees Cook CC: , , , , , , , , , , , , , , , References: <20240627081209.3511918-1-ruanjinjie@huawei.com> <20240627081209.3511918-4-ruanjinjie@huawei.com> <202406270958.D73912B@keescook> From: Jinjie Ruan In-Reply-To: <202406270958.D73912B@keescook> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi100008.china.huawei.com (7.221.188.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240628_000559_942288_EDD044E9 X-CRM114-Status: GOOD ( 11.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024/6/28 1:01, Kees Cook wrote: > On Thu, Jun 27, 2024 at 04:12:09PM +0800, Jinjie Ruan wrote: >> Tested ok with following test cases on Qemu cortex-a53 and HiSilicon >> Kunpeng-920: >> - Run `perf top` command >> - Switch between different `dynamic preempt` mode >> - Use `pseudo nmi` >> - stress-ng CPU stress test. > > I think two other things to test would be the MTE functionality > (especially async mode), and kasan in general. > > I've really struggled to get MTE working with qemu, so likely real > hardware would be needed for that... I'm hoping the ARM folks have > access to something that would work well for this. :) Hi, Kees I run the following testcases which are mostly in tools/testing/selftests/arm64/mte, the results is ok as below: 1、The simple mte test case in Documentation/arch/arm64/memory-tagging-extension.rst, it pass: # ./mte_test a[0] = 1 a[1] = 2 0x200ffff9dfa3000 a[0] = 3 a[1] = 2 Expecting SIGSEGV... Segmentation fault 2、 # cd tools/testing/selftests/arm64/mte/ # ./check_prctl pass: TAP version 13 1..5 ok 1 check_basic_read ok 2 NONE ok 3 SYNC ok 4 ASYNC ok 5 SYNC+ASYNC # Totals: pass:5 fail:0 xfail:0 xpass:0 skip:0 error:0 3、./check_tags_inclusion pass: 1..4 ok 1 Check an included tag value with sync mode ok 2 Check different included tags value with sync mode ok 3 Check none included tags value with sync mode ok 4 Check all included tags value with sync mode # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0 4、./check_user_mem pass: 1..64 ok 1 test type: read, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 2 test type: read, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 3 test type: read, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 4 test type: read, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 5 test type: read, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 6 test type: read, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 7 test type: read, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 8 test type: read, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 9 test type: read, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 10 test type: read, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 11 test type: read, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 12 test type: read, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 13 test type: read, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 14 test type: read, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 15 test type: read, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 16 test type: read, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 17 test type: write, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 18 test type: write, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 19 test type: write, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 20 test type: write, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 21 test type: write, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 22 test type: write, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 23 test type: write, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 24 test type: write, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 25 test type: write, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 26 test type: write, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 27 test type: write, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 28 test type: write, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 29 test type: write, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 30 test type: write, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 31 test type: write, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 32 test type: write, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 33 test type: readv, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 34 test type: readv, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 35 test type: readv, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 36 test type: readv, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 37 test type: readv, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 38 test type: readv, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 39 test type: readv, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 40 test type: readv, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 41 test type: readv, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 42 test type: readv, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 43 test type: readv, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 44 test type: readv, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 45 test type: readv, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 46 test type: readv, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 47 test type: readv, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 48 test type: readv, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 49 test type: writev, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 50 test type: writev, MTE_SYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 51 test type: writev, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 52 test type: writev, MTE_SYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 53 test type: writev, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 54 test type: writev, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 55 test type: writev, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 56 test type: writev, MTE_SYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 ok 57 test type: writev, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 0 ok 58 test type: writev, MTE_ASYNC_ERR, MAP_SHARED, tag len: 0, tag offset: 16 ok 59 test type: writev, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 0 ok 60 test type: writev, MTE_ASYNC_ERR, MAP_SHARED, tag len: 16, tag offset: 16 ok 61 test type: writev, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 0 ok 62 test type: writev, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 0, tag offset: 16 ok 63 test type: writev, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 0 ok 64 test type: writev, MTE_ASYNC_ERR, MAP_PRIVATE, tag len: 16, tag offset: 16 # Totals: pass:64 fail:0 xfail:0 xpass:0 skip:0 error:0 5、./check_mmap_options pass 1..22 ok 1 Check anonymous memory with private mapping, sync error mode, mmap memory and tag check off ok 2 Check file memory with private mapping, sync error mode, mmap/mprotect memory and tag check off ok 3 Check anonymous memory with private mapping, no error mode, mmap memory and tag check off ok 4 Check file memory with private mapping, no error mode, mmap/mprotect memory and tag check off ok 5 Check anonymous memory with private mapping, sync error mode, mmap memory and tag check on ok 6 Check anonymous memory with private mapping, sync error mode, mmap/mprotect memory and tag check on ok 7 Check anonymous memory with shared mapping, sync error mode, mmap memory and tag check on ok 8 Check anonymous memory with shared mapping, sync error mode, mmap/mprotect memory and tag check on ok 9 Check anonymous memory with private mapping, async error mode, mmap memory and tag check on ok 10 Check anonymous memory with private mapping, async error mode, mmap/mprotect memory and tag check on ok 11 Check anonymous memory with shared mapping, async error mode, mmap memory and tag check on ok 12 Check anonymous memory with shared mapping, async error mode, mmap/mprotect memory and tag check on ok 13 Check file memory with private mapping, sync error mode, mmap memory and tag check on ok 14 Check file memory with private mapping, sync error mode, mmap/mprotect memory and tag check on ok 15 Check file memory with shared mapping, sync error mode, mmap memory and tag check on ok 16 Check file memory with shared mapping, sync error mode, mmap/mprotect memory and tag check on ok 17 Check file memory with private mapping, async error mode, mmap memory and tag check on ok 18 Check file memory with private mapping, async error mode, mmap/mprotect memory and tag check on ok 19 Check file memory with shared mapping, async error mode, mmap memory and tag check on ok 20 Check file memory with shared mapping, async error mode, mmap/mprotect memory and tag check on ok 21 Check clear PROT_MTE flags with private mapping, sync error mode and mmap memory ok 22 Check clear PROT_MTE flags with private mapping and sync error mode and mmap/mprotect memory # Totals: pass:22 fail:0 xfail:0 xpass:0 skip:0 error:0 6、./check_ksm_options pass 1..4 ok 1 Check KSM mte page merge for private mapping, sync mode and mmap memory ok 2 Check KSM mte page merge for private mapping, async mode and mmap memory ok 3 Check KSM mte page merge for shared mapping, sync mode and mmap memory ok 4 Check KSM mte page merge for shared mapping, async mode and mmap memory # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0 7、./check_gcr_el1_cswitch pass 1..1 ok 1 Verify that GCR_EL1 is set correctly on context switch # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 8、# ./check_buffer_fill pass 1..20 ok 1 Check buffer correctness by byte with sync err mode and mmap memory ok 2 Check buffer correctness by byte with async err mode and mmap memory ok 3 Check buffer correctness by byte with sync err mode and mmap/mprotect memory ok 4 Check buffer correctness by byte with async err mode and mmap/mprotect memory ok 5 Check buffer write underflow by byte with sync mode and mmap memory ok 6 Check buffer write underflow by byte with async mode and mmap memory ok 7 Check buffer write underflow by byte with tag check fault ignore and mmap memory ok 8 Check buffer write underflow by byte with sync mode and mmap memory ok 9 Check buffer write underflow by byte with async mode and mmap memory ok 10 Check buffer write underflow by byte with tag check fault ignore and mmap memory ok 11 Check buffer write overflow by byte with sync mode and mmap memory ok 12 Check buffer write overflow by byte with async mode and mmap memory ok 13 Check buffer write overflow by byte with tag fault ignore mode and mmap memory ok 14 Check buffer write correctness by block with sync mode and mmap memory ok 15 Check buffer write correctness by block with async mode and mmap memory ok 16 Check buffer write correctness by block with tag fault ignore and mmap memory ok 17 Check initial tags with private mapping, sync error mode and mmap memory ok 18 Check initial tags with private mapping, sync error mode and mmap/mprotect memory ok 19 Check initial tags with shared mapping, sync error mode and mmap memory ok 20 Check initial tags with shared mapping, sync error mode and mmap/mprotect memory # Totals: pass:20 fail:0 xfail:0 xpass:0 skip:0 error:0 9、 ./check_child_memory pass 1..12 ok 1 Check child anonymous memory with private mapping, precise mode and mmap memory ok 2 Check child anonymous memory with shared mapping, precise mode and mmap memory ok 3 Check child anonymous memory with private mapping, imprecise mode and mmap memory ok 4 Check child anonymous memory with shared mapping, imprecise mode and mmap memory ok 5 Check child anonymous memory with private mapping, precise mode and mmap/mprotect memory ok 6 Check child anonymous memory with shared mapping, precise mode and mmap/mprotect memory ok 7 Check child file memory with private mapping, precise mode and mmap memory ok 8 Check child file memory with shared mapping, precise mode and mmap memory ok 9 Check child file memory with private mapping, imprecise mode and mmap memory ok 10 Check child file memory with shared mapping, imprecise mode and mmap memory ok 11 Check child file memory with private mapping, precise mode and mmap/mprotect memory ok 12 Check child file memory with shared mapping, precise mode and mmap/mprotect memory # Totals: pass:12 fail:0 xfail:0 xpass:0 skip:0 error:0 > > -Kees >