Received: by mail.netbsd.org (Postfix, from userid 605) id AC86C84D48; Tue, 17 Dec 2019 12:56:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 30FEC84D43 for ; Tue, 17 Dec 2019 12:56:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 6OjTIAn2wskC for ; Tue, 17 Dec 2019 12:56:45 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id B73ED84CD3 for ; Tue, 17 Dec 2019 12:56:45 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B4DD7FA97; Tue, 17 Dec 2019 12:56:45 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Tue, 17 Dec 2019 12:56:45 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-9] src/sys/arch/x86/x86 To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20191217125645.B4DD7FA97@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Martin Husemann" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: martin Date: Tue Dec 17 12:56:45 UTC 2019 Modified Files: src/sys/arch/x86/x86 [netbsd-9]: bus_space.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #566): sys/arch/x86/x86/bus_space.c: revision 1.42 sys/arch/x86/x86/bus_space.c: revision 1.43 Use LFENCE/SFENCE/MFENCE in x86 bus_space_barrier. These are needed for BUS_SPACE_MAP_PREFETCHABLE mappings. On x86, these are WC-type memory regions, which means -- unlike normal WB-type memory regions -- loads can be reordered with loads, requiring LFENCE, and stores can be reordered with stores, requiring SFENCE. Reference: AMD64 Architecture Programmer's Manual, Volume 2: System Programming, Sec. 7.4.1 `Memory Barrier Interaction with Memory Types', Table 7-3 `Memory Access Ordering Rules'. Skip fences in bus_space_barrier on I/O space. I/O operations are issued in program order. Not that I/O operations are usually a performance bottleneck anyway, but maybe it is slightly cheaper to avoid stalling on store buffers or pending loads, and there's very little cost to the skipping criterion here. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.41.4.1 src/sys/arch/x86/x86/bus_space.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.