Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp299200lqb; Tue, 16 Apr 2024 16:52:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCuJUtXGiFjMpFQJcySVKF+2ytEgKekmKNB3tbdFcMFDm1qKol/u9N4ydLxCy4cTox5RXiHLuRa8/UQfkFi1QClZ8UhH+iz1QFmltkcQ== X-Google-Smtp-Source: AGHT+IETSKdQJ6OkUGhFSZuwH9o2973afzTb8ssSobKnJuj1b0jmAhZY7XFw+SuTlWmC6rk0jniz X-Received: by 2002:a05:6a21:78a6:b0:1a9:6df3:fcd2 with SMTP id bf38-20020a056a2178a600b001a96df3fcd2mr14490804pzc.8.1713311562290; Tue, 16 Apr 2024 16:52:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713311562; cv=pass; d=google.com; s=arc-20160816; b=Gi0+XnagGWuZutS68Z+DuxswhjWy6E8msEyhwWmVjrmapewdSBlxoyh2ZBBc972Jzq MYQnVB+i8+xqdYY3+6Z1yTXUZ4POZz71bip0/ZKv/f3gZn/RCn/mrWg1Pfwrx/4S6xLh O1DDg3t4uZjHH9K34qQ1jXwJvyvWgf47yN3/z+H4Ypo8xIl3O5PFlKcmhZSCDVaTToyU Ntb5daAGZNQU2TBRIl84ywqtZpAFJJvYL3UsQGADXaxraVzJzBbxeP3/FEaxcaMbli0K qTVzHl6T35VtCE1ubWtMma+nfXctcTh0hpGFd7K/4Ob5sQRHOF/GY8xCbbwAEPSJSvqh W9cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ICYAyUDBPIUNfveHnFrE5DFvb2U/kZiyxXO4PQJnHnM=; fh=14qgfmA/Jkh4juzRXq0ct9lcQp+/HLIUS0xCVCTJfRc=; b=GLtB/edg1Guu6m5wAx4jhgm4ry2HzsXD+6qTGwEg33bMxAVe2tS7cWdQ66yekvYIIU bAXbcYnFhxoci7U6xFAIiwE29chWaEYdSLTcQW/J3edqFbmc7DR5B66kbnPcBZKQpZI3 cR12MNGyPmhRmkijX0m6Wfm35ledrR2sPqIjX8WSSAXfM2bMMT2EsUYGs+tYTUi8NPOS uNMijhrB5bLuuLBbIrkqTB4gFS2dmKtJXsFtsLnSaO4x4RmhLju3zq3QvVFMuBMzTn5v iXmg83PIxjgeCp67GW2hUzMq/TRx4JujmewJL7DEKo97Og2AziLwo+gtG7wyD8iIg4bj oKfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bKmCmapd; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v19-20020a1709028d9300b001e3c6c51673si10177979plo.307.2024.04.16.16.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 16:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bKmCmapd; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BF6E8284B5D for ; Tue, 16 Apr 2024 23:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C53A413AA46; Tue, 16 Apr 2024 23:52:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bKmCmapd" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 431A28120A; Tue, 16 Apr 2024 23:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311553; cv=none; b=eaOw4NP4a2XJRwfNzrMmZlnb9Afc/ZwI84gNWR1wje0JldF3lOYCOZkv0n2J/L/6o0Xje9zqfN4LHORid2+uaisUUDVkxEVBjczxtqPtBZy9x0EsfBXto/FCoxORaOZFRQz0j9G/zbCnqQBYWCcUagIDe7U4m6bR6Yi0OVWJJRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311553; c=relaxed/simple; bh=6HzpwzhVBJTxkosmKw85+TVSVUAqQ0ZL5X8gG+DYsjk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QFkpAET27ZKc9BUYzyZYVOboPKaZZTbNc24FaogSIJuDwT7GZqZTH4T0f79Wgwou8rmXhXr3aWMxHP+taAzgnCVdVTFUAkkzWgvP0pL1H3JdoydiZTZU/4Zea3X51KGekCRpPJNEYB/uupO+uXahvnGPHUooUlPkX52nteLzhxU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bKmCmapd; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713311552; x=1744847552; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=6HzpwzhVBJTxkosmKw85+TVSVUAqQ0ZL5X8gG+DYsjk=; b=bKmCmapdjwLSiPiouIYlodBAyuTwtQ1Ot8hPK9REm8LaqwKoEw6QrWew at1RdGx/3SM6eCxnbbJQMeHc5hFALRDckNTj2fICVqTlR4gmFFmxPGjeG KhV58RxhQiwOBbNnOGFPBTyfEEcOO/DnclJgKP5uQrJQYZd4igE0+FTRA pzR3fSBr0eL7PdIwm/+VP1GAL5IFToYwIVvnSYwmlT3L3eYJCL179VFvt Xh8sV/o6zsigyZtv4dVZj6gTB730S03X50ylMLO+0tEHUuXrxsaq0Q7uF 4aAN8JUDLfaKjm/XgYyWvuctBwVUGH20yhv9AmWr3rH9lBG41R3ayy8oY w==; X-CSE-ConnectionGUID: m+jxZWecRRKxutRv1BvwdQ== X-CSE-MsgGUID: p+YPSCVKRp2LWlNPyr5Xyw== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="12569131" X-IronPort-AV: E=Sophos;i="6.07,207,1708416000"; d="scan'208";a="12569131" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 16:52:31 -0700 X-CSE-ConnectionGUID: YnWvpaNZRRukiRVAY3nJTQ== X-CSE-MsgGUID: 2JKklJJDToClpfxfwgBwNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,207,1708416000"; d="scan'208";a="26865215" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 16:52:30 -0700 Date: Tue, 16 Apr 2024 16:52:30 -0700 From: Isaku Yamahata To: "Edgecombe, Rick P" Cc: "kvm@vger.kernel.org" , "Yamahata, Isaku" , "seanjc@google.com" , "Huang, Kai" , "federico.parola@polito.it" , "linux-kernel@vger.kernel.org" , "isaku.yamahata@gmail.com" , "dmatlack@google.com" , "michael.roth@amd.com" , "pbonzini@redhat.com" , isaku.yamahata@linux.intel.com Subject: Re: [PATCH v2 03/10] KVM: x86/mmu: Extract __kvm_mmu_do_page_fault() Message-ID: <20240416235230.GB3039520@ls.amr.corp.intel.com> References: <621c260399a05338ba6d034e275e19714ad3665c.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <621c260399a05338ba6d034e275e19714ad3665c.camel@intel.com> On Tue, Apr 16, 2024 at 02:36:31PM +0000, "Edgecombe, Rick P" wrote: > On Wed, 2024-04-10 at 15:07 -0700, isaku.yamahata@intel.com wrote: > > From: Isaku Yamahata > > > > Extract out __kvm_mmu_do_page_fault() from kvm_mmu_do_page_fault().  The > > inner function is to initialize struct kvm_page_fault and to call the fault > > handler, and the outer function handles updating stats and converting > > return code.  KVM_MAP_MEMORY will call the KVM page fault handler. > > > > This patch makes the emulation_type always set irrelevant to the return > a comma would help parse this better ^ > > code. > > >   kvm_mmu_page_fault() is the only caller of kvm_mmu_do_page_fault(), > > Not technically correct, there are other callers that pass NULL for > emulation_type. > > > and references the value only when PF_RET_EMULATE is returned.  Therefore, > > this adjustment doesn't affect functionality. > > Is there a problem with dropping the argument then? > > > > > No functional change intended. > > Can we not use the "intended"? It sounds like hedging for excuses. Thanks for review. As Chao pointed out, this patch is unnecessary. I'll use kvm_mmu_do_page_fault() directly with updating vcpu->stat. https://lore.kernel.org/all/20240416234334.GA3039520@ls.amr.corp.intel.com/ -- Isaku Yamahata