Commit Graph
8 Commits
Author SHA1 Message Date
Frediano Ziglio fdeba9d55f libs/guest: Drop guest_data in write_batch() and fill iov directly
There is no need to store the page pointers simply to transcribe the same
information into iov later.  Drop the guest_data intermediate array.

These days, linux has a maximum limit of 1024 iovs.  Libc under the hood will
subdivide the submission if necessary, which is why our general case of 1026
submissions works.

xenforeignmemory_map() maps the requested guest memory contiguously, and
except for PV pagetable frames, we submit contiguously into the stream.  When
safe to do, merge adjacent vectors by extending iov_len, reducing the
likelihood that libc needs to subdivide the submission.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-07-10 19:35:49 +01:00
Frediano Ziglio 85bdb67eaa libs/ctrl: Allow writev_exact() to change the iov array
Avoid having to allocate and copy the array if a partial write happens.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-07-10 19:35:49 +01:00
Frediano Ziglio 03851197a7 libs/guest: Reduce number of iovecs in write_batch()
Construct all of the headers together in one block, rather than a field at a
time.  Initialise as many of the fields as possible at declaration time.

Start filling in iov[] earlier, to allow for future simplifications.

No practical change.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
2026-07-08 15:35:45 +01:00
Frediano Ziglio dfb11094ae libs/guest: Use a single write_exact() in write_headers()
Reduce number of syscalls by coalescing the image and the domain headers.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
2026-07-08 15:35:45 +01:00
Frediano Ziglio 32204e8e19 libs/guest: Reduce number of iovecs in write_split_record()
Construct xc_sr_rhdr directly rather than in two halves.

Use size_t for combined_len, which allows the later size check to spot a few
more cases which might have truncated.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
2026-07-08 15:35:45 +01:00
Frediano Ziglio 44429b6931 xen/x86: Check supported features even for PVH dom0
The supported features ELF notes was tested only if the dom0 was
PV. Factor out a function to check ELF notes and reuse it even
for PVH.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-04-09 21:04:58 +01:00
Frediano Ziglio 6be01dffa0 xen/arm: Fix crash if last memory section is bigger than 1gb
On arm32 the xenheap has a maximum size of 1GB. On systems with more than 8GB
(so 1/8 total RAM is greater than 1GB) there is no point in searching for a
region with 1/8 of the total RAM when only 1GB will be used. Therefore limit
the maximum size to 1GB before searching.

Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- updated commit message as discussed ]
2014-10-03 14:34:32 +01:00
Frediano Ziglio 5ad71a6eef xen/arm: add support for early printk for HiSilicon D01 platform
This platform use a standard 8250 device on port 0xe4007000.

Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-10-03 10:23:43 +01:00