From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>,
Ben Gardon <bgardon@google.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-kselftest@vger.kernel.org
Cc: Peter Xu <peterx@redhat.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Peter Shier <pshier@google.com>, Oliver Upton <oupton@google.com>
Subject: Re: [PATCH 3/3] kvm: mmu: Separate pte generation from set_spte
Date: Wed, 5 Feb 2020 15:53:41 +0100 [thread overview]
Message-ID: <1adc4784-8567-d008-4d78-957fd33585ed@redhat.com> (raw)
In-Reply-To: <87pnetkuov.fsf@vitty.brq.redhat.com>
On 05/02/20 14:52, Vitaly Kuznetsov wrote:
>> + spte = make_spte(vcpu, pte_access, level, gfn, pfn, *sptep, speculative,
>> + can_unsync, host_writable, sp_ad_disabled(sp), &ret);
> I'm probably missing something, but in make_spte() I see just one place
> which writes to '*ret' so at the end, this is either
> SET_SPTE_WRITE_PROTECTED_PT or 0 (which we got only because we
> initialize it to 0 in set_spte()). Unless this is preparation to some
> other change, I don't see much value in the complication.
>
> Can we actually reverse the logic, pass 'spte' by reference and return
> 'ret'?
>
It gives a similar calling convention between make_spte and
make_mmio_spte. It's not the most beautiful thing but I think I prefer it.
But the overwhelming function parameters are quite ugly, especially
old_spte. I don't think it's an improvement, let's consider it together
with the rest of your changes instead.
Paolo
next prev parent reply other threads:[~2020-02-05 14:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 23:09 [PATCH 1/3] kvm: mmu: Replace unsigned with unsigned int for PTE access Ben Gardon
2020-02-03 23:09 ` [PATCH 2/3] kvm: mmu: Separate generating and setting mmio ptes Ben Gardon
2020-02-05 13:37 ` Vitaly Kuznetsov
2020-02-05 14:37 ` Paolo Bonzini
2020-02-03 23:09 ` [PATCH 3/3] kvm: mmu: Separate pte generation from set_spte Ben Gardon
2020-02-05 13:52 ` Vitaly Kuznetsov
2020-02-05 14:53 ` Paolo Bonzini [this message]
2020-02-05 12:00 ` [PATCH 1/3] kvm: mmu: Replace unsigned with unsigned int for PTE access Vitaly Kuznetsov
2020-02-05 16:46 ` Peter Xu
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=1adc4784-8567-d008-4d78-957fd33585ed@redhat.com \
--to=pbonzini@redhat.com \
--cc=bgardon@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=oupton@google.com \
--cc=peterx@redhat.com \
--cc=pshier@google.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@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
all inboxes | Powered by JetHome®