From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E397DCCFA00 for ; Fri, 31 Oct 2025 08:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uYhWV9OtILEcgQFP6BUjiflr7z/wUNFE1oVhlSo2YEA=; b=KVPgmGY13+IaYu g7cxuwKpEHmtYdJ19BZ3lSnVBFb80sth3SXv+a8dXrb/t59hw+Kh1Pg371Ymct2lL0jCdQb9uIFa0 f+XCqGZiq6l1DyT0koxaAsSLbp8e5f33LPg5jkQ9EG18ps0fH/vYLzDhxbyeTEbGKLytSSxuL57OG aaxsQ8oR4b6drnxebxv0JHT2u8zpSVYoQtD9vPF+mn1tWBGZeGTdw/p1z738iViveneeR7R3GtgI7 IdOd00XJn6GtIAZjErADybaUmYjEGa8CkQAaqbqGVhFaLRwr3NWc/coTgpYTkHuBXktJHSnqRsJH/ csKWiDYkgGUxFZRhppmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEkyX-00000005jNu-3XLx; Fri, 31 Oct 2025 08:59:13 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEkyV-00000005jNH-1sHM; Fri, 31 Oct 2025 08:59:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761901151; x=1793437151; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=14teRbdSNDZoo6LY1BdIEFiTD+Kt/E9bpeaMX41fhsM=; b=ZaJZCK5NvAhuyMYg6HJmSMLjm1NwHD/SXEx32GGuB6YLCCY3iTCkV7rR 522S2gQp49wj8A6Q5v6hN1xwQZwZjyFlSj+FnJc3E1lu1m66LiP03SfWU HIufguom79ZKqv/4m7/Zt9X/QTSBMGmZWFdhed0Xid4Bj252T5qLAOCmv vC8F0lOeUaAaLP6b8qwywpSbg4s/ViE83Kv9sFVKFmAb4RPsi2B5+BemM KWFAZJIDyNVDZc4vzuxVcl+rQKUNtH0v81CzrTSHGBS+5QhV5F8IZpgSg Cdpdndq7sHsi/KhOiMgMeKugfYDMLHVP1l7ClRgbusZQiozP+NRmBLZ12 A==; X-CSE-ConnectionGUID: fUixyae/RYS8DX9U1J49bQ== X-CSE-MsgGUID: DA37wERATc6B/St4H3Dy6g== X-IronPort-AV: E=McAfee;i="6800,10657,11598"; a="81685946" X-IronPort-AV: E=Sophos;i="6.19,268,1754982000"; d="scan'208";a="81685946" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:11 -0700 X-CSE-ConnectionGUID: Qkn6DZO5Rceyyp8KD2OnrQ== X-CSE-MsgGUID: hAjIabqjQHemJifWFRIz7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,269,1754982000"; d="scan'208";a="186119255" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.124.240.28]) ([10.124.240.28]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:02 -0700 Message-ID: <5eaab97d-30c3-46a5-8be2-2ea1ef28e71e@linux.intel.com> Date: Fri, 31 Oct 2025 16:58:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 18/28] KVM: TDX: Combine KVM_BUG_ON + pr_tdx_error() into TDX_BUG_ON() To: Sean Christopherson Cc: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Paolo Bonzini , "Kirill A. Shutemov" , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Ira Weiny , Kai Huang , Michael Roth , Yan Zhao , Vishal Annapurve , Rick Edgecombe , Ackerley Tng References: <20251030200951.3402865-1-seanjc@google.com> <20251030200951.3402865-19-seanjc@google.com> Content-Language: en-US From: Binbin Wu In-Reply-To: <20251030200951.3402865-19-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251031_015911_734247_9721CB54 X-CRM114-Status: UNSURE ( 6.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+kvm-riscv=archiver.kernel.org@lists.infradead.org On 10/31/2025 4:09 AM, Sean Christopherson wrote: > Add TDX_BUG_ON() macros (with varying numbers of arguments) to deduplicate > the myriad flows that do KVM_BUG_ON()/WARN_ON_ONCE() followed by a call to > pr_tdx_error(). In addition to reducing boilerplate copy+paste code, this > also helps ensure that KVM provides consistent handling of SEAMCALL errors. > > Opportunistically convert a handful of bare WARN_ON_ONCE() paths to the > equivalent of KVM_BUG_ON(), i.e. have them terminate the VM. If a SEAMCALL > error is fatal enough to WARN on, it's fatal enough to terminate the TD. > > Reviewed-by: Rick Edgecombe > Signed-off-by: Sean Christopherson Reviewed-by: Binbin Wu -- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22066329C53; Fri, 31 Oct 2025 08:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761901152; cv=none; b=ftcksk2WpUgBwCSWbXITop4SwINI6pAE7635CaRPJQXdOGuwQ2kaj3cKym0VzmF2HGXXvcJyv4F+pVH08VlOmlkLiVcMtPH8p7nNSPGGAgO9SGjX4jVyB0FO9Jqz9zABLGCSorPlbQTEkRTPo5FSRfnQJ/UIez5E46Jekdk9Mpo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761901152; c=relaxed/simple; bh=14teRbdSNDZoo6LY1BdIEFiTD+Kt/E9bpeaMX41fhsM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FLdPu2uhNpgrJAw8s9RHB9+1oZSvj84oq0JWyfb0mEno5OrrD3xDau/IK3zqw0eE2udHILS7nu/UUQTJyEuXRDPoGVGalgVhdKQbqqBNxbnpBYhZve6wchKP4EoePOQAd7GsEnCnrSXxGqsG+HLMwtey4xntLsiwwLvRQjn0bZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fACj2G1h; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fACj2G1h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761901152; x=1793437152; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=14teRbdSNDZoo6LY1BdIEFiTD+Kt/E9bpeaMX41fhsM=; b=fACj2G1huC3BjSANlqRNVV6cQ6XESOtH1ut6OKV/gj0KHYJpqwNwYfHz J/bDKESFqWHxfwMAmxvjNp9CdZepgyXsYflyfacK+TP4Fo4BO7TLTBvBC vWhtPQF/IYTY4qr2/GNkJKD2IUlGTx24kwKl2czh7TgjvTxrSK1TerG/N l4btOrpy3Bnpha/S3avLt1RgyBWxw5dXvlD2I0UosoERogJj2iQ9X9Trx Tkc89Wo7tzGGcUy3WAHfbAMynoD6NVFJ7yYmoYsVOBxH5frpPY1bAhhRQ f+tUPHtzwLthsWOA7TsmU0pgdTcT2btPizSs2P9502+UiSPfGMRwZTTMi g==; X-CSE-ConnectionGUID: OVjCLDqlSFW2pGDTY1MIlg== X-CSE-MsgGUID: xCnUw1JrRL2IW6jfHxJ6Tg== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="67892975" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="67892975" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:11 -0700 X-CSE-ConnectionGUID: Qkn6DZO5Rceyyp8KD2OnrQ== X-CSE-MsgGUID: hAjIabqjQHemJifWFRIz7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,269,1754982000"; d="scan'208";a="186119255" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.124.240.28]) ([10.124.240.28]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:02 -0700 Message-ID: <5eaab97d-30c3-46a5-8be2-2ea1ef28e71e@linux.intel.com> Date: Fri, 31 Oct 2025 16:58:59 +0800 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 18/28] KVM: TDX: Combine KVM_BUG_ON + pr_tdx_error() into TDX_BUG_ON() To: Sean Christopherson Cc: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Paolo Bonzini , "Kirill A. Shutemov" , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Ira Weiny , Kai Huang , Michael Roth , Yan Zhao , Vishal Annapurve , Rick Edgecombe , Ackerley Tng References: <20251030200951.3402865-1-seanjc@google.com> <20251030200951.3402865-19-seanjc@google.com> Content-Language: en-US From: Binbin Wu In-Reply-To: <20251030200951.3402865-19-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/31/2025 4:09 AM, Sean Christopherson wrote: > Add TDX_BUG_ON() macros (with varying numbers of arguments) to deduplicate > the myriad flows that do KVM_BUG_ON()/WARN_ON_ONCE() followed by a call to > pr_tdx_error(). In addition to reducing boilerplate copy+paste code, this > also helps ensure that KVM provides consistent handling of SEAMCALL errors. > > Opportunistically convert a handful of bare WARN_ON_ONCE() paths to the > equivalent of KVM_BUG_ON(), i.e. have them terminate the VM. If a SEAMCALL > error is fatal enough to WARN on, it's fatal enough to terminate the TD. > > Reviewed-by: Rick Edgecombe > Signed-off-by: Sean Christopherson Reviewed-by: Binbin Wu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2356CCCFA00 for ; Fri, 31 Oct 2025 08:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uMlHlu+FsqOia2f6D8KoapazM+OvKidIU8Ci1ZTd+u8=; b=DS1M0ncIgK1M2N xpkn35TmP67VuKGdySWwDC/5vhkFe4cr77j+2m/KACQXIiYewWj2mccOUrocGNhOVv66IkklOp9pd E1DYmNMyKOw8WNhjzrZWlaR7kEUxw7X4ZZt6ZlR5e2oBJiRKVT2gTnRv5/+F+s+y2My1V/mS6RAqe M8+X67fkbV02//t20EAKFskti8NSgJCoVYAEU+xyyhLnGyehL0FQTj8qRR8FMCwhZenr98927WWy9 Mo1w05J+Uh5JeGPSXPN2VVHRX3RSrOL/+I8oKEJ/yrVPfhxTx/inhTOEfO+pqUQskUwoRBa/TtBZk huIsARdmljx/lA/aGHXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEkyZ-00000005jOr-2296; Fri, 31 Oct 2025 08:59:15 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEkyV-00000005jNH-1sHM; Fri, 31 Oct 2025 08:59:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761901151; x=1793437151; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=14teRbdSNDZoo6LY1BdIEFiTD+Kt/E9bpeaMX41fhsM=; b=ZaJZCK5NvAhuyMYg6HJmSMLjm1NwHD/SXEx32GGuB6YLCCY3iTCkV7rR 522S2gQp49wj8A6Q5v6hN1xwQZwZjyFlSj+FnJc3E1lu1m66LiP03SfWU HIufguom79ZKqv/4m7/Zt9X/QTSBMGmZWFdhed0Xid4Bj252T5qLAOCmv vC8F0lOeUaAaLP6b8qwywpSbg4s/ViE83Kv9sFVKFmAb4RPsi2B5+BemM KWFAZJIDyNVDZc4vzuxVcl+rQKUNtH0v81CzrTSHGBS+5QhV5F8IZpgSg Cdpdndq7sHsi/KhOiMgMeKugfYDMLHVP1l7ClRgbusZQiozP+NRmBLZ12 A==; X-CSE-ConnectionGUID: fUixyae/RYS8DX9U1J49bQ== X-CSE-MsgGUID: DA37wERATc6B/St4H3Dy6g== X-IronPort-AV: E=McAfee;i="6800,10657,11598"; a="81685946" X-IronPort-AV: E=Sophos;i="6.19,268,1754982000"; d="scan'208";a="81685946" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:11 -0700 X-CSE-ConnectionGUID: Qkn6DZO5Rceyyp8KD2OnrQ== X-CSE-MsgGUID: hAjIabqjQHemJifWFRIz7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,269,1754982000"; d="scan'208";a="186119255" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.124.240.28]) ([10.124.240.28]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 01:59:02 -0700 Message-ID: <5eaab97d-30c3-46a5-8be2-2ea1ef28e71e@linux.intel.com> Date: Fri, 31 Oct 2025 16:58:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 18/28] KVM: TDX: Combine KVM_BUG_ON + pr_tdx_error() into TDX_BUG_ON() To: Sean Christopherson Cc: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Paolo Bonzini , "Kirill A. Shutemov" , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Ira Weiny , Kai Huang , Michael Roth , Yan Zhao , Vishal Annapurve , Rick Edgecombe , Ackerley Tng References: <20251030200951.3402865-1-seanjc@google.com> <20251030200951.3402865-19-seanjc@google.com> Content-Language: en-US From: Binbin Wu In-Reply-To: <20251030200951.3402865-19-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251031_015911_734247_9721CB54 X-CRM114-Status: UNSURE ( 6.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 10/31/2025 4:09 AM, Sean Christopherson wrote: > Add TDX_BUG_ON() macros (with varying numbers of arguments) to deduplicate > the myriad flows that do KVM_BUG_ON()/WARN_ON_ONCE() followed by a call to > pr_tdx_error(). In addition to reducing boilerplate copy+paste code, this > also helps ensure that KVM provides consistent handling of SEAMCALL errors. > > Opportunistically convert a handful of bare WARN_ON_ONCE() paths to the > equivalent of KVM_BUG_ON(), i.e. have them terminate the VM. If a SEAMCALL > error is fatal enough to WARN on, it's fatal enough to terminate the TD. > > Reviewed-by: Rick Edgecombe > Signed-off-by: Sean Christopherson Reviewed-by: Binbin Wu _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv