Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp209100lqh; Thu, 30 May 2024 21:05:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCh8o81n5+sv6d4aq/0RVpt1vsWECnMJ3ZFFRiqMvLJ3Bp9kyY7cP8/YI6lkh9aysLqn8FXlsCvqUowetqYXb7ohOb7X+4ib8BTyJtUw== X-Google-Smtp-Source: AGHT+IHgTbynN16XOx77td5Y58YjMgbOEBAzAxB329ThF59Ue9rM5IILaoHauvvqh6MS2fevO7XQ X-Received: by 2002:a05:620a:f05:b0:792:bb19:9ca4 with SMTP id af79cd13be357-794f5c733e3mr81583885a.27.1717128355797; Thu, 30 May 2024 21:05:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717128355; cv=pass; d=google.com; s=arc-20160816; b=UG9fHmRs6c8H7ym1oipsP86ZdSCk+1alvulTmiouKrcVuOsjGrrsGGlvdNTALA/tqj 27YbJ2XDSYbpm4vm1p7/dTp8G4LuDKRQOaaV2/Uau3aBdLI0vAE+jYIHdnXvrtihm+JX 0EvdfUAaf+tDh34ZROAuYPTh+YLOD6VPCR6zLjMykPmQbRYsIvsNSbDyuGH+YINmA3Ra Rripo3ANYX+31StxDTUlSXy01MNmhtkORkJueNrV41RIN4XDhwNOrX+BGJCSgp0u74au o+V8bWfaPxj/ZisWjlIacCRRf8Uql6YbmFpPYkoPvMjLxExbpnJCtu3qhXfaFqSyuZAg IIUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=t52/dCLBI6LW2wpxOVU+7ffX1nYOhNgBrwesusrb248=; fh=+44v4F1In2gpRz1k3VYqBR5anTspccxX0LPY/Dw8mrU=; b=ehSu1RfpbypuGBdZ+uYQSKbrzB8Zc62EQfc7O+rg5958miIO3SBEAiWO+Anl8F2QGU at8Sjb5eIdcIqYUZlWFqchRGhNYCdWu20gSxxgAR/Wi6ZX9lDLJ2UODTaswaz2XzGnp7 hBAQuCAj17zvBKkWjDC9GzZibFsLj4V/Om3KrzUJBhnBI9jjayzT8GqZo/ATu6W7OeFf 6zQuNtct8CjXzasMjRlKMq0jPeYXX/Szd4RIdYv/70wttFgJwXLN2mwrTI8PfoHVooU+ fCO/mkQG6u/aDP8S/Cpp3BLf98ZJgPu6k0hwWAU+xtLVLqE5jRkIgvvjDIRoU8mN0Mgt NSKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-196233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f2f05a26si112942585a.39.2024.05.30.21.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 21:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-196233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7EEBC1C23328 for ; Fri, 31 May 2024 04:05:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C4883BBE9; Fri, 31 May 2024 04:05:50 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5FB633C9 for ; Fri, 31 May 2024 04:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717128349; cv=none; b=mmyoIB5jMNguy6C+Q7EnVjCy758CLMuscqpg2utgv2h2iY1DgqJ939ogvsi+v9jad8pnXcgqWkBbF33f+OVqC+S+ebeL5Yl/VSOgx6H3cUUvzhDz6fz7A+P1TooLdgROTiW4JLpeAK8sUhQdJq+bEtONCa+vO2vi7Bk9bfsJsdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717128349; c=relaxed/simple; bh=OdjpInGiHUr863daWuAQoy/PnJlO+T3esnvR7MSs2qs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ZkeuksvBUNK6vFrmnJA6FEN2Z3w+TiKPOWH0b/XypqXO/loRF6nSNKfaxgyHgxDY1tBiCEEqBuwK/PhupVA4FZB1I7mOrGRrfZFNRyvMaVkJh78bDqQbcgLYxqDI9/OzGGeN0QN4T/O71nrF9wGXKjkf6f6aG85mdITAnni0kfI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Vr8ZV57fbz1S8K9; Fri, 31 May 2024 12:01:54 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 409AD140258; Fri, 31 May 2024 12:05:44 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 31 May 2024 12:05:43 +0800 Message-ID: <51c9752c-5390-43a2-a800-7dc1043ac93c@huawei.com> Date: Fri, 31 May 2024 12:05:43 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Revert "riscv: mm: accelerate pagefault when badaccess" Content-Language: en-US To: Palmer Dabbelt , CC: Paul Walmsley , Palmer Dabbelt , , , , , , , Bjorn Topel , , References: <20240530164451.21336-1-palmer@rivosinc.com> From: Kefeng Wang In-Reply-To: <20240530164451.21336-1-palmer@rivosinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) On 2024/5/31 0:44, Palmer Dabbelt wrote: > From: Palmer Dabbelt > > I accidentally picked up an earlier version of this patch, which had > already landed via mm. The patch I picked up contains a bug, which I > kept as I thought it was a fix. So let's just revert it. > > This reverts commit 4c6c0020427a4547845a83f7e4d6085e16c3e24f. Yes, this one is the wrong v1. Reviewed-by: Kefeng Wang > > Fixes: 4c6c0020427a ("riscv: mm: accelerate pagefault when badaccess") > Signed-off-by: Palmer Dabbelt > --- > arch/riscv/mm/fault.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c > index b3fcf7d67efb..5224f3733802 100644 > --- a/arch/riscv/mm/fault.c > +++ b/arch/riscv/mm/fault.c > @@ -293,8 +293,8 @@ void handle_page_fault(struct pt_regs *regs) > if (unlikely(access_error(cause, vma))) { > vma_end_read(vma); > count_vm_vma_lock_event(VMA_LOCK_SUCCESS); > - tsk->thread.bad_cause = SEGV_ACCERR; > - bad_area_nosemaphore(regs, code, addr); > + tsk->thread.bad_cause = cause; > + bad_area_nosemaphore(regs, SEGV_ACCERR, addr); > return; > } >