mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>,
	Christoph Hellwig	 <hch@infradead.org>,
	Kevin Wolf <kwolf@redhat.com>,
	dm-devel@lists.linux.dev,  Hanna Czenczek <hreitz@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	snitzer@kernel.org, "Kernel Mailing List,
	Linux" <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 0/2] dm mpath: Interface for explicit probing of active paths
Date: Thu, 15 May 2025 16:50:38 +0200	[thread overview]
Message-ID: <71b42e5b613628642abeba5bd1e61089ca59c643.camel@suse.com> (raw)
In-Reply-To: <CABgObfZVbKcAua_=+C_0eC5Ec2ZDY4Bsz_b1memF1KifVGhoQw@mail.gmail.com>

On Thu, 2025-05-15 at 12:51 +0200, Paolo Bonzini wrote:
> On Thu, May 15, 2025 at 12:34 PM Martin Wilck <mwilck@suse.com> 
> > 
> > Thanks for mentioning this. However, I suppose that depends on the
> > permissions with which the qemu process is started, no? Wouldn't
> > qemu need CAP_SYS_RAWIO for PCI passthrough as well?
> 
> Generally you want to assume that the VM is hostile and run QEMU with
> as few privileges as possible (not just capabilities, but also in
> separate namespaces and with restrictions from device cgroups,
> SELinux, etc.). PCI passthrough is not an issue, it only needs access
> to the VFIO inodes and you can do it by setting the appropriate file
> permissions without extra capabilities. The actual privileged part is
> binding the device to VFIO, which is done outside QEMU anyway.

Thanks for the clarification.

> > I admit that I'm confused by the many indirections in qemu's scsi-
> > block
> > code flow. AFAICS qemu forwards everything except PRIN/PROUT to the
> > kernel block device in "scsi-block" mode. Correct me if I'm wrong.
> 
> Yes, that's correct. The code for PRIN/PROUT calls out to a separate
> privileged process (in scsi/qemu-pr-helper.c if you're curious) which
> is aware of multipath and can be extended if needed.

Sure, I was aware of the helper. I just wasn't 100% clear about how it
gets called. Found the code in the meantime [1].

[1] https://github.com/qemu/qemu/blob/864813878951b44e964eb4c012d832fd21f8cc0c/block/file-posix.c#L4286

> > > .Of the ones that aren't simple I/O, mode parameters and TUR are
> > > the
> > > important cases. A TUR failure would be handled by the ioctl that
> > > Kevin proposed here by forcing a path switch. Mode parameters
> > > might
> > > not be shared(*) and would need to be sent down all the paths in
> > > that
> > > case; that can be fixed in userspace if necessary.
> > 
> > Passing TUR from a multipath device to a random member doesn't make
> > much sense to me. qemu would need to implement some logic to
> > determine
> > whether the map has any usable paths.
> 
> As long as one path replies to a TUR and the host is able to
> (eventually, somehow) steer I/O transparently to that path, that
> should be good enough. If the one path that the kernel tries is down,
> QEMU can probe which paths are up and retry. That seems consistent
> with what you want from TUR but maybe I'm missing something.

It's ok-ish, in particular in combination with Kevin't patch. But using
an equivalent of "multipath -C" would be closer to the real thing for
TUR.

Regards
Martin

  reply	other threads:[~2025-05-15 14:50 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 16:50 Kevin Wolf
2025-04-29 16:50 ` [PATCH 1/2] dm: Allow .prepare_ioctl to handle ioctls directly Kevin Wolf
2025-04-29 23:22   ` Benjamin Marzinski
2025-05-08 13:50   ` Martin Wilck
2025-04-29 16:50 ` [PATCH 2/2] dm mpath: Interface for explicit probing of active paths Kevin Wolf
2025-04-29 23:22   ` Benjamin Marzinski
2025-05-08 13:51 ` [PATCH 0/2] " Martin Wilck
2025-05-12 13:46   ` Mikulas Patocka
2025-05-13  7:06     ` Martin Wilck
2025-05-12 15:18   ` Kevin Wolf
2025-05-13  5:55     ` Christoph Hellwig
2025-05-13  6:09       ` Hannes Reinecke
2025-05-13  6:14         ` Christoph Hellwig
2025-05-13  6:32           ` Hannes Reinecke
2025-05-13  6:49             ` Christoph Hellwig
2025-05-13  8:17               ` Martin Wilck
2025-05-14  4:53                 ` Christoph Hellwig
2025-05-15 11:14                   ` Paolo Bonzini
2025-05-13 16:29               ` Benjamin Marzinski
2025-05-14  4:56                 ` Christoph Hellwig
2025-05-14  6:39                 ` Hannes Reinecke
2025-05-14 16:01                   ` Benjamin Marzinski
2025-05-16  5:52                 ` Christoph Hellwig
2025-05-13  9:29       ` Kevin Wolf
2025-05-13 15:43         ` Paolo Bonzini
2025-05-14  4:57         ` Christoph Hellwig
2025-05-14 16:23           ` Benjamin Marzinski
2025-05-14 17:37             ` Martin Wilck
2025-05-15  2:53               ` Paolo Bonzini
2025-05-15 10:34                 ` Martin Wilck
2025-05-15 10:51                   ` Paolo Bonzini
2025-05-15 14:50                     ` Martin Wilck [this message]
2025-05-15 14:29                   ` Benjamin Marzinski
2025-05-15 15:00                     ` Martin Wilck
2025-05-16  5:57                       ` Christoph Hellwig
2025-05-13  6:30     ` Hannes Reinecke
2025-05-13 18:09       ` Benjamin Marzinski
2025-05-13  8:00     ` Martin Wilck
2025-05-13 10:06       ` Martin Wilck
2025-05-14 21:21       ` Martin Wilck
2025-05-15 10:11         ` Kevin Wolf
2025-05-15 11:09           ` Paolo Bonzini
2025-05-15 15:18             ` Martin Wilck
2025-05-15 15:05           ` Martin Wilck
2025-05-16  6:00           ` Christoph Hellwig
2025-05-16 16:06             ` Benjamin Marzinski
2025-05-19  5:32               ` Christoph Hellwig
2025-05-19 18:24                 ` Benjamin Marzinski
2025-05-28 20:44                 ` Martin Wilck
2025-05-19 10:06             ` Kevin Wolf
2025-05-19 17:33             ` Martin Wilck
2025-05-20 13:46               ` Christoph Hellwig

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=71b42e5b613628642abeba5bd1e61089ca59c643.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hare@suse.com \
    --cc=hch@infradead.org \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=snitzer@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome