Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp609917ybx; Wed, 6 Nov 2019 23:41:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxuNKyiHMGv+3QZu5H/lom5V2mXbRl4zHL/lJsQZ2Z5bIkVWOgfA0gpgtqzeTKQjGuOIzKo X-Received: by 2002:a17:906:f255:: with SMTP id gy21mr1702491ejb.204.1573112504838; Wed, 06 Nov 2019 23:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573112504; cv=none; d=google.com; s=arc-20160816; b=FCS5BKP6hjybVznNbhMHJxW2833Xowbu/tQ0YZjyVz2xZY/zME9c42lV5tF9pDl+bE ALMBu21zHA8XQgNTxDxr2cLXo+NmV5hN6/xuGKZCFc1M1QZo9+NKn0CPkRaTtqNF9p20 HEQ20v/ZaGAqH4v/9297j0EvjtbiFvfJplE5w34XzzR4bh0CV5yn5jUGzFwfz0rJni/t A6NcPYjvUeVQU4cfRW7m5qfcvuZkLAuSkbx+lUM/fZqhs2t4jhPV9KQx/cOOhKBUuMQU nskat7MVY2v/5WfvEnwLmE/WA9epsVA7NMYds35RWer6i5+XJ4qY0DldSYAQvAKvPqJv uBag== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ib8Q2GU5PS/0gXUXAfkY/zu4kC9GCe7NHTO7scyBhJ0=; b=SVfp+Xd779JfjITw8Dl+7LPMFibGPbfgkLJ8zJSKWVNHY6y6Xt6ZlfQdmfkY6LPdoQ x0UXaNWNB5RLfU5w1J1AW027GizT8yLPLZIG3xEw7GlSbZNPqNpXA+Xi26K1d/x+cfyV kqxL4Zvm0a8S3wLN0NqZ249QF++i/34sRl9+0snKtiQRHj2bIjwzYVHQV3lsY7n9JiUC Omcwos2RxwRJ+7BhmFC+MyfOrKFJEV2YDPH8bGHQV3UAGqbR3EYfwlRDapcY8Hnu0NDS YluXp3L+aYeJJwRNnJXaNxAv3VPYuD2zHRX3X6CWbeCoIMzCViQTd6OcCBedtz8WIS/q z4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=O7d7WVuT; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si952689ejr.90.2019.11.06.23.41.21; Wed, 06 Nov 2019 23:41:44 -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=@gmail.com header.s=20161025 header.b=O7d7WVuT; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727510AbfKGHhY (ORCPT + 99 others); Thu, 7 Nov 2019 02:37:24 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:40511 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbfKGHhX (ORCPT ); Thu, 7 Nov 2019 02:37:23 -0500 Received: by mail-wr1-f48.google.com with SMTP id i10so1792539wrs.7 for ; Wed, 06 Nov 2019 23:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ib8Q2GU5PS/0gXUXAfkY/zu4kC9GCe7NHTO7scyBhJ0=; b=O7d7WVuTZca4vJtGFzC4Qs2bNyl+ch261Zm640CyeDmiT/sCeRGMvnWx82dxVvUAnO 2mmcOvz4juCECx9gZ06trUKNwOYalMiRWxQFbCIXFvBZD3qJ5qjCt8HmTMPgDjWBR8y1 SnNTZmd5kRwV4/nUdZ8FgqixAGt0+XMzv0cG5zNHICxab89Eudl0f4n+y5EkktDShHX5 WftA9BPKa5Wj7fPdfeNYnT2PcDDoLyyrNlwWw5wcAC9rlsr9nmtEZlEkj6UgTtd9c8ZC Yh253XgAxYtcg9N1b92CbUYb/rgGAcdz3qHxt8uWUUxWy9pSC8a7iyBxAd5k+mFDV793 RX0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Ib8Q2GU5PS/0gXUXAfkY/zu4kC9GCe7NHTO7scyBhJ0=; b=hE5dizQ9tdCuYWbjLD1/iRCNExEJvA5zH/R9TldZFjj2VuRKW50GAzJ3ikUc2SPawG M8ojrbpzYEInCSM58BuyPGVYXd7sRXR0qWdb7+eXq1oiG/X4SNFR5zjpVhEmRZM8yN5K Yx5+VACTY5rw3zANuG4zLR8VH9KQNhiXMTz86PaaF5SKBvzpb/MGQr0PohtBwEtYrq46 vsW4ogmzsDkT70sDD8zb0J9QAqUkr1dBVFl9irhbZ4tvzZ4ikVQr3hkPr31Gl4BQO/jd OhepginS+C8K6bV5nf1LzPN0UFQG/fO3c4H5Ls8xaa1XWjkG+joWF4e3ftgXzjZhxVAZ hlLg== X-Gm-Message-State: APjAAAX6RlrZrsEo3/weyNDTLqErgKLv+ZmsSRlZrl2rhE2mG4tG8NIq KGSEAaTVFjum2dbRqo6D8p8= X-Received: by 2002:a5d:4d0f:: with SMTP id z15mr1390908wrt.195.1573112242536; Wed, 06 Nov 2019 23:37:22 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id i3sm1385216wrw.69.2019.11.06.23.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 23:37:22 -0800 (PST) Date: Thu, 7 Nov 2019 08:37:20 +0100 From: Ingo Molnar To: Thomas Gleixner Cc: LKML , x86@kernel.org, Stephen Hemminger , Willy Tarreau , Juergen Gross , Sean Christopherson , Linus Torvalds , "H. Peter Anvin" Subject: Re: [patch 5/9] x86/ioport: Reduce ioperm impact for sane usage further Message-ID: <20191107073719.GD30739@gmail.com> References: <20191106193459.581614484@linutronix.de> <20191106202806.241007755@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191106202806.241007755@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Thomas Gleixner wrote: > @@ -365,19 +365,19 @@ struct tss_struct { > struct x86_hw_tss x86_tss; > > /* > - * Store the dirty size of the last io bitmap offender. The next > - * one will have to do the cleanup as the switch out to a non > - * io bitmap user will just set x86_tss.io_bitmap_base to a value > - * outside of the TSS limit. So for sane tasks there is no need > - * to actually touch the io_bitmap at all. > + * Store the dirty byte range of the last io bitmap offender. The > + * next one will have to do the cleanup because the switch out to a > + * non I/O bitmap user will just set x86_tss.io_bitmap_base to a > + * value outside of the TSS limit to not penalize tasks which do > + * not use the I/O bitmap at all. > */ > - unsigned int io_bitmap_prev_max; > + unsigned int io_zerobits_start; > + unsigned int io_zerobits_end; > > /* > - * The extra 1 is there because the CPU will access an > - * additional byte beyond the end of the IO permission > - * bitmap. The extra byte must be all 1 bits, and must > - * be within the limit. > + * The extra 1 is there because the CPU will access an additional > + * byte beyond the end of the I/O permission bitmap. The extra byte > + * must have all bits set and must be within the TSS limit. > */ > unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; > } __aligned(PAGE_SIZE); Note that on 32-bit kernels this blows up our CPU area calculations: ./include/linux/compiler.h:350:38: error: call to ‘__compiletime_assert_181’ declared with attribute error: BUILD_BUG_ON failed: CPU_ENTRY_AREA_PAGES * PAGE_SIZE < CPU_ENTRY_AREA_MAP_SIZE ./include/linux/compiler.h:331:4: note: in definition of macro ‘__compiletime_assert’ ./include/linux/compiler.h:350:2: note: in expansion of macro ‘_compiletime_assert’ ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ ./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ arch/x86/mm/cpu_entry_area.c:181:2: note: in expansion of macro ‘BUILD_BUG_ON’ make[2]: *** [scripts/Makefile.build:265: arch/x86/mm/cpu_entry_area.o] Error 1 Thanks, Ingo