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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C758E77173 for ; Sun, 8 Dec 2024 15:53:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C75D08D0021; Sun, 8 Dec 2024 10:53:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C25608D0015; Sun, 8 Dec 2024 10:53:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEF1C8D0021; Sun, 8 Dec 2024 10:53:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 94B7B8D0015 for ; Sun, 8 Dec 2024 10:53:08 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 245751A0893 for ; Sun, 8 Dec 2024 15:53:08 +0000 (UTC) X-FDA: 82872235446.29.F767CC3 Received: from m16.mail.126.com (m16.mail.126.com [220.197.31.6]) by imf21.hostedemail.com (Postfix) with ESMTP id 2C7031C0002 for ; Sun, 8 Dec 2024 15:52:27 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=126.com header.s=s110527 header.b=MqQAE0bG; dmarc=pass (policy=none) header.from=126.com; spf=pass (imf21.hostedemail.com: domain of ni_liqiang@126.com designates 220.197.31.6 as permitted sender) smtp.mailfrom=ni_liqiang@126.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733673168; a=rsa-sha256; cv=none; b=BB8K4wwN+xnvSTWQ7BXnDFsK7K8a3IEz744MEU8645pl14bEn6ImlKQgtxSNZkAb5Jf02i rNNwkE9Dd6xigjjsEzBswkhVIB/faGzR7IkLDjEMO9MvrBe0ADj4EfVGvez80omy+hWbCW xrTJBSmHY8ECAlaqvxKU25nqT2otJMU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=126.com header.s=s110527 header.b=MqQAE0bG; dmarc=pass (policy=none) header.from=126.com; spf=pass (imf21.hostedemail.com: domain of ni_liqiang@126.com designates 220.197.31.6 as permitted sender) smtp.mailfrom=ni_liqiang@126.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733673168; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nxI5rKZ08BnCDhR50j1kRXJkXSlItgYZ6GxJQvaVuSo=; b=qCb6x/GPYWATmqwUCCJ09D7lwTvX3zUrUc5dA3u7rlJCNnuTVEXeprzV5Wixqa9rUlTEP5 J8QlGazHaXalABGHAsXMKb9iownuzAr2Hsu34pQh6ruFbwYuoepHxeccIRwptsZ+/dVsGE S6JPUd+t2+JSh9uxq1YIf1onLtyk/k0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=nxI5r KZ08BnCDhR50j1kRXJkXSlItgYZ6GxJQvaVuSo=; b=MqQAE0bG/H98s7Yv5oOgo 25eCQfw9GOKpsKnu3ludkuEpHDqeZP7a1cQks00ezTpL5Qszmrd3ICU++I78LraT onrw7q6O3uIOlT6ac+/FchZgdWRPSeqiBj9zHFJweGzcl/rEn3K8ynjStm5fUVLL x8dfSH8ufmV9ep4bpD8YDg= Received: from nilq-virtual-machine.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDn9z+NwFVnfXBxAA--.54791S2; Sun, 08 Dec 2024 23:51:44 +0800 (CST) From: niliqiang To: debug@rivosinc.com Cc: Liam.Howlett@oracle.com, ajones@ventanamicro.com, akpm@linux-foundation.org, alexghiti@rivosinc.com, alistair.francis@wdc.com, andy.chiu@sifive.com, andybnac@gmail.com, aou@eecs.berkeley.edu, arnd@arndb.de, atishp@rivosinc.com, bp@alien8.de, brauner@kernel.org, broonie@kernel.org, carlos.bilbao.osdev@gmail.com, charlie@rivosinc.com, cleger@rivosinc.com, conor.dooley@microchip.com, conor@kernel.org, corbet@lwn.net, dave.hansen@linux.intel.com, david@redhat.com, devicetree@vger.kernel.org, ebiederm@xmission.com, evan@rivosinc.com, hpa@zytor.com, jim.shu@sifive.com, kees@kernel.org, kito.cheng@sifive.com, krzk+dt@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, lorenzo.stoakes@oracle.com, mingo@redhat.com, ni.liqiang@zte.com.cn Subject: Re: [PATCH v7 00/32] riscv control-flow integrity for usermode Date: Sun, 8 Dec 2024 23:51:41 +0800 Message-Id: <20241208155141.21611-1-ni_liqiang@126.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029-v5_user_cfi_series-v7-0-2727ce9936cb@rivosinc.com> References: <20241029-v5_user_cfi_series-v7-0-2727ce9936cb@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wDn9z+NwFVnfXBxAA--.54791S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KrWruw4kGr1fJrWUuw48Zwb_yoW8WFWfpF ZI9as3Jws5AF98Cr97ta18AFWSvws5trsxGr95Jr1S93y5Wry0vF4UtFWrGFy5CryYvF10 vw4j9348ua4DA3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UkgAwUUUUU= X-Originating-IP: [60.24.211.0] X-CM-SenderInf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ZBu83hgAg961mchYrkISRrqMu7m07FGQ8Y6AilfmeAaIHo8v+QWqf8twNIJsLa EYMr289L 60aUlvwE/i2KfR1nSlLC1Ip7dcXYzXWIrGcVMcHynQjhnUT68XiB7el5ttl5jvz0EjSwIDcFLWc/HoK6zyQRleExMcE0ys7z59abWdSjmRDKVHFI08a26UEvcnYl6peyDOaw2lRKPUCrhtF949jc/tZTezoZSmb+bvcWmbOQQ1Vfodi/6eBm719GML/Gh0zgyPL0BR5CveMVwfuhvFaR2cDUBVroVUHcxckZAhi/KrihZ0RwYs6T52okBnnLyFG1P31M8sXutOqqvD/+PfW5stknsFL1p5jKYbvD4uvaJpACzYh62LIuk9NIT7NictwW9cxlC7q+KdKh9xCI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > How to test this series > ======================= I recently built a test environment for RISCV control-flow integrity for usermode using QEMU, referring to the test instructions in the patch. I found several problems during the test, and I hope you can answer them. Thank you. Q1: The CFI-related macro definition values in QEMU(branch: qemu-zicfilp_zicfiss_ratified_master_july11) and Linux(branch: linux-riscv-cfi-vdso_user_cfi_v6.12-rc1) are inconsistent. For example, the definition value of PR_GET_SHADOW_STACK_STATUS in QEMU is 71, but the definition value in Linux is 74. In order to continue the test, I modified the relevant definitions in the QEMU and GUN source codes with reference to the Linux source code, so that the cfi-related macro definitions in the QEMU and GUN source codes are consistent with Linux. Q2: When zicfilp=true is added to the QEMU command to enable landing pad, after cfitests command is executed, a segmentation fault is prompted, software check exception is raised, and the value of xtval is 2. According to the comments in the code, when xtval is 2, there are the following exceptions. * An indirect branch doesn't land on 4 byte aligned PC or `lpad` * instruction or `label` value programmed in `lpad` instr doesn't * match with value setup in `x7`. Why do these software check exceptions exist? What should I do to further troubleshoot or resolve these issues? The software versions I am using are all the versions mentioned in the test instructions, and the zicfiss test is in line with expectations. Can you help me with the above two questions, especially the second one? thank you very much.