Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbbKJJE3 (ORCPT ); Tue, 10 Nov 2015 04:04:29 -0500 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:50449 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbbKJJEZ (ORCPT ); Tue, 10 Nov 2015 04:04:25 -0500 Subject: Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for reverse-mapped sptes To: Paolo Bonzini References: <20151106162016.6924957f7e227e52a345b061@lab.ntt.co.jp> <20151106162501.e97c5a05063625ed1a266553@lab.ntt.co.jp> <5640720F.3080904@redhat.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Takuya Yoshikawa Message-ID: <5641B350.5070705@lab.ntt.co.jp> Date: Tue, 10 Nov 2015 18:05:20 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5640720F.3080904@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1528 Lines: 40 On 2015/11/09 19:14, Paolo Bonzini wrote: > Can you also change kvm_mmu_mark_parents_unsync to use > for_each_rmap_spte instead of pte_list_walk? It is the last use of > pte_list_walk, and it's nice if we have two uses of for_each_rmap_spte > with parent_ptes as the argument. No problem, I will do. Since parent_ptes is also explained as the "reverse mapping" list of parent sptes (in mmu.txt and kvm_host.h), using rmap helpers will not look so strange. > BTW, on my todo list is to change the rmap items to a struct (with a > single u64 inside) for type safety. Since you are touching this code, > perhaps you can give it a shot? Yes, almost done here (assuming that you mean 'unsigned long'). But I have some candidates for its name in mind: 1. struct kvm_rmap { unsigned long val; }; 2. struct kvm_rmap_head { unsigned long val; }; 3. struct kvm_rmap_list_head { unsigned long val; }; 4. struct kvm_spte_list_head { unsigned long val; }; Since this is the head of the reverse mapping list of sptes, I thought name 3 might be the best and first made a patch with it, but it was a bit longer than I had hoped it to be. I have changed it to name 2, and it looks a bit nicer now, but even shorter, e.g. name 1, may be good as well. Do you have any preference? Takuya -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/