From patchwork Tue Aug 5 09:24:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 34893 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4632820523 for ; Tue, 5 Aug 2014 09:26:48 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id cm18sf1824836qab.7 for ; Tue, 05 Aug 2014 02:26:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=fql1wUTRxHxSi0NN0f6BEdKuK1y83OaYcTDs+trp06w=; b=bgzEODp+68oNfdm/eXJhMiBBBpj3brCVSCQMxbga/U+7E0SEDvEl6df+Clngx4luuN VUMSUYnU0g7eEkS3izPAs6v8tzBYpfN8aTCe+E7d5NQvi3a0pD73AQA65t/ksYLYY8eQ m1As3X0tcYDP4s6eqwgfW85BH5HlzmCvuNY0JOGWF1rj4U/c40IIRxXpmxuBdBKLv03s xJ+ti+n1Cxu+es+W2861X4wz2tptDJicnJ1oYsOuHDQ4ZKw4B2emqyBeA/GKM3XjBV8U UJ3Oy4xBGMPngLATZBrsT7P7rzjso9CnjR/uVA2RFks5ZLzpU5r9W3HJjyMW9I9mYI8w vgIw== X-Gm-Message-State: ALoCoQmDgdu/ZFFFvBshYPCqfV/sBGwoxBt0m/xX8P9ElKutrdJj/qYItduk8WQA6kbw7PD4t2x4 X-Received: by 10.236.120.9 with SMTP id o9mr1364762yhh.14.1407230808084; Tue, 05 Aug 2014 02:26:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.18 with SMTP id v18ls190131qge.51.gmail; Tue, 05 Aug 2014 02:26:47 -0700 (PDT) X-Received: by 10.220.192.129 with SMTP id dq1mr494247vcb.57.1407230807937; Tue, 05 Aug 2014 02:26:47 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id zt9si686590vdc.31.2014.08.05.02.26.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 02:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so971667vcb.40 for ; Tue, 05 Aug 2014 02:26:47 -0700 (PDT) X-Received: by 10.52.83.227 with SMTP id t3mr1804199vdy.20.1407230807825; Tue, 05 Aug 2014 02:26:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp369482vcb; Tue, 5 Aug 2014 02:26:47 -0700 (PDT) X-Received: by 10.66.66.237 with SMTP id i13mr2789252pat.126.1407230806992; Tue, 05 Aug 2014 02:26:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id pi2si1275386pbb.204.2014.08.05.02.26.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2014 02:26:46 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEazi-00025Q-NG; Tue, 05 Aug 2014 09:25:22 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEazT-0000qF-Ke for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 09:25:11 +0000 Received: by mail-pd0-f175.google.com with SMTP id r10so1021922pdi.20 for ; Tue, 05 Aug 2014 02:24:44 -0700 (PDT) X-Received: by 10.68.223.138 with SMTP id qu10mr2699133pbc.45.1407230684570; Tue, 05 Aug 2014 02:24:44 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ho7sm4434486pad.9.2014.08.05.02.24.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 02:24:43 -0700 (PDT) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Subject: [RFC PATCH 2/6] ARM64: perf: Re-enable overflow interrupt from interrupt handler Date: Tue, 5 Aug 2014 14:54:11 +0530 Message-Id: <1407230655-28864-3-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407230655-28864-1-git-send-email-anup.patel@linaro.org> References: <1407230655-28864-1-git-send-email-anup.patel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140805_022507_711184_60B28AF2 X-CRM114-Status: GOOD ( 10.59 ) X-Spam-Score: -1.4 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.175 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.175 listed in wl.mailspike.net] Cc: ian.campbell@citrix.com, kvm@vger.kernel.org, Anup Patel , marc.zyngier@arm.com, patches@apm.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org, pranavkumar@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anup.patel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 A hypervisor will typically mask the overflow interrupt before forwarding it to Guest Linux hence we need to re-enable the overflow interrupt after clearing it in Guest Linux. Also, this re-enabling of overflow interrupt does not harm in non-virtualized scenarios. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- arch/arm64/kernel/perf_event.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 47dfb8b..19fb140 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1076,6 +1076,14 @@ static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev) if (!armv8pmu_counter_has_overflowed(pmovsr, idx)) continue; + /* + * If we are running under a hypervisor such as KVM then + * hypervisor will mask the interrupt before forwarding + * it to Guest Linux hence re-enable interrupt for the + * overflowed counter. + */ + armv8pmu_enable_intens(idx); + hwc = &event->hw; armpmu_event_update(event, hwc, idx); perf_sample_data_init(&data, 0, hwc->last_period);