All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <ira.weiny@intel.com>, <alucerop@amd.com>,
	<a.manzanares@samsung.com>, <linux-cxl@vger.kernel.org>,
	<qemu-devel@nongnu.org>
Subject: Re: [PATCH 3/4] hw/cxl: Allow BI by default in Window restrictions
Date: Fri, 8 Aug 2025 16:47:55 +0100	[thread overview]
Message-ID: <20250808164755.0000339c@huawei.com> (raw)
In-Reply-To: <20250806055708.196851-4-dave@stgolabs.net>

On Tue,  5 Aug 2025 22:57:07 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> Update the CFMW restrictions to also permit Back-Invalidate
> flows by default, which is aligned with the no-restrictions
> policy.
> 
> While at it, document the 'restrictions=' option.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

I sat on this the original restrictions patch without trying to
upstream it on the basis that it's a horrible interface. 
Time to clean my mess up I guess then I'll fix this up on top.
We probably want it to enable everything by default (other
than the fixed device config one and then provide boolean
properties to turn things off.  For now I can't see a reason
to have the fixed device config as a possibility.

Jonathan


> ---
>  hw/cxl/cxl-host.c | 2 +-
>  qapi/machine.json | 3 ++-
>  qemu-options.hx   | 4 +++-
>  3 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c
> index def2cf75be61..0d17ea3e4c26 100644
> --- a/hw/cxl/cxl-host.c
> +++ b/hw/cxl/cxl-host.c
> @@ -64,7 +64,7 @@ static void cxl_fixed_memory_window_config(CXLFixedMemoryWindowOptions *object,
>      if (object->has_restrictions) {
>          fw->restrictions = object->restrictions;
>      } else {
> -        fw->restrictions = 0xf; /* No restrictions */
> +        fw->restrictions = 0x2f; /* No restrictions */
>      }
>  
>      fw->targets = g_malloc0_n(fw->num_targets, sizeof(*fw->targets));
> diff --git a/qapi/machine.json b/qapi/machine.json
> index ac258578e4ab..ea8ba71305b0 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -589,7 +589,8 @@
>  #     BIT(2) - Volatile
>  #     BIT(3) - Persistent
>  #     BIT(4) - Fixed Device Config
> -#     Default is 0xF
> +#     BIT(5) - BI
> +#     Default is 0x2F
>  #
>  # @targets: Target root bridge IDs from -device ...,id=<ID> for each
>  #     root bridge.
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 1f862b19a676..ef6072bd8b59 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -142,7 +142,7 @@ SRST
>              -machine memory-backend=pc.ram
>              -m 512M
>  
> -    ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]``
> +    ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity,restrictions=restrictions]``
>          Define a CXL Fixed Memory Window (CFMW).
>  
>          Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
> @@ -168,6 +168,8 @@ SRST
>          interleave. Default 256 (bytes). Only 256, 512, 1k, 2k,
>          4k, 8k and 16k granularities supported.
>  
> +	``restrictions=restrictions`` bitmask of restrictions of the CFMW.
> +
>          Example:
>  
>          ::


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <ira.weiny@intel.com>, <alucerop@amd.com>,
	<a.manzanares@samsung.com>, <linux-cxl@vger.kernel.org>,
	<qemu-devel@nongnu.org>
Subject: Re: [PATCH 3/4] hw/cxl: Allow BI by default in Window restrictions
Date: Fri, 8 Aug 2025 16:47:55 +0100	[thread overview]
Message-ID: <20250808164755.0000339c@huawei.com> (raw)
In-Reply-To: <20250806055708.196851-4-dave@stgolabs.net>

On Tue,  5 Aug 2025 22:57:07 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> Update the CFMW restrictions to also permit Back-Invalidate
> flows by default, which is aligned with the no-restrictions
> policy.
> 
> While at it, document the 'restrictions=' option.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

I sat on this the original restrictions patch without trying to
upstream it on the basis that it's a horrible interface. 
Time to clean my mess up I guess then I'll fix this up on top.
We probably want it to enable everything by default (other
than the fixed device config one and then provide boolean
properties to turn things off.  For now I can't see a reason
to have the fixed device config as a possibility.

Jonathan


> ---
>  hw/cxl/cxl-host.c | 2 +-
>  qapi/machine.json | 3 ++-
>  qemu-options.hx   | 4 +++-
>  3 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c
> index def2cf75be61..0d17ea3e4c26 100644
> --- a/hw/cxl/cxl-host.c
> +++ b/hw/cxl/cxl-host.c
> @@ -64,7 +64,7 @@ static void cxl_fixed_memory_window_config(CXLFixedMemoryWindowOptions *object,
>      if (object->has_restrictions) {
>          fw->restrictions = object->restrictions;
>      } else {
> -        fw->restrictions = 0xf; /* No restrictions */
> +        fw->restrictions = 0x2f; /* No restrictions */
>      }
>  
>      fw->targets = g_malloc0_n(fw->num_targets, sizeof(*fw->targets));
> diff --git a/qapi/machine.json b/qapi/machine.json
> index ac258578e4ab..ea8ba71305b0 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -589,7 +589,8 @@
>  #     BIT(2) - Volatile
>  #     BIT(3) - Persistent
>  #     BIT(4) - Fixed Device Config
> -#     Default is 0xF
> +#     BIT(5) - BI
> +#     Default is 0x2F
>  #
>  # @targets: Target root bridge IDs from -device ...,id=<ID> for each
>  #     root bridge.
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 1f862b19a676..ef6072bd8b59 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -142,7 +142,7 @@ SRST
>              -machine memory-backend=pc.ram
>              -m 512M
>  
> -    ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]``
> +    ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity,restrictions=restrictions]``
>          Define a CXL Fixed Memory Window (CFMW).
>  
>          Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
> @@ -168,6 +168,8 @@ SRST
>          interleave. Default 256 (bytes). Only 256, 512, 1k, 2k,
>          4k, 8k and 16k granularities supported.
>  
> +	``restrictions=restrictions`` bitmask of restrictions of the CFMW.
> +
>          Example:
>  
>          ::



  parent reply	other threads:[~2025-08-08 15:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  5:57 [PATCH -qemu 0/4] hw/cxl: Support Back-Invalidate Davidlohr Bueso
2025-08-06  5:57 ` [PATCH 1/4] hw/pcie: Support enabling flit mode Davidlohr Bueso
2025-08-08 15:42   ` Jonathan Cameron
2025-08-08 15:42     ` Jonathan Cameron via
2025-08-08 17:45     ` Davidlohr Bueso
2025-08-08 18:18     ` Markus Armbruster
2025-08-08 16:02   ` Jonathan Cameron
2025-08-08 16:02     ` Jonathan Cameron via
2025-08-06  5:57 ` [PATCH 2/4] hw/cxl: Refactor component register initialization Davidlohr Bueso
2025-08-06  5:57 ` [PATCH 3/4] hw/cxl: Allow BI by default in Window restrictions Davidlohr Bueso
2025-08-07  0:06   ` Davidlohr Bueso
2025-08-08 15:47   ` Jonathan Cameron [this message]
2025-08-08 15:47     ` Jonathan Cameron via
2025-08-06  5:57 ` [PATCH 4/4] hw/cxl: Support Type3 HDM-DB Davidlohr Bueso
  -- strict thread matches above, loose matches on Subject: below --
2025-08-11  3:34 [PATCH v2 -qemu 0/4] hw/cxl: Support Back-Invalidate Davidlohr Bueso
2025-08-11  3:34 ` [PATCH 3/4] hw/cxl: Allow BI by default in Window restrictions Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250808164755.0000339c@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=a.manzanares@samsung.com \
    --cc=alucerop@amd.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.