Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1063721ybx; Thu, 7 Nov 2019 06:46:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyMzjNn5jdXSi7F6tEV52uCs+EuT3M8hc4Md9msuGGQnNc//kCyWM1+st3BcUJ/nhv2EF0F X-Received: by 2002:aa7:c0d4:: with SMTP id j20mr4038738edp.187.1573137970172; Thu, 07 Nov 2019 06:46:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573137970; cv=none; d=google.com; s=arc-20160816; b=CxFpIxQSNZb8cLF5EuSNi/rHIZLGiB8wlwryHxR5gLf99VM7PfHVvLq6Q3FZvQ+pSg JE2tYm9N6q/FM3eM+MfHhhvs9MMnqnN56+E7Ct7JKE6GTsZV+B678jeX7E4YDDYi24tU 3UX/iKyEax1Cf8F4z/4hLobkf2L9ta/EhpY9rnfvnXeszSrJLOq53gNe/7Agg8iWWp1O AkOqgTEqkfR+FuE/tAZFhzwKJgwAJydc+riB7uxrVJfQnOWWfgPJd0PZmDc2cSmDKCas NYVGR9rwJUHKtyBN8SgStrnCjZy79GqkyhBtxaXJMfl3KPCqPyphC0xHwUTpoyEnLmam qq/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:dkim-filter; bh=xjHsNjx3y7WGORGoGD9WB7uagne++HGfQiBOzl7OELY=; b=w1ABD5qzyq0VVdItSLqHMz23sMhEfYRZc40xhgvXiXbp1u3Y24yMBPj31x9Uf98fQr wqA37Q0XXhPXGI6l/ww+oX8dddMfnNXOfBUq1Df/hWMq/zGT0lPa2Y18RaIWBjaIYGxG Ws103z8o7PUa4POGqql18/L/CORCwICpsgwNQ8XutY3zFc8vAwVaKqG9ma/N35ncYZmx UrNwgpx6GdVUkImUyUiUXjjj+d7dQC+PVMPP4LUZTuyVYFDa+lg4JCX/MzrHgDtGcsCl zCsGLGRazxsPw51GOswjDIkP3PXjL4aYp33P02kUpik4SVz/xjQVmVobshWYd1x6wHKf tMnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@zytor.com header.s=2019091901 header.b=UiUMtlqR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si1573011ejp.326.2019.11.07.06.45.44; Thu, 07 Nov 2019 06:46:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@zytor.com header.s=2019091901 header.b=UiUMtlqR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387863AbfKGKwS (ORCPT + 99 others); Thu, 7 Nov 2019 05:52:18 -0500 Received: from terminus.zytor.com ([198.137.202.136]:57227 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbfKGKwS (ORCPT ); Thu, 7 Nov 2019 05:52:18 -0500 Received: from [IPv6:2601:646:8600:3281:ac8f:6015:6ba:e227] ([IPv6:2601:646:8600:3281:ac8f:6015:6ba:e227]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id xA7AoRDw1190819 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 7 Nov 2019 02:50:28 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com xA7AoRDw1190819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019091901; t=1573123828; bh=xjHsNjx3y7WGORGoGD9WB7uagne++HGfQiBOzl7OELY=; h=Date:In-Reply-To:References:Subject:To:CC:From:From; b=UiUMtlqRiId81RDJjjcPVf4gTOcGEIzJ+mXMcajzvrJE4FGs5ueGbvy2Ts0ZXZQzC /bKEPhhg4TrchWdA0/K0fSoxoPCM8dkAlDFBSfKXdYB4QYb0rc9p2wGNOpgE8b+8e5 ZkwMuF1JK5s2yKxFv9BhhQlqX7PdJFtgaGK02DKW7Dg8F8bYmLD5IlxyfVNGXbNpvi SbFE96WpBjGVSkCGvf6EdkL6HYwTGuC58bKawBtVpJeqVHL/DXY7v9OpY5/JcMc2zu 1EYT7N6BPMdwN9CNrbc9NHCU9U4GCwct6upi9PMGgLNaREcYjqcuoA0X8LI5IC9xF6 3cEd4me0NO4qQ== Date: Thu, 07 Nov 2019 02:50:20 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <20191107102756.GD15536@1wt.eu> References: <20191106193459.581614484@linutronix.de> <20191106202806.241007755@linutronix.de> <20191107082541.GF30739@gmail.com> <20191107091704.GA15536@1wt.eu> <71DE81AC-3AD4-47B3-9CBA-A2C7841A3370@zytor.com> <20191107102756.GD15536@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [patch 5/9] x86/ioport: Reduce ioperm impact for sane usage further To: Willy Tarreau CC: Thomas Gleixner , Ingo Molnar , Linus Torvalds , LKML , the arch/x86 maintainers , Stephen Hemminger , Juergen Gross , Sean Christopherson From: hpa@zytor.com Message-ID: <5AAEF116-EC9D-4C58-878F-9D27189E123A@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On November 7, 2019 2:27:56 AM PST, Willy Tarreau wrote: >On Thu, Nov 07, 2019 at 02:19:19AM -0800, hpa@zytor=2Ecom wrote: >> >Changing ioperm(single port, port range) to be ioperm(all) is going >to >> >break a bunch of test cases which actually check whether the >permission >> >is restricted to a single I/O port or the requested port range=2E >> > >> >Thanks, >> > >> > tglx >>=20 >> This seems very undesirable=2E=2E=2E as much as we might wish otherwise= , >the port >> bitmap is the equivalent to the MMU, and there are definitely users >doing >> direct device I/O out there=2E > >Doing these, sure, but doing these while ranges are really checked ? >I mean, the MMU grants you access to the pages you were assigned=2E Here >with the I/O bitmap you just have to ask for access to port X and you >get it=2E I could understand the benefit if we had EBUSY in return but >that's not the case, you can actually request access to a port range >another device driver or process is currently using, and mess up with >what it does even by accident=2E I remember streaming 1-bit music in >userland from the LED of my floppy drive in the late-90s, it used to >cause some trouble to the floppy driver when using mtools in parallel >:-) > >Willy You get access to the ports you are assigned, just like pages you are assi= gned=2E=2E=2E the rest is kernel policy, or, for that matter, privileged us= erspace (get permissions to the necessary ports, then drop privilege=2E=2E= =2E the usual stuff=2E) --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E