|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v5 2/6] x86: rearrange how mod_l*_entry() functions call UPDATE_ENTRY
On 12.11.2026 15:10, Jan Beulich wrote:
> On 12.11.2026 14:56, Andrew Cooper wrote:
>> On 12/11/2026 10:00 am, Kevin Lampis wrote:
>>> --- a/xen/arch/x86/mm.c
>>> +++ b/xen/arch/x86/mm.c
>>> @@ -2197,12 +2197,12 @@ static int mod_l1_entry(l1_pgentry_t *pl1e,
>>> l1_pgentry_t nl1e,
>>> {
>>> l1_pgentry_t ol1e = l1e_read(pl1e);
>>> struct domain *pt_dom = pt_vcpu->domain;
>>> - int rc = 0;
>>>
>>> ASSERT(!paging_mode_refcounts(pt_dom));
>>>
>>> if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
>>> {
>>> + int rc;
>>> struct page_info *page = NULL;
>>> uint32_t disallow = l1_disallow_mask(pt_dom);
>>>
>>> @@ -2276,16 +2276,14 @@ static int mod_l1_entry(l1_pgentry_t *pl1e,
>>> l1_pgentry_t nl1e,
>>> }
>>> if ( page )
>>> put_page(page);
>>> -
>>> - UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, update_flags);
>>> }
>>> else if ( pv_l1tf_check_l1e(pt_dom, nl1e) )
>>> return -ERESTART;
>>> - else
>>> - UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, update_flags);
>>> +
>>> + UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, update_flags);
>>>
>>> put_page_from_l1e(ol1e, pt_dom);
>>> - return rc;
>>> + return 0;
>>> }
>>>
>>>
>>> @@ -2300,7 +2298,6 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
>>> struct domain *d = vcpu->domain;
>>> struct page_info *l2pg = mfn_to_page(mfn);
>>> unsigned long type = l2pg->u.inuse.type_info;
>>> - int rc = 0;
>>>
>>> if ( unlikely(!is_guest_l2_slot(d, type, pgentry_ptr_to_slot(pl2e))) )
>>> {
>>> @@ -2313,6 +2310,8 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
>>>
>>> if ( l2e_get_flags(nl2e) & _PAGE_PRESENT )
>>> {
>>> + int rc;
>>> +
>>> if ( unlikely(l2e_get_flags(nl2e) & L2_DISALLOW_MASK) )
>>> {
>>> gdprintk(XENLOG_WARNING, "Bad L2 flags %x\n",
>>> @@ -2331,17 +2330,15 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
>>>
>>> if ( unlikely((rc = get_page_from_l2e(nl2e, mfn, d, 0)) < 0) )
>>> return rc;
>>
>> Looking further through the call tree, I'm now confident that
>> get_page_from_l?e() can't return a positive number.
>
> They can return L{2,4}E_RECURSIVE (i.e. 1).
Oh, sorry, these constants are still only local to my tree.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |