All of lore.kernel.org
 help / color / mirror / Atom feed
From: <peng.hao2@zte.com.cn>
To: marc.zyngier@arm.com
Cc: kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] KVM:arm/arm64: dcache need be coherent unconditionally
Date: Sat, 10 Mar 2018 11:23:18 +0800 (CST)	[thread overview]
Message-ID: <201803101123186035154@zte.com.cn> (raw)
In-Reply-To: <90dba814-2aa3-e0e3-9021-4c349c9f9165@arm.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2472 bytes --]

>On 09/03/18 22:15, Peng Hao wrote:






>> For emulation devices just like vga, keeping coherent dcache between
>> guest and host timely is needed.
>> Now the display of vnc-viewer will not update continuously and the
>> patch can fix up.
>> 
>> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
>> ---
>>  virt/kvm/arm/mmu.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>> 
>> diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
>> index ec62d1c..4a28395e 100644
>> --- a/virt/kvm/arm/mmu.c
>> +++ b/virt/kvm/arm/mmu.c
>> @@ -1416,8 +1416,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>>              kvm_set_pfn_dirty(pfn);
>>          }
>>  
>> -        if (fault_status != FSC_PERM)
>> -            clean_dcache_guest_page(pfn, PMD_SIZE);
>> +        clean_dcache_guest_page(pfn, PMD_SIZE);
>>  
>>          if (exec_fault) {
>>              new_pmd = kvm_s2pmd_mkexec(new_pmd);
>> @@ -1438,8 +1437,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>>              mark_page_dirty(kvm, gfn);
>>          }
>>  
>> -        if (fault_status != FSC_PERM)
>> -            clean_dcache_guest_page(pfn, PAGE_SIZE);
>> +        clean_dcache_guest_page(pfn, PAGE_SIZE);
>>  
>>          if (exec_fault) {
>>              new_pte = kvm_s2pte_mkexec(new_pte);
>> 

>I'm sorry, but I have to NAK this.

>You're papering over the fundamental issue that you're accessing a
>cacheable alias of a non cacheable memory. The architecture is very
>clear about why this doesn't work, and KVM implements the architecture.



I find that I  just encounter the problem after  the commit '15303ba5d1cd9b28d03a980456c0978c0ea3b208 " .

The commit contains "icache invalidation optimizations, improving VM startup time",it changes

from unconditionally calling coherent_cache_guest_page(including dcache handle) to conditionally calling clean_dcache_guest_page.

 I trace the display of vnc abnormally and find it generate data abort in vga

address region with FSC_PERM,and it will not call clean_dcache_guest_page . So I think  should recover to uncontionally calling clean_dcache_guest_page.




Thanks.

>If you want this to work, map your VGA device as cacheable, add cache

>maintenance to QEMU, or use another frame-buffer emulation that doesn't
>require such a gack.

>Thanks,

>    M.
>-- 
>Jazz is not dead. It just smells funny...

[-- Attachment #1.1.2: Type: text/html , Size: 7107 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2018-03-10  3:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 22:15 [PATCH] KVM:arm/arm64: dcache need be coherent unconditionally Peng Hao
2018-03-09 22:15 ` Peng Hao
2018-03-09 14:21 ` Marc Zyngier
2018-03-09 14:21   ` Marc Zyngier
2018-03-10  3:23   ` peng.hao2 [this message]
2018-03-10 11:48     ` Marc Zyngier
2018-03-10 11:48       ` Marc Zyngier
2018-03-10 11:48       ` Marc Zyngier
2018-03-10  3:48 peng.hao2
2018-03-10  3:48 ` peng.hao2 at zte.com.cn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201803101123186035154@zte.com.cn \
    --to=peng.hao2@zte.com.cn \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.