From: Paul Mackerras Date: Thu, 12 May 2016 04:51:23 +0000 Subject: Re: [PATCH] powerpc: Fix definition of SIAR register Message-Id: <20160512045123.GA1421@oak.ozlabs.ibm.com> List-Id: References: <1460130851-29021-1-git-send-email-thuth@redhat.com> In-Reply-To: <1460130851-29021-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Huth Cc: Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , kvm-ppc@vger.kernel.org On Fri, Apr 08, 2016 at 05:54:11PM +0200, Thomas Huth wrote: > The SIAR register is available twice, one time as SPR 780 (unprivileged, > but read-only), and one time as SPR 796 (privileged, but read and write). > The Linux kernel code currently uses SPR 780 - and while this is OK for > reading, writing to that register of course does not work. > Since the KVM code tries to write to this register, too (see the mtspr > in book3s_hv_rmhandlers.S), the contents of this register sometimes get > lost for the guests, e.g. during migration of a VM. > To fix this issue, simply switch to the other SPR numer 796 instead. > > Signed-off-by: Thomas Huth > --- > Note: The perf code in core-book3s.c also seems to write to the SIAR > SPR, so that might be affected by this issue, too - but I did > not test the perf code, so I'm not sure about that part. EBBs mean we need to context-switch the SIAR between user tasks (among other registers). I notice that SDAR is also wrong, and the MMCR2 definition is also using the user-accessible number (though it at least is writable as well as readable). Paul.