From patchwork Fri Jul 26 23:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13743274 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3F3D16F836 for ; Fri, 26 Jul 2024 23:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722037990; cv=none; b=ICcUIVmJjLJL7ThxwQnW/XRTP/Ixrj5pCtNVZRTE1JidPUzOxPc28A4Sl89zlb345pO6liP65PG+BQM6zstddqQ23yoqkFxqZHg65XjAVn4+fcmQETWQdfnQtn8MYDzEQvdJoeX+NwaXO+VK52TsBuAsWt8kTqMWbw2+ZsxTkYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722037990; c=relaxed/simple; bh=wc/x3/oHz+A3HJ1377TECtP4A+SVRJ7qmCHuMbUKaP8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=G+gs9D6NTjQU75x15NXfZ8x9oDo+wLVz3OKwD5BX48IKDkIbdsAeuat3OgKRQHyOPMxbHCG9jOFeiuv4fAaKJHGJ5Q5RFNq5uF+HQ+ufcAG8ckkmCgyl405221BOSkWZBiwtXELfFTn7rgdDtznFvo+QmrJqgXt3P6WOLPBAW/E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EHGzxS0H; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EHGzxS0H" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-721d20a0807so1375506a12.1 for ; Fri, 26 Jul 2024 16:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722037988; x=1722642788; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=XEii1g2QxUcfpOdmeEwY4J2sYQAHz7s0WQ4Z9lEf4mM=; b=EHGzxS0HrLGgrJbHtWk+Qhe4MRs8fAABfwYbZu2W5hpU8aguKrm9ZyDqWpyCBd7i7R MwiNoZNPeS1gmr+I4eFWzty2MTPNNoXv5Bp3Xq6ganSxPmWk8FyT098aszpoEG7Y/VmD /3rGLXKnwVrVTEjqLBwM5rXgq/lwdDC6TtROHWJTivELZ/5nFjFi+f+Cp9TX/KXzqhGs bWnvHI/t1/q3h08FgOp17SdHLdABnJQ+xYuXcktcU491qhA+45KQ2pjqW+FxlfxvzlhH Qt7TyvcytVEri0xmVigSxECP3AjXzuTY8x0wKjneRa1oAlDMsph95NQTBsjJ+65j5Ytu dlmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722037988; x=1722642788; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XEii1g2QxUcfpOdmeEwY4J2sYQAHz7s0WQ4Z9lEf4mM=; b=K/qyZIjcq8+vROwSZxEK2lW+OQpZBK/HdOM5cOuyX+JY8a/qfOrj0v78i+LvK2kFNs 1odKR+NAO9AWnZcGArE7lsuYmCV3zLZjsMWGt4gp0w5eFcMy8rm5njMKCOSzyE6O5e/7 Y4/v54gmTUGQ1UQSxSWJGGDVlaH/TGadIlslcflvYV166gObjjakk0tXMPcTi876kHXx jgu3tkF0T1fv5z0g2KeMtiCzlkYDspK09bpQ0z+3ogHFdQiM1Cc1PrcLgEEW8ktsnRQU z7kL3lbxMRPdilVbLEEtypMfKS6FkqI0XBR1cTQkw96+jh63oJuHw0G+aX1NohQwQUqG FXiQ== X-Forwarded-Encrypted: i=1; AJvYcCWs1Tq8C7mu1ZmbGm/YtfF1EWR+Sa4OuvQqTlQdWnDTSJk93wIqcDBnHPdfrw+chYuuSwaaGaUwoCN4aTLGnlA2j6exlSZXOs8vUA== X-Gm-Message-State: AOJu0YyDKIyoUfsotksOkoGTXadn9lNqDT1A3JYHHGJZVzyC3gyIdcHJ higIZxBEC3MwB78nVTh7wm7X07M4tJaHHTBzWxeikZi2bDSO+vq8UPvi8jqjkp7dZ64hFM9wHjV ovA== X-Google-Smtp-Source: AGHT+IHOguM9TV1Wqy8YwTb6CBUJl4Q4k/lDzAhV2epo/9u56TnU3ou5KRwZKpMCKdXGcBYB5FJy1Mcb3zg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a65:6556:0:b0:710:cc3c:3916 with SMTP id 41be03b00d2f7-7ac8e0b6796mr2159a12.3.1722037987987; Fri, 26 Jul 2024 16:53:07 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 26 Jul 2024 16:51:24 -0700 In-Reply-To: <20240726235234.228822-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240726235234.228822-16-seanjc@google.com> Subject: [PATCH v12 15/84] KVM: x86/mmu: Drop kvm_page_fault.hva, i.e. don't track intermediate hva From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , David Stevens Remove kvm_page_fault.hva as it is never read, only written. This will allow removing the @hva param from __gfn_to_pfn_memslot(). Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 5 ++--- arch/x86/kvm/mmu/mmu_internal.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index eb9ad0283fd5..e0bfbf95646c 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3248,7 +3248,6 @@ static int kvm_handle_noslot_fault(struct kvm_vcpu *vcpu, fault->slot = NULL; fault->pfn = KVM_PFN_NOSLOT; fault->map_writable = false; - fault->hva = KVM_HVA_ERR_BAD; /* * If MMIO caching is disabled, emulate immediately without @@ -4333,7 +4332,7 @@ static int __kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault fault->pfn = __gfn_to_pfn_memslot(fault->slot, fault->gfn, false, true, fault->write, &fault->map_writable, - &fault->hva); + NULL); /* * If resolving the page failed because I/O is needed to fault-in the @@ -4362,7 +4361,7 @@ static int __kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault */ fault->pfn = __gfn_to_pfn_memslot(fault->slot, fault->gfn, true, true, fault->write, &fault->map_writable, - &fault->hva); + NULL); return RET_PF_CONTINUE; } diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h index 1721d97743e9..f67396c435df 100644 --- a/arch/x86/kvm/mmu/mmu_internal.h +++ b/arch/x86/kvm/mmu/mmu_internal.h @@ -238,7 +238,6 @@ struct kvm_page_fault { /* Outputs of kvm_faultin_pfn. */ unsigned long mmu_seq; kvm_pfn_t pfn; - hva_t hva; bool map_writable; /* @@ -310,7 +309,6 @@ static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, .is_private = err & PFERR_PRIVATE_ACCESS, .pfn = KVM_PFN_ERR_FAULT, - .hva = KVM_HVA_ERR_BAD, }; int r;