All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Marcelo Tosatti <marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Andrea Arcangeli <andrea-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Subject: Re: KVM swapping with mmu notifiers
Date: Mon, 14 Jan 2008 16:09:03 +0200	[thread overview]
Message-ID: <478B6CFF.9070801@qumranet.com> (raw)
In-Reply-To: <20080114134539.GB15200@dmt>

Marcelo Tosatti wrote:
>>  
>> +static void unmap_spte(struct kvm *kvm, u64 *spte)
>> +{
>> +	struct page *page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT);
>> +	get_page(page);
>> +	rmap_remove(kvm, spte);
>> +	set_shadow_pte(spte, shadow_trap_nonpresent_pte);
>> +	kvm_flush_remote_tlbs(kvm);
>> +	__free_page(page);
>> +}
>> +
>> +void kvm_rmap_unmap_gfn(struct kvm *kvm, gfn_t gfn)
>> +{
>> +	unsigned long *rmapp;
>> +	u64 *spte, *curr_spte;
>> +
>> +	spin_lock(&kvm->mmu_lock);
>> +	gfn = unalias_gfn(kvm, gfn);
>> +	rmapp = gfn_to_rmap(kvm, gfn);
>>     
>
> The alias and memslot maps are protected only by mmap_sem, so you
> should make kvm_set_memory_region/set_memory_alias grab the mmu spinlock
> in addition to mmap_sem in write mode.
>
> kvm_mmu_zap_all() grabs the mmu lock.. that should probably move up into
> the caller.
>
>   

Aren't mmu notifiers called with mmap_sem held for read?

Maybe not from the swap path?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

  parent reply	other threads:[~2008-01-14 14:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 13:32 KVM swapping with mmu notifiers Andrea Arcangeli
     [not found] ` <20080113133244.GC8736-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-13 15:02   ` Anthony Liguori
2008-01-14 13:45   ` Marcelo Tosatti
2008-01-14 14:06     ` Andrea Arcangeli
2008-01-14 14:09     ` Avi Kivity [this message]
     [not found]       ` <478B6CFF.9070801-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-14 14:24         ` Andrea Arcangeli
     [not found]           ` <20080114142457.GF7062-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-14 15:43             ` Avi Kivity
     [not found]               ` <478B833E.1020801-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-14 17:44                 ` Andrea Arcangeli
     [not found]                   ` <20080114174447.GA30812-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-15 14:40                     ` Avi Kivity
     [not found]                       ` <478CC5D3.2040201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 15:52                         ` Andrea Arcangeli
     [not found]                           ` <20080115155253.GA7059-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-15 15:57                             ` Avi Kivity
     [not found]                               ` <478CD7CF.3080603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 16:09                                 ` Andrea Arcangeli
     [not found]                                   ` <20080115160936.GC7059-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-20 15:16                                     ` Avi Kivity
     [not found]                                       ` <479365B3.3000600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-21 11:37                                         ` Andrea Arcangeli
     [not found]                                           ` <20080121113715.GE6970-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-21 12:53                                             ` Avi Kivity
2008-01-22 13:37                                             ` Avi Kivity
     [not found]                                               ` <4795F1B7.9050604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-22 14:56                                                 ` Andrea Arcangeli
     [not found]                                                   ` <20080122145631.GG7331-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-22 16:17                                                     ` Avi Kivity
     [not found]                                                       ` <47961722.2010804-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-22 17:18                                                         ` Andrea Arcangeli
     [not found]                                                           ` <20080122171806.GH7331-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org>
2008-01-22 20:03                                                             ` Andrea Arcangeli

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=478B6CFF.9070801@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=andrea-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.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 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.