Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp623732imw; Thu, 14 Jul 2022 07:52:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+w18xmPiUmd0TYQ0X3m6HJXChfS4hYbtJZDWTIp2txFKQfMoVauhKpJKHTF9guTe6HfQX X-Received: by 2002:a65:6e04:0:b0:40d:26eb:8225 with SMTP id bd4-20020a656e04000000b0040d26eb8225mr8111811pgb.138.1657810354047; Thu, 14 Jul 2022 07:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657810354; cv=none; d=google.com; s=arc-20160816; b=d3skTkwT2S9EXBD407HaHQvCsDkMmxBZr+hv0Aslz1T5JanNBEGcDypNcRgb0wlkFP uhcRteHpzFM0+hB1+1yYnN9wBqtONfNiaO6AKKX56bTaNZydVmiEhPfW2tADMAjjaZcC ZQheD2BXvDwiukqHyduT/stj7pwJLgegLGr43Jix5ULcnQmuYVeWRl16el5iF1AgMJxl wubUtBi4G4/kyF68FZO0SKqQQyLa5dwFxCAI3roxLjursTWhj2jC8gh0AthOlgFzNUK5 r98Zbsd241kEFsRwj4tqEPTaNiryZofmYPYD/De+z5rMs4++dCdhzh6kF5PSMpQOAOy0 VCHg== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=QOScCUna7jzGC8nM61U98aiTSWJdbb9UT0k3z+i5t7s=; b=N2aUXIY8XD84JhZ35Jwp8kkpb21SDpEa5xoFNrCywKwS8AkRdeLc/+6sJ5Rnj7hcqv CuzY/aCGbmgOTy46JWmkuRAYyAwcpxZQPz2fe8Lw3kR1pflca0XGL6Iq7w/MfTy2VHXy Y7XtywdWMbMqQMOidqnGiHfQAXwNzcpwAJ4BdD7e0CurpVIwj6RY790v505H6ES/nWWB htGBSOSkedg8t445HdA64yFy2qz2VfDIRX3eoPrcWtFXWs/epLXI3r4ShrmeOucaYeym Ur6J0W4p97h8EX1pTUDVOr4yUx13gMznd0B5xeAoTvUwupXuBpSIet83vZixkYzd3OXJ /u+A== 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 22-20020a631256000000b004160a070348si2272277pgs.17.2022.07.14.07.52.19; Thu, 14 Jul 2022 07:52:34 -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 S239401AbiGNOnO (ORCPT + 99 others); Thu, 14 Jul 2022 10:43:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239171AbiGNOnK (ORCPT ); Thu, 14 Jul 2022 10:43:10 -0400 X-Greylist: delayed 1798 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Jul 2022 07:43:07 PDT Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1492458870; Thu, 14 Jul 2022 07:43:07 -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 1oBzEp-0000eY-FW; Thu, 14 Jul 2022 15:50:43 +0200 Message-ID: <52d44630-21ad-1291-4185-40d5728eaea6@maciej.szmigiero.name> Date: Thu, 14 Jul 2022 15:50:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] KVM: SVM: fix task switch emulation on INTn instruction. Content-Language: en-US To: Maxim Levitsky Cc: Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Sean Christopherson , Joerg Roedel , Ingo Molnar , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, Jim Mattson , kvm@vger.kernel.org References: <20220714124453.188655-1-mlevitsk@redhat.com> From: "Maciej S. Szmigiero" In-Reply-To: <20220714124453.188655-1-mlevitsk@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 14.07.2022 14:44, Maxim Levitsky wrote: > Recently KVM's SVM code switched to re-injecting software interrupt events, > if something prevented their delivery. > > Task switch due to task gate in the IDT, however is an exception > to this rule, because in this case, INTn instruction causes > a task switch intercept and its emulation completes the INTn > emulation as well. > > Add a missing case to task_switch_interception for that. > > This fixes 32 bit kvm unit test taskswitch2. > > Fixes: 7e5b5ef8dca322 ("KVM: SVM: Re-inject INTn instead of retrying the insn on "failure"") > > Signed-off-by: Maxim Levitsky > --- That's a good catch, your patch looks totally sensible to me. People running Win 3.x or OS/2 on top of KVM will surely be grateful for it :) Reviewed-by: Maciej S. Szmigiero Thanks, Maciej