Linux CXL
 help / color / mirror / Atom feed
From: Gregory Price <gregory.price@memverge.com>
To: Ravi Kanth <mvrravikanth@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-cxl@vger.kernel.org, Sajjan Rao <sajjanr@gmail.com>
Subject: Re: Support for CXL v3.0 spec with QEMU
Date: Fri, 1 Sep 2023 10:18:08 -0400	[thread overview]
Message-ID: <ZPHyoJsZDnzpU7C4@memverge.com> (raw)
In-Reply-To: <CAEvOrRyquLL6-d=vOyB9NNOPVE370qjV0zu8XBsTJmpOBx2UNw@mail.gmail.com>

On Fri, Sep 01, 2023 at 07:33:57PM +0530, Ravi Kanth wrote:
> Thanks Jonathan. We built the custom kernel and were able to run the
> test tool successfully and get the data.
> 
> However when we modify the code to send raw commands, we are not able
> to send raw commands to the driver. We always see ENOPERM from the
> driver. Below is the code snippet. Should we enable some settings or
> from a code perspective should changes be made?
> 
> From CXL driver code perspective, we see that ENOPERM can only be
> returned by cxl_mem_raw_command_allowed(). Not really sure why the raw
> command is not able to go through but the MEM
> command(CXL_MEM_COMMAND_ID_INFO_STAT_IDENTIFY) is able to run
> successfully.
> 
> Can you please help us here?
> 
> Code snippet:
>   cmd.id = CXL_MEM_COMMAND_ID_RAW;
>   cmd.raw.opcode= 0x0001; /*This is a Identify (Opcode 0001h) per CXL spec */
>   cmd.out.size = sizeof(is_identify);
>   cmd.out.payload = (__u64)&is_identify;
> 
>   printf("sending identify command...\n");
>   printf("cmd.id:%x cmd.raw.opcode:%x\n",cmd.id,cmd.raw.opcode);
>   printf("cmd.raw.rsvd:%d\n",cmd.raw.rsvd);
>   rc = ioctl(fd, CXL_MEM_SEND_COMMAND, &cmd);
> 
> Appreciate your help all along.
> 
> Ravi
> 

raw commands are not allowed by default, you must turn on
CONFIG_CXL_MEM_RAW_COMMANDS in the kernel build config.

~Gregory

  reply	other threads:[~2023-09-01 14:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 16:12 Support for CXL v3.0 spec with QEMU Ravi Kanth
2023-08-10 16:33 ` Jonathan Cameron
2023-08-10 16:40   ` Ravi Kanth
2023-08-11 12:04     ` Ravi Kanth
2023-08-11 13:52       ` Jonathan Cameron
2023-08-16 11:41         ` Ravi Kanth
2023-08-23 17:03           ` Jonathan Cameron
2023-09-01 14:03             ` Ravi Kanth
2023-09-01 14:18               ` Gregory Price [this message]
2023-09-01 14:37                 ` Ravi Kanth
2023-09-01 16:19                   ` Ravi Kanth
     [not found]                     ` <SJ0PR17MB5512449C5FFD76AD50B3D3AF83E4A@SJ0PR17MB5512.namprd17.prod.outlook.com>
2023-09-02 14:58                       ` Ravi Kanth
2023-10-18 10:30                         ` Ravi Kanth
2023-10-19 17:08                           ` Ravi Kanth
2023-10-20 20:38                             ` Ira Weiny
2023-10-22  6:45                               ` Ravi Kanth
2023-10-23 13:50                                 ` Jonathan Cameron
2023-10-26  1:52                                   ` Ravi Kanth
2023-10-26  8:59                                     ` Jonathan Cameron
2023-10-23 13:44                               ` Jonathan Cameron
2023-08-11 13:49     ` Jonathan Cameron

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=ZPHyoJsZDnzpU7C4@memverge.com \
    --to=gregory.price@memverge.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=mvrravikanth@gmail.com \
    --cc=sajjanr@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox