From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 13A28146D57 for ; Tue, 7 Jan 2025 22:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736287290; cv=none; b=K0XQPWpesyH2XHscbyQFqzT7l3w5tvjQS0MlwABGBO8i5S0T/hxO9EdHES2oJUY1fcSCg7HqbKF4aH365EXNzzSHDgXsJsbP/whv+iQtAw3tLLT1mxefIxO89OxZerEyLegmsacpp9pm9xxp0Qzdm6hNknop88hR2zxMsJWm8S8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736287290; c=relaxed/simple; bh=HTd6aNzd+WG4gQYS/ec1UtjMqQBNV7pllBynGdA6iOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=byKPna8dqws8sV2k/hrRdhLOT1HnnFsamBj5WH7mW07RXp9wufySXB6AD0L1i9B0cOirX8pKXyQ0YPG/MviZSqBUzcN4nJW4ZsRZ4x+e8OfBYZJcg8VgZ0JTUiy26XcbN4s4N5O8vjCKY4+33GQqD7Psi7N9tz1UewoGrYoxwlw= 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=G7Xk2R0E; arc=none smtp.client-ip=209.85.219.44 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="G7Xk2R0E" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6dd5c544813so118068266d6.1 for ; Tue, 07 Jan 2025 14:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736287285; x=1736892085; 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=9z8RNkUkt+CcynHF95NF8N98PCbipY/N38UIAM8LaNM=; b=G7Xk2R0E8ra5rHDh2cvQ0d2nXFQitlpjzzjSH9Mwk/m6ZDVR7Bb6SHZPgdP0tlxXIi S7ayMbdxkqS+x5LG5RYpHr4TbB7D+d8x0TTnDt1+eXcTt9AMUeHJa3zGrMFGtZzrPAZX p0DW72YcxVGj+6XZdugUAVQ2XJ8+HXy7J+fnFO5TfaLY0OI9KXCuHL3RFxCMQWNpvUC0 gqzs1dJ8jgd666BtSHzgfHkTYnSebINsTqjHuuEFbm6coFXRbFIjYUm1sBaMX382gjYc J6jMHGgWJcQ5avBkjSaaL4T6tjyoDw4QlYZuubhy//te/SETKPRcHVBDJ0jtss8AaLJ3 7vIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736287285; x=1736892085; 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=9z8RNkUkt+CcynHF95NF8N98PCbipY/N38UIAM8LaNM=; b=NgF34ubsSYrI3foB2oZ3bCIboAmfZ1Ai5jspPzG/FRMc4uNu/BD3R0O+1TKRnjwD9+ NvjhNYjhoohb6ply6ahjOoB+XDz1BTu3WVbBN/GcGMRLE/IZ4O67THzBNKWs3ubJoZUZ SwsY1UyBfLAVZ/mNHce8rs251t+HjKLspZkkUxcJeC8Eyd/3pzm8oXuAQ5pOiw4eiMNs OyDB5lGCTv8X6FT0dumVV2Wu5Mjg2GfMXcprjOYRw2yoQD0HhkNX35u5ZQ5WCIu+OXtT d0M95a/c6JxMoWUjxQy9OR/tjH1/lFyzlnMYl9zvMDoB/bKc9sNLkMpx8mizrNglk37P SFQQ== X-Forwarded-Encrypted: i=1; AJvYcCVNDPes1FZ+rEWWt9orTl/C6z7zlT8dPVTx3ldB8S07nD+vTvBq31rAyx45d1F4DyIskWIzjGMblahRdxs=@vger.kernel.org X-Gm-Message-State: AOJu0YxxtdHoJcRQCbt6EgjEk1vfAqQ1vHf+7a2neOz5fEfDLS6OEPyU YAYenerw9wwegLRo7JGvHRLaZfse4gXIbtVcPbdwlTL2W15NL0IsYq2LdTDsYjE= X-Gm-Gg: ASbGncsjJrHO1KxFp8GeVENp1Xut4si735TP3u6dzDkt576A5h2ybCBZPRrA39LYSXC WcMHdvj9tewzkyvKbkrcpYjtOUkxr57MBd9IBCmyu6zwYXGvYhKb+NfhM5+LffHxi5/i8ep1pzO nH9x5zF0vH3bsIcA90HjrN4HSSQSF4DUocIRntLUQNNcOmMGW8irc5OYV3iP3/QeDfQizv9cUzg B64eKoHSpfsvXe0kYOdr4ckrXI5AsoFU0oxvRpBD+SOotRXAc3Q1mRVa1jPCdyIdjKPWWGlfEje djTV2//nMGQmXVZ36S+Wvu8dXwv1t+S4drkBMrU= X-Google-Smtp-Source: AGHT+IHbOqe2Ef0AYcLsrDlalZWeqM6pd6Eh/2Fncle6Uf/C590+nFuSLbF1ltS+ZHE+yhoYTu6SBA== X-Received: by 2002:a05:6214:5782:b0:6d8:8480:27e with SMTP id 6a1803df08f44-6df9b1eb0afmr13222126d6.11.1736287284860; Tue, 07 Jan 2025 14:01:24 -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 6a1803df08f44-6dd180ea6fdsm185057416d6.23.2025.01.07.14.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 14:01:24 -0800 (PST) Date: Tue, 7 Jan 2025 17:01:22 -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 16/29] cxl/region: Use translated HPA ranges to calculate the endpoint position Message-ID: References: <20250107141015.3367194-1-rrichter@amd.com> <20250107141015.3367194-17-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-17-rrichter@amd.com> On Tue, Jan 07, 2025 at 03:10:02PM +0100, Robert Richter wrote: > To enable address translation, the calculation of the endpoint > position must use translated HPA ranges. The function > cxl_endpoint_initialize() already uses translation which could be > reused to calculate the endpoint position. > > Use translated HPA address ranges for the calculation of endpoint > position by moving it to cxl_endpoint_initialize(). Create a function > cxl_port_calc_pos() for use in the iterator there, but keep a > simplified version of cxl_calc_interleave_pos() for the > non-auto-discovery code path without address translation since it is > not support there. > > Signed-off-by: Robert Richter > --- just one inline question > +static int cxl_calc_interleave_pos(struct cxl_endpoint_decoder *cxled) > +{ > + struct cxl_port *iter, *port = cxled_to_port(cxled); > + struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); > + struct range *range = &cxled->cxld.hpa_range; > + int pos = 0; > + > + /* > + * Address translation is only supported for auto-discovery of > + * decoders. There is no need to support address translation > + * here. > + */ Just clarifying - it's only supported for discovery of already programmed decoders (programmed in BIOS)? i.e. driver-programmed decoders shouldn't need this translation / won't support this type of interleaving? Comment here begs some questions but not necessarily a review blocker. ~Gregory