Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp502078pxb; Wed, 6 Oct 2021 09:22:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAR9tz3ec9/c+tSqZEt61fYrqbPFX+mWhSMkNRA6JTX1T4eSoyZsjLZ2SJt9O+0/riXUFA X-Received: by 2002:a63:4c55:: with SMTP id m21mr12117829pgl.126.1633537345160; Wed, 06 Oct 2021 09:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633537345; cv=none; d=google.com; s=arc-20160816; b=wqTKgujZ6UbruMGn8vAenCuxikZEu41AbqEsZMRus/5m1PA85nPA2VWvqr75+qjdQy NLmKWcMZo0HiiO9p5MY6SmwAeGy8vgaBIaPeMHOSFD7m6HwXf7JQWt5CrNOjMCCLscok fCpS1awUzlk5Lbu4zSGvF635JzMH9OeOAx4eV+xIp6JwI51q2FPv9ne388d9uMvjdL0J LCp/FmfUPBbFmrvReOXqjyIPv+DQ25Kqsv5lhkqVSf/HPC18fd9lcfe7sm8pMCDg097w ND916gQjglad2J8ossm8Gmt1loskoxXLf1AlGBbJZg83ZBdP1OgXzwsB6ka5QHQ5btXX EFbw== 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=1xddPaZ1UE7THsd1YqIakKfcdzE8fDpzy5AsfG2miN4=; b=zGg7gZt2eMdqG36Ch1BiJ+76BMCEvJZNh5LLkRDTS1B5cJrVnld6TdYxjTR19ETFNk fzTdn2LCeshMbKt8EP0KuPCmyg0r6xJVPlViHjOXKm7hKMJC3wwZgFMz/7qb7ITmG/0e pjK3hFHdOwg8SSmkX1wYDmc5bZZP+NPryA6tj4yUwsZV0Rgk1FdcuJecggxCTU+5LgkZ Qc0r+5cKcu2JVPdKXmrUHnq4UHNeCgWpe3ElmU5zI0rReo7gNRj2FgPZBkL/CTxAghPd qCTTACQzrSVX5MxNzRxeftWjKEHxVYwOdc7iMmL/tXHnevSA7X3xQnyz1Ye63Nsvacze +JYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=QLWmuk0s; 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 z11si26079607pla.170.2021.10.06.09.22.11; Wed, 06 Oct 2021 09:22:25 -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=QLWmuk0s; 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 S239411AbhJFQWl (ORCPT + 99 others); Wed, 6 Oct 2021 12:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239381AbhJFQWk (ORCPT ); Wed, 6 Oct 2021 12:22:40 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC30C061746 for ; Wed, 6 Oct 2021 09:20:48 -0700 (PDT) Received: from zn.tnic (p200300ec2f0d3600bdb6aa8687ce684e.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:3600:bdb6:aa86:87ce:684e]) (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 8AB881EC03FE; Wed, 6 Oct 2021 18:20:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1633537246; 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=1xddPaZ1UE7THsd1YqIakKfcdzE8fDpzy5AsfG2miN4=; b=QLWmuk0sdHDEvg0dsydydUF1AtPZ3u7XXbFpiRqFIAnspA+EdtJ5Ld/Bb2jN1MwG8rkBkD HhDaO3QAc6X/p4ioCRW98ueERjbzmZs8l+TVt0ijXuVj3a5cQ7yqEis3nbKxsXGSKQMXhW VEqxddiZc8nTYsEcVlwQIzcwLzzSqm0= Date: Wed, 6 Oct 2021 18:20:41 +0200 From: Borislav Petkov To: "Kuppuswamy, Sathyanarayanan" Cc: 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 , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 03/11] x86/cpufeatures: Add TDX Guest CPU feature Message-ID: References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-4-sathyanarayanan.kuppuswamy@linux.intel.com> <328cc0e7-89e7-a1b2-f798-fe758c2c1f4e@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <328cc0e7-89e7-a1b2-f798-fe758c2c1f4e@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 06, 2021 at 08:43:48AM -0700, Kuppuswamy, Sathyanarayanan wrote: > Yes. But, Joerg Roedel in his review recommended using variable > similar to sme_me_mask to avoid function call in Intel platform in > cc_platform_has(). That would normally make sense if this were a fast path. But I don't see that being one. Besides, the subsequent runs will be the function call + a couple of instructions: # arch/x86/kernel/tdx.c:22: if (tdx_guest >= 0) movl tdx_guest(%rip), %eax # tdx_guest, testl %eax, %eax # jns .L11 #, ... .L11: # arch/x86/kernel/tdx.c:23: return tdx_guest; setne %al #, # arch/x86/kernel/tdx.c:35: } ret which is not the end of the world. And it if it is really used in a fast path, then we can do a static branch etc. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette