Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387AbdLNLp4 (ORCPT ); Thu, 14 Dec 2017 06:45:56 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54780 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbdLNLnu (ORCPT ); Thu, 14 Dec 2017 06:43:50 -0500 Message-Id: <20171214113851.647809433@infradead.org> User-Agent: quilt/0.63-1 Date: Thu, 14 Dec 2017 12:27:37 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, tglx@linutronix.de Cc: x86@kernel.org, Linus Torvalds , Andy Lutomirsky , Peter Zijlstra , Dave Hansen , Borislav Petkov , Greg KH , keescook@google.com, hughd@google.com, Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , aliguori@amazon.com, Will Deacon , linux-mm@kvack.org, kirill.shutemov@linux.intel.com, dan.j.williams@intel.com Subject: [PATCH v2 11/17] selftests/x86/ldt_gdt: Prepare for access bit forced References: <20171214112726.742649793@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=selftests-x86-ldt_gdt--Prepare-for-access-bit-forced.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 879 Lines: 23 From: Thomas Gleixner In order to make the LDT mapping RO the access bit needs to be forced by the kernel. Adjust the test case so it handles that gracefully. Signed-off-by: Thomas Gleixner --- tools/testing/selftests/x86/ldt_gdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/tools/testing/selftests/x86/ldt_gdt.c +++ b/tools/testing/selftests/x86/ldt_gdt.c @@ -122,8 +122,7 @@ static void check_valid_segment(uint16_t * NB: Different Linux versions do different things with the * accessed bit in set_thread_area(). */ - if (ar != expected_ar && - (ldt || ar != (expected_ar | AR_ACCESSED))) { + if (ar != expected_ar && ar != (expected_ar | AR_ACCESSED)) { printf("[FAIL]\t%s entry %hu has AR 0x%08X but expected 0x%08X\n", (ldt ? "LDT" : "GDT"), index, ar, expected_ar); nerrs++;