From patchwork Tue Oct 5 19:57:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 66856 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42E8AB70D6 for ; Wed, 6 Oct 2010 07:04:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756509Ab0JEUEY (ORCPT ); Tue, 5 Oct 2010 16:04:24 -0400 Received: from forward1.mail.yandex.net ([77.88.46.6]:46349 "EHLO forward1.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755647Ab0JEUEY (ORCPT ); Tue, 5 Oct 2010 16:04:24 -0400 X-Greylist: delayed 386 seconds by postgrey-1.27 at vger.kernel.org; Tue, 05 Oct 2010 16:04:24 EDT Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward1.mail.yandex.net (Yandex) with ESMTP id 7841C69E9BA4; Tue, 5 Oct 2010 23:57:57 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1286308677; bh=zyP99KJdIubNsm2nIj6avasLTLhb3U+3sc8xPDDK/Jw=; h=Subject:From:To:Cc:Content-Type:Date:Message-ID:Mime-Version: Content-Transfer-Encoding; b=aowKDjVsFnyrhQprT4+49yonSzu6N43S5F0UWX57b/n4UojcpXrAnoWbSsVw32Zct NzCJTiow/LrZXQYHtqMkPN5L7D+zz3we8tt0aXCRUREdUVANgkuPihdTEg09B5d8U/ 92zTmZLM14aw2Ju47uStHdD3OGqtNrQ4tJpS+HxE= Received: from [192.168.1.2] (unknown [95.72.169.117]) by smtp4.mail.yandex.net (Yandex) with ESMTPA id 37D4E12808D; Tue, 5 Oct 2010 23:57:57 +0400 (MSD) Subject: [PATCH]SPARC v9: __tsb_context_switch - demap old tsb_map_vaddr From: Kirill Tkhai To: sparclinux@vger.kernel.org Cc: David Miller Date: Tue, 05 Oct 2010 23:57:56 +0400 Message-ID: <1286308676.11216.4.camel@hp> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 X-Yandex-TimeMark: 1286308677 X-Yandex-Spam: 1 X-Yandex-Front: smtp4.mail.yandex.net Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org SPARC v9: __tsb_context_switch - demap old tsb_map_vaddr --- When TSB context switches in the function switch_mm() the following situation could occur. We have old mapping between physical address and tsb_map_vaddr in uTLB, and new mapping is written in fDTLB. Because uDTLB has more priority than fDTLB, all transformations occur through it, and TSB Pointer in tl0_damiss will be formed with the wrong physical address. To prevent this, we need to flush old tsb_map_vaddr (TSB_BASE) in TLB. Kernel version 2.6.35.7. Signed-off-by: Tkhai Kirill --- -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- arch/sparc/kernel/tsb.S.orig 2010-10-05 19:46:55.272218523 +0400 +++ arch/sparc/kernel/tsb.S 2010-10-05 19:48:56.136235329 +0400 @@ -396,6 +396,9 @@ __tsb_context_switch: 2: ldx [%o1 + TSB_CONFIG_MAP_VADDR], %o4 brz %o4, 9f + or %o4, 1 << 5, %o5 + stxa %g0, [%o5] ASI_DMMU_DEMAP + membar #Sync ldx [%o1 + TSB_CONFIG_MAP_PTE], %o5 sethi %hi(sparc64_highest_unlocked_tlb_ent), %g2