From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 633F742CB0E for ; Tue, 7 Jul 2026 15:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783438667; cv=none; b=Xb0FzIN6Gyn3Juw+RdK0blnavd0/GbWcER/dWBWlnpDzanAPAaBPL6+ooM+rTX3cqUpazuoFFh92id+fFGCzR7Pt1K3Bey7tcj/3aclRuT2NtLJxms4/6gglGI/P5a0mijj5uBwHdSTvP3mXPK2CdGzB2tqI3aIiKKa2mOJw5qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783438667; c=relaxed/simple; bh=nNEtWhsqH+EElpDPwy5F3Hy38N2bH/smUGCQo+NrEzk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OxKVpRBdEcUrlkbRSQYw2fTeBIpL7i46f3hZstA01aDcUqebTW6MzSw5lRI/O8hpEsByJ5oPLOukMpOQdAO6a5Jc+H6yACdmkusqp7PSFd6X6dkcEAzx7AFUowbKeSjPaD6NKlsmg9xeOR9+qCawZg4Aj+Gp5rqIfFkREVEbcL4= 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=p8Rr1UUB; arc=none smtp.client-ip=209.85.214.202 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="p8Rr1UUB" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2ccafc5e82cso25527575ad.3 for ; Tue, 07 Jul 2026 08:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783438665; x=1784043465; 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=KcPF5J/bz/mF1ksfoKKLrOzuL/Bt6L6jlasgMUKGJgQ=; b=p8Rr1UUBK3xJJ4/l/4rrRWRs+tWJH4pESaGetFWWAd+qJyHr04ZB3H6JkBdREyH9pM 8GeQG2aOWiZ/dS5mJ0uZR52crDo/cfcsXxtEb06LuIucN8HihRTHAcl5xPejUBaxFIUX xQoZdDOPGl8CJ0achK9O9TJugCXj83DXGa37g8yuLTGY0VHXDMKiugdsSl7aPkAU72Im W7TjabAuTF0cbTXglJAqQQNWxKESS8VB18rQGZ2ned2urbYvf//zxKekWRA3+0QE0ix7 v5IcZtms57uD2zmstbYkYpksOZnekNshnEkFgYhouGJA2l+tFnWcP50JGQdolzmtj8oc KzYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783438665; x=1784043465; 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=KcPF5J/bz/mF1ksfoKKLrOzuL/Bt6L6jlasgMUKGJgQ=; b=rOHe/LS8j96YvDbuS1EeDjbIhgs4qJ26hPZjeN/L5RdNet/rrYCSiSIqKOcWu7IwFo Q8lnycQswbLyAypxFer2wHjwHwdBUuwPMO/oBX2o+8wTbh8igKAFa/+L2SalyaMDYoxu pENRqFfC2qpJ2Z434/dXWJlY+frN/gSWD2ZboTc3YeCe5e0wmijUBTcfItm03GfmiXOJ P5W/J3NAquLYv5NTjwE6EnV0KDqe01+x6WitzpOIr4qqw2OrV0KWZxpiA6JIuk3GpoZH 5L5O1rpo0JOJ1irLbVS5crj9tnIp98skXaRKvNdqBNIIXQlkNz+vPqnU4X308xU/tf3l 9svQ== X-Forwarded-Encrypted: i=1; AHgh+RpNADdelHVTpfNZMGvtsBIBk8Be/u+mVUkJFmRvvrUYeOTk1wqkGqnvsBQW9dhc250dFgClPa/m99p5BZyZZTM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1IadPfHZKpKBQ1WKvgOYRrRr2J+TjTAV51S2OchlFsv89iZge Amm2qxJU6h+lZvEjc8WLRTVYDS7eA6pZSw2Ky1r4G/kqIwq7NdkVAz6pirds+juwsxoo2dDXjzY P3O/yeQ== X-Received: from plbjx4.prod.google.com ([2002:a17:903:1384:b0:2c6:a078:41f8]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ebc6:b0:2ca:106c:7122 with SMTP id d9443c01a7336-2ccbe3ee417mr56406945ad.9.1783438664543; Tue, 07 Jul 2026 08:37:44 -0700 (PDT) Date: Tue, 7 Jul 2026 08:37:43 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260629125205.52394-1-zhang_wei@open-hieco.net> <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:41=E2=80=AFAM Sean Christopherson wrote: > > > > insn =3D ctxt->fetch.data; > > if (ctxt->eip =3D=3D kvm_rip_read(vcpu)) > > insn_len =3D ctxt->fetch.end - ctxt->fetch.ptr; > > > > for (len =3D X86_MAX_INSTRUCTION_LENGTH - insn_len; len >=3D 0;= len--) { > > if (!kvm_fetch_guest_virt(vcpu, kvm_rip_read(vcpu) + in= sn_len, > > &insn[insn_len], len, NULL)) > > break; > > } >=20 > This split doesn't bother you? What split? Do you mean reading some bytes from the emulator, and some at = the time of #VMEXIT? If so: no. IMO, the most important thing in practice is = to capture the actual bytes used to decode the instruction that led to the #NP= F. Exactly how and when the "CPU" reads the bytes is a micro-architectural det= ail, so I don't have any qualms from an architectural-correctness perspective.