From nobody Fri Dec 19 08:56:16 2025 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.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 1CFE11097B for ; Sat, 31 Aug 2024 00:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725063382; cv=none; b=GgoKIGIz4lbie+pwVDr8u99dQNHOAQMKXPvvf4HVUPaNLSwipHnjshlqcYG+C7NYxQWQZlvqIlkgro6snVoq77K9yioATUQ9BG3fuI/lDEC6vnsAaRj6r/LbUIK2tZguT8+IJPu/c9mXzKhgRoslAN8lN6UKF4JgrWGzaWR68S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725063382; c=relaxed/simple; bh=ccmI6fgXaS6ULZCMeBWyQaXyCbh7+cmAtQZQ72hgJko=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OW2ahEw02ZCqEMpsyqCLIerXSnoIj2fUcMEUPTKQNtQCKH1gWHot1akOLrhvib4QwpOPof9x60dGZxZyaEATxtoTkNMOUW4Xvw4lYk3rogRZRRU2e7bni5tj9DczWfqzyRgqV2GcXMplTjHm5GGXla8FfPAdRI8nG4VUkgKgLX0= 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=fhaWi+E1; arc=none smtp.client-ip=209.85.128.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="fhaWi+E1" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6b8d96aa5ebso45066967b3.1 for ; Fri, 30 Aug 2024 17:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1725063380; x=1725668180; 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=heJP/gE8sNgyHlf3GBWAi72kmE/mtNKhFddnYBUVTOE=; b=fhaWi+E106CCFd5rgQtGX4joRjEjC0gmVzUlr+pTI5dSIPC7JrJoYsPFdc4PK8EFVt XKXw6KPkvSrYdFC0bNPtLpxTtE2paLsNrSHNoEBHfzjBpw1IvHmlx75IkqFufOKbUJlI yv6wHagtf98IUSXyoXqXnzxkz+mTcwh4Y++lnVlKvXKheb21V9q5uTXhbZuTZdw/tUfI cHZb8vH+y3lkUZGxXWS7YQ8+VLvM1ntiaFdNR5/U+Ofc5CHqNAMyvUnmKSVyD8NkJvVq VszHbjvT4g/Oogn1S/+m2xKGKbUpQmRYML14h48qy2b/DYAGRUTR9/8Jfo5i6nqD4V1A pWeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725063380; x=1725668180; 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=heJP/gE8sNgyHlf3GBWAi72kmE/mtNKhFddnYBUVTOE=; b=AEHqCedzf7GGDdm4aHFrccH37jf1C2XIlQL5oRRt4ODo+8BZ7dbmt6S4ZIE/++8gyV uLvoJvUnYkiBAVUVCICf5pSAQxhE3bc7qU67TWlhEJiXUcW0dUJoMyWdhCR++T3jvQNR nXWdjUsi3WR6qxGo0thjjcl484IhnPfqyVjOCIbp8PcA9ybTey0eZmqjvPi8AfMs0vT8 s3CX9AyT6mo6HcwMFVgmHF4u8PLxrKaTCnBQnifpLDGChcdovNM3zPE7lt20t/nun7Mo EU1WCWVmZ63DbNeMGSUWfZgpnrwgj86nETbmmDrzQiXuf6nBeY7VfeYrZJnZWZj1PcEe fTSw== X-Forwarded-Encrypted: i=1; AJvYcCWGyI5l4z1IwLGLNJftQ1KoZufDWS8iv1lJ/LJ9EI0oz5NO4aN9QLKnQprvb4hVQDDe/B0eW3PPGisw/jg=@vger.kernel.org X-Gm-Message-State: AOJu0YxtLBlLbQQ2M/wC4aw829obYkuWY6SEBMHz69FzajBEvQv+FjDS H/G2KGiEr7Xt7Yq5DiNXSQnB6wUxAkSgfi9ZWNCc+fLaK+zTfydqMVX6xqMH+HtPlUUl54yGC6S V7A== X-Google-Smtp-Source: AGHT+IHiBKbgkYqyJRDMcIF9+XogmVSPipW/TOpEzV4NmLy2XzHmDX3Zwx+y82tht7UQeTFU4iZAMrMnrmI= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:6103:b0:62c:ea0b:a447 with SMTP id 00721157ae682-6d40d88f5d9mr2178957b3.2.1725063380216; Fri, 30 Aug 2024 17:16:20 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 30 Aug 2024 17:15:34 -0700 In-Reply-To: <20240831001538.336683-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240831001538.336683-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog Message-ID: <20240831001538.336683-20-seanjc@google.com> Subject: [PATCH v2 19/22] KVM: x86: Rename reexecute_instruction()=>kvm_unprotect_and_retry_on_failure() From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Yao , Yuan Yao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename reexecute_instruction() to kvm_unprotect_and_retry_on_failure() to make the intent and purpose of the helper much more obvious. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/x86.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 081ac4069666..450db5cec088 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -8857,8 +8857,9 @@ static int handle_emulation_failure(struct kvm_vcpu *= vcpu, int emulation_type) return 1; } =20 -static bool reexecute_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, - int emulation_type) +static bool kvm_unprotect_and_retry_on_failure(struct kvm_vcpu *vcpu, + gpa_t cr2_or_gpa, + int emulation_type) { if (!(emulation_type & EMULTYPE_ALLOW_RETRY_PF)) return false; @@ -9125,8 +9126,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gp= a_t cr2_or_gpa, kvm_queue_exception(vcpu, UD_VECTOR); return 1; } - if (reexecute_instruction(vcpu, cr2_or_gpa, - emulation_type)) + if (kvm_unprotect_and_retry_on_failure(vcpu, cr2_or_gpa, + emulation_type)) return 1; =20 if (ctxt->have_exception && @@ -9212,7 +9213,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gp= a_t cr2_or_gpa, return 1; =20 if (r =3D=3D EMULATION_FAILED) { - if (reexecute_instruction(vcpu, cr2_or_gpa, emulation_type)) + if (kvm_unprotect_and_retry_on_failure(vcpu, cr2_or_gpa, + emulation_type)) return 1; =20 return handle_emulation_failure(vcpu, emulation_type); --=20 2.46.0.469.g59c65b2a67-goog