Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1051284lqo; Fri, 17 May 2024 09:12:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVV+StNM854jJLq5iAofgnelwbgj6RPOqMaGc9EYfZe2V7MdTnTTkH9jqRDVRXDrMcVOj0SunFh/S0UAqq0dxuz6TSsNvsQYulw8EFNAA== X-Google-Smtp-Source: AGHT+IFkZDm0cLu+NDSbBHKjANqB0PritmlskDuYCfeCjbh03FJbbg11lmWQosy7V0we4yZMlkNA X-Received: by 2002:a05:620a:1102:b0:792:c0b6:c011 with SMTP id af79cd13be357-792c759ae7cmr2242711585a.30.1715962377235; Fri, 17 May 2024 09:12:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715962377; cv=pass; d=google.com; s=arc-20160816; b=W/eQMvN21KPK6EQWJLcAT7X8ixz6QgKtjKFgWCrQ608e7yDJCpFTHs5DMFdD3afJib hRCKVLQOVRT9pM7sxvObo6cQdyrLntS7Cz2xnwZWtOVjh8GHEb06RE9Yc8nNM3RH+y2g GNGdEr9qzqmUgx3V0ehqi3uOjiDOMKFm6pfPGVRQAIVjBGdbB8M8cqViKqQR5dcTnAeQ E0kRpcKfdTgyHpNdhKg4GPqb/UMR93+4mXf+vp1xIOyc/HL8EpK74/JTBJQc5c+EJFD0 QY64BkHmUjeMm8aYfBFss6m8vRkeGX+XlC0zjHtI78T5JVYhIulcMytSoh10b6wmGQSr 2uTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=PBMN//2dzEWEm4W8Y5IMMq8lUa+WFPysYoXE9Qr+u4k=; fh=w7x3L2t39dU3hg2QQ6SzgMJcxc0AQKcLhvwWB8VoyLk=; b=WVBueQVuiQc54WjPxwMMQPlS3DCIVV5RoZwkl23POpTGJCUyBmIhX6Oqn6JJJPVfPo YYYVK7BD+mRbmimjw0vYTvaH1g3e3lRaHJqQasv7aMOWvkAE8MynyDyMpxYhqwWgTQEq arK7PXc04cxrynj+QdBmh6lj2QBhurUA7AkzwOrp8bOgxamxFX38VmEUQskZtyNUj7kl u/s83dQr9d+jHYob3laTokwFa1vs+uf2lNvW+TfDcxLjD4hIWA9ynHTTi7eySCTB6GRe znwTuPpsflVpHg0AVCJYLfuI7T6yFbWanz0KfYzDQCA4WzIrjrTrVgEuCSCl4uGPRTi5 1syw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cz3rIptD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-793190966a7si127246785a.746.2024.05.17.09.12.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 09:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cz3rIptD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E31971C2176F for ; Fri, 17 May 2024 16:12:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE91912FB07; Fri, 17 May 2024 16:12:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cz3rIptD" 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 B738412F590 for ; Fri, 17 May 2024 16:12:48 +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=1715962370; cv=none; b=MEH5pUaGtAPZXULgQn8n/0++gnU+lKwJYNjSVJvr7qzOF1W6XyVA+OqL2+ev21O3QA4oJpudcpOJkRmrH8uo25jUkV/a3XDLTaoAyHNOAf4c9zpcllpxoYDkhOgH90ngnti5kbhYoD5tCcd7px6we6Vie0rQtO8TGqVNpHENpxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715962370; c=relaxed/simple; bh=5gUro8GtU38iMRW0NhHxIp0qvlICZpEYq2lzerfQgvY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I5Uy7P/JyjT7KOJFKONxMyj+y833Qp/CfDpXBQEXsWQrHCoVWgkGxMAb317TQZFe02Pb5izLvpbp1XB/cOdxp7NlmpfZ4+aQ/Ge8yn9Fwtz8XbTjAFak1bqJs6QWxT2huLNcSTREyfOkkX/hcMa0e33dRtMDWO40qTRHbTtSltw= 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=cz3rIptD; 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 Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61be4601434so185321447b3.3 for ; Fri, 17 May 2024 09:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715962368; x=1716567168; 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=PBMN//2dzEWEm4W8Y5IMMq8lUa+WFPysYoXE9Qr+u4k=; b=cz3rIptDW5IdBV9G57IEiOmFo1VSmdux16+Z4cpiEWeNVSV57SajocT47ymhpw2LHt ZdPhNdi1xNxzpeRUbntTFBn3PahoioK22zuWkPSo7mfY8A79WgypJbjt/PBV9Lr+8mpX GfpH4oZLz7ExeMqHzAHYN1chiNY8oH50RxdTgfePRlUJZTBRbiPxkSNZfHqukYpKdZ7e EHdBHq0QFOfFggmS/BB/xDQaTh/TWj78xN1bLTPktUKJb0OmiH/3Eobtl0NY1V/B0B3t 0wKe2hawDIghpNp1xe/6nJT4YWcupetHkjPnmmeueW22KgflYVkBVIN0d5aH7MU5CYtF pmMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715962368; x=1716567168; 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=PBMN//2dzEWEm4W8Y5IMMq8lUa+WFPysYoXE9Qr+u4k=; b=bF6Nn5heUDP+5YXpFX5d+GAJImPFzX13QjN0elBCjijB5BAB0cHD8E1+1vLpGF+Cl3 umWyaf5dUEPQnSXyXP4gm53NiEASZxGQziFIqQXb1jQTA3yKnKmbxyS6OkpZsW91/Qgv vE8X/uGf/StyWylKkRlg0Y9TDmW2tUpMkvaP5KzZCdtoOXzKcUIA/fBwHENXsIow+SEM rZdhrBcy63S7q4HpLisS1ilrsb2Q4LQKGUOqL74yAee8RiCcQQZrKW7TQ0S8Enj+xpuL s20vg+7vXQho5qB38lSycwclb36kxDoiXG5PN444vdajLYuCzzedf//KpDZpHZkv55n7 7lkg== X-Forwarded-Encrypted: i=1; AJvYcCXIv6otek/v6UcZVeo18zIOZzSb1g5nWFLI1OI9MHSnsyH8OpBLdNUIytzfs+mxm08GTTQy386p/El4ybSwWnkTkAmd1OuXq6Cmcjvu X-Gm-Message-State: AOJu0Yz3+UXnKrHPjuhlx56RqAMst+9Pwe4Yg7GyZRTXvX9gjPo8WF85 4PaZcL6gNNLM1jbCbJrOSdsDcFQf+9DcxdFuzmTb4KZRSkoEmR5Qd8OSMRo3k3Zw++lpFWzHW8P N2Q== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:338f:b0:61b:ec62:e713 with SMTP id 00721157ae682-622b019b498mr55037307b3.10.1715962367828; Fri, 17 May 2024 09:12:47 -0700 (PDT) Date: Fri, 17 May 2024 09:12:45 -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: <20240517121450.20420-1-jgross@suse.com> Message-ID: Subject: Re: [PATCH] x86/kvm/tdx: Save %rbp in TDX_MODULE_CALL From: Sean Christopherson To: "Kirill A. Shutemov" Cc: Juergen Gross , linux-kernel@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Content-Type: text/plain; charset="us-ascii" On Fri, May 17, 2024, Kirill A. Shutemov wrote: > On Fri, May 17, 2024 at 02:14:50PM +0200, Juergen Gross wrote: > > While testing TDX host support patches, a crash of the host has been > > observed a few instructions after doing a seamcall. Reason was a > > clobbered %rbp (set to 0), which occurred in spite of the TDX module > > offering the feature NOT to modify %rbp across TDX module calls. > > > > In order not having to build the host kernel with CONFIG_FRAME_POINTER, > > save %rbp across a seamcall/tdcall. > > There's a feature in TDX module 1.5 that prevents RBP modification across > TDH.VP.ENTER SEAMCALL. See NO_RBP_MOD in TDX Module 1.5 ABI spec. LOL, "feature". How was clobbering RBP not treated as a bug? I'm party joking, but also quite serious. Unless I'm missing something, the guest ABI changes based on whether or not NO_RBP_MOD is enabled, as a TDVMCALL that was previously valid would now fail if the guest attempts to expose RBP to the host. The whole point of Intel defining a guest-host ABI is to allow interoperability between hypervisors and guests. Allowing the hypervisor to arbitrarily change the ABI is asinine. > I think it has to be enabled for all TDs and TDX modules that don't > support it need to be rejected. Yes, because as above, IIUC it's a breaking change for the guest ABI.