Received: by 10.192.165.156 with SMTP id m28csp2245131imm; Thu, 12 Apr 2018 10:59:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+nYd9rjAbLZqecuKLKa1m7TG/3CUDMPYMnYBQG5+Iwum9Q57LMse1N/rnBrsqF9YCf17p5 X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr2029752plb.380.1523555978936; Thu, 12 Apr 2018 10:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523555978; cv=none; d=google.com; s=arc-20160816; b=xqJpVgPK+FbRvZjSwjuV9b6eEdKDAtDSgIR1taY9wmVXzeA1m8En45T2RiuyqLf6MM wadG8oVZZRyeQutL6dOvPIWmo4ifscRqRVse5oNfXgYwR+r1BPtH9sTHShfWCJdkdtpT emXD7V5CaK1luzBeSjNAFLP0ifVZNRV9+gcuTKS5+Egu5/FZy6sZJyWKsnMw5o+XbxNu VtcycFOpXe8FyPlaIFbiOozV4qaR1sQ5/BHs/NkjNfqAjGXpOrzLH5iGO2cqicx9MK0m w0xj04OIT6uVC7UI3MnKoLSLJh6eIiLlmFQxY9fe1JndEIPB0VQpF+IIb5XaCpsYI+L8 DksA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=R6veYNe32N6GZIn07yhw40Oi9kCrfAj1QaJKfzXT9A4=; b=RxKvpMhPydKWHKTJP5emBO2z8YjKLFsuzEzPvUk/nQk6Ho5L417p9Wi6Xiaj7uesoN pGSBJpbxorFHwSdI/0BXmzw7sx6QM9SCyw4GcB2861huscg5ujIy1vOXHCYQSfWhotVU UKGuDI98gzdpR/FrwTo8MN19kQPeTgsLcvHB+81hUT5XnlpNXa32dqaWYsDtkCyTPIRr xPXQZZBjQuUGsMKRqnwz1uLmtB54NVnohBIVE4iYTEbzBNjRvsIXkSUAOKf+NmCb3FyR 9O6rXZgsnJXn1Z6h+5oL3fn64ZLQpbQP9RQ4RMxlAzrCZz2scT0PnLZ7WUB4yeEfWgvG p2yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si2616305pgq.478.2018.04.12.10.59.16; Thu, 12 Apr 2018 10:59:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752879AbeDLR5p (ORCPT + 99 others); Thu, 12 Apr 2018 13:57:45 -0400 Received: from mga06.intel.com ([134.134.136.31]:17629 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbeDLR5o (ORCPT ); Thu, 12 Apr 2018 13:57:44 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 10:57:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,442,1517904000"; d="scan'208";a="36795347" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.15]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2018 10:57:43 -0700 Date: Thu, 12 Apr 2018 10:57:42 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: KarimAllah Ahmed , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, hpa@zytor.com, jmattson@google.com, mingo@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de Subject: Re: [PATCH 06/10] KVM/nVMX: Use kvm_vcpu_map when mapping the virtual APIC page Message-ID: <20180412175742.GA14534@linux.intel.com> References: <1519235241-6500-1-git-send-email-karahmed@amazon.de> <1519235241-6500-7-git-send-email-karahmed@amazon.de> 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 12, 2018 at 04:38:39PM +0200, Paolo Bonzini wrote: > On 21/02/2018 18:47, KarimAllah Ahmed wrote: > > + > > + if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->virtual_apic_page_addr), map)) > > + vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, gfn_to_gpa(map->pfn)); > > This should in principle be pfn_to_hpa. However, pfn_to_hpa is unused; > let's just remove it and do "<< PAGE_SHIFT". Unlike gfn_to_gpa, where > in principle the shift could be different, pfn_to_hpa is *by definition* > a shift left by PAGE_SHIFT. Any reason not to use PFN_PHYS instead of the handcoded shift? > Paolo