Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp22124pxb; Tue, 5 Oct 2021 22:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7IYLfe5Xei8TVEuRLW6vzq45x/2f9YALuUXt99jsGnH54OoaLntFhspotoJU8KiLBWagN X-Received: by 2002:aa7:8b0d:0:b0:44c:89ca:7844 with SMTP id f13-20020aa78b0d000000b0044c89ca7844mr5380509pfd.19.1633496709386; Tue, 05 Oct 2021 22:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633496709; cv=none; d=google.com; s=arc-20160816; b=PAX2aphVq9mtMQ9a8HfJbF8jJbtY4sV4vi6u9JXvG+ZpgDKtks5at6fdngFp10zhDU z8SkA6vFQ78Yit2JyejxPDt1GxUfR6eZR765kv54zZoU32KnF1ZVolIPQmtGGtJD7vgo CGYFDoVt8SB9QVqHDQGSRkV3kLAmU0x/OS8TaL3FH17AyuRLqpLL9hhmSQbisq/8sdDu xwF81vFLcQ8UysYrmxe172z9zNWDWgNvNClza+Wvu3WNXsG6zkmwH4E4IDx6sx1J/f4+ FtGe98gw4n+nseeiu8vZ+ksLepwLeoXXyTiARVLBkKKffJEf413BKFGuUYTcy4HGBdYe /6BQ== 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=jpUquQ+TSbcBWrdGCbweYOaUjNx4Fqghxa/0j010Ebw=; b=XrvfCjTFqdzqOOlLFfheRuDeKJ/n/C2WGuc59xcQ724Xfl12xkk/hVfk7uS+i5132o e8vOsI7nA25T2UfpSy7WtcVndrWguIj/5JYI6dAImyVQEXuy6Tht7Z6ruyMev7r++Qlb tBj4GLYhG0wwaZkLf5MSu5ATa3aM19EVNbFSsE9MDugd6rFhM8mOttf07U5KNq31ManP nZfnqdaa/WMPbjpmZ+UK+p7iR8lHTVVa98aXl0rviDvKSeE9hamQx3aFatdA2Z4J4K6H 8SaMwYivL9PI3A+GEtf428HOPVVkmdNapLXljfStlQc23+1zQBFVuP+63dLRqkPwWr6x rlxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R8E0JbTw; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l70si12800210pge.80.2021.10.05.22.04.36; Tue, 05 Oct 2021 22:05:09 -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=@redhat.com header.s=mimecast20190719 header.b=R8E0JbTw; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbhJFFFL (ORCPT + 99 others); Wed, 6 Oct 2021 01:05:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40141 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhJFFFJ (ORCPT ); Wed, 6 Oct 2021 01:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633496597; 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: in-reply-to:in-reply-to:references:references; bh=jpUquQ+TSbcBWrdGCbweYOaUjNx4Fqghxa/0j010Ebw=; b=R8E0JbTwSZbbenVNosITNJ9MH50H1h4eY82i5NlvPyLqptKiFIGDqmpkTQgl4oll89Gbst XndgBDgzOzD3dsjuDxS3ZB2ltZFNQH9kZj7XpDeXaRXntUYhCUkbQFomug/K/NHkny6rdT 9BfpkbmGxy3acOANzCJQ5iJ4c+gEAT0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-91-XDlFp0sGNMa4vz7LPlTWeg-1; Wed, 06 Oct 2021 01:03:16 -0400 X-MC-Unique: XDlFp0sGNMa4vz7LPlTWeg-1 Received: by mail-qv1-f72.google.com with SMTP id gi5-20020a056214248500b00382f7a7c7e6so1737559qvb.21 for ; Tue, 05 Oct 2021 22:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jpUquQ+TSbcBWrdGCbweYOaUjNx4Fqghxa/0j010Ebw=; b=gPO6upTHBwTpTBT/Z/H+qM4V2ZSFEUeOPbKk++evL8gTWX9pm0eUXiZBUTABj0Hdz6 6ddl9yEQYYXkoVmFKM24nomjPgktq3pYoF1BSZjxWRJthT0LLIlv6Y23Dro/FjF2Xe3J 4VENH+6SEPlXy3JFI2a2anOKD/KpVYKtefYFdcMe0SpB+XLHbJWkjwg11kz1PWYGNElX aCO0+joJ/rTrR2rHk0pdjk1Wlg+ocEez6UBA7XOF7ldTVbiHRusQzUybJFobsVITU+xT knv11i8kSHbgteFU/kB9sCHpeG4dB4ovj3fmToaArfWkJhg1XEfhfCWMy8DeRppG2Foe g8bw== X-Gm-Message-State: AOAM5314pm+Cizl1tiQz48NO/DMbjen1G1VRQmq1kmOgtNK73WpUliXY 6NQDvXx8pKSDkXwckp/vaxMxVE9GxXCtYYly/1S9Y9OPmCEtQls1y6rTN9W+iNqKeCwX/86SJ6t yW9grtaijrpp3ROjXs11DAhwu X-Received: by 2002:a37:66d6:: with SMTP id a205mr18163175qkc.138.1633496595889; Tue, 05 Oct 2021 22:03:15 -0700 (PDT) X-Received: by 2002:a37:66d6:: with SMTP id a205mr18163156qkc.138.1633496595642; Tue, 05 Oct 2021 22:03:15 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::15]) by smtp.gmail.com with ESMTPSA id l195sm10881615qke.98.2021.10.05.22.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 22:03:15 -0700 (PDT) Date: Tue, 5 Oct 2021 22:03:09 -0700 From: Josh Poimboeuf To: "Kuppuswamy, Sathyanarayanan" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , 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: <20211006050309.ldn5myznmpurnomm@treble> References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-4-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005210423.yfftpxxmj3cjprtv@treble> <15a07997-2659-6be1-b8a3-da57e72562b5@linux.intel.com> <20211006034218.ynamwigsvpgad7sr@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 05, 2021 at 09:33:35PM -0700, Kuppuswamy, Sathyanarayanan wrote: > > > On 10/5/21 8:42 PM, Josh Poimboeuf wrote: > > > is_tdx_guest was mainly introduced to support cc_platform_has() > > > API in early boot calls (similar to sme_me_mask in AMD code). > > > Regarding FEATURE flag it will be useful for userspace tools to > > > check the TDX feature support. > > FEATURE flags can also be checked in the kernel, with boot_cpu_has(). > > Or am I missing something? > > Yes, previously we have been using x86_feature_enabled() check in > cc_platform_has() call. Now with the introduction of is_tdx_guest > global variable, we don't use it in kernel. But I still want to > keep the feature flag for user space use case. I'm not suggesting getting rid of the feature flag. I'm suggesting getting rid of the global variable. Is there a reason you can't check the feature flag instead of checking the global variable? -- Josh