Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003Ab2KQO4d (ORCPT ); Sat, 17 Nov 2012 09:56:33 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:39432 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850Ab2KQO4c (ORCPT ); Sat, 17 Nov 2012 09:56:32 -0500 MIME-Version: 1.0 In-Reply-To: <20121117145015.GF16441@x1.osrc.amd.com> References: <508A8D31.9000106@redhat.com> <20121026132601.GC9886@gmail.com> <20121026144502.6e94643e@dull> <20121026221254.7d32c8bf@pyramind.ukuu.org.uk> <508BE459.2080406@redhat.com> <20121029165705.GA4693@x1.osrc.amd.com> <20121117145015.GF16441@x1.osrc.amd.com> From: Linus Torvalds Date: Sat, 17 Nov 2012 06:56:10 -0800 X-Google-Sender-Auth: YiBd5YxpIwl4CPx9bBQrvM9_ECY Message-ID: Subject: Re: [PATCH 2/3] x86,mm: drop TLB flush from ptep_set_access_flags To: Borislav Petkov , Linus Torvalds , Rik van Riel , Alan Cox , Ingo Molnar , Andi Kleen , Michel Lespinasse , Peter Zijlstra , Andrea Arcangeli , Mel Gorman , Johannes Weiner , Thomas Gleixner , Andrew Morton , Linux Kernel Mailing List , linux-mm , Florian Fainelli , Borislav Petkov Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 29 On Sat, Nov 17, 2012 at 6:50 AM, Borislav Petkov wrote: > > Albeit with a slight delay, the answer is yes: all AMD cpus > automatically invalidate cached TLB entries (and intermediate walk > results, for that matter) on a #PF. Thanks. I suspect it ends up being basically architectural, and that Windows (and quite possibly Linux versions too) have depended on the behavior. > I don't know, however, whether it would be prudent to have some sort of > a cheap assertion in the code (cheaper than INVLPG %ADDR, although on > older cpus we do MOV CR3) just in case. This should be enabled only with > DEBUG_VM on, of course... I wonder how we could actually test for it. We'd have to have some per-cpu page-fault address check (along with a generation count on the mm or similar). I doubt we'd figure out anything that works reliably and efficiently and would actually show any problems (plus we would have no way to ever know we even got the code right, since presumably we'd never find hardware that actually shows the behavior we'd be looking for..) Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/