From patchwork Tue Aug 23 01:56:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wangshaobo (bobo)" X-Patchwork-Id: 12951609 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 C30DFC28D13 for ; Tue, 23 Aug 2022 01:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4P9nZ0QXgMPPlpo5wG04rkJm/mpIqy6EK0qTRYgLelA=; b=vKsitgMNP2IteI yMW3C2cMC5+GlST9rUsGrrfn3nY+WEdMPG+AHmGIDzUFQg7x0MUBvsxdxM9NuLOKJVUN+1puGBR/w 7vPriQmDdtEBptFiPunsocoiZw0PNi75XXjGTLOSKEdAWtaedSqzNNkCaBlibf0Fo9Gq3hiyJQBtZ WHD7jPyZbjmx1fZvWTsC81h67bObtu89JACi1iF1lknyyIi4ewFCWOtN2fUlGAURDuv8eOap1tdD+ 7TCeE/EPLmcylCxBEKZJq3ee/TwPAHMRkpjwWRZEjGyaf3Dul8LJh7mW+URF2rQhHTUemItPeCtAI eu5dP+1DfNRqDIJZuyyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQJ22-00HTFT-MI; Tue, 23 Aug 2022 01:48:42 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQJ1y-00HT5N-Nk for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 01:48:40 +0000 Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MBX9L6Br3zlVyK; Tue, 23 Aug 2022 09:45:10 +0800 (CST) Received: from dggpemm500015.china.huawei.com (7.185.36.181) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 23 Aug 2022 09:48:23 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500015.china.huawei.com (7.185.36.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 23 Aug 2022 09:48:22 +0800 From: Wang ShaoBo To: CC: , , , , , , Subject: [PATCH] arm64/sme: Clearing TIF_SVE but not TIF_SME in za_set() Date: Tue, 23 Aug 2022 09:56:27 +0800 Message-ID: <20220823015627.4161141-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500015.china.huawei.com (7.185.36.181) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220822_184839_222256_4AF8E898 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. 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 Clearing target's TIF_SVE but not current's TIF_SME in za_set(), as it indicates target's SVE storage unavailable. Fixes: 776b4a1cf364 ("arm64/sme: Add ptrace support for ZA") Signed-off-by: Wang ShaoBo --- arch/arm64/kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 21da83187a60..66d5c7efb745 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -1084,7 +1084,7 @@ static int za_set(struct task_struct *target, if (!target->thread.sve_state) { sve_alloc(target); if (!target->thread.sve_state) { - clear_thread_flag(TIF_SME); + clear_tsk_thread_flag(target, TIF_SVE); ret = -ENOMEM; goto out; }