From patchwork Mon Jun 14 12:27:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 12318499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83A96C48BE6 for ; Mon, 14 Jun 2021 10:29:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4E3DA61206 for ; Mon, 14 Jun 2021 10:29:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E3DA61206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=rUx4BqUcjG/weZeNIcQ0X5uFFuq9biedSIvCKgWeIvs=; b=x0DeDKBBPDj44s Oie2nmDeZy6blyf8LwYjb+WGZZAG5WDAO6+PHDDpdY8yWStAy0Ti1EzcVOlctDV0aYwe4CexPvGnf cnGM2R8JCSLDwl2rDSfdu7pMe4omNifTZbPVBrH8HIpVjmy5CU5D6TOz73xWawJgWL6dARFfmTURN mIxTqAeXQvVJiyIEk0hoMubFbcLCrMcBfxkl3rQ+lLreW1UPYZIkepbD+DmEoskOwuY9pvw+xwRJx EizMRpjM7XkSnjOLT03OF1XHKEW9nLQ5sVfv6rwyWpBgBz4oIrwUtZBPAweVyclTFIlVenfqCaBGY b75+IL9tEL2arfoRbtkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsjou-00DZ5D-Mc; Mon, 14 Jun 2021 10:27:52 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsjoq-00DZ4H-T2 for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 10:27:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623666466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9XM61IljzLkk0ttuVusWr1Qy/8a5hNQuFNXR1LkOZec=; b=NShtudBY/WPe+z8DECft9fjANomw+vgz0eM60akOjBAENPMe3NPUT8+dM49/U0mpWBlUy2 vO/Msmjos188UsUEz7brIbivFJdLaHabtB9ynVGpbSXnbC8fkRD4JWkbh1mrdvSl0xKI6C KuUfNR11oeUbfSF04NtYGC+6CDxlUqg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-NJ2QFjspOZWS_7Sya1dFiw-1; Mon, 14 Jun 2021 06:26:05 -0400 X-MC-Unique: NJ2QFjspOZWS_7Sya1dFiw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A38DB1842A99; Mon, 14 Jun 2021 10:26:03 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-47.bne.redhat.com [10.64.54.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 012D95C233; Mon, 14 Jun 2021 10:26:00 +0000 (UTC) From: Gavin Shan To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, shan.gavin@gmail.com Subject: [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault() Date: Mon, 14 Jun 2021 20:27:01 +0800 Message-Id: <20210614122701.100515-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_032749_182996_AC604493 X-CRM114-Status: GOOD ( 14.24 ) 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 Currently, the lower bits of fault address is cleared before it's passed to handle_mm_fault(). It's unnecessary since generic code does same thing since the commit 1a29d85eb0f19 ("mm: use vmf->address instead of of vmf->virtual_address"). This passes the original fault address to handle_mm_fault() in case the generic code needs to know the exact fault address. Signed-off-by: Gavin Shan Acked-by: Catalin Marinas Reviewed-by: Anshuman Khandual --- arch/arm64/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 871c82ab0a30..e2883237216d 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -504,7 +504,7 @@ static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, */ if (!(vma->vm_flags & vm_flags)) return VM_FAULT_BADACCESS; - return handle_mm_fault(vma, addr & PAGE_MASK, mm_flags, regs); + return handle_mm_fault(vma, addr, mm_flags, regs); } static bool is_el0_instruction_abort(unsigned int esr)