All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Paul Durrant <paul@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 1/3] x86/iommu: remove regions not to be mapped
Date: Thu, 25 Jan 2024 12:13:01 +0100	[thread overview]
Message-ID: <ed221b62-0151-45ce-a88d-d7e2a9946136@suse.com> (raw)
In-Reply-To: <ZbIgE8exXDVicN8D@macbook>

On 25.01.2024 09:47, Roger Pau Monné wrote:
> On Thu, Jan 25, 2024 at 09:34:40AM +0100, Jan Beulich wrote:
>> On 24.01.2024 18:29, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/hvm/io.c
>>> +++ b/xen/arch/x86/hvm/io.c
>>> @@ -369,6 +369,22 @@ bool vpci_is_mmcfg_address(const struct domain *d, paddr_t addr)
>>>      return vpci_mmcfg_find(d, addr);
>>>  }
>>>  
>>> +int __hwdom_init vpci_subtract_mmcfg(const struct domain *d, struct rangeset *r)
>>> +{
>>> +    const struct hvm_mmcfg *mmcfg;
>>> +
>>> +    list_for_each_entry ( mmcfg, &d->arch.hvm.mmcfg_regions, next )
>>> +    {
>>> +        int rc = rangeset_remove_range(r, PFN_DOWN(mmcfg->addr),
>>> +                                       PFN_DOWN(mmcfg->addr + mmcfg->size - 1));
>>
>> Along the lines of this, ...
>>
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -2138,6 +2138,54 @@ int __hwdom_init xen_in_range(unsigned long mfn)
>>>      return 0;
>>>  }
>>>  
>>> +int __hwdom_init remove_xen_ranges(struct rangeset *r)
>>> +{
>>> +    paddr_t start, end;
>>> +    int rc;
>>> +
>>> +    /* S3 resume code (and other real mode trampoline code) */
>>> +    rc = rangeset_remove_range(r, PFN_DOWN(bootsym_phys(trampoline_start)),
>>> +                               PFN_DOWN(bootsym_phys(trampoline_end)) - 1);
>>
>> ... did you perhaps mean
>>
>>                                PFN_DOWN(bootsym_phys(trampoline_end) - 1));
>>
>> here (and then similarly below, except there the difference is benign I
>> think, for the labels being page-aligned)?
> 
> They are all page aligned, so I didn't care much,  but now that you
> point it might be safer to do the subtraction from the address instead
> of the frame number, just in case.

Hmm, no, for me neither trampoline_end nor trampoline_start are page
aligned. While bootsym_phys(trampoline_start) is, I don't think
bootsym_phys(trampoline_end) normally would be (it might only be by
coincidence).

Jan


  reply	other threads:[~2024-01-25 11:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 17:29 [PATCH v5 0/3] x86/iommu: improve setup time of hwdom IOMMU Roger Pau Monne
2024-01-24 17:29 ` [PATCH v5 1/3] x86/iommu: remove regions not to be mapped Roger Pau Monne
2024-01-25  8:34   ` Jan Beulich
2024-01-25  8:47     ` Roger Pau Monné
2024-01-25 11:13       ` Jan Beulich [this message]
2024-01-25 12:37         ` Roger Pau Monné
2024-01-25 12:55           ` Andrew Cooper
2024-01-25 13:13             ` Jan Beulich
2024-01-25 13:22               ` Andrew Cooper
2024-01-25 14:37                 ` Roger Pau Monné
2024-01-25 13:26   ` [PATCH v6 " Roger Pau Monne
2024-01-25 13:36     ` Jan Beulich
2024-01-25 16:46     ` Jan Beulich
2024-01-29 16:23     ` Paul Durrant
2024-01-24 17:29 ` [PATCH v5 2/3] x86/iommu: switch hwdom IOMMU to use a rangeset Roger Pau Monne
2024-01-25 14:17   ` Jan Beulich
2024-01-29 16:28   ` Paul Durrant
2024-01-24 17:29 ` [PATCH v5 3/3] x86/iommu: cleanup unused functions Roger Pau Monne
2024-01-29 16:31   ` Paul Durrant

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=ed221b62-0151-45ce-a88d-d7e2a9946136@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.