From patchwork Tue Jun 18 02:17:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 2738131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 10829C0AB1 for ; Tue, 18 Jun 2013 02:16:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2777720240 for ; Tue, 18 Jun 2013 02:16:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33F3A2023D for ; Tue, 18 Jun 2013 02:16:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UolTC-0004lU-Qk; Tue, 18 Jun 2013 02:16:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UolT6-0001rA-FF; Tue, 18 Jun 2013 02:16:24 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UolSv-0001pl-Fg for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2013 02:16:13 +0000 Received: by mail-pd0-f173.google.com with SMTP id v14so3402389pde.4 for ; Mon, 17 Jun 2013 19:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=dda3OGZrbYHOTFLEjF8ucRLDI+Qx//zO86es5qHeCPc=; b=fe7RAJPO9dl7T25sxDPFKZNhMu42Uf5XI1oT7HmY+GPqMJVlkvrTEp1ItxXsNlxiCW oiH4VgleEqwNEhoWtoAiHjv2bM4JGT9V0qwn/O46qXjKseqxcqSnRs5/k0eGv7xqGy2W Ewz6Z/jBkvg//dVjKDsqBNvja2Evbp22wTtsDyJ2BUutu0vDB2EJpnpv38CnDZ4JMN/0 FFkavODX80jMykLJPoEPgJ1fCtFkBTZmABCHlCXJ7csqbTYSfKwrG3lokYGi9UeAZAQv TFSywfO4kkYHhFQMH9uhtjV8eGIGUyt8qqsOvYF9tIMW5qzmoJzG3r4Jyozn+d0rh6wn 9pkg== X-Received: by 10.68.211.73 with SMTP id na9mr15322552pbc.90.1371521752114; Mon, 17 Jun 2013 19:15:52 -0700 (PDT) Received: from localhost.localdomain (c-67-169-183-77.hsd1.ca.comcast.net. [67.169.183.77]) by mx.google.com with ESMTPSA id eq5sm15998366pbc.15.2013.06.17.19.15.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 19:15:51 -0700 (PDT) From: Christoffer Dall To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [RFC PATCH 2/2] arm64: KVM: Fix build errors after 32-bit THP support Date: Mon, 17 Jun 2013 19:17:41 -0700 Message-Id: <1371521861-372-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371521861-372-1-git-send-email-christoffer.dall@linaro.org> References: <1371521861-372-1-git-send-email-christoffer.dall@linaro.org> X-Gm-Message-State: ALoCoQkdndxjeQmdHWXrO+jnTa3eYos49id4foSVmg+Mqo6nlXV8NQKdZpaK5drsGzMI/3Jk2X6N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130617_221613_598005_A3628742 X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: 0.6 (/) Cc: linaro-kernel@lists.linaro.org, Christoffer Dall , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When KVM 32-bit adds THP support the build of KVM/arm64 will break because we rename some definition to be more sane and change the interface to coherent_icache_guest_page. Huge pages are not supported on arm64 and the pgtable predicates will always return false, so this shouldn't change any functionality on the 64-bit side. Signed-off-by: Christoffer Dall --- arch/arm64/include/asm/kvm_host.h | 4 ++-- arch/arm64/include/asm/kvm_mmu.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 644d739..f5d73dc 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -38,8 +38,8 @@ /* We don't currently support large pages. */ #define KVM_HPAGE_GFN_SHIFT(x) 0 -#define KVM_NR_PAGE_SIZES 1 -#define KVM_PAGES_PER_HPAGE(x) (1UL<<31) +#define KVM_HPAGE_SIZE 1 +#define KVM_PAGES_PER_HPAGE (1UL<<31) struct kvm_vcpu; int kvm_target_cpu(void); diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index efe609c..c86749e 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -118,11 +118,11 @@ static inline void kvm_set_s2pte_writable(pte_t *pte) struct kvm; -static inline void coherent_icache_guest_page(struct kvm *kvm, gfn_t gfn) +static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva, + size_t size) { if (!icache_is_aliasing()) { /* PIPT */ - unsigned long hva = gfn_to_hva(kvm, gfn); - flush_icache_range(hva, hva + PAGE_SIZE); + flush_icache_range(hva, hva + size); } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */ /* any kind of VIPT cache */ __flush_icache_all();