From patchwork Mon Feb 11 12:12:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 2124081 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F103A3FCA4 for ; Mon, 11 Feb 2013 12:14:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756690Ab3BKMNW (ORCPT ); Mon, 11 Feb 2013 07:13:22 -0500 Received: from mail-ia0-f178.google.com ([209.85.210.178]:59367 "EHLO mail-ia0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756426Ab3BKMNU (ORCPT ); Mon, 11 Feb 2013 07:13:20 -0500 Received: by mail-ia0-f178.google.com with SMTP id y26so6463461iab.9 for ; Mon, 11 Feb 2013 04:13:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=fmioM4iN4CF7aBmDGXL0xIRLc2ca74wJ/4LyrPd8Jy0=; b=FlbaLUvP8Xgs7mpOP9BU8StCzlgF32ly/mQn8+PAFBkoiwmiJ7BhL0cXOHnn/MOTvG 9FbAQYGTP1xbTKH4oJxnxBNZ3EpZm4OEVoqNLY+oBmS6bWDxg7lho3OF4Y0FO0Tg4TXS TOng+XeNp+OQrdjsj8zaZytN4xrgzSWN8Xrgt2j7Jp0JugBckAMOnnZJt8blmXXHo5Rc /8vE+wqLWbQVFLkIe6Apqqm3vwd5Xc4uUm8cXA69R8B5Vt6YgUDGpBzYIOznC50Xyl+e Z1/bw+QMopeFmxa+Uwkvu+9y+rcscVjFyN6UsUTKm9lccRytYyyXRJLXpvpEUiysw2gX LMSQ== X-Received: by 10.50.187.169 with SMTP id ft9mr11829788igc.25.1360584799900; Mon, 11 Feb 2013 04:13:19 -0800 (PST) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPS id kf2sm27923653igc.0.2013.02.11.04.13.05 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Feb 2013 04:13:09 -0800 (PST) From: aik@ozlabs.ru To: Benjamin Herrenschmidt Cc: Alexey Kardashevskiy , Paul Mackerras , Alexander Graf , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, David Gibson Subject: [PATCH 1/4] powerpc: lookup_linux_pte has been made public Date: Mon, 11 Feb 2013 23:12:40 +1100 Message-Id: <5118e055.22ca320a.1f08.ffffe2e5@mx.google.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360584763-21988-1-git-send-email-a> References: <1360584763-21988-1-git-send-email-a> X-Gm-Message-State: ALoCoQkq9aOPT5mvldeYtp04LafpHtIBLJ24xPTuPVXBHipcvL0lwmwQkKOU43axMNBJRw2yGxrx Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Alexey Kardashevskiy The lookup_linux_pte() function returns a linux PTE which is required to convert KVM guest physical address into host real address in real mode. This convertion will be used by upcoming support of H_PUT_TCE_INDIRECT as TCE list address comes from the guest directly so it is a guest physical. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson --- arch/powerpc/include/asm/pgtable-ppc64.h | 3 +++ arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index 0182c20..ddcc898 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h @@ -377,6 +377,9 @@ static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, } #endif /* !CONFIG_HUGETLB_PAGE */ +pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva, + int writing, unsigned long *pte_sizep); + #endif /* __ASSEMBLY__ */ #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */ diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index 19c93ba..6a042d0 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c @@ -145,8 +145,8 @@ static void remove_revmap_chain(struct kvm *kvm, long pte_index, unlock_rmap(rmap); } -static pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva, - int writing, unsigned long *pte_sizep) +pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva, + int writing, unsigned long *pte_sizep) { pte_t *ptep; unsigned long ps = *pte_sizep;