Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2511860lqt; Mon, 22 Apr 2024 12:52:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpP5ib5PN9nvIh8ftCaRzExF1oKiuC9vIEWUj258fm3rhRkQUKfk6hDw8RZjteGlgOefzmE6pFkzRn5r9gzDCHtOr9llB7CLj5d02ORQ== X-Google-Smtp-Source: AGHT+IGK8YnzyQ3ujxmlo6LSwn8kR3+kICxuT+HZzvKmHNDRBVxOadXHPoctsMMwhcmhL+tQj1+O X-Received: by 2002:a05:6808:2d0:b0:3c7:5077:3200 with SMTP id a16-20020a05680802d000b003c750773200mr9315082oid.47.1713815520470; Mon, 22 Apr 2024 12:52:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713815520; cv=pass; d=google.com; s=arc-20160816; b=QEOAoktC3gvImBHykZ0wbTEblHBG+fd/WIaD+/q4Xqp6w2OZoHQasnGKbAmjMgBqZo osGneA9YweRFOyEpSXTNUBDb5mkMIEXamBwpp3E3hYDEbouD4y7c0bu8+LMnfB+/rmGj ufVwaXXLN/BK5qMN5RK34Y/81qMA7gO7cH00rJ5A16ldpYGM3gQM72s4ui+X0vNa6/3S H+hj2yK3ExBiXhDcMf+xMw5FbvqNRgF6Kif16dnPJr9XzVltyadSH1JrROCdKKtTdExn 2dOtdGAmTiqMeadLd7kFbprN/zTKnOX4bI4KuBUgDnK5H4GKs/HdU2GqF0vNa7cquLWQ JfDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=40a3MchZu5mMTZq1b5V3FW0T182EE5PXteHrxGlZ8Bk=; fh=8Nt7H8hwNfv6CH7KAoyzmStDaPLWkdsmmZcgfi9emWQ=; b=fBPqhRFOAzvUN4nwZSwnxtIql52THiJ/HkNv5Y5NZ971mCMGKJQyQ0qfNidLH266Mw v+1DsSMLISZHlOI94zZ0zR04kRdHstsVNhWs2isLoG8Ilw5XFU1aWtepdTQblkv4qZSP 10K1/beiJm+V5DCuXVVEV0HpI/w9A0QkBh8LN+g4TuN2+Pe5m9fiOzjgg2IvYOEWsfKa +KpdX12pzZk5jjkBLRkzmkZyuD6ELHhNLQSD/Lwo3Nyg4wWVEc4qjomXkmB5CUqwwloQ Q+JStHyTo+ezOsdn9TE0rW6g/dvcMRXq9jt1Mvho8eyL3roLGRW/EQM6q1CYBYqC7f8w Z2Hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=V2MQFhMa; 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-153946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153946-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. [147.75.199.223]) by mx.google.com with ESMTPS id kl11-20020a056214518b00b0069689128772si10905761qvb.138.2024.04.22.12.52.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=V2MQFhMa; 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-153946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153946-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 2E0731C2090E for ; Mon, 22 Apr 2024 19:52:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D843156884; Mon, 22 Apr 2024 19:50:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="V2MQFhMa" 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 D2FE7156249 for ; Mon, 22 Apr 2024 19:50:33 +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=1713815435; cv=none; b=QSD7HPRZKd30/jViGKauxikraK1mmfGAkEIV1s5x8CUbtOhToaG88VNL4aB7GcmziRG1quar4pCZFWCg/t7h2JFPoqhXfZh5zld/ruB0e+PJ889lnhqCNZd3+a0UuqP/uiVrMjyiNedZI+d/ZUnxH/WOqxjpD9MBYuYjoANNpa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815435; c=relaxed/simple; bh=U+b7pU5cDdsFy0gBnEHx5mcf6OCQLyZ6PHnEwR5GEhU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=SVYFxLsdgc+V37FJWsB0w8RxhcmbvyKfaNdykHbhmWz6WV0QY8KF4Hd5drIg4iRCzx4/c83A2ILrNXumDCKn5WDieWf8EJjP2I/FUsj3muUUYESLTAD9CCCqV2OVfXhvjJAf0SlAgjWpSw4XMBMNdGn5QeXVVw9/TbLBvIubucM= 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=V2MQFhMa; 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 Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-1e417e43c13so64311195ad.2 for ; Mon, 22 Apr 2024 12:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713815433; x=1714420233; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=40a3MchZu5mMTZq1b5V3FW0T182EE5PXteHrxGlZ8Bk=; b=V2MQFhMaCT4yP/ZyTOsHDThmIJyrhKUlWB4Nlr5MM4Z7NsfmIYORdP90W1J0n52ECC eb7zZL1Oe9Zezk75dwVvaOxyKwYo+suc/Tyu0zMs235iPRz53yxuZDFx/e5s8Q4Ot9rm bFQiRfSrhzDhfRjR6J4NmzY8it69OCJKwXzYR9Bw1Di43GqHZLXpHwZh2hy2tXL61dH5 J1Cx7cwmiPUNFZJgNCI/uxtwmZ/JWRXGOxU+Lg2RMWsEYJFFk+Yv61w3iHU1nR1qsBLx zh4Arw6stzauoM+aJryYZO6NaVBDPr5myUcbLxyeA4IN4zo2G54dT6ASh2Qa9kJhVs7T WuBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713815433; x=1714420233; h=content-transfer-encoding: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=40a3MchZu5mMTZq1b5V3FW0T182EE5PXteHrxGlZ8Bk=; b=VwQfxTi/4VIrkDE7iAvyjFnK9H/IoidtSwwqLUEyBsa7rBO2D1o1btvMholtjf0xtr yBp52m7Oi6XY2zkeSSlW5OpotCB8xJN3vwtykpNLnLOepUgkkBwnIsf41aMxEzknOPyD 3y20zLZLA8cOjOkBbNdRrGUJl8T5JMGNgogtl/qkK3lAK3PlSxG21ICJKqL69CdV33fr FM/5X2c/6pAKEtGSB2lQIbnUEsuBA0KMEHsOjT2fm2CA9N3VznFO1lvuH1ULOtNaOXZ7 a0ZD/dbooC5gMq6QgUYGG7tTO2TTNkHvMUkcPvxChhX4PA+QRfMcqIxKK2PFOU6tl2LT QAZg== X-Forwarded-Encrypted: i=1; AJvYcCWjZ37otLAIgcprJsAu7WQhnvbycKHFivIUGD3kFF2UuaX+ZZFYhfcrS8xde24eo27WxUQpsteyfU3IdEegi7Hslmyu2M149LimwsxT X-Gm-Message-State: AOJu0YypOUPnV6BPSLM20QUcY+SfT7eMyZYeRYVKKjDJzFvk1AMD1Mih bvtPhYiOuQieYFMqesBPLQSQcQ+MCkX6rabcCE7Zmrw5nRbOuCNtUPG2V2oKPcf/ft9U0duwXL+ ECQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:d4c5:b0:1e8:6d56:b376 with SMTP id o5-20020a170902d4c500b001e86d56b376mr606835plg.6.1713815432988; Mon, 22 Apr 2024 12:50:32 -0700 (PDT) Date: Mon, 22 Apr 2024 12:50:31 -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: <54ae3bbb-34dc-4b10-a14e-2af9e9240ef1@intel.com> <39e9c5606b525f1b2e915be08cc95ac3aecc658b.camel@intel.com> <7otbchwoxaaqxoxjfqmifma27dmxxo4wlczyee5pv2ussguwyw@uqr2jbmawg6b> <3290ad9f91cf94c269752ccfd8fe2f2bfe6313d1.camel@intel.com> Message-ID: Subject: Re: [PATCH v19 007/130] x86/virt/tdx: Export SEAMCALL functions From: Sean Christopherson To: Rick P Edgecombe Cc: "kirill.shutemov@linux.intel.com" , Tina Zhang , Dave Hansen , Hang Yuan , Kai Huang , "x86@kernel.org" , Bo2 Chen , "sagis@google.com" , "linux-kernel@vger.kernel.org" , Erdem Aktas , "isaku.yamahata@gmail.com" , "kvm@vger.kernel.org" , Isaku Yamahata , "pbonzini@redhat.com" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 22, 2024, Rick P Edgecombe wrote: > On Mon, 2024-04-22 at 14:46 +0300, kirill.shutemov@linux.intel.com wrote: > > On Fri, Apr 19, 2024 at 08:04:26PM +0000, Edgecombe, Rick P wrote: > > > On Fri, 2024-04-19 at 17:46 +0300, kirill.shutemov@linux.intel.com=C2= =A0wrote: > > > >=20 > > > > > Side topic #3, the ud2 to induce panic should be out-of-line. > > > >=20 > > > > Yeah. I switched to the inline one while debugging one section mism= atch > > > > issue and forgot to switch back. > > >=20 > > > Sorry, why do we need to panic? > >=20 > > It panics in cases that should never occur if the TDX module is > > functioning properly. For example, TDVMCALL itself should never fail, > > although the leaf function could. >=20 > Panic should normally be for desperate situations when horrible things wi= ll > likely happen if we continue, right? Why are we adding a panic when we di= dn't > have one before? Is it a second change, or a side affect of the refactor? The kernel already does panic() if TDCALL itself fails, static inline void tdcall(u64 fn, struct tdx_module_args *args) { if (__tdcall_ret(fn, args)) panic("TDCALL %lld failed (Buggy TDX module!)\n", fn); } /* Called from __tdx_hypercall() for unrecoverable failure */ noinstr void __noreturn __tdx_hypercall_failed(void) { instrumentation_begin(); panic("TDVMCALL failed. TDX module bug?"); } it's just doesn in C code via panic(), not in asm via a bare ud2.