From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCH v3 4/8] arm/arm64: KVM: Implement GICD_ICFGR as RO for PPIs Date: Fri, 2 Oct 2015 15:51:50 +0100 Message-ID: <560E9A06.3040404@arm.com> References: <1443538145-11990-1-git-send-email-christoffer.dall@linaro.org> <1443538145-11990-5-git-send-email-christoffer.dall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marc Zyngier , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" , "kvm@vger.kernel.org" To: Christoffer Dall Return-path: In-Reply-To: <1443538145-11990-5-git-send-email-christoffer.dall@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org Hi Christoffer, On 29/09/15 15:49, Christoffer Dall wrote: > The GICD_ICFGR allows the bits for the SGIs and PPIs to be read only. > We currently simulate this behavior by writing a hardcoded value to the > register for the SGIs and PPIs on every write of these bits to the > register (ignoring what the guest actually wrote), and by writing the > same value as the reset value to the register. > > This is a bit counter-intuitive, as the register is RO for these bits, > and we can just implement it that way, allowing us to control the value > of the bits purely in the reset code. > > Reviewed-by: Marc Zyngier > Signed-off-by: Christoffer Dall > --- > virt/kvm/arm/vgic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index fe0e5db..e606f78 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -655,7 +655,7 @@ bool vgic_handle_cfg_reg(u32 *reg, struct kvm_exit_mmio *mmio, > ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); > if (mmio->is_write) { > if (offset < 8) { > - *reg = ~0U; /* Force PPIs/SGIs to 1 */ > + /* Ignore writes to read-only SGI and PPI bits */ > return false; > } Nit: Isn't this now violating kernel coding style because of a single statement not needing braces? Maybe move the comment in front of the if-statement to make this more obvious? Other than that: Reviewed-by: Andre Przywara Cheers, Andre.