From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755371AbcCBNAA (ORCPT ); Wed, 2 Mar 2016 08:00:00 -0500 Received: from mail.skyhub.de ([78.46.96.112]:39234 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbcCBM76 (ORCPT ); Wed, 2 Mar 2016 07:59:58 -0500 Date: Wed, 2 Mar 2016 13:59:52 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Oleg Nesterov , Andrew Cooper , Brian Gerst Subject: Re: [PATCH 01/10] selftests/x86: In syscall_nt, test NT|TF as well Message-ID: <20160302125952.GG16954@pd.tnic> References: <98d687a7a464ba29ba493f3885f138902c6ac574.1456720860.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <98d687a7a464ba29ba493f3885f138902c6ac574.1456720860.git.luto@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2016 at 09:28:46PM -0800, Andy Lutomirski wrote: > Setting TF prevents fastpath returns in most cases, which causes the > test to fail on 32-bit kernels because 32-bit kernels do not, in > fact, handle NT correctly on SYSENTER entries. > > The next patch will fix 32-bit kernels. > > Signed-off-by: Andy Lutomirski > --- > tools/testing/selftests/x86/syscall_nt.c | 57 +++++++++++++++++++++++++++----- > 1 file changed, 49 insertions(+), 8 deletions(-) > > diff --git a/tools/testing/selftests/x86/syscall_nt.c b/tools/testing/selftests/x86/syscall_nt.c > index 60c06af4646a..a6ceff86c199 100644 > --- a/tools/testing/selftests/x86/syscall_nt.c > +++ b/tools/testing/selftests/x86/syscall_nt.c ... > +static void do_it(unsigned long extraflags) > +{ > + unsigned long flags; > + > + set_eflags(get_eflags() | extraflags); > syscall(SYS_getpid); > - if (get_eflags() & X86_EFLAGS_NT) { > - printf("[OK]\tThe syscall worked and NT is still set\n"); > - return 0; > + flags = get_eflags(); > + if ((flags & extraflags) == extraflags) { > + printf("[OK]\tThe syscall worked and flags are still set\n"); > } else { > - printf("[FAIL]\tThe syscall worked but NT was cleared\n"); > - return 1; > + printf("[FAIL]\tThe syscall worked but flags were cleared (flags = 0x%lx but expected 0x%lx set)\n", > + flags, extraflags); > + nerrs++; > } > } > + > +int main() ERROR: Bad function definition - int main() should probably be int main(void) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.