Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1102381imw; Thu, 14 Jul 2022 17:39:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sz/A3FvooIOsx4YlrH7ec8IQ2QDRfffrQwZY45jMgf8sUJcFpFrJKgloR8BwN9ZlWgzjK8 X-Received: by 2002:a05:6402:11d1:b0:43a:8c33:f549 with SMTP id j17-20020a05640211d100b0043a8c33f549mr15746614edw.354.1657845548999; Thu, 14 Jul 2022 17:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657845548; cv=none; d=google.com; s=arc-20160816; b=Eb36iZauwTREvlGU+JXMToB/Ob35FajsthnkxU146ECRqXPJkTFFNQt/bCixU+JLFJ nA9bUQgMpmNwlr6KRB+jwRqOghjlbUgUtLtUceKFB9wQtUCXg065UOLdNzH/QhPs0RQE xqXMFC0hhAGAOFP9bkOhbfIBHY9Efx00hgrykV58LUFrIYefFkOZvdm9x+I6wN0V5YPm 45ccC0dJRHv1++BLlxqGHvUvliDPAtaLqXD9VbBKUbKBq5IdJyf9GIF8szrQHZUZhhDj 4v8wHNG6g3JpG0xcBTg1MLBc6RViziJzh4a5G/bVbeZqhYT6piLnzaw2h3JP1bny7xVx u4Xw== 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=UQQRlisvFE3qG/84+NRCdXjem1ls49Nbap0O2VwH2yc=; b=t4A2PjYvWPw92uxGKV8a2imXAMtd9jC2WkqacoP3OG27nj0ZB1wqItmAYak+CRp0oB J2wwMYwkzfxfy3uLxkjmylzpqA3lDex1YNZr8Fq7k1MWt/kezJhGyrf0uizrX81Iikpr WQSlGYU3azs6OsbaV8pS8fFeXvkn9FwYC8cJZlIzzodrz+pII63FuyVfA6y0j2dAk1c9 hvBgjHnfI2c2dD7A5E3G3v9L2w7cv1xmZpVYrue0Htd9VrHYQiBGs5sVGikzmMjESlW5 I+2cQoRSijEaQdPZp91nznNNuR9KIYnPQCsr3/00Tp5OlzYglVAgK/9mzMysgkefV9bk Qlcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TNBzixoP; 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 hv9-20020a17090760c900b007262d1f0dd0si3667317ejc.485.2022.07.14.17.38.43; Thu, 14 Jul 2022 17:39:08 -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=TNBzixoP; 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 S229471AbiGNXYO (ORCPT + 99 others); Thu, 14 Jul 2022 19:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbiGNXYN (ORCPT ); Thu, 14 Jul 2022 19:24:13 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31B81B783 for ; Thu, 14 Jul 2022 16:24:12 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id r1so1754491plo.10 for ; Thu, 14 Jul 2022 16:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UQQRlisvFE3qG/84+NRCdXjem1ls49Nbap0O2VwH2yc=; b=TNBzixoP59o3WHWGhZl5d/VsYSnIKUF/lAF9WOfPsikfhkXxb0q4YPNskb73BHZppV ZHHcIYzmUTM/ncVFvqz2/zymIzBT5yec5sV6dEkO+bipYDTRR6COCoZH1OhNd0SjaHH5 qaZ3qjS9AcDCOYsxhvnpxpLzlrE2j/318AbTqypY4SUwtYl7VPB7SWNRyjr9BG+gImhC VncFnSEWPfHAlda71miShnDzVTt2Yovdi8pK6xDFFk/UC+GiPpcxpjUI6I7tLPJrhFet jHovKEcJvEeAzN8VM1xBOpaQTPOTeO4ZkwD8hJwYgIaTryLzztJDmWjytV0/TfbeWHOx PVDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UQQRlisvFE3qG/84+NRCdXjem1ls49Nbap0O2VwH2yc=; b=qamIMZOOm7ZUEnN9JJdXV879+lteYiGwU/1J0tT7iF+OZiXXn++6yxe4NAUK0ZX9NL DJ3UgGZK9cGC7TK4qw5zvIvw7ZcOvhc8UNWDReWHMC2bexbFhebB7hK+BgmzbdW9r9gC ckilbBbMufxMPIyAM7MkHep9xAzql31y5hHw6/hJ9tjWoalaCTXW1o/kQgtdH+sDT6bq QRcuxVTFC8i4RDP27jz3MQMP71Ppdru2y8wxoigYLE/QO5wixoeCgikalbEBbB/D4ETb RJQRAbGWLAu6HHD4L8lcZBpRXTN/icL5jlNYLFyO+Gz9O6T1vXS8RPPNNX0kF5Jxetkg fWfg== X-Gm-Message-State: AJIora8L9B+++0CIC+6DyvD2rYL24CvLxG9RrGjh6xwjZHSF+zkmmx0q AExuofeTtx6uYeBsLqFTG9pSKQ== X-Received: by 2002:a17:902:d2cf:b0:16c:223e:a3e8 with SMTP id n15-20020a170902d2cf00b0016c223ea3e8mr10635200plc.125.1657841052184; Thu, 14 Jul 2022 16:24:12 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b0016b8746132esm2054067plg.105.2022.07.14.16.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 16:24:11 -0700 (PDT) Date: Thu, 14 Jul 2022 23:24:08 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: 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, Jim Mattson , kvm@vger.kernel.org Subject: Re: [PATCH] KVM: SVM: fix task switch emulation on INTn instruction. Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84646f56-dcb0-b0f8-f485-eb0d69a84c9c@maciej.szmigiero.name> 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=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 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.