From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable() Date: Fri, 12 Jul 2013 10:30:27 +1000 Message-ID: <1373589027.19894.128.camel@pasglop> References: <1373559480.8183.258@snotra> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Alexander Graf , "tiejun.chen" , "" , " list" To: Scott Wood Return-path: In-Reply-To: <1373559480.8183.258@snotra> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, 2013-07-11 at 11:18 -0500, Scott Wood wrote: > > If we set IRQs as soft-disabled prior to calling hard_irq_disable(), > then hard_irq_disable() will fail to call trace_hardirqs_off(). Sure because setting them as soft-disabled will have done it. However by doing so, you also create the possibility of latching a new event in irq_happened. > > or by disabling preemption until we enter the guest for real. > > I don't follow this one. We're exiting, not entering. > > > Any preferences? > > Use arch_local_save_flags() in hard_irq_disable() instead of reading > soft_enabled with C code. That or just use local_paca... Though we'd had problems in the past where gcc would defeat us there and essentially copy r13 to another register and start indexing from there. That kills you if you preempt. Cheers, Ben.