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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30397C433F5 for ; Mon, 18 Oct 2021 10:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F789610A6 for ; Mon, 18 Oct 2021 10:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbhJRKzz (ORCPT ); Mon, 18 Oct 2021 06:55:55 -0400 Received: from mail.skyhub.de ([5.9.137.197]:43220 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbhJRKzy (ORCPT ); Mon, 18 Oct 2021 06:55:54 -0400 Received: from zn.tnic (p200300ec2f085700846cd5acb237d67e.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:5700:846c:d5ac:b237:d67e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0A0601EC01DF; Mon, 18 Oct 2021 12:53:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634554422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=4nuTuWqK/08nFLEj5f2FRFTNFNDe0ksMTiDCZVgq+Gc=; b=Iqq5tQFZlbXKgm5HkArnT4BHUPe+d0ENpAgjLLszm9vx5V2W7Dw/763al/WYgAnKcT9L3q 3KdzL8n1fWr6xta49tO9XyzjrPf7plrCtZCorYUmcco6dy2ePOElCslVbuXHaQHIDFAoOr eLEAb2UgmI81tz1VncC31/TPJfQaDSI= Date: Mon, 18 Oct 2021 12:53:40 +0200 From: Borislav Petkov To: Dave Hansen Cc: Kuppuswamy Sathyanarayanan , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Josh Poimboeuf , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter H Anvin , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 06/11] x86/traps: Add #VE support for TDX guest Message-ID: References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-7-sathyanarayanan.kuppuswamy@linux.intel.com> <5b7f13b9-6d32-c97c-aaea-4e256a59f90b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5b7f13b9-6d32-c97c-aaea-4e256a59f90b@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 17, 2021 at 10:15:22AM -0700, Dave Hansen wrote: > I think it's equivalent to something like a 'pt_regs' or 'stack_info' > that we pass around in other exception handlers. It's always stack > allocated. It's never dynamically allocated and NULL is never passed > for some other semantic reason. Ok, but why is adding that check such a big deal? Are you saying that nothing else will call tdx_get_ve_info() in the future so we should trust the passed in *ve pointer blindly or should we simply add that cheap check just in case. I don't mind having it without it but wondering why a little defensive programming is a problem, at all. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette