From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Smarduch Subject: Re: [PATCH v5 2/4] live migration support for initial write protect of VM Date: Fri, 30 May 2014 09:48:15 -0700 Message-ID: <5388B64F.3080100@samsung.com> References: <1399509616-4632-1-git-send-email-m.smarduch@samsung.com> <1399509616-4632-3-git-send-email-m.smarduch@samsung.com> <20140515185312.GA6159@lvm> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, steve.capper@arm.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gavin.guo@canonical.com, peter.maydell@linaro.org, jays.lee@samsung.com, sungjinn.chung@samsung.com To: Christoffer Dall Return-path: Received: from mailout1.w2.samsung.com ([211.189.100.11]:59621 "EHLO usmailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933923AbaE3QsY (ORCPT ); Fri, 30 May 2014 12:48:24 -0400 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6E002VCC0MWE20@mailout1.w2.samsung.com> for kvm@vger.kernel.org; Fri, 30 May 2014 12:48:22 -0400 (EDT) In-reply-to: <20140515185312.GA6159@lvm> Sender: kvm-owner@vger.kernel.org List-ID: >> >> +static inline void kvm_set_s2pte_readonly(pte_t *pte) >> +{ >> + pte_val(*pte) &= ~(L_PTE_S2_RDONLY ^ L_PTE_S2_RDWR); > > This relies on the pte already having been set as RDONLY or RDWR, if you > are creating a new pte and calling this function it could be easy to > miss that distinction, I would prefer: > > pte_val(*pte) &= L_PTE_S2_RDWR; > pte_val(*pte) |= L_PTE_S2_RDONLY; > Confused on this comment, this appears to just add the read-only permission. But will leave other permission bits intact, and clears out the rest of the pte? - Mario