From: Peter Xu <peterx@redhat.com>
To: Hamza Mahfooz <someguy@effective-light.com>
Cc: linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: const-ify all relevant uses of struct kvm_memory_slot
Date: Fri, 30 Jul 2021 16:19:21 -0400 [thread overview]
Message-ID: <YQReyaxp/rwypHbR@t490s> (raw)
In-Reply-To: <20210713023338.57108-1-someguy@effective-light.com>
Hi, Hamza,
On Mon, Jul 12, 2021 at 10:33:38PM -0400, Hamza Mahfooz wrote:
> @@ -1467,16 +1467,20 @@ rmap_walk_init_level(struct slot_rmap_walk_iterator *iterator, int level)
>
> static void
> slot_rmap_walk_init(struct slot_rmap_walk_iterator *iterator,
> - struct kvm_memory_slot *slot, int start_level,
> + const struct kvm_memory_slot *slot, int start_level,
> int end_level, gfn_t start_gfn, gfn_t end_gfn)
> {
> - iterator->slot = slot;
> - iterator->start_level = start_level;
> - iterator->end_level = end_level;
> - iterator->start_gfn = start_gfn;
> - iterator->end_gfn = end_gfn;
> + struct slot_rmap_walk_iterator iter = {
> + .slot = slot,
> + .start_gfn = start_gfn,
> + .end_gfn = end_gfn,
> + .start_level = start_level,
> + .end_level = end_level,
> + };
> +
> + rmap_walk_init_level(&iter, iterator->start_level);
Here it should be s/iterator->//.
>
> - rmap_walk_init_level(iterator, iterator->start_level);
> + memcpy(iterator, &iter, sizeof(struct slot_rmap_walk_iterator));
> }
This patch breaks kvm/queue with above issue. Constify of kvm_memory_slot
pointer should have nothing to do with this so at least it should need a
separate patch. At the meantime I also don't understand why memcpy() here,
which seems to be even slower..
--
Peter Xu
next prev parent reply other threads:[~2021-07-30 20:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 2:33 [PATCH] KVM: const-ify all relevant uses of struct kvm_memory_slot Hamza Mahfooz
2021-07-26 16:23 ` Paolo Bonzini
2021-07-30 20:19 ` Peter Xu [this message]
2021-07-30 20:47 ` Hamza Mahfooz
2021-07-31 4:55 ` Hamza Mahfooz
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=YQReyaxp/rwypHbR@t490s \
--to=peterx@redhat.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=someguy@effective-light.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@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