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 66F0B2AD16 for ; Thu, 5 Mar 2026 04:22:45 +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=1772684566; cv=none; b=mxWKVw1/Q3Q+k56hrMNeCU/xD7Qb6f+Ds3nV/4vtM3gbPKoMd6R16ZVlrLf7gzjJVCfW6GFuB5Ysdvfd0nY4IsSYRASXuZwhnpMZTFA5lPdjfYxvQpDWFjIDf1nTzZdmufCi1MER+dkziFnhubglVATFXJP5dVnHGvBZ8HfFwiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772684566; c=relaxed/simple; bh=81yLoi3tXabw0dqSXUmCvROMbXPWzxbqe15oyfoa03k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l0gV8ZDVRHN2IIx3ooOV5Aiy3+nBzDb3IeNiCk3+hhYORA/AE9uQ2e5NVDnDtk1yU4/eWdrfQDZFi4UZ0bQ4zAEpBDtMAtN/TZ54K8Fw2AZ19yiOkRFp80YBwphs+V5Fhk6QgLb/jOw/KvKI/7n6EZ9r6d50isk4hhZLSOTEFVI= 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=aMhWlKPN; 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="aMhWlKPN" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-3598d3e3bc7so3625974a91.3 for ; Wed, 04 Mar 2026 20:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772684565; x=1773289365; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=5W+vjOw4sHJfZ2ztYmHn3awEcYReG2mo7cvKhP8YlFQ=; b=aMhWlKPN90aycq0h0qZjHK5zbht4c94Y2IYQ2aje0FfaD/vAEZU9/J/ZOLlD6tViYc GH+eYp1bQCWtt631PazBYXz7EnhGhj4nktRkaLCWe0ZkCAycmUjDWUpB7+QqTbx/UH/l sgHYgeiX1KroHEECsdXoLGsuNuOzZv8guC5sznHG14g/HHt/3wYZNZ1g7npXP6Y2Y9qc mErEU7s4yX3oXv+iaLUpEOrSLahEYwKSkZ73ZVF1MkfEjEu2sWxXi7dxc+4Hgj7RCEdr Me3dvyFd6FbNz5yqEbOfro++4wBoR0AAag2F3ulIJzDDr6FZRls1OBXCLhcwFiO1xaee MViA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772684565; x=1773289365; h=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; bh=5W+vjOw4sHJfZ2ztYmHn3awEcYReG2mo7cvKhP8YlFQ=; b=kFcz9YB/UIx9Ba0HjF6zs3r1nAuCb6MAtCVLQh8NOu+i2YRclI0dbl7bFRVQioaKOL wP2WairXNjor9iOLH388kfB+evvN0Ac94cmMVf6Xq4gqu/oglpSd1wTogoO7xEZ3e5kE fu3gfqoW/0rNo9mjn5oxbIuy+Ny7qb00MxMWN64Wxji5498dZAyn5v/n5gWXe0mScjsI fn10/8rYlmaAVJaiE2BaQf2pknstMrnXSbL0zuu1nIJJG2hePZkVJ14Qj+7Gwc8DJywu CsCNIulsDab3/E4DzIFoocyTqxA9hHb4XMleQkSYeMEo8rL8p9LB0TeI8YOwcaOuNTSL VabQ== X-Forwarded-Encrypted: i=1; AJvYcCU28813avo0KRggtRwwVTa64bcvsgOnabYbjdg93gEU9rQBhIexbLpmF9gf2NCFmbjef++ZvqKMiiX8FYs=@vger.kernel.org X-Gm-Message-State: AOJu0YzydUaDpd3SfEoqlNLSrcLYhNJwTM26X5KIHDJqWtvNko+lxNU7 1tgQD4vJxSGtBp0un2NPfJVfOFgWrCFdQBqQP5DsTfoQoaQopHJhY5PrZVWGtEjA+g8/fxoU4dH 3rf5bzg== X-Received: from pjd13.prod.google.com ([2002:a17:90b:54cd:b0:358:eda2:4a10]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4fc7:b0:356:7b41:d355 with SMTP id 98e67ed59e1d1-359a69a0346mr3119329a91.1.1772684564578; Wed, 04 Mar 2026 20:22:44 -0800 (PST) Date: Wed, 4 Mar 2026 20:22:43 -0800 In-Reply-To: <20260112235408.168200-10-chang.seok.bae@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260112235408.168200-1-chang.seok.bae@intel.com> <20260112235408.168200-10-chang.seok.bae@intel.com> Message-ID: Subject: Re: [PATCH v2 09/16] KVM: emulate: Support EGPR accessing and tracking From: Sean Christopherson To: "Chang S. Bae" Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, chao.gao@intel.com Content-Type: text/plain; charset="us-ascii" For the scope, KVM: x86: because other architectures have emulator code, and as is the case here, x86's emulator code isn't strictly contained to the emulate.c. On Mon, Jan 12, 2026, Chang S. Bae wrote: > Extend the emulator context and GPR accessors to handle EGPRs before > adding support for REX2-prefixed instructions. > > Now the KVM GPR accessors can handle EGPRs. Then, the emulator can > uniformly cache and track all GPRs without requiring separate handling. > > Signed-off-by: Chang S. Bae > --- > arch/x86/kvm/kvm_emulate.h | 10 +++++----- > arch/x86/kvm/x86.c | 4 ++-- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h > index fb3dab4b5a53..16b35a796a7f 100644 > --- a/arch/x86/kvm/kvm_emulate.h > +++ b/arch/x86/kvm/kvm_emulate.h > @@ -105,13 +105,13 @@ struct x86_instruction_info { > struct x86_emulate_ops { > void (*vm_bugged)(struct x86_emulate_ctxt *ctxt); > /* > - * read_gpr: read a general purpose register (rax - r15) > + * read_gpr: read a general purpose register (rax - r31) > * > * @reg: gpr number. > */ > ulong (*read_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg); > /* > - * write_gpr: write a general purpose register (rax - r15) > + * write_gpr: write a general purpose register (rax - r31) > * > * @reg: gpr number. > * @val: value to write. > @@ -314,7 +314,7 @@ typedef void (*fastop_t)(struct fastop *); > * a ModRM or SIB byte. > */ > #ifdef CONFIG_X86_64 > -#define NR_EMULATOR_GPRS 16 > +#define NR_EMULATOR_GPRS 32 If we add Kconfig, this would be the place to use it...