From: Alex Williamson <alex.williamson@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] kvm/vfio: Constify struct kvm_device_ops
Date: Fri, 1 Nov 2024 08:37:18 -0600 [thread overview]
Message-ID: <20241101083718.32f1657a.alex.williamson@redhat.com> (raw)
In-Reply-To: <e7361a1bb7defbb0f7056b884e83f8d75ac9fe21.1727517084.git.christophe.jaillet@wanadoo.fr>
On Sat, 28 Sep 2024 11:52:46 +0200
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 'struct kvm_device_ops' is not modified in this driver.
>
> Constifying this structure moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.
>
> On a x86_64, with allmodconfig:
> Before:
> ======
> text data bss dec hex filename
> 2605 169 16 2790 ae6 virt/kvm/vfio.o
>
> After:
> =====
> text data bss dec hex filename
> 2685 89 16 2790 ae6 virt/kvm/vfio.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only
> ---
> virt/kvm/vfio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c
> index 388ae471d258..e72a6a1d5a20 100644
> --- a/virt/kvm/vfio.c
> +++ b/virt/kvm/vfio.c
> @@ -353,7 +353,7 @@ static void kvm_vfio_release(struct kvm_device *dev)
>
> static int kvm_vfio_create(struct kvm_device *dev, u32 type);
>
> -static struct kvm_device_ops kvm_vfio_ops = {
> +static const struct kvm_device_ops kvm_vfio_ops = {
> .name = "kvm-vfio",
> .create = kvm_vfio_create,
> .release = kvm_vfio_release,
Applied to vfio next branch for v6.13. Thanks,
Alex
prev parent reply other threads:[~2024-11-01 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 9:52 [PATCH] kvm/vfio: Constify struct kvm_device_ops Christophe JAILLET
2024-11-01 14:37 ` Alex Williamson [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=20241101083718.32f1657a.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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