[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120414112635.0940cc4628320821a88646fc@gmail.com>
Date: Sat, 14 Apr 2012 11:26:35 +0900
From: Takuya Yoshikawa <takuya.yoshikawa@...il.com>
To: Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>
Cc: Avi Kivity <avi@...hat.com>, Marcelo Tosatti <mtosatti@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH v2 05/16] KVM: MMU: abstract spte write-protect
On Fri, 13 Apr 2012 18:11:45 +0800
Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com> wrote:
> +/* Return true if the spte is dropped. */
Return value does not correspond with the function name so it is confusing.
People may think that true means write protection has been done.
> +static bool spte_write_protect(struct kvm *kvm, u64 *sptep, bool large,
> + bool *flush)
> +{
> + u64 spte = *sptep;
> +
> + if (!is_writable_pte(spte))
> + return false;
> +
> + *flush |= true;
> +
> + if (large) {
> + pgprintk("rmap_write_protect(large): spte %p %llx\n",
> + spte, *spte);
> + BUG_ON(!is_large_pte(spte));
> +
> + drop_spte(kvm, sptep);
> + --kvm->stat.lpages;
> + return true;
> + }
This suggests we should use separate functions?
Takuya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists