Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2356451rwb; Thu, 29 Sep 2022 09:10:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4S6Xs1TvQbnq8AZ0jE5t4azzj7PxLQtu02QVaQkvxeWaSbuTr6O+dladfx8pZxRnT6eJYy X-Received: by 2002:a05:6402:1c92:b0:456:f10c:a499 with SMTP id cy18-20020a0564021c9200b00456f10ca499mr4039244edb.197.1664467837050; Thu, 29 Sep 2022 09:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664467837; cv=none; d=google.com; s=arc-20160816; b=ZP/aAKR72paWS9d9j7KGGfJPNCoq8kycUQsYEpsLRB8M+2jS2U80BZ38LqIhH4QJ16 Q1lhPQbZ15NaGzBsD6UTwWudwFIlMKiNbaf6YWTSEKkpe7vl6rd+2aO8bRQertMrvNAU fuvvsOlsEtIl/dxWcUTjQpXgqfA2T4U6sbPGOc2omtiKFC1977Mbj0Zskl+JmSNhEOlL SSAGoExl1qfsMURqS15mYgNrX8Ke1W5M3EP0Eyi+rJxVODNiYx3u+3nlXUZgQ8G5baF7 kB4+ZS2kNLNfE85muutqO7AnKSNUgynDlvrtL3ue5TvAGjDFJdAEVWqMelAaf/to1tPb Gllw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=+7i7NuFKRtomgfB7uUwJKTVpcPqltOz3E9iNJjBurPY=; b=IApRZ3rFQq257cIDN+Hv7sjjV1egyQMeWJx5dS/vizLKmCoBkKM7USZ6xZRuzEl59h 7GvI54UAD5M6oEBpXc1EraRAZbhI1Ga72iM5dkZQA+PnnvaFnrQ7n8vFRkkaszX2Y137 7I5wlN1v9yYF+MT8R2vIJS/zcAvKjkkl3JrmGJ+3k9lM+9unhpdqopFd9ux8bccyT9AX 6E0y3e5tMMHiUo+LOl3o1TnyFYe5oL4NyCp/CqK3lK2HfTSYVbL0viX3IKqJxt6CFj55 8/Q0dNE65/3HUaaHFQGxkLuxg+Z8L/TwnA0fx62lS2qHKgZ7eCP8FgurQXPrJuAEeJQU Z/ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fk8-20020a056402398800b00456f51ed614si8920928edb.361.2022.09.29.09.10.10; Thu, 29 Sep 2022 09:10:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235210AbiI2PuJ (ORCPT + 99 others); Thu, 29 Sep 2022 11:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235025AbiI2PuG (ORCPT ); Thu, 29 Sep 2022 11:50:06 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B1F71F62B; Thu, 29 Sep 2022 08:50:01 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1odvnS-0005cZ-5r; Thu, 29 Sep 2022 17:49:58 +0200 Message-ID: Date: Thu, 29 Sep 2022 17:49:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US, pl-PL To: Paolo Bonzini , Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20220927152241.194900-1-pbonzini@redhat.com> From: "Maciej S. Szmigiero" Subject: Re: [PATCH] KVM: allow compiling out SMM support In-Reply-To: <20220927152241.194900-1-pbonzini@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.09.2022 17:22, Paolo Bonzini wrote: > Some users of KVM implement the UEFI variable store through a paravirtual device > that does not require the "SMM lockbox" component of edk2; allow them to > compile out system management mode, which is not a full implementation > especially in how it interacts with nested virtualization. > > Suggested-by: Sean Christopherson > Signed-off-by: Paolo Bonzini > --- > The patch isn't pretty. I could skip all the changes to add WARNs > to called functions, but the point of adding the config symbol is > to make sure that those functions, and all the baggage they bring, > are dead. > Out of curiosity: why the SMM support is so special that it's worth to add a dedicated Kconfig entry for it? After all, the current typical way to disable stuff (for testing, etc) in KVM is to provide this possibility via a kvm module parameter. This way it also can be switched on or off without having to rebuild the kernel. Looking at the patch it doesn't seem to disable that much of code (like, significantly slim down the binary) and where it does disable something it mostly relies on compiler dead code removal rather than explicit #ifdefs (which would guarantee that the disabled code did not end in the binary). Thanks, Maciej