From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: I/O port permission bit inheritance between threads Date: Thu, 23 May 2013 12:27:59 +0300 Message-ID: <20130523092759.GL4725@redhat.com> References: <20130520142431.5221e2d0@nehalam.linuxnetplumber.net> <20130521095030.GC7424@8bytes.org> <20130521100118.GC4725@redhat.com> <20130521082709.4427b6ae@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Joerg Roedel , kvm@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39621 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757582Ab3EWJ2D (ORCPT ); Thu, 23 May 2013 05:28:03 -0400 Content-Disposition: inline In-Reply-To: <20130521082709.4427b6ae@nehalam.linuxnetplumber.net> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 21, 2013 at 08:27:09AM -0700, Stephen Hemminger wrote: > On Tue, 21 May 2013 13:01:18 +0300 > Gleb Natapov wrote: > > > On Tue, May 21, 2013 at 11:50:30AM +0200, Joerg Roedel wrote: > > > Hey Stephen, > > > > > > On Mon, May 20, 2013 at 02:24:31PM -0700, Stephen Hemminger wrote: > > > > ioperm() inheritance across threads is different in KVM then when run > > > > on physical hardware. The following program runs on physical hardware > > > > but get SEGV under KVM. > > > > > > > > It appears that the I/O permission bits are not shared between threads > > > > in the same way. > > > > > > Is this specific to SVM or do you see it on VMX too? My first guess > > > would be that the KVM instruction emulator does not check to > > > IO-permissions correctly, but that would affect VMX and SVM. > > > > > The program segfaults on physical hardware: > > # ./a.out > > joining > > waiting > > beeping > > Segmentation fault > > > > -- > > Gleb. > > The program had timing races, changing it slightly shows that. > # ./beep > beeping > done > oo > # ./beep --pre > joining > beeping > Segmentation fault > # ./beep --post > beeping > joining > done > oo > # > And I get the same in a VM on Intel host. -- Gleb.