From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Wed, 04 Nov 2015 01:42:15 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S HV: Synthesize segment fault if SLB lookup fails Message-Id: <20151104014215.GA21954@voom.redhat.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="AhhlLboLdkugWU4S" List-Id: References: <20151027051356.GA17068@iris.ozlabs.ibm.com> In-Reply-To: <20151027051356.GA17068@iris.ozlabs.ibm.com> To: Paul Mackerras Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 27, 2015 at 04:13:56PM +1100, Paul Mackerras wrote: > When handling a hypervisor data or instruction storage interrupt (HDSI > or HISI), we look up the SLB entry for the address being accessed in > order to translate the effective address to a virtual address which can > be looked up in the guest HPT. This lookup can occasionally fail due > to the guest replacing an SLB entry without invalidating the evicted > SLB entry. In this situation an ERAT (effective to real address > translation cache) entry can persist and be used by the hardware even > though there is no longer a corresponding SLB entry. >=20 > Previously we would just deliver a data or instruction storage interrupt > (DSI or ISI) to the guest in this case. However, this is not correct > and has been observed to cause guests to crash, typically with a > data storage protection interrupt on a store to the vmemmap area. >=20 > Instead, what we do now is to synthesize a data or instruction segment > interrupt. That should cause the guest to reload an appropriate entry > into the SLB and retry the faulting instruction. If it still faults, > we should find an appropriate SLB entry next time and be able to handle > the fault. >=20 > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWOWJ3AAoJEGw4ysog2bOSXeUP/298mqMY4ZbOh2avFWl8X9LK ptfudd86vA03h1HSPlByzvUxaEz69O9tWgMrePtKCfqaN9sIHf66Gi3evWVckTSG H8Ls/tj9jNRTr6RHC1SdKyjSK7eGyNw28U6JHpmwX0XM7V0QyFWrRWRvTSexjNIN Jc9/yxIrx4MUWBrN96Y2fonXUdPRgtX9ZjAiwxC/E6W7cYvlzAU4RB1zOofMcKLE +CcxKfvez598j5Jei0RW7KELwE5uXWhQJ02Fcz+2KSku5m7BDvRRNWVDKejYN0Hn xQEzWgbnPAhzE5m5xGRPjFt/4P03oNglz4ppmXTrGr6c2ClvSKCTl5j+ZfP943Q/ s2Yr4fk8kCnYRDt+ymZ4ADLDNhnBIxQCaPweeOnZzDo1iDi4lxoy6paj+KGQ9ZnS 6FQcFXjRyDejV2zjjfvjKzS7VwBKSUfS0+EOs6D6+CqUQM82aBCgF0lDjr9RGfGx MdGZH1uEvPscY74gYhnVjy0gkKjpOjPMPxdi+Va8W50+UyEJeXZTJ4mqzRPKQ+g1 1IgXSdDarB7Q8vQEgwB7D5jvFSPuLIGKBcfBeGWOzjkHYZh4WpQ/C5y68GNoOk1f H8K1qoYY822Z+9e6VycvQJ4ddsq80BzUeo1ibJycI0FIsMFWZpPWwCgdmbzV+xnt yjdXD/F/W9RXU7ABYLSs =AuMR -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH] KVM: PPC: Book3S HV: Synthesize segment fault if SLB lookup fails Date: Wed, 4 Nov 2015 12:42:15 +1100 Message-ID: <20151104014215.GA21954@voom.redhat.com> References: <20151027051356.GA17068@iris.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras Return-path: Received: from ozlabs.org ([103.22.144.67]:51618 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbbKDCLl (ORCPT ); Tue, 3 Nov 2015 21:11:41 -0500 Content-Disposition: inline In-Reply-To: <20151027051356.GA17068@iris.ozlabs.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 27, 2015 at 04:13:56PM +1100, Paul Mackerras wrote: > When handling a hypervisor data or instruction storage interrupt (HDSI > or HISI), we look up the SLB entry for the address being accessed in > order to translate the effective address to a virtual address which can > be looked up in the guest HPT. This lookup can occasionally fail due > to the guest replacing an SLB entry without invalidating the evicted > SLB entry. In this situation an ERAT (effective to real address > translation cache) entry can persist and be used by the hardware even > though there is no longer a corresponding SLB entry. >=20 > Previously we would just deliver a data or instruction storage interrupt > (DSI or ISI) to the guest in this case. However, this is not correct > and has been observed to cause guests to crash, typically with a > data storage protection interrupt on a store to the vmemmap area. >=20 > Instead, what we do now is to synthesize a data or instruction segment > interrupt. That should cause the guest to reload an appropriate entry > into the SLB and retry the faulting instruction. If it still faults, > we should find an appropriate SLB entry next time and be able to handle > the fault. >=20 > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWOWJ3AAoJEGw4ysog2bOSXeUP/298mqMY4ZbOh2avFWl8X9LK ptfudd86vA03h1HSPlByzvUxaEz69O9tWgMrePtKCfqaN9sIHf66Gi3evWVckTSG H8Ls/tj9jNRTr6RHC1SdKyjSK7eGyNw28U6JHpmwX0XM7V0QyFWrRWRvTSexjNIN Jc9/yxIrx4MUWBrN96Y2fonXUdPRgtX9ZjAiwxC/E6W7cYvlzAU4RB1zOofMcKLE +CcxKfvez598j5Jei0RW7KELwE5uXWhQJ02Fcz+2KSku5m7BDvRRNWVDKejYN0Hn xQEzWgbnPAhzE5m5xGRPjFt/4P03oNglz4ppmXTrGr6c2ClvSKCTl5j+ZfP943Q/ s2Yr4fk8kCnYRDt+ymZ4ADLDNhnBIxQCaPweeOnZzDo1iDi4lxoy6paj+KGQ9ZnS 6FQcFXjRyDejV2zjjfvjKzS7VwBKSUfS0+EOs6D6+CqUQM82aBCgF0lDjr9RGfGx MdGZH1uEvPscY74gYhnVjy0gkKjpOjPMPxdi+Va8W50+UyEJeXZTJ4mqzRPKQ+g1 1IgXSdDarB7Q8vQEgwB7D5jvFSPuLIGKBcfBeGWOzjkHYZh4WpQ/C5y68GNoOk1f H8K1qoYY822Z+9e6VycvQJ4ddsq80BzUeo1ibJycI0FIsMFWZpPWwCgdmbzV+xnt yjdXD/F/W9RXU7ABYLSs =AuMR -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--