Linux-kselftest Archive on
 help / color / Atom feed
From: Paolo Bonzini <>
To: Vitaly Kuznetsov <>,
	Ben Gardon <>,,,
Cc: Peter Xu <>,
	Sean Christopherson <>,
	Peter Shier <>, Oliver Upton <>
Subject: Re: [PATCH 3/3] kvm: mmu: Separate pte generation from set_spte
Date: Wed, 5 Feb 2020 15:53:41 +0100
Message-ID: <> (raw)
In-Reply-To: <>

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.


  reply index

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-kselftest Archive on

Archives are clonable:
	git clone --mirror linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ \
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone