lkml.org 
[lkml]   [2016]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PART1 RFC 9/9] svm: Manage vcpu load/unload when enable AVIC
From
Date


On 12/02/2016 14:59, Suravee Suthikulpanit wrote:
> +
> + if (is_running) {
> + phys_addr_t pa = PFN_PHYS(page_to_pfn(svm->avic_bk_page));
> +
> + entry->bk_pg_ptr = (pa >> 12) & 0xffffffffff;
> + entry->valid = 1;
> + entry->host_phy_apic_id = h_phy_apic_id;
> + barrier();
> + entry->is_running = is_running;

I'm not sure if you can rely on the compiler doing the right thing here.
I would prefer something like:

new_entry = READ_ONCE(entry);
new_entry.bk_pg_ptr = (pa >> 12) & 0xffffffffff;
new_entry.valid = 1;
new_entry.host_phy_apic_id = h_phy_apic_id;
new_entry.is_running = is_running;
WRITE_ONCE(entry, new_entry);

Paolo

\
 
 \ /
  Last update: 2016-02-12 17:01    [W:0.165 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site