Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3861536ybt; Sun, 5 Jul 2020 08:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0yWUJbthL/m8n9jvO16G8Uc3ql/vpZIui/1hfhLhT4nfzsD0eTUA8XclpRx8hOAdz+ycY X-Received: by 2002:a17:906:46d1:: with SMTP id k17mr39543087ejs.446.1593964668758; Sun, 05 Jul 2020 08:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593964668; cv=none; d=google.com; s=arc-20160816; b=mozh/cjm+2H02R3pFRp3Ny9apKaPQtZnlDckTMU7wD4wUBQV9VN8Iwzu5NtOOteW3k xoxRXB2JE/aMkdCl7KN/v4fb5QWd8/T3GNU6jnKTfhPtih+dv9lhYyoZ2LQXvwT2pXrj 2Qbv6GBLhXF0FwGqI02BOcGvZ0X74+XR5txiW31TSPc7OcCrEk3UnNIMeclzjTni1mPk aGTtywSPium2t+uL16gEgzurcTw2RMFDN1zy4u9RfgbQKDXZ/1WMSOMSN/2ULl+JAH8X wHj16Kd0Mdhad1HXbxt09AEIJrcQh+ydz3eFoCDJTQITVqeI1dGZWvM3qwi87Yv4XQQd riYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=/GJsuCT73gLGt03xxtSABG0dllJoj9gjPgi6ZNtIWaw=; b=gVetPa2giLeGHrCoq91xwPmbC1OgbKeriYYOuSn3sT2/SPQZoobAPSEEA5SP2wN7a5 Mdv6T3FMfHIosnip0DnFTmlrIC5UKdsy0tZVK9MXsnffh3qbJ5X/2BFC/mWFv6uKQxnv Qx8zM4N4OoaCx34O7KYsTkfwFuOD3IKv4kSMy/yjj6+DISFgnmtI5l49Cl6Z/cHhRtZS cJQMDU8CkqfAixc93XCjtHPGOmI0Lj98IxxBq87OZCoHt4aI9t6rob2e+/qIOO/8xFC7 /ffttID2BD4yNNTlV7jxTLCdEqMKXlZpK0UNAZ9AvDIwMcSYlYkE++CJgeZnijHdjY77 qR2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MCD0MNCQ; 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 l17si12427829ejc.174.2020.07.05.08.57.25; Sun, 05 Jul 2020 08:57:48 -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=MCD0MNCQ; 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 S1727898AbgGEP5J (ORCPT + 99 others); Sun, 5 Jul 2020 11:57:09 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:49011 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727843AbgGEP5I (ORCPT ); Sun, 5 Jul 2020 11:57:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593964627; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/GJsuCT73gLGt03xxtSABG0dllJoj9gjPgi6ZNtIWaw=; b=MCD0MNCQB6C8hD7A3Y+NMtqLp6v2BM6VmS3LT4xGgJcKJgYrLnELMMnzWFOSTvj+WXnvUA ZKY5GvdH8iD1iZDVO64esmcSAp16VtGOmsAZWc6Pbtm+NngjS3bpguTlCih5+8Zy/a0KYJ TkPX9ShEMBQquLc+/opIUihQm44lQP4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-XTFwP_eyMtGf0BAc5FQEdw-1; Sun, 05 Jul 2020 11:57:03 -0400 X-MC-Unique: XTFwP_eyMtGf0BAc5FQEdw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9145918FE860; Sun, 5 Jul 2020 15:57:00 +0000 (UTC) Received: from llong.remote.csb (ovpn-112-238.rdu2.redhat.com [10.10.112.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 752B87BED0; Sun, 5 Jul 2020 15:56:57 +0000 (UTC) Subject: Re: [PATCH v3] x86/speculation/l1tf: Add KConfig for setting the L1D cache flush mode To: Mike Rapoport , Doug Anderson Cc: Abhishek Bhardwaj , Anthony Steinhauser , LKML , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Jim Mattson , Joerg Roedel , Josh Poimboeuf , Mark Gross , Paolo Bonzini , Pawan Gupta , Peter Zijlstra , Sean Christopherson , Thomas Gleixner , Tony Luck , Vitaly Kuznetsov , Wanpeng Li , kvm@vger.kernel.org, x86 References: <20200702221237.2517080-1-abhishekbh@google.com> <20200703114037.GD2999146@linux.ibm.com> <20200705152304.GE2999146@linux.ibm.com> From: Waiman Long Organization: Red Hat Message-ID: <5d2ccf3d-b473-cf30-b863-e29bb33b7284@redhat.com> Date: Sun, 5 Jul 2020 11:56:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200705152304.GE2999146@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/5/20 11:23 AM, Mike Rapoport wrote: >> Nothing prevents people from continuing to use the command line >> options if they want, right? This just allows a different default. >> So if a distro is security focused and decided that it wanted a slower >> / more secure default then it could ship that way but individual users >> could still override, right? > Well, nothing prevents you from continuing to use the command line as > well;-) > > I can see why whould you want an ability to select compile time default > for an option, but I'm really not thrilled by the added ifdefery. > It turns out that CONFIG_KVM_VMENTRY_L1D_FLUSH values match the enum vmx_l1d_flush_state values. So one way to reduce the ifdefery is to do, for example, +#ifdef CONFIG_KVM_VMENTRY_L1D_FLUSH +#define VMENTER_L1D_FLUSH_DEFAULT CONFIG_KVM_VMENTRY_L1D_FLUSH +#else +#define VMENTER_L1D_FLUSH_DEFAULT      VMENTER_L1D_FLUSH_AUTO #endif -enum vmx_l1d_flush_state l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_AUTO; +enum vmx_l1d_flush_state l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_DEFAULT; Of course, we may need to add a comment on enum vmx_l1d_flush_state definition to highlight the dependency of CONFIG_KVM_VMENTRY_L1D_FLUSH on it to avoid future mismatch. Cheers, Longman