Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1066212imw; Thu, 14 Jul 2022 16:45:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uS2VZd3wPOPIa7xUjub05hgPBibYirhY9UcMsEVP430HQglHKO1kVkQB8DX/3AkvL+ct61 X-Received: by 2002:a17:906:730c:b0:72b:4f83:51c1 with SMTP id di12-20020a170906730c00b0072b4f8351c1mr10880671ejc.515.1657842324340; Thu, 14 Jul 2022 16:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657842324; cv=none; d=google.com; s=arc-20160816; b=s49E689xJkb8v7ogZbPBaEPWqLRwFALzTJ/YhGRNtbt2ulVX0SldTtS4jzsSO9Jk9C k+0Rl9kXyqwogYuIZC053AGCirDkchyI4aFQsQ2INWrRAox9OTX8l9nujpPa59+TkMeM oragLsRAp65wzlbQ75auCnV4q1pgRfTM+CdyntdDl5ejKBD8cddKDgl4kM1Vnj/aoOyk L9V4gQgrpaiU8OE8XKqsDfLF9De55XG07/xkfMX73aD6z0Bizb6Ra5mBKEf36NzsCOgT aUn/N3uaKs1zcPsOY215IIxuv+JZOL2uRkKoeg6nhRPPJ07NKSbHhC/57ICLxVAEr3tU 5TtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WUad+Xw6PKcQuVvg0NVjHjZrXjvIwRxx7gYLjE8eWlc=; b=UZ/YBZsOkDc0nXGU+dscqlkBdaXnDIlLUQdBzhwaI/ROrYwA7M/Br3hXzt/yPujy2X c4xaVXkfFd8+d/02qPWz8GexGFe+eZCrcWSMImPtxwer6/A6nBLrEwdIYQFCuPmHMtBs DI86Mr7WOA724wzCQPW+rjvv1rxfI2Mnbv8bxl6TKAkmDxH4UWGD7UV42uLrY0sPvC3h Z0ilnN1CzLEYaijvyWFHZOBsULsCQVzcJbfmQYIPMzNDfMI8SrZmrtsdpgY6VbcHNI/r 5OdnsXzLu7zw5Iaejm/J2i8qbDHs9bhekoCxQJ9H2RSiFgBlQiddpXb/S6uavQRmp1Mi s1Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Jm7C2LQZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz15-20020a0564021d4f00b0043a6799389bsi4667747edb.425.2022.07.14.16.44.44; Thu, 14 Jul 2022 16:45:24 -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=@google.com header.s=20210112 header.b=Jm7C2LQZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232617AbiGNXhN (ORCPT + 99 others); Thu, 14 Jul 2022 19:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiGNXhL (ORCPT ); Thu, 14 Jul 2022 19:37:11 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA4DA67C8E for ; Thu, 14 Jul 2022 16:37:10 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id y10-20020a9d634a000000b006167f7ce0c5so2402298otk.0 for ; Thu, 14 Jul 2022 16:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WUad+Xw6PKcQuVvg0NVjHjZrXjvIwRxx7gYLjE8eWlc=; b=Jm7C2LQZsxxWNagj8GABg7+kKx3vxX4cfGi8JP0PEmKJnaWG80wpBD0RfgEHAy99J/ PX/JxovHwJGAE8KF5hXaLLZ7WAISNUTcDONyADJzadN8H7pvhuKxj4Mx5uVfFDlGiDZG +sLN0+Wf9UMEsTLxdFxa/Y3KtZMGQQcfOt4vWnSwuBDyfzXCKrk6moO1kYon0HCBBAKU uSbf0EJn6e4rU89jyAnOQ3H8oS9/5Dj1lm8gwvqx5vEpym8X2BNKZtYb33MpRuCsJlwF ygtVw1fLLIzyrhcjfGAyU81UMZnuBXYLrqvvZL0oeEtD8gYdyELZk+B8DMwj4pn//G07 ouvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WUad+Xw6PKcQuVvg0NVjHjZrXjvIwRxx7gYLjE8eWlc=; b=iMWOl+BjE3/DwJ6/sPGittbg5iVMZe/7agGfQ6NEC++Bf1cFlWW10vYBznmAFzUFFX MWsGoStUpH14XqF9fe3UEIgCUdKMJFJMnQtw/FiaiHNhkFZL/d6zb7TvncKJ1Ea0Ge7O bmWLZ4Lm4NzBB6gPxizUpjx7LE1n+YPvHrZtDJnFgBMkhQ5br5Oaz5u+zGphWx6ui4SL iiGs/EsaqdTdi6kD+Z4/4ksU4ZsPWHgyuoJQqRpTTOzZhJE4c4+ve6sK5egcUbPuRnkT nL3fWmnEkPjaD1W3hvdOTRxasbgsRNakK5BoyE2pUooe8G3qASyYLP2o6bHeAe1ZUQRd MhGA== X-Gm-Message-State: AJIora/YlkRpBbQJRAQ97/vZjpBrJfBpurAf8tE64Esv+i6Q+r87QLwv ZqJuMJqVURJwF06pqys4EOnaG/ZezlMaNN1XW21EHQ== X-Received: by 2002:a05:6830:2331:b0:61c:2c18:555 with SMTP id q17-20020a056830233100b0061c2c180555mr4590577otg.367.1657841830085; Thu, 14 Jul 2022 16:37:10 -0700 (PDT) MIME-Version: 1.0 References: <20220714124453.188655-1-mlevitsk@redhat.com> <52d44630-21ad-1291-4185-40d5728eaea6@maciej.szmigiero.name> <034401953bc935d997c143153938edb1034b52cd.camel@redhat.com> <84646f56-dcb0-b0f8-f485-eb0d69a84c9c@maciej.szmigiero.name> In-Reply-To: From: Jim Mattson Date: Thu, 14 Jul 2022 16:36:59 -0700 Message-ID: Subject: Re: [PATCH] KVM: SVM: fix task switch emulation on INTn instruction. To: Sean Christopherson Cc: "Maciej S. Szmigiero" , Maxim Levitsky , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , Ingo Molnar , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Jul 14, 2022 at 4:24 PM Sean Christopherson wrote: > > On Fri, Jul 15, 2022, Maciej S. Szmigiero wrote: > > On 14.07.2022 15:57, Maxim Levitsky wrote: > > > On Thu, 2022-07-14 at 15:50 +0200, Maciej S. Szmigiero wrote: > > > > 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 :) > > > > > > Yes and also people who run 32 bit kvm unit tests :) > > > > It looks like more people need to do this regularly :) > > I do run KUT on 32-bit KVM, but until I hadn't done so on AMD for a long time and > so didn't realize the taskswitch2 failure was a regression. My goal/hope is to > we'll get to a state where we're able to run the full gamut of tests before things > hit kvm/queue, but the number of permutations of configs and module params means > that's easier said than done. > > Honestly, it'd be a waste of people's time to expect anyone else beyond us few > (and CI if we can get there) to test 32-bit KVM. We do want to keep it healthy > for a variety of reasons, but I'm quite convinced that outside of us developers, > there's literally no one running 32-bit KVM. It shouldn't be necessary to run 32-bit KVM to run 32-bit guests! Or am I not understanding the issue that was fixed here?