Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4513052rwl; Mon, 3 Apr 2023 06:10:03 -0700 (PDT) X-Google-Smtp-Source: AKy350bqqRXQGGi04u6ASB3TdmCzjIlj2Gg7EN+6WzhxUTb5rzK4iyLzomO+oRm6kKK9nhY899OF X-Received: by 2002:aa7:de0f:0:b0:4fc:73dc:5df3 with SMTP id h15-20020aa7de0f000000b004fc73dc5df3mr35549767edv.29.1680527403609; Mon, 03 Apr 2023 06:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680527403; cv=none; d=google.com; s=arc-20160816; b=bZhf3c6Sr6G17uXqfyPGdPmTFxIske7oi0AqT5EwNlWxxnm3FgqlIt/ffx5jqbaNEO v/LIS7gJuatHaHDqwIgL1nW5n1Ye887a2V4OkOh85TGEdkbKTdI1NFlZnJ8pJNUMb1jQ 9gsa56T6fQ51g6yOBde4HJjf/EjKegDYIRCcOIgbqz7wjcuA0JIICbg9cRckVNf9onDR t/KRuDqT3XUfCQDwno1FbBhk9pk+xb5W9uEoKxqnH5z3vm/7WV5nQgmStLsjEZ+8l+kI Ac/JeZkAtGEewlimtW9YkJrbnW5gSm34DqbLAMMMMi6ohJb657ijblrDXDDbz/txMz1Y lK4A== 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=ExM1Cu+DJCAxzlahZyCX73JV4P0UuXPZJA23inCQoRs=; b=0pvTDHzczRgSi2ZwlErMbIzJX6cE/s09NNrXooffXMck5DwRLgeBkX5fX9VoIqf3lK 3IHDcEtVkXkDEg0L9+rRB8R4TPsUhbq8T1rY0Bx1HfdgM7uVRiQMXiznu8ABN7EoySlb U8L08x4GaK7OQ0ObdvQ4t6adH1IYa9DFXagyxRT3Fp6dBA52GUUpkZ6hYTIjahv5HfdY af6lA/T9S22CA6UxKmlj3DcxMFVIieRda0j+fzXzoyBeKZlptYi8k5rgFaLEBs6mLK+x 9cWBRjVBjtOqaba0ZBWOB/MauWROsT6v9/mXAh5nsiXLSZH41LQevIA5xbMhbNdztAPk W5fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i13zJ0wa; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020aa7d350000000b004bd5e278481si6989244edr.628.2023.04.03.06.09.38; Mon, 03 Apr 2023 06:10:03 -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=@linuxfoundation.org header.s=korg header.b=i13zJ0wa; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232474AbjDCNIw (ORCPT + 99 others); Mon, 3 Apr 2023 09:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231553AbjDCNIv (ORCPT ); Mon, 3 Apr 2023 09:08:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEAA110D7; Mon, 3 Apr 2023 06:08:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4965660A71; Mon, 3 Apr 2023 13:08:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33109C433D2; Mon, 3 Apr 2023 13:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680527326; bh=LAV//JPbB9QVvq/VUV4Ckfl5qCzolGCOQod4gC5PLk4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i13zJ0watYt53sX+Fy1N0c16JMQAbdjExUC21m9z/Srw+VNTZbw+j5VeMdka59AZQ u23bWaMKgVaW3VQqECqfzuTv5hL/evKC1UITFmO7XM5q0JsZcZjg9y6l2p9Ic4hL2t SPtKDuNoNs4pb02/dL5eEcWBAhb+e9U6QPYnukjU= Date: Mon, 3 Apr 2023 15:08:44 +0200 From: Greg KH To: Tudor Ambarus Cc: pbonzini@redhat.com, stable@vger.kernel.org, seanjc@google.com, joro@8bytes.org, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, suravee.suthikulpanit@amd.com, kvm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mlevitsk@redhat.com, joneslee@google.com, syzbot+b6a74be92b5063a0f1ff@syzkaller.appspotmail.com Subject: Re: [PATCH][for stable/linux-5.15.y] KVM: VMX: Move preemption timer <=> hrtimer dance to common x86 Message-ID: <2023040335-backlash-tubeless-7d21@gregkh> References: <20230329151747.2938509-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230329151747.2938509-1-tudor.ambarus@linaro.org> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Wed, Mar 29, 2023 at 03:17:47PM +0000, Tudor Ambarus wrote: > From: Sean Christopherson > > commit 98c25ead5eda5e9d41abe57839ad3e8caf19500c upstream. > > Handle the switch to/from the hypervisor/software timer when a vCPU is > blocking in common x86 instead of in VMX. Even though VMX is the only > user of a hypervisor timer, the logic and all functions involved are > generic x86 (unless future CPUs do something completely different and > implement a hypervisor timer that runs regardless of mode). > > Handling the switch in common x86 will allow for the elimination of the > pre/post_blocks hooks, and also lets KVM switch back to the hypervisor > timer if and only if it was in use (without additional params). Add a > comment explaining why the switch cannot be deferred to kvm_sched_out() > or kvm_vcpu_block(). > > Signed-off-by: Sean Christopherson > Reviewed-by: Maxim Levitsky > Message-Id: <20211208015236.1616697-8-seanjc@google.com> > Signed-off-by: Paolo Bonzini > [ta: Fix conflicts in vmx_pre_block and vmx_post_block as per Paolo's > suggestion. Add Reported-by and Link tags.] > Reported-by: syzbot+b6a74be92b5063a0f1ff@syzkaller.appspotmail.com > Link: https://syzkaller.appspot.com/bug?id=489beb3d76ef14cc6cd18125782dc6f86051a605 > Tested-by: Tudor Ambarus > Signed-off-by: Tudor Ambarus > --- > arch/x86/kvm/vmx/vmx.c | 6 ------ > arch/x86/kvm/x86.c | 21 +++++++++++++++++++++ > 2 files changed, 21 insertions(+), 6 deletions(-) Now queued up, thanks. greg k-h