From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 641C6190664 for ; Tue, 7 Jan 2025 22:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736289305; cv=none; b=FNHvRQD4Y58ltN+dW7Nn9cWW3TLlHkR65a4JTz4LBPzUT3gQlhjepseN0i/W0/xfhpkZVTyBVL169Q9a6N+DQ75MjLVL65uG5Iq/xOBjhDT+Yc2lGmED55Yo3jKD/SnrTxCgkWN7DqcwwB5SH+7ac6TwGyqTmoS99BJWRDhJf8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736289305; c=relaxed/simple; bh=yPZGWdBx5A0pMgHsMGyEc3nl2PscNIs/BxteV4XQEhY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HUTstADH8KsBZjcIPIv7L1dGH1tX1GAMfBdNbt8Td+otUQEvP/WUwONaovcOZmq223etCQMTVFu6i7QH4BavCk9oYISH7XOBZIjJne2t9Du4dTlYsd6j6t3QnvAGzmdUXi45Wn3d8VmnjtWb9t7rXLzW7ZzSeggFgwaFyD8CbUQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=kDn9Gzem; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="kDn9Gzem" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7b7041273ddso1118648685a.3 for ; Tue, 07 Jan 2025 14:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736289302; x=1736894102; 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=W32+DfbiSFJc5BSiD7HWso1Bv/1sco9S6FmQB5UqoO0=; b=kDn9Gzem2RGLEIjkKfQLcr6VplOyFNNvj8lI0ngk+ysWWFsz+1FU/NT1QPWNkCMhY5 nYu1Tdlg3VEWJZdT/2e+cVj1eGwWuMIz8p136LhFllZRaA3kfL9CYf20hY5SiV6vkzxi YILZw3WW9NUFVBTz/2m/Z+4yd1wIF1KISvPuhHNl3cNaT5HGgY8nwLhSfSAaA2BD0e3l Vg/FMA7yIKVZUXwgqfc2/TQu7ueLDuDLP91NJ9yQ26/S03arR/DmTDXO7YWA5HzOSKJC 1bZwvkH+AAmE9IARBT6osHrZJ2HA9EQGdZDJILPNQ0GdWRONuk9lTGne6DxAbpNx+G9X WSWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736289302; x=1736894102; 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=W32+DfbiSFJc5BSiD7HWso1Bv/1sco9S6FmQB5UqoO0=; b=SESJhWLwY8gl1gcg+nz0YW+3JUKL6eiYb3whOtjpP3OPkakgXCYeUmlbr0qknN8F41 BhzGBKeYg7XiQKjrRy8CiDcuLvF3gLvZU0+75S7U1q1pzk04o8P90BWAdRbm2zsvLwmJ cxOhpWLH9Q9XYvBWY+F9EtqMolsvJyLyV8sqgfWWOU/6JNdUdx7G1iL7KINDr2gAfQhK TVyvDfVwT8TAbszqY8yCoIF+/8EEjvnBVZ1r9hzauVNEorqT5jZrWTrLprbmsTyP52nb Jr4BUW7GcVVcQ5+8bXglgn0cYB8bWoSpk2L1hvpWCDbsucA8v6yKs/WVHFrPB/oCwQbL yMQA== X-Forwarded-Encrypted: i=1; AJvYcCWrOU6iHrL/5lU7ts1ptXWHPqhCBOvk5snKaMeEMStsNYAEEf12CJc7xPq2pJ3YUP0b/a8YjEKzXLdgFz0=@vger.kernel.org X-Gm-Message-State: AOJu0YyIg59layVs5EQDtKp5jMwUkIskYdEPw+0zc+6MuaZcMKXQEUGR 6PWbV1UX19CuHuOKK3DHhRRZqmpyOdl7/OzcIGunidNC57r+jn6XmKUWP28jCzY= X-Gm-Gg: ASbGnctdLw6Qps4GGilpYp46TL5OnWUo1x7d34bckUBiVbW/z/8b6PkIWACpu/SHfva t3Hc+vgiesgraaXVV6+J46JH+jJNIugzsJHDQJ4SR68sWUOKbbFeooI7Dvxa5Kj4l/+lou1hCxT ZYqY66XMILKU5Dpwa4BCM+u7v6TOIUDv82ADM63NF2EOfeLnbl3SN/XPppgwBvULnYRtmGvMeWB EpHvBAwt9uA+5nO8a58bOJ50MDra5AsYy84AtDu29DHnkR8PIGYJM5p06mVYC6xIhIuA/7RSMwF zj4UAQVDC67gY4spaqbsuAMlxxvFajTapKHCUnM= X-Google-Smtp-Source: AGHT+IEaPaQR/CUFN15VORQEgoexJmgGjQbJC03yJsAU5djhDHrZK+o8/ABz82G4BVWZq1TsOQu/WQ== X-Received: by 2002:a05:620a:2785:b0:7b6:7970:651c with SMTP id af79cd13be357-7bcd97a57d7mr77471185a.41.1736289302358; Tue, 07 Jan 2025 14:35:02 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac2d11a2sm1622392085a.29.2025.01.07.14.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 14:35:02 -0800 (PST) Date: Tue, 7 Jan 2025 17:35:00 -0500 From: Gregory Price To: Robert Richter Cc: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, "Fabio M. De Francesco" , Terry Bowman Subject: Re: [PATCH v1 21/29] cxl/region: Lock decoders that need address translation Message-ID: References: <20250107141015.3367194-1-rrichter@amd.com> <20250107141015.3367194-22-rrichter@amd.com> 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: <20250107141015.3367194-22-rrichter@amd.com> On Tue, Jan 07, 2025 at 03:10:07PM +0100, Robert Richter wrote: > There is only support to translate from the endpoint to its parent > port, but not in the opposite direction from the parent to the > endpoint. Thus, the endpoint address range cannot be determined and > setup manually. If the parent implements the ->to_hpa() callback and > needs address translation, forbit reprogramming of the decoders and ^^^^^^ forbid? > lock them. > > Signed-off-by: Robert Richter > --- > drivers/cxl/core/region.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > index 8d7893878362..681c26abc26e 100644 > --- a/drivers/cxl/core/region.c > +++ b/drivers/cxl/core/region.c > @@ -3353,6 +3353,17 @@ static int cxl_endpoint_initialize(struct cxl_endpoint_decoder *cxled) > if (cxl_port_calc_hpa(parent, cxld, &hpa)) > return -ENXIO; > > + /* > + * There is only support to translate from the endpoint to its > + * parent port, but not in the opposite direction from the > + * parent to the endpoint. Thus, the endpoint address range > + * cannot be determined and setup manually. If the parent > + * implements the ->to_hpa() callback and needs address > + * translation, forbit reprogramming of the decoders and lock ^^^^^^ forbid? > + * them. > + */ > + cxld->flags |= CXL_DECODER_F_LOCK; > + > /* Iterate from endpoint to root_port refining the position */ > pos = cxl_port_calc_pos(iter, &hpa, pos); > if (pos < 0) > -- > 2.39.5 >