kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Andrew Jones <andrew.jones@linux.dev>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [kvm-unit-tests PATCH 2/2] arm64: ensure tlbi is safe
Date: Fri, 14 Jul 2023 17:20:13 +0000	[thread overview]
Message-ID: <CCDDCFF3-C580-494A-B542-00C0A99B11D1@vmware.com> (raw)
In-Reply-To: <ZLEoL8NbvmRNysJF@monolith.localdoman>



> On Jul 14, 2023, at 3:55 AM, Alexandru Elisei <alexandru.elisei@arm.com> wrote:
> 
> !! External Email
> 
> Hi,
> 
> On Sat, Jun 17, 2023 at 01:31:38AM +0000, Nadav Amit wrote:
>> From: Nadav Amit <namit@vmware.com>
>> 
>> While no real problem was encountered, having an inline assembly without
>> volatile keyword and output can allow the compiler to ignore it. And
>> without a memory clobber, potentially reorder it.
>> 
>> Add volatile and memory clobber.
>> 
>> Signed-off-by: Nadav Amit <namit@vmware.com>
>> ---
>> lib/arm64/asm/mmu.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/lib/arm64/asm/mmu.h b/lib/arm64/asm/mmu.h
>> index 5c27edb..cf94403 100644
>> --- a/lib/arm64/asm/mmu.h
>> +++ b/lib/arm64/asm/mmu.h
>> @@ -14,7 +14,7 @@
>> static inline void flush_tlb_all(void)
>> {
>>      dsb(ishst);
>> -     asm("tlbi       vmalle1is");
> 
> From the gas manual [1]:
> 
> "asm statements that have no output operands and asm goto statements, are
> implicitly volatile."
> 
> Looks to me like both TLBIs fall into this category.
> 
> And I think the "memory" clobber is not needed because the dsb macro before and
> after the TLBI already have it.

You are completely correct. I forgot about the implicit “volatile”.

This one can be dropped.


      reply	other threads:[~2023-07-14 17:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  1:31 [kvm-unit-tests PATCH 0/2] arm64: fix paging issues Nadav Amit
2023-06-17  1:31 ` [kvm-unit-tests PATCH 1/2] arm64: set sctlr_el1.SPAN Nadav Amit
2023-06-25 19:44   ` Nadav Amit
2023-07-07 18:26   ` Nadav Amit
2023-07-14 10:31   ` Alexandru Elisei
2023-07-14 11:29     ` Shaoqin Huang
2023-07-14 18:42       ` Nadav Amit
2023-07-17  6:50         ` Andrew Jones
2023-07-17  6:52           ` Andrew Jones
2023-07-17  8:53             ` Nikos Nikoleris
2023-07-17 17:05               ` Nadav Amit
2023-07-18  8:44                 ` Alexandru Elisei
2023-07-19  5:42                   ` Nadav Amit
2023-06-17  1:31 ` [kvm-unit-tests PATCH 2/2] arm64: ensure tlbi is safe Nadav Amit
2023-07-14 10:55   ` Alexandru Elisei
2023-07-14 17:20     ` Nadav Amit [this message]

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=CCDDCFF3-C580-494A-B542-00C0A99B11D1@vmware.com \
    --to=namit@vmware.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    /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).