Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp196340rdb; Tue, 31 Oct 2023 05:13:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXqmsi+T6Vy/BRqc6QrDWvX/hiS6u9XM5k1fCoJhj/ZM3rtjQLp2fYfSZ9ESeIYJYLE7Ot X-Received: by 2002:a05:6a20:8417:b0:16b:f4ca:e3d9 with SMTP id c23-20020a056a20841700b0016bf4cae3d9mr13452501pzd.27.1698754425206; Tue, 31 Oct 2023 05:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698754425; cv=none; d=google.com; s=arc-20160816; b=ZAyhxihEqFxEgYcBg0I1eZkUF/BSgnky7ONuCqGH7UOMBnJfuLrODxaqp1IQVUpYes Keh7URTnAkKdeI0CEZ2K5A5b91AJxZ8TeSt1DB2CH/ovbLUsjxKMTYh4bTWQjONuPITT qW/A5hHnp37k3/g+ME6dqYEeUlqQYDcO2MeBJTx23eCG4UHlExBN08aORWMp/MqzzZB4 x8gSr9TebHc5Wd53jJm5ZTN1RTHCfU2IQaDrzpcqnIMUrS5Dkg3zLo313qksik60vEF7 1chk2tnZ/PLK4MV+AhZgPGxmKw0sjIiabL/bEKyKlsgk1vtkk5WViGGbAQ+oYJk7eiBv lFhQ== 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=bGV25K3nUnQ+2KxGVOhDHO+SWa9Obf8EAYV7RnLmQDU=; fh=qaYm4b6GKYlZ0T3gtLZ7fjEfCEC8jMv5XzYe6fOhw1Y=; b=RsXer/3ZSGyJOnK8+eietBYJJYfM/k8D1a8GHR/TnXeCvZz9LSPEKbow0N5L1WxgFk 3cwpKJZlML43NZups7vu7BTAqL+d2aLJDPeYOwSq/VB/BwX5Sr/d/q2azFtYYzRNTspK wQQqHzSZt1bkmf+RaonKG0H/aft5j0eaOsJKE0o27zLZsz3IV6RM9AkuUId1BSt9ZK8l 332dsQJ86lXcDgVVMDVfSjn6l/zH99GokpnYNiZu8X+Qa2rTi2Y0Q+pXuLqZI2mG5GiM OCfVO6EXO0oBt6EJqeOb6IH3o2dUJ2bciERj6fd+UuPcRdCv6hgUDarCgut+FYBAPBj7 7wvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="W/H04JMt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m21-20020a656a15000000b005898d64820esi982109pgu.322.2023.10.31.05.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 05:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="W/H04JMt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B83CC80C9A71; Tue, 31 Oct 2023 05:13:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344094AbjJaMNh (ORCPT + 99 others); Tue, 31 Oct 2023 08:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbjJaMNg (ORCPT ); Tue, 31 Oct 2023 08:13:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F6491 for ; Tue, 31 Oct 2023 05:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698754366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bGV25K3nUnQ+2KxGVOhDHO+SWa9Obf8EAYV7RnLmQDU=; b=W/H04JMtr6gixcwqHI1ABeRP/KGl3xGTci7culxD1FgME8ygF7zWJV8TLXFxtHhp5TIQb6 5ZJ86YSVU+RWlvBXjl/tpuOX1tguGyVnq9LN/URrImvzF5xKyGo4tAO04d++5PhTKBz1YZ bRnvRvpdp69Bm5pub1GlhIlns+kcLUE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-226-Faric4d0MdCqBYpAKSgDSg-1; Tue, 31 Oct 2023 08:12:44 -0400 X-MC-Unique: Faric4d0MdCqBYpAKSgDSg-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4094cc441baso7338015e9.1 for ; Tue, 31 Oct 2023 05:12:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698754363; x=1699359163; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bGV25K3nUnQ+2KxGVOhDHO+SWa9Obf8EAYV7RnLmQDU=; b=sia5e3mcDB3GEggHO4v+ppe3MUN2R53BbFMli4xSOUpH7bs3ly2EVpnx6SFLYJ2YDk E2CnHIMRhwQaHhYInAnedTo+m3qiiiwgcXPXDDLid/cd/e2Cx84/kfX2MFUahP+nUzBA A/InQWBfdDxoEF28EHFnXjNzuAa8Q+klblzxciWOxw+ZuT2ky0O5nMgxUsON4QP41TUl FsMZfAXOeGHht4dDaZNPDQfDpWQSqjHsOCKuM63TBxHVnqXqH00aSTXPqg0fYQ7n3SB6 EbM/ttFeQfQUsyu3zjlOx7pa5J4g2vOWSr+9DHKbUkR0NVcKo8jrQ63YUqeraJ4V1KTu Vqgw== X-Gm-Message-State: AOJu0YzxYj2XGPFbKPcivWOd4eFuF6kaV381xc6TG2MVFzF17r9jLYoM rTxtu1ZF9asEzgllNgvwkQBvEiQ9kwbyQOglpOysPElweI2uQJHQWDEgdQdLVZ6w0y9MdP0PA22 5x2B2zbFVFzbyzto68PhRdAy4VhKfLd1UoAGvEpaR X-Received: by 2002:a05:600c:35c9:b0:407:3b6d:b561 with SMTP id r9-20020a05600c35c900b004073b6db561mr10853435wmq.9.1698754362830; Tue, 31 Oct 2023 05:12:42 -0700 (PDT) X-Received: by 2002:a05:600c:35c9:b0:407:3b6d:b561 with SMTP id r9-20020a05600c35c900b004073b6db561mr10853418wmq.9.1698754362417; Tue, 31 Oct 2023 05:12:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Prasad Pandit Date: Tue, 31 Oct 2023 17:45:28 +0530 Message-ID: Subject: Re: About patch bdedff263132 - KVM: x86: Route pending NMIs To: Sean Christopherson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 31 Oct 2023 05:13:42 -0700 (PDT) Hello Sean, On Mon, 30 Oct 2023 at 20:41, Sean Christopherson wrote: >> if a fix patch like below would be acceptable OR reverting above patch is >> more reasonable? > > No, a revert would break AMD's vNMI. * Okay, that confirmation helps. >> - kvm_make_request(KVM_REQ_NMI, vcpu); >> + if (events->nmi.pending) >> + kvm_make_request(KVM_REQ_NMI, vcpu); > > This looks sane, but it should be unnecessary as KVM_REQ_NMI nmi_queued=0 should > be a (costly) nop. Hrm, unless the vCPU is in HLT, in which case KVM will treat > a spurious KVM_REQ_NMI as a wake event. When I made this change, my assumption > was that userspace would set KVM_VCPUEVENT_VALID_NMI_PENDING iff there was > relevant information to process. But if I'm reading the code correctly, QEMU > invokes KVM_SET_VCPU_EVENTS with KVM_VCPUEVENT_VALID_NMI_PENDING at the end of > machine creation. > > Hmm, but even that should be benign unless userspace is stuffing other guest > state. E.g. KVM will spuriously exit to userspace with -EAGAIN while the vCPU > is in KVM_MP_STATE_UNINITIALIZED, and I don't see a way for the vCPU to be put > into a blocking state after transitioning out of UNINITIATED via INIT+SIPI without > processing KVM_REQ_NMI. > > Please provide more information on what is breaking and/or how to reproduce the > issue. E.g. at the very least, a trace of KVM_{G,S}ET_VCPU_EVENTS. There's not > even enough info here to write a changelog. > * I see, I'll try to understand in more detail about what's really happening and will get back asap. Thank you. --- - Prasad