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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 82B0BC2D0CE for ; Fri, 24 Jan 2020 22:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 596982072C for ; Fri, 24 Jan 2020 22:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbgAXWWo (ORCPT ); Fri, 24 Jan 2020 17:22:44 -0500 Received: from mga07.intel.com ([134.134.136.100]:50330 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbgAXWWo (ORCPT ); Fri, 24 Jan 2020 17:22:44 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2020 14:22:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,359,1574150400"; d="scan'208";a="426755932" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by fmsmga005.fm.intel.com with ESMTP; 24 Jan 2020 14:22:12 -0800 Date: Fri, 24 Jan 2020 14:22:12 -0800 From: Sean Christopherson To: Jim Mattson Cc: Randy Dunlap , Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , KVM Subject: Re: linux-next: Tree for Jan 24 (kvm) Message-ID: <20200124222212.GS2109@linux.intel.com> References: <20200124173302.2c3228b2@canb.auug.org.au> <38d53302-b700-b162-e766-2e2a461fc569@infradead.org> <20200124213027.GP2109@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Fri, Jan 24, 2020 at 01:48:07PM -0800, Jim Mattson wrote: > On Fri, Jan 24, 2020 at 1:30 PM Sean Christopherson > wrote: > > > > On Fri, Jan 24, 2020 at 12:51:31PM -0800, Randy Dunlap wrote: > > > On 1/23/20 10:33 PM, Stephen Rothwell wrote: > > > > Hi all, > > > > > > > > Changes since 20200123: > > > > > > > > The kvm tree gained a conflict against Linus' tree. > > > > > > > > > > on i386: > > > > > > ../arch/x86/kvm/x86.h:363:16: warning: right shift count >= width of type [-Wshift-count-overflow] > > > > Jim, > > > > This is due to using "unsigned long data" for kvm_dr7_valid() along with > > "return !(data >> 32);" to check for bits being set in 63:32. Any > > objection to fixing the issue by making @data a u64? Part of me thinks > > that's the proper behavior anyways, i.e. the helper is purely a reflection > > of the architectural requirements, the caller is responsible for dropping > > bits appropriately based on the current mode. > > Why not just change that bad return statement to one of the > alternatives you had suggested previously? Because it's not consistent with e.g. is_noncanonical_address() and I don't like dropping bits 63:32 of vmcs12->guest_dr7 when kvm_dr7_valid() is called from nested_vmx_check_guest_state(). KVM will eventually drop the bits anyways when propagating vmcs12->guest_dr7 to vmcs02, but I'd prefer the consistency check to not rely on that behavior. > I think "return !(data >> 32)" was the only suggested alternative that > doesn't work. :-)