From patchwork Wed Aug 14 11:47:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 19109 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B07E2390D for ; Wed, 14 Aug 2013 11:48:06 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id a11sf10887597qcx.9 for ; Wed, 14 Aug 2013 04:48:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=juGofOEIvMZlUmk19OxS14w02cqCui65dMsJoxlQso4=; b=VKjTC4Nd+WKKYGdD8EilUfrxdgeFmnpYlMTu1kRpG5Ql7nf9xnJMo5GQf3WlX27FNV Q5xukBEY6gfbSfrDEkGGoMJn2ksWEhzYDq9EAeqgqoONFVfnrmV1lK2ST8e78Z2m+faa YuBU6IA8M4SGp/mF9v/xLekV5UDw9B1PrEB7ddbzeyaaPErqGR14zu1aVqsGpHcSuz2I KMMjgag8LeTpGdDFl+MurltaOxbplnMhw1BZbck9T31sZ1j+shMNNgklYQqCMFmc3aMi 7KtuW9UGeG4mRbRA6cuzCgOT1/mCV6fGz+RnFX3XqpnyULWqgPuTkRkpnTBxixNppIDu y1oQ== X-Received: by 10.224.171.72 with SMTP id g8mr9858109qaz.7.1376480886200; Wed, 14 Aug 2013 04:48:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.168 with SMTP id 8ls3016632qen.8.gmail; Wed, 14 Aug 2013 04:48:06 -0700 (PDT) X-Received: by 10.220.249.67 with SMTP id mj3mr9280596vcb.23.1376480886076; Wed, 14 Aug 2013 04:48:06 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id jf10si10898534vdb.141.2013.08.14.04.48.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:48:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so7533157veb.2 for ; Wed, 14 Aug 2013 04:48:06 -0700 (PDT) X-Gm-Message-State: ALoCoQmvhSmldXkhfwQPHd0k4ZC1E5mMr7O8SFbA3rbj9xWndmXWAnQ9eAkeRUBohpmn7BlMKO6q X-Received: by 10.58.119.233 with SMTP id kx9mr9275849veb.3.1376480885976; Wed, 14 Aug 2013 04:48:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp208305vcz; Wed, 14 Aug 2013 04:48:05 -0700 (PDT) X-Received: by 10.68.178.35 with SMTP id cv3mr1697118pbc.160.1376480885132; Wed, 14 Aug 2013 04:48:05 -0700 (PDT) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id km7si27979675pbc.95.2013.08.14.04.48.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:48:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id kx10so4513097pab.41 for ; Wed, 14 Aug 2013 04:48:04 -0700 (PDT) X-Received: by 10.67.5.132 with SMTP id cm4mr522342pad.186.1376480884618; Wed, 14 Aug 2013 04:48:04 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id nv6sm49838569pbc.6.2013.08.14.04.48.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:48:03 -0700 (PDT) From: Pranavkumar Sawargaonkar To: kvmarm@lists.cs.columbia.edu Cc: marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, catalin.marinas@arm.com, Pranavkumar Sawargaonkar , Anup Patel Subject: [PATCH] ARM64: KVM: Fix coherent_icache_guest_page() for host with external L3-cache. Date: Wed, 14 Aug 2013 17:17:12 +0530 Message-Id: <1376480832-18705-1-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Systems with large external L3-cache (few MBs), might have dirty content belonging to the guest page in L3-cache. To tackle this, we need to flush such dirty content from d-cache so that guest will see correct contents of guest page when guest MMU is disabled. The patch fixes coherent_icache_guest_page() for external L3-cache. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- arch/arm64/include/asm/kvm_mmu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index efe609c..5129038 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -123,6 +123,8 @@ static inline void coherent_icache_guest_page(struct kvm *kvm, gfn_t gfn) if (!icache_is_aliasing()) { /* PIPT */ unsigned long hva = gfn_to_hva(kvm, gfn); flush_icache_range(hva, hva + PAGE_SIZE); + /* Flush d-cache for systems with external caches. */ + __flush_dcache_area((void *) hva, PAGE_SIZE); } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */ /* any kind of VIPT cache */ __flush_icache_all();