linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Paolo Bonzini <pbonzini@redhat.com>, Alexander Graf <graf@amazon.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [GIT PULL] KVM patches for Linux 6.1-rc2
Date: Sun, 23 Oct 2022 15:15:08 -0700	[thread overview]
Message-ID: <CAHk-=wgL7sh-+6mPk7FGCFtjuh36fhOLNRTT0_4g3yd380P0+w@mail.gmail.com> (raw)
In-Reply-To: <20221023174307.1868939-1-pbonzini@redhat.com>

On Sun, Oct 23, 2022 at 10:43 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> x86:
>
> - add compat implementation for KVM_X86_SET_MSR_FILTER ioctl

Side note: this should probably have used

        compat_uptr_t bitmap;
        ...
        .bitmap = compat_ptr(cr->bitmap),

instead of doing that

        __u32 bitmap;
        ...
       .bitmap = (__u8 *)(ulong)cr->bitmap,

because not only are those casts really ugly, using that
'compat_uptr_t" and "compat_ptr()" helper also really explains what is
going on.

compat_ptr() also happens to get the address space right (ie it
returns a "void __user *" pointer). But since the non-compat 'struct
kvm_msr_filter_range' bitmap member doesn't get that right either
(because it uses the same type for kernel pointers as for user
pointers - ugly uglt), that isn't such a big deal. The kvm code
clearly doesn't do proper user pointer typing, and just uses random
casts instead.

                         Linus

  reply	other threads:[~2022-10-23 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-23 17:43 [GIT PULL] KVM patches for Linux 6.1-rc2 Paolo Bonzini
2022-10-23 22:15 ` Linus Torvalds [this message]
2022-10-25  9:42   ` Paolo Bonzini
2022-10-23 22:39 ` pr-tracker-bot

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='CAHk-=wgL7sh-+6mPk7FGCFtjuh36fhOLNRTT0_4g3yd380P0+w@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=graf@amazon.com \
    --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;
as well as URLs for NNTP newsgroup(s).