Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp875004lqt; Tue, 19 Mar 2024 06:39:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBbxKu+Rbv8PiP7ZUzlWMrxKkmxwYVEpCBFv0baatRCmMLaZ3ZwI1LoOuIX/dklVVGLkIAyNQ06ArzXtFhcKe6v3ncsKvFi0HlRm7Crw== X-Google-Smtp-Source: AGHT+IHskzI5pP71UqC7nLZBicH+pP1xyctPH/Eu6mIVLU0TAVTJXCxSHids/6bf/dERqBfQH88z X-Received: by 2002:a05:6214:411a:b0:68f:db20:b300 with SMTP id kc26-20020a056214411a00b0068fdb20b300mr4127749qvb.21.1710855573238; Tue, 19 Mar 2024 06:39:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710855573; cv=pass; d=google.com; s=arc-20160816; b=ylsETbAUaXTkknE3q8uz8cztZ4Zy5mU3fukrcflpE1NALWWgsmaAADrQ8hIzFmX/aR +A9eGgyq1/YMMaWIxQ3QmyiyMASiKlmRZlbUDL4eN2nHa166DXvO7cKBee/g3h5c2HYR pcB2BDY7zsKt52z3X55Wf4DXV01puUUosHMrZgUayqCh64qSNC71jO7JtIY5+C4x8SWZ MXmzOyHrdrtBq8fgvePoFiMg9MPEk/ys1wnZsnHJpfofT0rLlyyWkrqwfotUjN0DcJtj c236YloJraKxUqRBoqPTPFRv4c0JRxoiwOGFoX3QOvhVYpG2l6VXqLBFtoSQ6Gz5KOm+ tXgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4zAsS/uNen1I904a04qYYT/TYDmbVxX/Uth0W4MlTuw=; fh=jmKNQ79B1zSKlGVKCX967UxtdxsP1hP3NB06tUCubIw=; b=PWcdrpKBwmYp9qNPfNv5A8c7Xu76pt3llKsWYpzBcwgBk5jQr9tumWn1n6jbUsJ94P gXJiBsOhg9KQHW/jYRAAwCl+s0iHhrccRucRjUYLaIlFFl2HBi2NQWla3CO408+dS2Wk maVmxWMnM5Zr0NfwmmlDATfmJIuSB8kNS2cNerlmzINJeUNe03bfQFy8rXAAVn0KBfXK agRbwx8xEeyRkDUhXjI9uP16wo7NnDAlzFeBqaGrhMZXm3r5CMIkV41fKmQrlxYCZnT6 qyf/cVPFK7+saKbbJmqYo5aCnmPFi3pP203seyMJvL7nvYhuYdryzliFgoFJ0pR6driq VaAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=P1OqbeGV; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-107600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107600-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id im3-20020a056214246300b0069007a575f5si10863187qvb.226.2024.03.19.06.39.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 06:39:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=P1OqbeGV; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-107600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107600-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E17D61C22BFE for ; Tue, 19 Mar 2024 13:39:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 930FE80616; Tue, 19 Mar 2024 13:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="P1OqbeGV" Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1F9780607 for ; Tue, 19 Mar 2024 13:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710855567; cv=none; b=eWrlGxkp9i4YUnpZommC/lC7qM9SIoGLPA9ehRr6yiSD0ZiZFuuYoTpFj38TeVQ+qHDMyQGkanBBpqpY3gjsSloOeGimWHTltOUhER0vsmQfJegtapMgLHFRvPwPiEGl9+dVeE7yZixLE2TKI//Eb1LVV5tLZR7LxrEakMMqwjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710855567; c=relaxed/simple; bh=sGGyhg7qmrAF3VEJNWEaHGwkum60h1VaoacXAoOTovk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JsBNQSAs0mFMr94c2jEtO2DmKe6ynBtBwQoNXCYuImtG1VtnyDeixajQtUscmBbKnwlczDrv4rxEGUVlOj7t260Q/W35AReAWvHv7HJQ+g94G26pdfLU8IBE++OzDWPErk3iwxLx+xbYTRRZr6xbEavS8PJxZDmo/oAr7q0OCvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=P1OqbeGV; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-568107a9ff2so6680820a12.3 for ; Tue, 19 Mar 2024 06:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1710855563; x=1711460363; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4zAsS/uNen1I904a04qYYT/TYDmbVxX/Uth0W4MlTuw=; b=P1OqbeGVx/LNo6k00aDeY0qqnZbyhwxJi/H5vPs6blh9cklngarVGr+2Kzw4IJuh70 IHsav1HSdeXmJmu0MgqJNAyJGChxVzybXBLcOlvptlhZHQaaQvVdZ52/dvfBzaca6rFx rXk/Te8lH7/NwcnTOYnJZbXrAdHziu2G9JLPHlfCU275a4W5kUqRNvEQaVw0KSkN//PB 2A283x3TDCPoPcbPlYs3h4CrcbcazIDpje6gu0cmDePzxJAjBabTvgxyMthK3BKVEOyH ckEnLuasQGtvjUmZiXrwXmtg9NZvsfsryVW38m5mjRVOZKFiehQ6WPw5Dya2bb30S343 p0BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710855563; x=1711460363; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4zAsS/uNen1I904a04qYYT/TYDmbVxX/Uth0W4MlTuw=; b=d2JMHE9BhjXZUheK763DKgKTdhbfYNKhVlFyKrelce9o2fRIQkbMbRQrSLjZ4ozVfF 8hnhcWmeQ5rNOb3g2f/HZ0wZ9WFjpLd0MRu9eIAh4o//jS8im/koT8PzEkcgbtNKIMel CnnueUEVmTu6uM+bWONLfkmhHMVdNaZUPEjpcHq/g7gAijPTiOSPgl6DOSFlxd0wxA3L aAj/JeOJUnbf28d2hbzG84yy+iUglsQiNhZj3+exuO+DHy/NirrfD+KKCzuqynsJRJLj fly/fkTpuYuVk+w6hS3IKZRddVhqfkBmuEy89Arl8lH4eNkCEMeRgCOZKkOccknalLWd tpEQ== X-Forwarded-Encrypted: i=1; AJvYcCVAMdSkgNfHeW5ccCMaAML79kyc3P2JGKlBknczsZAPtX549CMCQo+g/2QOZ8AgYc3dvj89FXl3vnal5HC3YSboKZ4Y66k1MhywFwhT X-Gm-Message-State: AOJu0YyYVbZKj78YyuPofTtnnslGQFecUzWqvK1eFO5x29+WUAQXnrej P6o7HU6jkGSVLx/oVVz25D9zii75ve3qXwp/at2wlhWtBkOpzIi4G7leyKCMJ0Q= X-Received: by 2002:a05:6402:5516:b0:568:1248:9f49 with SMTP id fi22-20020a056402551600b0056812489f49mr11014066edb.18.1710855562942; Tue, 19 Mar 2024 06:39:22 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id er27-20020a056402449b00b00568d2518105sm2756561edb.12.2024.03.19.06.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 06:39:22 -0700 (PDT) Date: Tue, 19 Mar 2024 14:39:21 +0100 From: Andrew Jones To: Conor Dooley Cc: Atish Patra , Inochi Amaoto , Qingfang Deng , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland , Conor Dooley , Heiko Stuebner , Guo Ren , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] perf: RISC-V: fix IRQ detection on T-Head C908 Message-ID: <20240319-3e72d732cbf2fcf1cb81f968@orel> References: <20240311063018.1886757-1-dqfext@gmail.com> <20240312-evil-resource-66370b68b9b4@spud> <20240315-73aa13079ef83a4559869084@orel> <2de56d8b-bc78-428b-9c09-4729b269fa41@rivosinc.com> <20240318-such-animal-bf33de12dc3a@spud> <4bdaaff1-13ec-48c2-b165-6a8255784aef@rivosinc.com> <20240319-worry-video-66589b3ed8ae@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240319-worry-video-66589b3ed8ae@spud> On Tue, Mar 19, 2024 at 09:06:34AM +0000, Conor Dooley wrote: > On Mon, Mar 18, 2024 at 05:48:13PM -0700, Atish Patra wrote: > > On 3/18/24 16:48, Conor Dooley wrote: > > > On Mon, Mar 18, 2024 at 03:46:54PM -0700, Atish Patra wrote: > > > > > For 2.b, either we can start defining pseudo extensions or adding > > > > vendor/arch/impid checks. > > > > > > > > @Conor: You seems to prefer the earlier approach instead of adding the > > > > checks. Care to elaborate why do you think that's a better method compared > > > > to a simple check ? > > > > > > Because I don't think that describing these as "errata" in the first > > > place is even accurate. This is not a case of a vendor claiming they > > > have Sscofpmf support but the implementation is flawed. As far as I > > > understand, this is a vendor creating a useful feature prior to the > > > creation of a standard extension. > > > A bit of a test for this could be "If the standard extension never > > > existed, would this be considered a new feature or an implementation > > > issue". I think this is pretty clearly in the former camp. > > > > > > > So we have 3 cases. > > > > 1. Pseudo extension: An vendor extension designed and/or implemented before > > the standard RVI extension was ratified but do not violate any standard > > encoding space. The vendor should name these extensions themselves. > > > > 2. Erratas: An genuine bug/design issue in the expected behavior from a > > standard RVI extension (including violating standard encoding space) More on this below, but I think vendors should name these too. > > > > 3. Vendor extension: A new or a variant of standard RVI extension which is > > different enough from standard extension. > > > > IMO, the line between #2 and #1 may get blurry as we going forward because > > of the sheer number of small extensions RVI is comping up with (which is a > > problem as well). The line between #1 and #2 is blurry because the only difference is the original intentions. The end result is that a vendor has implemented something that resembles a standard extension, but is not the same as the standard extension. > > Aye, I think some of that is verging on ridiculous. > > > Just to clarify: I am not too worried about this particular case as we know > > that T-head's implementation predates the Sscofpmf extension. > > But once we define a standard mechanism for this kind of situation, vendor > > may start to abuse it. > > How do you envisage it being abused by a vendor? > Pre-dating the standard extension does make this one fairly clear-cut, > but are you worried about people coming along and claiming to implement > XConorSscofpmf instead of Sscofpmf rather than suffer the "shame" of a > broken implementation? Other than the concern of the ballooning bitmap, I'd prefer this approach. If a vendor has implemented some extension which happens to be "almost Sscofpmf", then whether it was implemented before the Sscofpmf spec existed, or after, isn't really important. What's important is that it's only "almost Sscofpmf" and not _exactly_ Sscofpmf, which means it should not use the Sscofpmf extension name. Since vendors are allowed to create their own XVendor names, then that shouldn't be a problem. Indeed, the abuse concern seems to be in the opposite direction, that vendors will try to pass off almost-standard extensions as standard extensions by trying to get workarounds into Linux. Maybe Linux policy should be to simply reject workarounds to extensions, requiring vendors to create new names instead. > All this stuff is going to be pretty case-by-case (to begin with at > least) so I'm not too worried about that sort of abuse. Case-by-case is reasonable, since it's probably too strict to always require new names. We can consider each proposed workaround as they come, but it's a slippery slope once workarounds are accepted. Thanks, drew