From patchwork Tue Jan 21 08:15:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 312828 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 834BF2C031F for ; Tue, 21 Jan 2014 19:14:29 +1100 (EST) Received: from mail-yh0-x231.google.com (mail-yh0-x231.google.com [IPv6:2607:f8b0:4002:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 30ABB2C009F for ; Tue, 21 Jan 2014 19:14:02 +1100 (EST) Received: by mail-yh0-f49.google.com with SMTP id b6so2672761yha.36 for ; Tue, 21 Jan 2014 00:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=qTWtUZvt15AeCjxtNT9W1Svr+8Hz38LwJd/Kk5Agz3k=; b=CuvmfGSniQ1aIRyWUJCgMZNN9T79Yyg1E8AQDN61S0zO9hter5JRzuvsl5pzRGULPJ owLhvFk7AO8TNk8FMtqFIpAB56wjm+8Vic8gnBLrnIXiOl5HB2CnyUJBXBT/yOWNLzgV sbKlZnnXphSmL+CzRKoHtta8VZ1ftHtcpHJc8uwypfI4vNba91CtLWWqnp2wEQ29vTgA eGjBgOA5s7+Z9FYk7Z9vf7rTciZsxa+wZYa2Bog/M/biZwvYZyeONRszABAtYw3Tanfy ZrzV0GQN41NaOqnmO4IUqGXlArol/AIgI10oEtiEHAtrN8VuqBgcgzK7neKzqn2goCiA wcyw== X-Received: by 10.236.81.237 with SMTP id m73mr21898684yhe.29.1390292038148; Tue, 21 Jan 2014 00:13:58 -0800 (PST) Received: from localhost ([202.108.130.138]) by mx.google.com with ESMTPSA id 44sm10650869yhp.17.2014.01.21.00.13.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Jan 2014 00:13:57 -0800 (PST) From: Liu Ping Fan To: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect Date: Tue, 21 Jan 2014 16:15:29 +0800 Message-Id: <1390292129-15871-1-git-send-email-pingfank@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.1.4 Cc: Paul Mackerras , Alexander Graf , "Aneesh Kumar K.V" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" To make sure that on host, the pages marked with _PAGE_NUMA result in a fault when guest access them, we should force the checking when guest uses hypercall to setup hpte. Signed-off-by: Liu Ping Fan Reviewed-by: Aneesh Kumar K.V --- v2: It should be the reply to "[PATCH 2/4] powernv: kvm: make _PAGE_NUMA take effect" And I imporve the changelog according to Aneesh's suggestion. --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index 9c51544..af8602d 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c @@ -232,7 +232,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, /* Look up the Linux PTE for the backing page */ pte_size = psize; pte = lookup_linux_pte(pgdir, hva, writing, &pte_size); - if (pte_present(pte)) { + if (pte_present(pte) && !pte_numa(pte)) { if (writing && !pte_write(pte)) /* make the actual HPTE be read-only */ ptel = hpte_make_readonly(ptel);