From patchwork Wed Aug 14 11:45:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 19108 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5CB152390D for ; Wed, 14 Aug 2013 11:46:10 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q8sf748018yen.8 for ; Wed, 14 Aug 2013 04:46:09 -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=c0RCmL+/+xiSrDkgB+PGDKg5390W+7ttmakrgbPcFWu9c0DW1biigU9Odnj78dYXit U2Dg3riPPIT5ZmjK4UePa3HhURX0eS8W5tij+ld358BR9ZUHTH1ZdP+fDoqxLaWpHebJ JSwr1vAFFzMGc4QqefPPcaD8jFk+yZUZiSoVGgdSd0caM/wSAheKbW8i9P/IOF5/2Hu4 zccK7ylgfD+Xh1S7ScSDBTaG/fJJzCVCCv0fI5Rd9N9Bba/Z1ybBHrKEXH3AH17oUYfJ qtQv+9kVEgRfCj5uB+4TfzJa+y7FAyi9M+jZg6aW0PT6CSzMbj2ofNgBXof1q2Xte6Gl 9/fA== X-Received: by 10.58.189.3 with SMTP id ge3mr1986184vec.36.1376480769595; Wed, 14 Aug 2013 04:46:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.3 with SMTP id 3ls3146402qeq.83.gmail; Wed, 14 Aug 2013 04:46:09 -0700 (PDT) X-Received: by 10.220.206.195 with SMTP id fv3mr9216899vcb.15.1376480769496; Wed, 14 Aug 2013 04:46:09 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id cj2si10911021vcb.8.2013.08.14.04.46.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:46:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id h11so7476298vbh.2 for ; Wed, 14 Aug 2013 04:46:09 -0700 (PDT) X-Gm-Message-State: ALoCoQlLPPjKVdxDvQpxLkTEPl/ybmlcvULMrY2xilFqlJyBPSQoog2HzZFk4bNH2tQpfdtKZPMT X-Received: by 10.221.40.10 with SMTP id to10mr9283306vcb.22.1376480769385; Wed, 14 Aug 2013 04:46:09 -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 u4csp208236vcz; Wed, 14 Aug 2013 04:46:08 -0700 (PDT) X-Received: by 10.66.234.232 with SMTP id uh8mr842206pac.155.1376480768403; Wed, 14 Aug 2013 04:46:08 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id yt8si27219062pab.32.2013.08.14.04.46.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:46:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w10so6234250pde.37 for ; Wed, 14 Aug 2013 04:46:08 -0700 (PDT) X-Received: by 10.66.27.43 with SMTP id q11mr9250126pag.97.1376480767887; Wed, 14 Aug 2013 04:46:07 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id om2sm49792027pbc.30.2013.08.14.04.46.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 04:46:06 -0700 (PDT) From: Pranavkumar Sawargaonkar To: kvmarm@list.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:15:05 +0530 Message-Id: <1376480706-18642-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.212.43 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();