Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2912211rdb; Fri, 22 Sep 2023 11:48:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFePRuwPNVCw5sis4Z80M6D8pJALnuo48YvzUjbjTGilhWn/dcZLbfOEJoDfMICGtHioBps X-Received: by 2002:a17:903:24e:b0:1be:f45c:bc38 with SMTP id j14-20020a170903024e00b001bef45cbc38mr395721plh.2.1695408489134; Fri, 22 Sep 2023 11:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695408489; cv=none; d=google.com; s=arc-20160816; b=flGAfdn07cJc0cYXAYeQNey5uLWXPhnhS4Z/Mucgtm2KNdsS1q36Td0XnRQu5u40m5 84/pf5wO9xVnJjnHt6onS0sDtDdn5bL/RGYySS/xiZJ7KIoCcU8N6yC6oy923TIbQ6bU XFVLH/bEaUGs4papg8h6/BoJFNukHV60YmXUFxBf1wnk1ZbckTR7X2v1+RC4pnRmXTjI 3ETiPm2QOu0PvqxvHTQBOllmLdLRLBeYpL5biwJJPmzJx9KF4fknwThccdcvlyi6dCdZ 3+i5AsDiDqZCbf+ZaGhKVsinqufQQf/9mNHH9ba8zw+I+MzwUoOPVy9mceNL2RhNbGw1 TSqg== 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; bh=uy4Qx3oAlemzZ68pG10cO3ool7kPh2NALLfQXvvFL/M=; fh=dz0QZA+SovQaB8O84ZCkIDLREfHgRE0YXigGW5vUkjg=; b=06YEDo/3+rTdFakcXmFqp60LhrHfzaq1p1o8dQ4sTe5EjxgPbtxEiR6JO5ZU00LPdl vHruvAxCMGK8XmLgCeIBtRm4PqOM4uYFkCnhrm9yPGj7ywzZP8jfBmzoqL6Wpsa++osl iP+7maof2FqzvWSgEUG/2FMBGLoBpLIdrbAUnVoF20XhrvBTTCKqzpLY5qvFyYhTr9gA vz1JJaX8s+Lg+aF8AOw+MwwN5k21wUMQ2jVLWfmPrZiDzq2VaVEwULdLRFxN2+4Z8VKZ vfZMuSemZwfozAz/s5W2f65E/U8A8BTfPR/ew9RPOYbllu5WYo4Oh+ZRSed3rQ9ctZMu 3aWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id iz19-20020a170902ef9300b001b9be3b94dfsi4060941plb.268.2023.09.22.11.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CB604832F641; Fri, 22 Sep 2023 11:42:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232403AbjIVSmq (ORCPT + 99 others); Fri, 22 Sep 2023 14:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbjIVSmp (ORCPT ); Fri, 22 Sep 2023 14:42:45 -0400 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815DAA9; Fri, 22 Sep 2023 11:42:39 -0700 (PDT) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1c3cbfa40d6so22975025ad.1; Fri, 22 Sep 2023 11:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695408159; x=1696012959; 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=uy4Qx3oAlemzZ68pG10cO3ool7kPh2NALLfQXvvFL/M=; b=H2pbrAMvmp8v/KmbukUu/IxvsRmZB1t7TwZCQVN0Sc8XFsyqE7dt6JE1po/DS2Ht5A AOKOflk+ncq6YqNGDxLBxE+HMcyBJFrTqRTVBErAGZFVG3GEkRH+b9MKT+U0jgQ31jGJ Uwbi7f6INYV7AuRzCSifMjtZCZsETV4rbKAj6yVRpvcSt9VuhqiCtHSLuj3kjktOW2/d OB7nHh+1pFnn5AzyKa+I8UPrjMU2h55G8/4eCS5VVzZ6R5w1mv9Mjdagol/nas0ZLrlM v4HJRvOnF0t/gM+HarXQrUy9qIC3WTGgGl1L1/KZXvE8zLkJKTCcF2k5zlqtw0YQ/59B ndBg== X-Gm-Message-State: AOJu0YyEGHIzEJ6N8s+UFqelRvTEURXeVp3GZm1mseFkHCpHEo6zySPG nvgbiNivJA6csWnifL4NBnfEHjyCOME= X-Received: by 2002:a17:903:120a:b0:1c4:2641:7744 with SMTP id l10-20020a170903120a00b001c426417744mr332698plh.25.1695408158778; Fri, 22 Sep 2023 11:42:38 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id l20-20020a170903005400b001bc18e579aesm3831240pla.101.2023.09.22.11.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:42:38 -0700 (PDT) Date: Fri, 22 Sep 2023 18:41:55 +0000 From: Wei Liu To: Saurabh Sengar Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com, vkuznets@redhat.com, ssengar@microsoft.com Subject: Re: [PATCH v3] x86/hyperv: Restrict get_vtl to only VTL platforms Message-ID: References: <1695182675-13405-1-git-send-email-ssengar@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1695182675-13405-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 22 Sep 2023 11:42:55 -0700 (PDT) X-Spam-Level: ** On Tue, Sep 19, 2023 at 09:04:35PM -0700, Saurabh Sengar wrote: > When Linux runs in a non-default VTL (CONFIG_HYPERV_VTL_MODE=y), > get_vtl() must never fail as its return value is used in negotiations > with the host. In the more generic case, (CONFIG_HYPERV_VTL_MODE=n) the > VTL is always zero so there's no need to do the hypercall. > > Make get_vtl() BUG() in case of failure and put the implementation under > "if IS_ENABLED(CONFIG_HYPERV_VTL_MODE)" to avoid the call altogether in > the most generic use case. > > Signed-off-by: Saurabh Sengar > Reviewed-by: Vitaly Kuznetsov Applied to hyperv-fixes. Thanks.