From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 4E15A2F8E9E for ; Tue, 7 Jul 2026 15:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783439280; cv=none; b=bhRYSyOXTG3E9Zs52xJm/mSUnf184GNElvReH011F1wtoVpvxeHJJJ40c2z8r65vTOTlu/j7NM1n3lF2pbOyomDpyyYfQpKaNtxxDsqbx3cMp7W8jfb804WumTkwQqc6k+R6Fhi65/rcwAgxYTSoLwRoshCtjxRCpoMXcFYHJ5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783439280; c=relaxed/simple; bh=HbMq234Uyb3E8674h9zi3dcp6D6Ew7FJR1STGkpFODU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=N56yW7TU5SvfdrDL/Wqi21NlBd/biOzI4jZKfSFZlzWHR50R/cqgnKgTuoCCQmERDnAww160DsAFp6E+UxJF8wR+aVpWbp8HQYa0Ufh36oLtVvNnUpl04B+Yr50/SVviWDV6aTMEk5nLtxOBlKBUVdKn2PCHuBJcXE9D0fpT/Pg= 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=dgnMkIWN; arc=none smtp.client-ip=209.85.216.73 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="dgnMkIWN" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-37fc66ee6a4so8371651a91.3 for ; Tue, 07 Jul 2026 08:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783439279; x=1784044079; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=pnbZL8GFknsSmfGkHHwg+LoF2mVzXx5fw5O3ZG0ZY88=; b=dgnMkIWNh9r3jJ5bQCXAGHu+u/dw1KR9E7SHBPeFPo5GXsQSx47dx+jYDe5A7Bw+VK SMTe2H5nJ7L5nxrLcLZpK3lGBwnEmawF5mBKB6jwF9AAbGBuyJG1+w6NSCggU4FASMNb 7nCXe2sY9OP+0QbLtiPyo4cV0NbmV797U5K4l+mpM+eLgD5aRpMQUJHD5PsdXx3j5CHr tgRIGehFWzbAklHu9GMhEeQB51klivY2Y5XCSmjdE8qM+p0e77ncJZ4pKIUwGLvtk0dK b43dgQg4rDfsbSr7q6sEMzU10UKe1Fm7oXiBjgABhvGV14gWGAGG5Y4QbC0v0C4+oCGS UL1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783439279; x=1784044079; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pnbZL8GFknsSmfGkHHwg+LoF2mVzXx5fw5O3ZG0ZY88=; b=H05RefpyiLGRVyP+PUEvjVH2gvt88/TxRLlvdaMyE3DxI53nBUV3XojBFiXkktVV2Z VaHFEKNLDbk3gFhBkp8Cdxefsh6hkyD8zC9DSK3nw+0oxmowNo+DW3beaPZewolEeTcA 9aXNMGS9u49Lhmmb62LdSX5lxrG7sKTUB96UFUNPww2BHb2rsw/GeNSPqb+mDv/ROQ2L dTR2dqZPN0b/FRvwquKaG6t1UbVjPJzfpb8j9xHsr7Ud3z2gFJekzgtvAAhkRayZV98r M+BPVZwGbQvn6zWoZqnT+vBKCltn/qToEwqWpBWyDwxkEYKT48kNjYl4fwOqRVpCdAGs DYRA== X-Forwarded-Encrypted: i=1; AHgh+RrSGKgi0yCYoxn/pAdPdAveTqA9Ycz563inoIr2EMwO0w5WdR+FDnoig1D8uFS3cgFXlO9eFSEzTRYFrBo=@vger.kernel.org X-Gm-Message-State: AOJu0YzLKO4Vcj4Z+zkNMeeprpn7E7G9UbIEi26WF8Yljz9O7tBU/Ou2 pOnyO4c4uE4efsB5QokHPDriaIySaOGPxC+e+4PJ/4S+CuxAGJ9703ITpjWak125SO6sLi0VQLu WTdAuUA== X-Received: from pljc4.prod.google.com ([2002:a17:903:3b84:b0:2c7:ee2a:a90e]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:e18b:b0:381:854:dba4 with SMTP id 98e67ed59e1d1-38758164250mr6197519a91.20.1783439278489; Tue, 07 Jul 2026 08:47:58 -0700 (PDT) Date: Tue, 7 Jul 2026 08:47:57 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <0e576fd8d8cd2ed1739cee36eba393fea7745506.camel@redhat.com> Message-ID: Subject: Re: [PATCH 0/2] KVM: nSVM: Expose DecodeAssists to L1 From: Sean Christopherson To: Jim Mattson Cc: Tina Zhang , mlevitsk@redhat.com, Paolo Bonzini , kvm@vger.kernel.org, Shuah Khan , zhouyanjing@hygon.cn, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 07, 2026, Jim Mattson wrote: > On Tue, Jul 7, 2026 at 7:42=E2=80=AFAM Sean Christopherson wrote: > > > > On Mon, Jul 06, 2026, Jim Mattson wrote: > > > On Mon, Jul 6, 2026 at 8:25=E2=80=AFPM Jim Mattson wrote: > > > > > > > > On Mon, Jul 6, 2026 at 8:21=E2=80=AFPM Sean Christopherson wrote: > > > > > > > > > > On Tue, Jul 07, 2026, Tina Zhang wrote: > > > > > > > > > > > > > > > > > > On 7/7/2026 9:32 AM, Jim Mattson wrote: > > > > > > > On Mon, Jul 6, 2026 at 5:02=E2=80=AFPM Tina Zhang wrote: > > > > > > > > > > > > > > > I will take another look for the next version and try to ha= ndle the > > > > > > > > remaining pieces properly, while also making sure we don't = expose stale > > > > > > > > or incorrectly synthesized decode-assist state for emulated= exits. > > > > > > > > > > > > > > Naples erratum 1096 seems to imply that the instruction bytes= stored > > > > > > > in the VMCB are not necessarily the same instruction bytes th= at were > > > > > > > fetched and decoded to lead to the #PF/#NPF. Hence, in the ca= se of > > > > > > > emulation, it might be sufficient to read the instruction byt= es quite > > > > > > > late in nested_svm_vmexit(). That would certainly simplify th= e > > > > > > > plumbing. > > > > > > > > > > The plumbing doesn't seem all that complex though. > > > > > > What about the case of a userspace-injected #PF while running L2, whe= n > > > L1 intercepts #PF? > > > > That can/will be handled by the fallback logic of reading the code stre= am on-demand? >=20 > Could be, but I would prefer consistency. Not sure I follow. Consistency with what? If userspace injects a #PF in r= esponse to an exit from emulator proper, the emulator context will still be valid. = If the #PF is injected for something like X86_WRMSR, X86_RDMSR, or MEMORY_FAULT, K= VM will fetch the bytes on-demand, same as it would if KVM itself synthesized a #PF= that didn't originate in hardware.