From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralf Baechle Subject: Re: [PATCH 1/7] MIPS: KVM/locore.S: Don't preserve host ASID around vcpu_run Date: Mon, 9 May 2016 17:30:44 +0200 Message-ID: <20160509153044.GD28818@linux-mips.org> References: <1462541784-22128-1-git-send-email-james.hogan@imgtec.com> <1462541784-22128-2-git-send-email-james.hogan@imgtec.com> <57309D29.6010903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: James Hogan , Paul Burton , Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-mips@linux-mips.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from eddie.linux-mips.org ([148.251.95.138]:38290 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbcEIPau (ORCPT ); Mon, 9 May 2016 11:30:50 -0400 Received: from localhost.localdomain ([127.0.0.1]:33818 "EHLO linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP id S27028419AbcEIParwAtD- (ORCPT ); Mon, 9 May 2016 17:30:47 +0200 Content-Disposition: inline In-Reply-To: <57309D29.6010903@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 09, 2016 at 04:22:33PM +0200, Paolo Bonzini wrote: > On 06/05/2016 15:36, James Hogan wrote: > > - It is actually redundant, since the host ASID will be restored > > correctly by kvm_arch_vcpu_put(), which is called almost immediately > > after kvm_arch_vcpu_ioctl_run() returns. > > What happens if the guest does a rogue access to the area where the host > kernel resides? Would that cause a wrong entry in the TLB? The kernel and lowmem reside in KSEG0/XKPYS which are "unmapped segments". Unmapped means, the TLB isn't accessed at all nor does the ASID matter in the address translation process in one of these unmapped segments. Ralf