From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16810C10F13 for ; Thu, 11 Apr 2019 13:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2A472184E for ; Thu, 11 Apr 2019 13:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726644AbfDKNow (ORCPT ); Thu, 11 Apr 2019 09:44:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:43814 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726629AbfDKNow (ORCPT ); Thu, 11 Apr 2019 09:44:52 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 06:44:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,337,1549958400"; d="scan'208";a="134883877" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.181]) by orsmga006.jf.intel.com with ESMTP; 11 Apr 2019 06:44:51 -0700 Date: Thu, 11 Apr 2019 06:44:51 -0700 From: Sean Christopherson To: Nadav Amit Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org Subject: Re: [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table Message-ID: <20190411134451.GB29427@linux.intel.com> References: <20190410211334.13391-1-nadav.amit@gmail.com> <20190411134104.GA29427@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190411134104.GA29427@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Apr 11, 2019 at 06:41:05AM -0700, Sean Christopherson wrote: > On Wed, Apr 10, 2019 at 02:13:34PM -0700, Nadav Amit wrote: > > Untested, but clearly bit 12 is the one that needs to be tested. > > > > Signed-off-by: Nadav Amit > > --- > > x86/cstart64.S | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/x86/cstart64.S b/x86/cstart64.S > > index 21db10f..8626f02 100644 > > --- a/x86/cstart64.S > > +++ b/x86/cstart64.S > > @@ -243,7 +243,7 @@ start64: > > setup_5level_page_table: > > /* Check if 5-level paging has already enabled */ > > mov %cr4, %rax > > - test $12, %eax > > + bt $12, %eax > > jnz lvl5 > > Unfortunately BT doesn't affect RFLAGS.ZF, so 'jnz' needs to be changed > to 'jc'. Or alternatively, do 'test $1000, %eax'. And of course that should be $0x1000...