From: Stefan Hajnoczi <stefanha@redhat.com>
To: Jeuk Kim <jeuk20.kim@samsung.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"fam@euphon.net" <fam@euphon.net>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"kwolf@redhat.com" <kwolf@redhat.com>,
"hreitz@redhat.com" <hreitz@redhat.com>,
Klaus Birkelund Jensen <k.jensen@samsung.com>,
"eblake@redhat.com" <eblake@redhat.com>
Subject: Re: [PATCH v2 3/3] hw/ufs: Support for UFS logical unit
Date: Mon, 19 Jun 2023 16:45:10 +0200 [thread overview]
Message-ID: <20230619144510.GG2497337@fedora> (raw)
In-Reply-To: <20230619111627epcms2p70ab099f30804d2819b72f105c6f28e19@epcms2p7>
[-- Attachment #1: Type: text/plain, Size: 2232 bytes --]
On Mon, Jun 19, 2023 at 08:16:27PM +0900, Jeuk Kim wrote:
> On Fri, Jun 19, 2023, Stefan Hajnoczi wrote:
> >On Fri, Jun 16, 2023 at 03:58:27PM +0900, Jeuk Kim wrote:
> >> This commit adds support for ufs logical unit.
> >> The LU handles processing for the SCSI command,
> >> unit descriptor query request.
> >>
> >> This commit enables the UFS device to process
> >> IO requests.
> >
> >Is UFS a SCSI Host Bus Adapter capable of exposing any SCSI device? The
> >code is written as if UFS was a special-purpose SCSI bus that cannot
> >handle regular SCSI devices already emulated by QEMU (like scsi-hd). As
> >a result, it duplicates a lot of SCSI device code instead of just
> >focussing on unwrapping/wrapping the SCSI commands and responses from
> >the UFS interface.
> >
> >Would it be possible to have:
> >
> > --device ufs,id=<bus-name>
> > --device scsi-hd,bus=<bus-name>
> >
> >?
> >
> >I think that would involve less code and be more flexible.
> >
>
> Unfortunately, UFS is not a generic SCSI Host Bus Adapter.
> UFS uses the SCSI specification to communicate with the driver,
> but its behaviour is very different from that of a typical SCSI device.
> (So it's intentional that UFS looks like a special-purpose SCSI bus.)
>
> For example, UFS has the well-known lu.
> Unlike typical SCSI devices, where each lu is independent,
> UFS can control other lu's through the well-known lu.
>
> Therefore, UFS can only work properly with ufs-lu, and not with
> other scsi devices such as scsi-hd. :'(
>
> That's why I made the UFS bus and added the ufs_bus_check_address()
> to prevent normal scsi devices and UFS from connecting to each other.
>
> Also, in the future, I will add more ufs-specific features
> like hibernation and zoned, which are different from normal SCSI devices.
>
> So personally, I think we should define ufs-lu separately as we do now.
> Is that okay?
Yes, I think that makes sense. Thanks for explaining.
Paolo Bonzini is the QEMU SCSI emulation maintainer. He might have more
thoughts about this. I have CCed him, but I think you can continue with
the current approach unless Paolo decides to get involved in this patch
series.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-06-19 14:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230616065827epcms2p2ad3eefa7762feafe673ff9c0a54ba007@epcms2p2>
2023-06-16 6:58 ` [PATCH v2 3/3] hw/ufs: Support for UFS logical unit Jeuk Kim
2023-06-19 8:23 ` Stefan Hajnoczi
2023-06-19 11:16 ` Jeuk Kim
2023-06-19 14:45 ` Stefan Hajnoczi [this message]
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=20230619144510.GG2497337@fedora \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=jeuk20.kim@samsung.com \
--cc=k.jensen@samsung.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.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.