Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp774492ybx; Thu, 7 Nov 2019 02:30:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxb5N05lap4/bKw4zbYK9KQY3aEJlmKcKrBSEnFBSPKAK9m7Ic55qZh8hxvb2Y4QFsDyuRo X-Received: by 2002:aa7:d0d4:: with SMTP id u20mr2696775edo.112.1573122659531; Thu, 07 Nov 2019 02:30:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573122659; cv=none; d=google.com; s=arc-20160816; b=gaBA4GxFwmf4BqJl4pSHnwHQSCAvm2JrKfqP9B/1VOw4Ig9UNWQVnA24dgWBmXWnBX o3533wlT1KmX4dzciZDje8u7WJYCJP/3R7gvQW8gHokph4kgG8YsVkgbHm6BPvL/k5It veclDEmQizKxFwMNxniqRL7NgsZeDlDXQ8sLAJuT0BFdLTWX/AQf3oRkBkbrvr1sflOe ksw8ylWPQvnnO4i/WTtLWJJ/RMet6qPUIBl2S/65SDYP6vIM8EIhooYcusAR5BQGTIhg /NiXIUNRPp42uoWku5A57j5SsjbgoNHCLrKJFUvZ4Ezy3z62nojMJL8AFtJT5HEqTFe7 Qy5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kiwTkorvf52t/B8owPA4EnaTVcBn66AzpBIuy4uiJ6g=; b=mmj78HUMRFoWfq1RC6ziJ8+gBDyHzUQBMCUlTb4jrT9QxPPgiG3/uA/3Tx1HNnInZf BKOSdYWZPzbzTMutBqudSwUj1q33wyGVOdGMdAAH3cbTF/P9EdNsGksbgK1xYj+m9Jlu tyM7XcfoutW9JhCNuvqK9hAAg4d2yKcKDnzEdjnbtSpfj4p/yAl9ZpG+XH16N17npzEG IxJuYQNho40en4pJ42DKhxuLr768PJu232oPJh7gJaS6ueAwqNqGTdKuDbMS3cO8UUkM vlqhzEfq76T5hLNA1929CZlF9/UvG26ieM02uoywwHKUFzA1EbwtIcn97pRTsxC+mq3F k3bQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si1327447edi.272.2019.11.07.02.30.35; Thu, 07 Nov 2019 02:30:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733286AbfKGK2v (ORCPT + 99 others); Thu, 7 Nov 2019 05:28:51 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:14670 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbfKGK2u (ORCPT ); Thu, 7 Nov 2019 05:28:50 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id xA7ARuBv015631; Thu, 7 Nov 2019 11:27:56 +0100 Date: Thu, 7 Nov 2019 11:27:56 +0100 From: Willy Tarreau To: hpa@zytor.com Cc: Thomas Gleixner , Ingo Molnar , Linus Torvalds , LKML , the arch/x86 maintainers , Stephen Hemminger , Juergen Gross , Sean Christopherson Subject: Re: [patch 5/9] x86/ioport: Reduce ioperm impact for sane usage further Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71DE81AC-3AD4-47B3-9CBA-A2C7841A3370@zytor.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 02:19:19AM -0800, hpa@zytor.com 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. > > > >Thanks, > > > > tglx > > This seems very undesirable... 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. Doing these, sure, but doing these while ranges are really checked ? I mean, the MMU grants you access to the pages you were assigned. Here with the I/O bitmap you just have to ask for access to port X and you get it. 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. 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