Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1266338

Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for reverse-mapped sptes

From Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for reverse-mapped sptes
Date 2015-11-10 10:10 +0100
Message-ID <qtd69-35q-3@gated-at.bofh.it> (permalink)
References <qrJjQ-1lQ-3@gated-at.bofh.it> <qrJtv-1pc-13@gated-at.bofh.it> <qsRIn-55g-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] KVM: x86: MMU: Clean up x86's mmu code for future work Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-06 08:10 +0100
  [PATCH 2/5] KVM: x86: MMU: Add helper function to clear a bit in  unsync child bitmap Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-06 08:10 +0100
  [PATCH 4/5] KVM: x86: MMU: Remove is_rmap_spte() and use  is_shadow_present_pte() Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-06 08:20 +0100
  [PATCH 3/5] KVM: x86: MMU: Make mmu_set_spte() return emulate value Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-06 08:20 +0100
  [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for  reverse-mapped sptes Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-06 08:20 +0100
    Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for  reverse-mapped sptes Paolo Bonzini <pbonzini@redhat.com> - 2015-11-09 11:20 +0100
      Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for  reverse-mapped sptes Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-10 10:10 +0100
        Re: [PATCH 5/5] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for  reverse-mapped sptes Paolo Bonzini <pbonzini@redhat.com> - 2015-11-10 10:20 +0100
  Re: [PATCH 0/5] KVM: x86: MMU: Clean up x86's mmu code for future  work Paolo Bonzini <pbonzini@redhat.com> - 2015-11-09 11:20 +0100

csiph-web