From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] KVM: PPC: HV: Remove generic instruction emulation Date: Wed, 30 Jul 2014 20:57:05 +0200 Message-ID: <53D94001.9090806@suse.de> References: <1406726865-30072-1-git-send-email-agraf@suse.de> <53D91B97.9060408@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Paolo Bonzini , kvm-ppc@vger.kernel.org Return-path: In-Reply-To: <53D91B97.9060408@redhat.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 30.07.14 18:21, Paolo Bonzini wrote: > Il 30/07/2014 15:27, Alexander Graf ha scritto: >> Now that we have properly split load/store instruction emulation and generic >> instruction emulation, we can move the generic one from kvm.ko to kvm-pr.ko >> on book3s_64. >> >> This reduces the attack surface and amount of code loaded on HV KVM kernels. > Can emulation races happen on HV KVM like you can have on x86? > Basically one CPU writes to MMIO while the other patches instructions so > that basically anything can end up in the hands of the emulator? On PPC > it may even happen simply because of a missing icache invalidation, I > think, since it doesn't support self-modifying code without explicit > invalidation. Yes, this is perfectly possible. As of my last patch set we will never enter the generic emulator for HV KVM, so that race is moot (we just inject a PROGRAM interrupt into the guest). With this patch even the code to emulate these bits doesn't exist in the kernel anymore if you don't modprobe kvm-pr.ko. Alex