Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3704321rwo; Mon, 24 Jul 2023 15:35:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEkYEhnjyE1EoNVCsD8W55I2A0V/e9bMtlL0O/9hMJLBPrYD1jEXZUq5zQjHaCOyCCIvGX/ X-Received: by 2002:a2e:94c2:0:b0:2b6:a618:9f3b with SMTP id r2-20020a2e94c2000000b002b6a6189f3bmr6368028ljh.24.1690238111423; Mon, 24 Jul 2023 15:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690238111; cv=none; d=google.com; s=arc-20160816; b=SzZjJAs+Np6EuvhCC1G1K5pSIW4z/EQ7ru9EqTK9upt1dyNwUEAYNE1BKDzioUgdTO Zo6w/4wyGvw+27xYs7r3q/fOwz/Kxm6tYZagj7yTHHJWoWxdN8kBdyQTGA34ksOmcr2a CGUzxOh2wPGxJloEfp+Z2U3W2pDS0eVk1NqDYNuy9fphB3+9pUCvP5AEsSKytIgewb3C wSyD7Z1VoZMgWR5aSa6RV5KAIrwi9AXSnpVaHnmCJx90HgivOALFTt8aLJnaC9ZnLZCD 5RtsHilF3WO74BHc7Oqq2rQmH18Sc1UR3XtCRYEm8NTH6+gdRBWqQeavWqPx9s8gEx3T LS/w== 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=0fbW2p4gExV+dRAH4t+fQv6KZU5wysFEgmsKG6RQE3U=; fh=4/A9k+Sq+1fNVirx4K0oSXBvJ54kVoGKq+sS7G60SdA=; b=Qo2ybfM/US3apY4Ahvea3M2IzXpu3XEmRy4Js5KOtrqefo7voBQG5qQwls91wNYp4N ZoZDG4KtgLQfFmnFPz3BVr4GyMIk2TRyx8LpMpm8nMEoja6TtWCeWQgoTGLgknBnwAm7 YuSzpHFzz1MD0+X7qidWJ2LEsFiVI8ge4nC5qwZv2VkaPEq198m26pUvbeFQt+rqoLpP og5ZXapdkCzrYy07lKzZNcJJCStICqQoxqqDRnnaDwWoW1NkS9CHPwc18BD7ac7Bb6AZ WII/CAvf/ccci2vIGPhZuNdPUUBp16YrEDGts04RsmoSb7NxzL2b/1RppEd9jKqamDBV uUeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eqCyZWOg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kg20-20020a17090776f400b009930a6c0b51si7049304ejc.379.2023.07.24.15.34.46; Mon, 24 Jul 2023 15:35:11 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eqCyZWOg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjGXW3l (ORCPT + 99 others); Mon, 24 Jul 2023 18:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjGXW3j (ORCPT ); Mon, 24 Jul 2023 18:29:39 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05D2C10D; Mon, 24 Jul 2023 15:29:39 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6bb07d274feso3750457a34.0; Mon, 24 Jul 2023 15:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690237778; x=1690842578; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0fbW2p4gExV+dRAH4t+fQv6KZU5wysFEgmsKG6RQE3U=; b=eqCyZWOg1GYQ3NPxLmzBkap7N3a53wSFZ6D3WxNgefFC/Il/js96yWptfpIw1LnBdZ L/5QQwbRc7wR5+wu89/sT6o2li0tdybpCZHKjSuSH7+soU0MeKyR8MH30vKrXSjNol0M MpgEEkYILch9P2MMHlkCIHIi5VS31ZmePmvtLiYVTvXFjpavhAW+bkEYu3ZWBtpQtdZt oo7QLftbpo5ZnS0fqfrUqj1aE1FAymjX7lV/pReTUs0fimo6OX5ZW8lLCNDZNGKpgOIX EXHoCh/Qh5fxlQk1YHQSDSma4WFOYWN/gyI9YvcuitWR7WjUl4RxLzgEsBY/xVR00asP /NUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690237778; x=1690842578; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0fbW2p4gExV+dRAH4t+fQv6KZU5wysFEgmsKG6RQE3U=; b=Q/TGh73QgQick6jeJzbEE1hNtV1ZhUMKw5fBOClx9q+YlZmqo2FOxcpaOBr7Q8/6Pj cjkyh3Fkx0YEZcsYY95jqpGDmuMxRVLI8TEka/AYe7DDj3lYAt6ZN6FzyoVA7uZA6IMU Mxq6e5SK+K1ZOVEd/obTKFBYYQ/+Z7++75kDsx04RmK70J/i28pV9j1VcWCGTm33b6d1 hQthR2t5/PzQlSnl63f3p/Kt4I3RvWwmbW53oGlKmxJGHO+qSHEGcqxf/IoMvrOGtppO v9omTCw4GszAZ9rGiYEbLx7akmIjyGE02ZE74NVLIy5d7VzXcFl/3LALDb+noxQ4VzxM 0ZEg== X-Gm-Message-State: ABy/qLYgYdgTJj+l9lvk1XADFRacAV3rhQcrro3cqmS3ryce10AX6lIh g3JBG6zV8To3/8fD2vaR4m4= X-Received: by 2002:a05:6358:9212:b0:12f:213:b558 with SMTP id d18-20020a056358921200b0012f0213b558mr6623406rwb.22.1690237778128; Mon, 24 Jul 2023 15:29:38 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:9d8f:da31:e274:eeb5]) by smtp.gmail.com with ESMTPSA id q11-20020a638c4b000000b0055b44a901absm8991765pgn.70.2023.07.24.15.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 15:29:37 -0700 (PDT) Date: Mon, 24 Jul 2023 15:29:34 -0700 From: Dmitry Torokhov To: Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Andrew Cooper , Kai Huang , Chao Gao Subject: Re: [PATCH v4 14/19] KVM: SVM: Check that the current CPU supports SVM in kvm_is_svm_supported() Message-ID: References: <20230721201859.2307736-1-seanjc@google.com> <20230721201859.2307736-15-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721201859.2307736-15-seanjc@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FSL_HELO_FAKE, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Sean, On Fri, Jul 21, 2023 at 01:18:54PM -0700, Sean Christopherson wrote: > +static bool kvm_is_svm_supported(void) > +{ > + bool supported; > + > + migrate_disable(); > + supported = __kvm_is_svm_supported(); > + migrate_enable(); I am typically very wary of the constructs like this, as the value returned is obsolete the moment migrate_enable() happens. Is value of "svm was supported at some time in the past but may or may not be supported right now" useful and if it is then could you add comment why? Thanks. -- Dmitry