Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2876608pxb; Mon, 18 Oct 2021 03:55:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZt1oX4kHygFeq6x6cJ7yghD3HTFCHLOwaOc31Kz8rVEAOfvo9hxlGMCaV0P4a648ZrLH1 X-Received: by 2002:a05:6402:410:: with SMTP id q16mr44787075edv.286.1634554549980; Mon, 18 Oct 2021 03:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634554549; cv=none; d=google.com; s=arc-20160816; b=quWPAz3L9BPjyPAR8nACttImHF42UnSsXYApW/jCgTGlwyLSgGM2aVkI4iw7mSgyHe FxZgiRHTUUkz+oNeU7LE07DmmLgoL9uVUFt6k+B1J8WMHnQHUwIeZKMY0ujCUPVMBWKF YaYSi4fDRqRhKmIbzpSXRUfJuptSmbrt3rn8/uSS9rwgKkIgfYJgA5cPUvO2dNF87cLM fBcwwHCXCIED83lzT7/OO0Dp2ON8NxwkLWaXnJMnrtDKwVx/2zvpo2huQhoNnWZGYIID MrDeLPa+t0V1R5q5vM4WnoKPxA+Zndbv+/AYNYLXiwe1bNJMj20jMOCDHKzyIWzmJ27K 7bIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4nuTuWqK/08nFLEj5f2FRFTNFNDe0ksMTiDCZVgq+Gc=; b=MWPBL/8jZVhsdV32G1rObcxhWu7r3bP8wYpqtlZz8kSf5Rh5dd2JFGdqnxaGJAjNgX 8b1cnRzxb16lw3ZlevRo4m/IHuHLOifQZ/NS9DLQPEigzJuFpp+LjLexwGrEbwT50FNt WiGJmdBv2rA1NRoFjUeQjEYIVmy6CfsNG7gzNySerLnv2c7octEujlEp6pPS67U8NC5V 4h3kfTzhjwnWyU3G+LxcpFHy6bxipkQCHdw3GsUCaBza2Wt73WZ6TzVFtJUVsam/JUCI pkQ/cEkbJa6O7z15j2yi6qtTz1BVM0AqrEL0wovFhfqw/VL24lYFRJG+JbG0zpYBohfc aXXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Iqq5tQFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd37si24538395ejc.597.2021.10.18.03.55.26; Mon, 18 Oct 2021 03:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Iqq5tQFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbhJRKzy (ORCPT + 99 others); Mon, 18 Oct 2021 06:55:54 -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