Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp291828pxb; Thu, 12 Aug 2021 16:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+fYgYs5m4L9LEIJBobBjH7yZ6ogqSWuSLIIAF0JXIgQp7rpy4UJB2jN1CKUdDtjeXuXIo X-Received: by 2002:a5d:85ca:: with SMTP id e10mr4934664ios.193.1628811956725; Thu, 12 Aug 2021 16:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628811956; cv=none; d=google.com; s=arc-20160816; b=stGXUM0+0Dy5TH1JwFtLvF5bq6q1xLLq81cjdwD6qSxLRQQsgnyP0MRZsC/dn/GbPX 4uZW+Vlf17ldq2NrQUQattWbRaqeuXR6PC515um9D8MD2QvuwrAIjH0GJq4xuK+NTIpv QHBj3f61BHxczY5CU9cT1pvPZoZe8E4oQEnq7RMvkv3g8mdDnGu3W922JKCKlg60OS7Q zvYPRyDfHrHPsnUwFMrlbkxVY60oS9aKFg58TikI4vArNlCOOR0GwmGpHOAYFKmn3RLE Q8EP4ZfOAA0W1yyRfgUjVWtCFzELWbmksDFztdraZMBkfWGHAmuNZo1YVZX3W2v4g/dc uVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WwfUxP6wu7dS3GTYQqaV9WkuWbtJkZj1i1D+/Sj2ptg=; b=thTGAe4eNp8NxIanVcp5BJzhEOxeFlsaoIV/SYurSDiy9v5qvpubi2JydnIk7D0MOy xoUjPtFJmuwoxVCer5kaQ3l7G1wOaiBg8P93W82uZ+6Adk84+I7VApZJXu3QMokQtGR5 5yGu6wQZImg5TdObSXxn6bvAYpmwNKS7mdV/hYWkhP+TD/zom2XherECSarEyFM2iJZE gQeGAFJ7kuk+7EYKyjQLI3sA0FQq94hGnfO6gJULURNIoZzMsgqQ3/zwaZ4b8MsqNFc5 0wQ9+Y8cOe0tR0UDOPKSV2Eo5m/miStWWcwpSOC/DazxnXnx8Uvv/CInwmhNDhePr2mN X+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=roa0nbg6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si5383398jat.17.2021.08.12.16.45.46; Thu, 12 Aug 2021 16:45:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=roa0nbg6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238486AbhHLXia (ORCPT + 99 others); Thu, 12 Aug 2021 19:38:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:48688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238019AbhHLXiZ (ORCPT ); Thu, 12 Aug 2021 19:38:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF3F8610A5; Thu, 12 Aug 2021 23:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628811479; bh=SDwFDPOQmz/pmHMM+4prMbb/FBKaF/3A8kiP4jUiFjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=roa0nbg6P0b49j69EM6FvuJQOVTYh9WC3m/MSLBaWFNjUV+xkyM3Sep4d0y4LtEHo f5CaYtQWvkn4tZ3DHgCgkHKPXNkc+32AAjUCGiV39QnXL3t5bdYB/5wGizl+5rc2Cn 9DaypbSSEqCr1e3eBWDofGqHqUwVLMVjgPNujXwg/B0jYRDyrnN8c1o9foaRw7+0hm iZ3uHbCyeDgFh1QMjdXKP5Go5wH/hXnkju2P+6OelxdXM3z/eOh5Zm/sf+xKs7eEv5 +qBR8Iaju8svs91k0gm4lKV3K7Cls/dHPTqk+BHqo9h0NODF2NAm7K9k486yY4Ka9H /djBZrU5z5bnA== From: Vineet Gupta To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual , Mike Rapoport , Vineet Gupta Subject: [PATCH v2 04/19] ARC: mm: Fixes to allow STRICT_MM_TYPECHECKS Date: Thu, 12 Aug 2021 16:37:38 -0700 Message-Id: <20210812233753.104217-5-vgupta@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812233753.104217-1-vgupta@kernel.org> References: <20210812233753.104217-1-vgupta@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Vineet Gupta --- arch/arc/mm/tlb.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 6079dfd129b9..15cbc285b0de 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -71,7 +71,7 @@ static void tlb_entry_erase(unsigned int vaddr_n_asid) } } -static void tlb_entry_insert(unsigned int pd0, pte_t pd1) +static void tlb_entry_insert(unsigned int pd0, phys_addr_t pd1) { unsigned int idx; @@ -109,13 +109,16 @@ static void tlb_entry_erase(unsigned int vaddr_n_asid) write_aux_reg(ARC_REG_TLBCOMMAND, TLBDeleteEntry); } -static void tlb_entry_insert(unsigned int pd0, pte_t pd1) +static void tlb_entry_insert(unsigned int pd0, phys_addr_t pd1) { write_aux_reg(ARC_REG_TLBPD0, pd0); - write_aux_reg(ARC_REG_TLBPD1, pd1); - if (is_pae40_enabled()) + if (!is_pae40_enabled()) { + write_aux_reg(ARC_REG_TLBPD1, pd1); + } else { + write_aux_reg(ARC_REG_TLBPD1, pd1 & 0xFFFFFFFF); write_aux_reg(ARC_REG_TLBPD1HI, (u64)pd1 >> 32); + } write_aux_reg(ARC_REG_TLBCOMMAND, TLBInsertEntry); } @@ -391,7 +394,7 @@ void create_tlb(struct vm_area_struct *vma, unsigned long vaddr, pte_t *ptep) unsigned long flags; unsigned int asid_or_sasid, rwx; unsigned long pd0; - pte_t pd1; + phys_addr_t pd1; /* * create_tlb() assumes that current->mm == vma->mm, since -- 2.25.1