From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.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 A9F213D4131 for ; Tue, 14 Apr 2026 15:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776181087; cv=none; b=grn/i9clHIY58uJ3Yib8pRC4GXtbBeeSkn3Tu8WPDjEJz6WpnoxGgqCmoxPZxTqxw18AEoKUXOKQ/Nk7I6fxyzzUWLBgk2bFA7TLAngNtZkyxBlZ4nuaX8cqFy/bE08Jf7Ljg932Oj1/iSJMUcVDk6KNSFz9ersv0Ny1uAjlghc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776181087; c=relaxed/simple; bh=pDXF8QRt7ZGKEq0AdjebnFgpWu1BsXgK6gD+2dgsUZo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rz0Jt0I1EuGVzDYHd2HlkLPV2FGVIouth+BulIUUrOVGENjyx6FpGmGyqGnxBEr/nH6Yc4WTF8bBxBJFEjYto4TTCk/oo+o/rDfkCUAohAOgH/K2b6sVui/oZxZD2Vkg5/slTNv3eHrCj4EgZLhbasxSdRHbzwnWYDk7Ls3cgGk= 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=kiFTcO/p; arc=none smtp.client-ip=209.85.214.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="kiFTcO/p" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2b2e91add2aso30504035ad.1 for ; Tue, 14 Apr 2026 08:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776181086; x=1776785886; 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=fTzayLah8spuwGg86ncm2630WsNZvV7i/NqWUT/CAWQ=; b=kiFTcO/p2NN7MKSMo0LPdKwYjLAC9Kf0g0xDWdOuoOUxEa6f9ySfMGyiLyWBwku64Y TyJlyPy8c6DJRHCMy9kemNYtap08OEuAURFioDhXESAT87lJ7kaf02gsUQpPyJNBWOgQ 1QbTAtItgod1GBNRn4Hgfog691In/p0QqvipQHaozpX7R/FUhIJ1KSH1GVcELl1BJlnE 3785vKc2bjLWhKaGLmvW1Vcvw8dnwy506wdrfJ187mu56CxLjBdgx1gDLpPRNyNSwMLR ZzYyKWZu1gH5y8acTO6MwMl7pXMKhc9netxlw0doiXGNngKyqs+rCt7c/PhiClLr7xyk FPMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776181086; x=1776785886; 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=fTzayLah8spuwGg86ncm2630WsNZvV7i/NqWUT/CAWQ=; b=ciGvwoHq7ue7Eeijq1SbzlKbWc+wesiFOe0S0SJdFEjDhIko+f42K33PadARKbb7l4 0CREZTHLxAE0mhjGs1zI6AZ5i3zxzeov6hk9h7Iy6R/e3+xLhcOKf3uPJmSLACofmNZ9 cJKw3HwdmT6j2ilRTZA0hotvHieM9JO3VQPflsvbqiAuqp+uEeTcTrP0LVUzqRHXZm1J b4CwsklGmCSoaHBSmHe7U4Mk30o9oRtTPzGvk2EW07IvNvmxWQ9O7bDON4Y/A1bdqEjF 2oP55MLOg+MZfL4nvNLGb+jOnSm4on9r5Ac7MODONHUiiyuH55K7Y0/yQyENyIjI9A2Q HfEQ== X-Forwarded-Encrypted: i=1; AFNElJ9gPorcHkC1BTWf71QVxYH1vu0BXCKXM+7aZxzImZkIn13ZZB+8C+9A73bXE94YXt+YbdKUWnol2iVtBnA=@vger.kernel.org X-Gm-Message-State: AOJu0YzOR5kxgAJiCSErzi/y5GgvvIAT3bCurLBWkxyOXUEww/hp7QNm r4v8iVFTMxhfR5I/5VcdLb24RLxrXVRDhC5X1EJNd7iUrJzx30RTCdqp1jL1S6e3aAQ6e9G0ZrJ 6SvxoKQ== X-Received: from pjyd3.prod.google.com ([2002:a17:90a:dfc3:b0:35c:e6e:959]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1802:b0:35b:e566:15a6 with SMTP id 98e67ed59e1d1-35e4286354bmr18000661a91.28.1776181085761; Tue, 14 Apr 2026 08:38:05 -0700 (PDT) Date: Tue, 14 Apr 2026 08:37:55 -0700 In-Reply-To: <87e767b6-0324-44e6-92cb-f933002dec43@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260409224236.2021562-1-seanjc@google.com> <20260409224236.2021562-2-seanjc@google.com> <20b82b65-b156-4a2c-8094-b86dccfb3025@intel.com> <87e767b6-0324-44e6-92cb-f933002dec43@intel.com> Message-ID: Subject: Re: [PATCH v2 1/6] KVM: x86: Add dedicated storage for guest RIP From: Sean Christopherson To: "Chang S. Bae" Cc: Xiaoyao Li , Paolo Bonzini , Kiryl Shutsemau , kvm@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Tue, Apr 14, 2026, Chang S. Bae wrote: > On 4/14/2026 5:31 AM, Xiaoyao Li wrote: > > Even leave RIP in regs[], what is the problem by just allocating the > > index 16-31 to R16-R31 and making RIP the index 32? > > But why? > > Even though the array isn't explicitly labeled as GPRs, that's effectively > how it's being used, and RIP isn't part of that set. > > I don't think there is any benefit of leaving it in regs[]. +1. Chang's earlier argument that RIP isn't a proper GPR swayed me over, e.g. RIP doesn't have an architectural index. Keeping RIP in regs[] saves one line of code in arch/x86/include/asm/kvm_host.h, at the cost of making the code less readable (IMO) and incorrectly suggesting that RIP can be accessed like other regs[].