From: Dave Hansen <dave.hansen@intel.com>
To: Zhao Liu <zhao1.liu@linux.intel.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ira Weiny <ira.weiny@intel.com>,
"Fabio M . De Francesco" <fmdefrancesco@gmail.com>,
Zhenyu Wang <zhenyu.z.wang@intel.com>,
Zhao Liu <zhao1.liu@intel.com>
Subject: Re: [PATCH] KVM: SVM: Replace kmap_atomic() with kmap_local_page()
Date: Fri, 2 Sep 2022 08:09:29 -0700 [thread overview]
Message-ID: <e08c8c46-2aa8-3cb4-dce6-61d64c6835cb@intel.com> (raw)
In-Reply-To: <20220902090811.2430228-1-zhao1.liu@linux.intel.com>
On 9/2/22 02:08, Zhao Liu wrote:
> From: Zhao Liu <zhao1.liu@intel.com>
>
> The use of kmap_atomic() is being deprecated in favor of
> kmap_local_page()[1].
>
> In arch/x86/kvm/svm/sev.c, the function sev_clflush_pages() doesn't
> need to disable pagefaults and preemption in kmap_atomic(). It can
> simply use kmap_local_page() / kunmap_local() that can instead do the
> mapping / unmapping regardless of the context.
>
> With kmap_local_page(), the mapping is per thread, CPU local and not
> globally visible. Therefore, sev_clflush_pages() is a function where
> the use of kmap_local_page() in place of kmap_atomic() is correctly
> suited.
This changelog is a little on the weak side. You could literally take
any arbitrary call-site and file for kmap_atomic() and slap that
changelog on it. For instance:
In drivers/target/target_core_sbc.c, the function
sbc_dif_copy_prot() doesn't need to disable pagefaults and
preemption in kmap_atomic(). It can simply use kmap_local_page()
/ kunmap_local() that can instead do the mapping / unmapping
regardless of the context.
With kmap_local_page(), the mapping is per thread, CPU local and
not globally visible. Therefore, sbc_dif_copy_prot() is a
function where the use of kmap_local_page() in place of
kmap_atomic() is correctly suited.
That's all valid English and there's nothing incorrect in it. But, it
doesn't indicate that any actual analysis was performed. It's utterly
generic. It could literally have been generated by a pretty trivial script.
It would be great to add at least a small, call-site-specific human
touch to these changelogs.
In this case, saying something about how global the cache flush is would
be a great addition.
next prev parent reply other threads:[~2022-09-02 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 9:08 [PATCH] KVM: SVM: Replace kmap_atomic() with kmap_local_page() Zhao Liu
2022-09-02 15:09 ` Dave Hansen [this message]
2022-09-04 15:54 ` Zhao Liu
2022-09-02 15:15 ` Sean Christopherson
2022-09-02 15:25 ` Dave Hansen
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=e08c8c46-2aa8-3cb4-dce6-61d64c6835cb@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fmdefrancesco@gmail.com \
--cc=hpa@zytor.com \
--cc=ira.weiny@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=zhao1.liu@intel.com \
--cc=zhao1.liu@linux.intel.com \
--cc=zhenyu.z.wang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.