Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp118378imm; Thu, 7 Jun 2018 15:00:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmv/XdJw+8HePzl08ThBfIb+IqyrHEHyk3EYjmFKZ2bTQHSoVgz7SBXFahde1sTe4CHy/p X-Received: by 2002:a17:902:6181:: with SMTP id u1-v6mr3676655plj.369.1528408846356; Thu, 07 Jun 2018 15:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528408846; cv=none; d=google.com; s=arc-20160816; b=Dfhg8ivuc6ePVWxapFn1yuGqhk1CCHmyVY2kongDAfKvWtRGBWOVzaAL2jgmqiJ0WU qD6Gh6wwTlq2gpv6e7ZEXYfq0N0T94pzYo48Kb35EHqXO4Up4FKzGVYtxNQins9/++a6 wJ2hJKWa6w8id13LGGDp4m/j7CFaWf0j6i6vg7vlhxr0X2MYS/tvgLP+yjrod48k4HJh 2iy6WAT/RHZOe1nLpfIH1Q4WEQIKdZe2S47XNEpjQNnbzUC1gAc2q4CUUi+ZDxrKc1IQ cw5LjOLVk6b7eze6vdVsIH6ot4NfnaY2eYloaXx9WxaNj0wlo4avYZ16eryRyZNyl65s APCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=WWY8aKhutNswxelsBbeNWOwg1CwPIYATsE2fDCPNTC0=; b=kB2yd5Rm00UboPVMqnU0u1tEpN9sfXIvTxTAvV0/D64dFxb2v7Q2rv5WuqPOMaKPv0 0JAd02pryRoSAzwN1D6hMIygeTEwVKy0jswPiD5yTs4liRhORz+bBbwL/id4JsR4AaMp bZitOwOkOqGSA/jX7C+5xHEOZm+xCx4Ydgonsd4VovUHv6Izd2jV6eTnHLKUDsizRg9U HaVDPbQCDUEIEfExPyt6j0y+oh3DPTrRfiADzlDoOnw36kRSPZOamx6TJ7Rq9hZHXoNJ r+hkWLooDxk16leiCmU/XnKlYlSbnU8SUoPXj/CQzCAs3iUi2rQ4yjUROhLI/+qlH9L3 kF5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRG1H2W5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si43732843pgc.669.2018.06.07.15.00.31; Thu, 07 Jun 2018 15:00:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRG1H2W5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752142AbeFGV76 (ORCPT + 99 others); Thu, 7 Jun 2018 17:59:58 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35560 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbeFGV74 (ORCPT ); Thu, 7 Jun 2018 17:59:56 -0400 Received: by mail-wm0-f66.google.com with SMTP id j15-v6so22190064wme.0 for ; Thu, 07 Jun 2018 14:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WWY8aKhutNswxelsBbeNWOwg1CwPIYATsE2fDCPNTC0=; b=QRG1H2W5iQg8R6ZMrY4y/uAy6T56r7fO/OToJIawbjxrKcru1eh/jalQ3C9Fuyh3jY gvtZtXv1orEQifq/ad9Q8qBUu1+x5b8ocvCEtjmC7k15gEGsU4Wui3LjWuUZrFKbaq6E sRoOnJVC7P+Zt1+fO/65J5V+jwvKznlAGRnQE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WWY8aKhutNswxelsBbeNWOwg1CwPIYATsE2fDCPNTC0=; b=lTcLNFOyDl/+u/+Aw+gffBdGRgeAipTviqZDc/VovXoHpYK1RxVdJu4PfK8FL+bri8 xvt+0hZeDfx19b72dBIrmYBIf3874g76NWxlZsjhhn+Krtmqa35zMGw53oWdBHx8hMdf r0t3VIjj6MMrtaOXUPaiSANvdKlaMMj+7v/B8jsjGqUIYFxH7wUO9inEnhG7YBzDvHdl q7Af0edfEdxPS1NRcD41liY0iZ7rfMfI9pptOUlwXcc89FXNaxx0tCKHFlu+HqsmqxGg jOrbfUZs8Ck8lEl4YCx/5NT19/3cepqbfcS09MZaXUfiM218pLFF73tLegKbxVx6IKEJ 5B5g== X-Gm-Message-State: APt69E0Nf36Y5h1nYrS71VbqWG6rL6nU+ly6Cx40uRiIST0x3E9OHAJr y7lITKaamqRgkA2NPmYMpobIC7Rc6QXIyoUFZ2JQ4g== X-Received: by 2002:a50:b52a:: with SMTP id y39-v6mr4239624edd.195.1528408795303; Thu, 07 Jun 2018 14:59:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:a48a:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 14:59:54 -0700 (PDT) In-Reply-To: <20180607164747.7e4bb30f69a1fb4c160b6ef1@arm.com> References: <20180605210710.22227-1-kim.phillips@arm.com> <20180605210710.22227-6-kim.phillips@arm.com> <20180606082422.GB19727@kroah.com> <20180606155501.704583e1412996a1a2c6fa61@arm.com> <20180607083401.GE16651@kroah.com> <3219276b-2703-bc30-92e1-bae80cdc5901@arm.com> <20180607091353.GA20438@kroah.com> <2f8d233e-8847-ce3d-3a5b-06b175e3944b@arm.com> <20180607095322.GA26174@kroah.com> <20180607121304.017d1d6804466050dd5c0af2@arm.com> <39d1089f-585d-bc19-2ecd-c9c9c812f85f@arm.com> <20180607164747.7e4bb30f69a1fb4c160b6ef1@arm.com> From: Mathieu Poirier Date: Thu, 7 Jun 2018 15:59:54 -0600 Message-ID: Subject: Re: [PATCH v4 05/14] coresight: get/put module in coresight_build/release_path To: Kim Phillips Cc: Suzuki K Poulose , Greg Kroah-Hartman , Leo Yan , Alexander Shishkin , Alex Williamson , Andrew Morton , David Howells , Eric Auger , Eric Biederman , Gargi Sharma , Geert Uytterhoeven , Kefeng Wang , Kirill Tkhai , Mike Rapoport , Oleg Nesterov , Pavel Tatashin , Rik van Riel , Robin Murphy , Russell King , Thierry Reding , Todd Kjos , Randy Dunlap , linux-arm-kernel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7 June 2018 at 15:47, Kim Phillips wrote: > On Thu, 7 Jun 2018 22:10:07 +0100 > Suzuki K Poulose wrote: > >> On 06/07/2018 06:13 PM, Kim Phillips wrote: >> > I'm going to assume the series is still valid after this discussion, >> > since technically just this patch can get dropped, and the user is able >> > to shoot themselves in the foot. >> >> That doesn't mean the kernel can panic() if the user decided to unload >> the module while the trace session is in progress. It only means that >> the trace session could be stopped in between in the worst case. But >> nothing more harmful to the system. > > FWIW, I didn't see the kernel panic in my basic tests; just some bad > accesses: the new remove functions take care of cleaning up most items, > and most drivers still depend on the links and sinks (funnel, > replicator) drivers, so they can't be upset too bad. > >> > This series is for development purposes, after all. >> >> Do you mean that this series is for internal development purposes and >> not upstream ? Making the drivers modular are always helpful, especially > > no, I'm posting them for upstream review because I'd like them upstream. > >> for something related to tracing, that allows the module to be unloaded >> after use. So, it would be good to have this series in, but in a manner >> which is usable and doesn't cause harm to the overall system usage. >> >> I think the summary of the discussion is that we need more robust code >> to handle the situation, which also allows unloading the modules without >> any trouble. > > Trouble's relative. My point was since the series is going to be used > mainly by developers testing their code, they already prepare for, and > expect badness to occur anyway. Greg's point isn't lost here, and in > my interpretation, his review of this patch was that it was in the > wrong direction of safety: it made things unnecessarily too safe, up > front, and that items relative to the perf core should strive to adhere > to the higher standards set in place by the networking subsystem. So, > this patch doesn't get his ack. Greg's point was that it's OK to let users harm themselves (which I totally support), but if you're going to prevent it, make sure to do it right. > > I compiled a new v5 series that omits this patch, and overwrote the v4 > series here: > > git://linux-arm.org/linux-kp.git, coresight-modules branch > > but I'll hold of submitting a v5 for now. > > I don't know how the perf core handles AUXTRACE drivers hanging up on > it. I see intel-pt record support can't be built as a module. I'm > guessing more testing for actual panics when using perf or sysfs is > what's being sought here? There are two ways to approach the problem: 1) Kill active trace sessions (either sysFS or perf) if a driver that is being used is removed. 2) Deal with the removal in the coresight core, making sure we don't access operations provided by removed drivers. The end result in both cases will be the same: failure to properly terminate the trace session because of user action. I'm personally in favour of the second option, simply because it keeps problems resolution with the CS subsystem. > > Kim