Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4319172pxf; Tue, 16 Mar 2021 10:28:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhjwbJKuHbnFXMaRnYBDipgjiK+Glnc9u79BL8asAtEZFMtlRIkdz+z9jUOqr5ZzK76A7R X-Received: by 2002:a17:906:81d5:: with SMTP id e21mr30508048ejx.102.1615915736325; Tue, 16 Mar 2021 10:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615915736; cv=none; d=google.com; s=arc-20160816; b=GQn/ovDPwA30/C4jHgcvZN95h+GDH7JsnFcLRVLZL12loMGLvlWZqwSgrZvq3M/TL5 5gE7SEPqs701lnbd1iZK6zDztSCTpX+5Z/slkjjyZZ6A+QqKWOifQh9kcCqeYj1RgbXm kY7LomcZP8zgKphrnwdhaoiPr7BtpyBP2toT1s6U3bBSXPqTwwbkcp+EamasqEcNzpfU QJEBDHxMfGPovVuVZInVYO/NkNQvileG22VRkCmRNNEoT9Bd5Ya/GkF6Q3bKWiZ2e9+V qBxFovf4wD+OxBLgsO0itz0QyY7ebc5DpP1DlX9OHcMo6EfKLMdnRKQoXb+xaTUc3SM3 i+ZQ== 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=j2TcsItQe9mXM2OmXCX8WBXwODoYV6ptAcT0XjuWaxM=; b=eSjPsx8kMpg766Qw/Uwfb/A2u5MxMbnI8m3DTFgEr7bwHp2bOwcxA2jzf5R+9n7wV5 pnlBSnZTUeekDp/AxdqpJPUcAGfXygFtAAR1xmteCQ8+FBAR5jiUOLDeWms144IjiqGI XNsYGVnA7ClZ1RRRtzscAefGAWZef61b83TPUz1bQzFE91FLFceVIgxJbGDbI7ZZOnH8 fBBHd2OhXo3lnjh1BMdKsiC2ugvX8KBkiW4wIMXu8yItzsQrYXwdLqzmb5TSdnORaWCa jjjxpQynUJgjsZ4CqXTcXzBKTii/pZYyN3FGp3SH/On1Sp8Nc/0T8Jy1gZ2XJcHS+L14 2lNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BlLOKdjS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si13502303edq.578.2021.03.16.10.28.33; Tue, 16 Mar 2021 10:28:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BlLOKdjS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231637AbhCPR1l (ORCPT + 99 others); Tue, 16 Mar 2021 13:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234870AbhCPR0o (ORCPT ); Tue, 16 Mar 2021 13:26:44 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1878CC061756 for ; Tue, 16 Mar 2021 10:26:43 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id z5so17294133plg.3 for ; Tue, 16 Mar 2021 10:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=j2TcsItQe9mXM2OmXCX8WBXwODoYV6ptAcT0XjuWaxM=; b=BlLOKdjSYi530fvJUVRZor11SX8QYxGIJTizXqSLZqbaiDPNo/hd93yLlWm54Ieck5 pbhiVeyo3X2+CmWY0rtJ77+WatqV/iiFURp6biPWmZAEuey8ore8I9zeQReMjVwV4w/N +Wq3MhOa8aIiiB6HksiIJlcHOLDcW3gqWVLP0eQPsVxXfgHA1Xsq4QfnrSFabMz5/N4K JtesF5lr6As5uETTk+4V5L7NNZjbqGtPhnIGmLIvStzTWzL5RwWyjAYW/4kus8GOG+85 1G6r3r3m5aI5lZ4vod10ujaWdM1LHQaSEJUt7JQeEYyQhfVt2g0BsG7i0JWGZQ20mfkV cktQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=j2TcsItQe9mXM2OmXCX8WBXwODoYV6ptAcT0XjuWaxM=; b=mtVCSbYjt4dXi1iiTmvf4R3epeMRAzvQJESEhlmmYkWlw+A8pUpdCYDQC1yEiKz//S /LPIgqFBadA2iLudwV7cTgtO6oJ0yyFvPqoCsZhQBKUybWaZAt30/Pzec48RFw0GnFh3 PXg/TORLSDma/aFS3dEHJGPfi3J9jByPSmRjYb3LVmgVTim/K9nzyQfQZw2hIOdnNR+L UfuMyqSl6Htygc7uTSpr1S2jkJc1kPv8FKWKGPtOS5bL5/YSPMOYLRyRwxUjWw1041xB kVbfEe8M6YQmtg28uSNYd/2DmGCGw/zlJyY83XMX8J6Qc7Pl23lKPzzIR2u3HMLcRucP n35A== X-Gm-Message-State: AOAM532mcacmYU3ONQqDGvjpfVK3ui7fHHYP9a0vOr7qdhWn0/lt6JOU xk1i5MQf+3YKuhywBFfxcatSsg== X-Received: by 2002:a17:902:edc2:b029:e4:3738:9b23 with SMTP id q2-20020a170902edc2b02900e437389b23mr554373plk.37.1615915602144; Tue, 16 Mar 2021 10:26:42 -0700 (PDT) Received: from google.com ([2620:15c:f:10:e113:95c2:2d1:e304]) by smtp.gmail.com with ESMTPSA id g26sm17464964pge.67.2021.03.16.10.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 10:26:41 -0700 (PDT) Date: Tue, 16 Mar 2021 10:26:34 -0700 From: Sean Christopherson To: Jan Kiszka Cc: Maxim Levitsky , kvm list , Vitaly Kuznetsov , LKML , Thomas Gleixner , Wanpeng Li , Kieran Bingham , Jessica Yu , Andrew Morton , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Joerg Roedel , Jim Mattson , Borislav Petkov , Stefano Garzarella , "H. Peter Anvin" , Paolo Bonzini , Ingo Molnar Subject: Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping Message-ID: References: <1259724f-1bdb-6229-2772-3192f6d17a4a@siemens.com> <71ae8b75c30fd0f87e760216ad310ddf72d31c7b.camel@redhat.com> <2a44c302-744e-2794-59f6-c921b895726d@siemens.com> <1d27b215a488f8b8fc175e97c5ab973cc811922d.camel@redhat.com> <727e5ef1-f771-1301-88d6-d76f05540b01@siemens.com> <31c0bba9-0399-1f15-a59b-a8f035e366e8@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31c0bba9-0399-1f15-a59b-a8f035e366e8@siemens.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021, Jan Kiszka wrote: > On 16.03.21 17:50, Sean Christopherson wrote: > > Rather than block all events in KVM, what about having QEMU "pause" the timer? > > E.g. save MSR_TSC_DEADLINE and APIC_TMICT (or inspect the guest to find out > > which flavor it's using), clear them to zero, then restore both when > > single-stepping is disabled. I think that will work? > > > > No one can stop the clock, and timers are only one source of interrupts. > Plus they do not all come from QEMU, some also from KVM or in-kernel > sources directly. But are any other sources of interrupts a chronic problem? I 100% agree that this would not be a robust solution, but neither is blocking events in KVM. At least with this approach, the blast radius is somewhat contained. > Would quickly become a mess. Maybe, but it'd be Qemu's mess ;-)