Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3553644pxb; Mon, 25 Jan 2021 21:09:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoBMbI81iim+v2LXayZlDYXXjMOF6TMLVEqvwkYy6pJN672x+nuZQAPYVn6t4dLxvtX4vZ X-Received: by 2002:aa7:d94b:: with SMTP id l11mr3126193eds.1.1611637786556; Mon, 25 Jan 2021 21:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611637786; cv=none; d=google.com; s=arc-20160816; b=Pgmitkq6g1TZk5C7Abd4Kgegu+jNZ2aRHDMaMUGMwoXRv/cPqH6Y81lSBpv2ekvXrH QetDySMN1Yr1/BGZ8SMZr+ZBxi7aS0qH5YZ8N/OFyl72sO5QFv5wq5rbr/L0Qp5ZOS4i RNztkNznlwStIyXv+c8XIeFHzNmQqs5o4RdA+pt5k6BS8+u+xz5ftaLB6fx2VT8GU2fu 3zMF/uu2yMuqP9xJSJslX6KxrkHL0G7tAiS0n2L7ogDIAq+DwmOjlV2qg/M5Cvm6/Gv5 R/1hZjrF9wkEDTrHz61y8E9a8xBYS9MvX+RrQMt8Zg5sGwKSl9ddnLMM+2BvwvW2+HvQ Hw3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=YrXVO4zN2cI60urIVTvITgOgVbXxh3VmDdFkiYsYy2s=; b=PiSlzrj1cVCYg6HH2DEkvKVUc+suz7/25rpEmY5/QATN1DuXCoLUS9qj7s1pB/vPG/ 219VrvcWeGDcRkycCNowiEYaQaA2MUSNJ0nk8vkz2Qkop79zabCfQWlAomIOhlY6rzJ5 8KkCnXCvWW87mNV34wPRW1ZfMOfcNkluFR0G06U6ME2T4O6ts3GuOec5xnMqX61E5XGG BToJ1xNaKuACGq8DOEzy/aA133wKhHy/k1t/5/qQvLVHXO2TGZnfJf8OtzZZ9UTSW55Q QQOUEnXP56mCb8RqMGpxCCOJkzlFobIplst/7QH1d72T3bGorC4jUj7TTy7xtwt0XJKi pYYQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si6603444ejc.587.2021.01.25.21.09.22; Mon, 25 Jan 2021 21:09:46 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730048AbhAZE6g (ORCPT + 99 others); Mon, 25 Jan 2021 23:58:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:21973 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbhAYJUP (ORCPT ); Mon, 25 Jan 2021 04:20:15 -0500 IronPort-SDR: 6Z8pwwGR9ZByhUNj53GCp7mwzjsISPKnjUXAb171icLZhlZXZJuJbb/UK4rhfbCiAoS+WnZoRw GDZ+/bmwPMIw== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="198459800" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="198459800" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 00:26:36 -0800 IronPort-SDR: krmTHTvV9H1Em7YztLgy8AHyHyDUYxQkj03g7g4NA78ph4D8nEIi8ocAQEiHfrfeZEd2vGIV6W s89XGV2WwhSQ== X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="387239873" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.238.4.93]) ([10.238.4.93]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 00:26:24 -0800 Subject: Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest To: Peter Zijlstra Cc: Kan Liang , Paolo Bonzini , eranian@google.com, kvm@vger.kernel.org, Ingo Molnar , Sean Christopherson , Thomas Gleixner , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andi Kleen , wei.w.wang@intel.com, luwei.kang@intel.com, linux-kernel@vger.kernel.org, "Xu, Like" References: <20210104131542.495413-1-like.xu@linux.intel.com> <20210104131542.495413-5-like.xu@linux.intel.com> <9c343e40-bbdf-8af0-3307-5274070ee3d2@intel.com> <2c197d5a-09a8-968c-a942-c95d18983c9d@intel.com> From: Like Xu Organization: Intel OTC Message-ID: Date: Mon, 25 Jan 2021 16:26:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 2021/1/15 22:44, Peter Zijlstra wrote: > On Fri, Jan 15, 2021 at 10:30:13PM +0800, Xu, Like wrote: > >>> Are you sure? Spurious NMI/PMIs are known to happen anyway. We have far >>> too much code to deal with them. >> >> https://lore.kernel.org/lkml/20170628130748.GI5981@leverpostej/T/ >> >> In the rr workload, the commit change "the PMI interrupts in skid region >> should be dropped" >> is reverted since some users complain that: >> >>> It seems to me that it might be reasonable to ignore the interrupt if >>> the purpose of the interrupt is to trigger sampling of the CPUs >>> register state. But if the interrupt will trigger some other >>> operation, such as a signal on an fd, then there's no reason to drop >>> it. >> >> I assume that if the PMI drop is unacceptable, either will spurious PMI >> injection. >> >> I'm pretty open if you insist that we really need to do this for guest PEBS >> enabling. > > That was an entirely different issue. We were dropping events on the > floor because they'd passed priv boundaries. So there was an actual > event, and we made it go away. > > What we're talking about here is raising an PMI with BUFFER_OVF set, > even if the DS is empty. That should really be harmless. We'll take the > PMI, find there's nothing there, and do nothing. > In the host and guest PEBS both enabled case, we'll get a crazy dmesg *bombing* about spurious PMI warning if we pass the host PEBS PMI "harmlessly" to the guest: [11261.502536] Uhhuh. NMI received for unknown reason 2c on CPU 36. [11261.502539] Do you have a strange power saving mode enabled? [11261.502541] Dazed and confused, but trying to continue Legacy guest users may be very confused and dissatisfied with that. I'm double checking with you if it's acceptable to take the proposal "disables the co-existence of guest PEBS and host PEBS" as the first step to upstream, and enable both host and guest PEBS in the near future. --- thx,likexu