Re: [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
Hi Christoph, On Wed, Apr 06, 2022 at 06:05:04AM +, Christoph Hellwig wrote: > From: Christoph Hellwig > Subject: [PATCH 15/27] block: use bdev_alignment_offset in > part_alignment_offset_show > > Replace the open coded offset calculation with the proper helper. > This is an ABI change in that the -1 for a misaligned partition is > properly propagated, which can be considered a bug fix and maches s/maches/matches/ > what is done on the whole device. > > Signed-off-by: Christoph Hellwig > --- > block/partitions/core.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/block/partitions/core.c b/block/partitions/core.c > index 2ef8dfa1e5c85..240b3fff521e4 100644 > --- a/block/partitions/core.c > +++ b/block/partitions/core.c > @@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev, > static ssize_t part_alignment_offset_show(struct device *dev, > struct device_attribute *attr, char > *buf) > { > - struct block_device *bdev = dev_to_bdev(dev); > - > - return sprintf(buf, "%u\n", > - queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits, > - bdev->bd_start_sect)); > + return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev))); Should this now be %d instead of %u, there are one or two examples of both in the rest of the patch series. Alan
Re: [PATCH 12/15] swiotlb: provide swiotlb_init variants that remap the buffer
Hi Christoph, On Mon, Apr 04, 2022 at 05:05:56AM +, Christoph Hellwig wrote: > From: Christoph Hellwig > Subject: [PATCH 12/15] swiotlb: provide swiotlb_init variants that remap > the buffer > > To shared more code between swiotlb and xen-swiotlb, offer a > swiotlb_init_remap interface and add a remap callback to > swiotlb_init_late that will allow Xen to remap the buffer the s/the buffer// > buffer without duplicating much of the logic. Alan > > Signed-off-by: Christoph Hellwig > --- > arch/x86/pci/sta2x11-fixup.c | 2 +- > include/linux/swiotlb.h | 5 - > kernel/dma/swiotlb.c | 36 +--- > 3 files changed, 38 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c > index c7e6faf59a861..7368afc039987 100644 > --- a/arch/x86/pci/sta2x11-fixup.c > +++ b/arch/x86/pci/sta2x11-fixup.c > @@ -57,7 +57,7 @@ static void sta2x11_new_instance(struct pci_dev *pdev) > int size = STA2X11_SWIOTLB_SIZE; > /* First instance: register your own swiotlb area */ > dev_info(&pdev->dev, "Using SWIOTLB (size %i)\n", size); > - if (swiotlb_init_late(size, GFP_DMA)) > + if (swiotlb_init_late(size, GFP_DMA, NULL)) > dev_emerg(&pdev->dev, "init swiotlb failed\n"); > } > list_add(&instance->list, &sta2x11_instance_list); > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h > index ee655f2e4d28b..7b50c82f84ce9 100644 > --- a/include/linux/swiotlb.h > +++ b/include/linux/swiotlb.h > @@ -36,8 +36,11 @@ struct scatterlist; > > int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, unsigned int > flags); > unsigned long swiotlb_size_or_default(void); > +void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, > + int (*remap)(void *tlb, unsigned long nslabs)); > +int swiotlb_init_late(size_t size, gfp_t gfp_mask, > + int (*remap)(void *tlb, unsigned long nslabs)); > extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); > -int swiotlb_init_late(size_t size, gfp_t gfp_mask); > extern void __init swiotlb_update_mem_attributes(void); > > phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t phys, > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c > index 119187afc65ec..d5fe8f5e08300 100644 > --- a/kernel/dma/swiotlb.c > +++ b/kernel/dma/swiotlb.c > @@ -256,9 +256,11 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned > long nslabs, > * Statically reserve bounce buffer space and initialize bounce buffer data > * structures for the software IO TLB used to implement the DMA API. > */ > -void __init swiotlb_init(bool addressing_limit, unsigned int flags) > +void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, > + int (*remap)(void *tlb, unsigned long nslabs)) > { > - size_t bytes = PAGE_ALIGN(default_nslabs << IO_TLB_SHIFT); > + unsigned long nslabs = default_nslabs; > + size_t bytes; > void *tlb; > > if (!addressing_limit && !swiotlb_force_bounce) > @@ -271,12 +273,23 @@ void __init swiotlb_init(bool addressing_limit, > unsigned int flags) >* allow to pick a location everywhere for hypervisors with guest >* memory encryption. >*/ > +retry: > + bytes = PAGE_ALIGN(default_nslabs << IO_TLB_SHIFT); > if (flags & SWIOTLB_ANY) > tlb = memblock_alloc(bytes, PAGE_SIZE); > else > tlb = memblock_alloc_low(bytes, PAGE_SIZE); > if (!tlb) > goto fail; > + if (remap && remap(tlb, nslabs) < 0) { > + memblock_free(tlb, PAGE_ALIGN(bytes)); > + > + nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE); > + if (nslabs < IO_TLB_MIN_SLABS) > + panic("%s: Failed to remap %zu bytes\n", > + __func__, bytes); > + goto retry; > + } > if (swiotlb_init_with_tbl(tlb, default_nslabs, flags)) > goto fail_free_mem; > return; > @@ -287,12 +300,18 @@ void __init swiotlb_init(bool addressing_limit, > unsigned int flags) > pr_warn("Cannot allocate buffer"); > } > > +void __init swiotlb_init(bool addressing_limit, unsigned int flags) > +{ > + return swiotlb_init_remap(addressing_limit, flags, NULL); > +} > + > /* > * Systems with larger DMA zones (those that don't support ISA) can > * initialize the swiotlb later using the slab allocator if needed. > * This should be just like above, but with some error catching. > */ > -int swiotlb_init_late(size_t size, gfp_t gfp_mask) > +int swiotlb_init_late(size_t size, gfp_t gfp_mask, > + int (*remap)(void *tlb, unsigned long nslabs)) > { > unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE); > unsigned long bytes; > @@ -303,6 +322,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask) > if (swiot
[PATCH v2] tools/libxl: add missing blank in message
Add missing blank giving "an emulation" instead of "anemulation" while making the text a single source line. Signed-off-by: Alan Robinson --- Changed since v1: * text as as single line, requested by Juergen tools/libs/light/libxl_dm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index dbd3c7f278..5cc8ce34c2 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -1893,8 +1893,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (format == NULL) { LOGD(WARN, guest_domid, "Unable to determine disk image format: %s\n" - "Disk will be available via PV drivers but not as an" - "emulated disk.", + "Disk will be available via PV drivers but not as an emulated disk.", disks[i].vdev); continue; } @@ -1905,8 +1904,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (!target_path) { LOGD(WARN, guest_domid, "No way to get local access disk to image: %s\n" - "Disk will be available via PV drivers but not as an" - "emulated disk.", + "Disk will be available via PV drivers but not as an emulated disk.", disks[i].vdev); continue; } -- 2.26.2
[PATCH] tools/libxl: add missing blank in message
From: Alan Robinson Add trailing blank to first part of concatenated string giving "an emulated" instead of "anemulated". Signed-off-by: Alan Robinson --- tools/libs/light/libxl_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index dbd3c7f278..755641604a 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -1893,7 +1893,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (format == NULL) { LOGD(WARN, guest_domid, "Unable to determine disk image format: %s\n" - "Disk will be available via PV drivers but not as an" + "Disk will be available via PV drivers but not as an " "emulated disk.", disks[i].vdev); continue; @@ -1905,7 +1905,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (!target_path) { LOGD(WARN, guest_domid, "No way to get local access disk to image: %s\n" - "Disk will be available via PV drivers but not as an" + "Disk will be available via PV drivers but not as an " "emulated disk.", disks[i].vdev); continue; -- 2.26.2
Re: [Xen-devel] [PATCH v3 5/6] mm: add 'is_special_page' macro...
A typo... On Thu, Mar 05, 2020 at 01:45:03PM +0100, pdurr...@amzn.com wrote: > > PGC_extra pages are intended to hold data structures that are associated > with a domain and my be mapped by that domain. They should not be treated s/my/may/ > as 'normal' guest pages (i.e. RAM or page tables). Hence, in many cases > where code currently tests is_xen_heap_page() it should also check for > the PGC_extra bit in 'count_info'. > > This patch therefore defines is_special_page() to cover both cases and > converts tests if is_xen_heap_page() to is_special_page() where > appropriate. > Alan ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86: don't offer Hyper-V option when "PV Shim Exclusive"
On Thu, Dec 05, 2019 at 04:42:08PM +0100, Jan Beulich wrote: > > This only added dead code. Use "if" instead of "depends on" to make > (halfway) clear that other guest options should also go in thae same s/thae/the/ > block. Move the option down such that the shim related options get > presented first, avoiding to ask the question when the answer may end > up being discarded. > > While in the neighborhood also bring PV_SHIM_EXCLUSIVE into more > "canonical" shape. > Alan ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH 3/5] xen/domain: Audit config->max_vcpus during {, arch_}check_domain_config()
On Fri, Oct 05, 2018 at 04:54:47PM +0200, Andrew Cooper wrote: > The purpose of this is to move the auduting to be earlier than > arch_domain_create(). > s/auduting/auditing/ Alan smime.p7s Description: S/MIME cryptographic signature ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] xen/blkfront: correct purging of persistent grants
On Fri, Sep 28, 2018 at 09:28:27AM +0200, Juergen Gross wrote: > Commit a46b53672b2c2e3770b38a4abf90d16364d2584b ("xen/blkfront: cleanup > stale persistent grants") introduced a regression as purged persistent > grants were not pu into the list of free grants again. Correct that. s/pu /put / Alan smime.p7s Description: S/MIME cryptographic signature ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v5 04/16] xen/arm: mm: Remove unused M2P code
Hi Julien, > At the same time move the remaining M2P define just above just above > set_gpfn_from_mfn to keep all the dummy helpers for M2P together. At the same time move the remaining M2P define just above set_gpfn_from_mfn to keep all the dummy helpers for M2P together. can't really evaluate the actual code.. Alan ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
[Xen-devel] [PATCH v2 ] get_maintainers.pl: Avoid THE_REST when files are added or removed
When files are added or removed /dev/null is used as a place holder name in the patch for the absent file. Don't try and find a MAINTAINER for this place holder, it only ever flags and then spams THE REST, behaviour for a real filename is unchanged. Signed-off-by: Alan Robinson --- v1 - original version v2 - addresses /dev/null and $lastfile comments from Jan Tested by pretending to remove xen/common/cpupool.c for which get_maintainers.pl currently flags 11 addresses, after this patch only xen-devel and its two maintainers (Juergen and Dario) get listed. Also tested adding a 'dev/null' file which get_maintainer.pl now accepts and suggests 'THE_REST'. scripts/get_maintainer.pl | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 0ce2d367fa..3fb1ad4b69 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -444,10 +444,12 @@ foreach my $file (@ARGV) { my $patch_line = $_; if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) { my $filename = $1; - $filename =~ s@^[^/]*/@@; - $filename =~ s@\n@@; - $lastfile = $filename; - push(@files, $filename); + if ($1 ne "/dev/null") { #Ignore the no-file placeholder + $filename =~ s@^[^/]*/@@; + $filename =~ s@\n@@; + $lastfile = $filename; + push(@files, $filename); + } $patch_prefix = "^[+-].*"; #Now parsing the actual patch } elsif (m/^\@\@ -(\d+),(\d+)/) { if ($email_git_blame) { -- 2.14.1 ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] get_maintainers.pl: Avoid THE_REST when files are added or removed
Hi Jan, On Thu, Feb 22, 2018 at 02:45:48AM -0700, Jan Beulich wrote: > Oh, I see - it's the file name collection code you change, not the > consuming side, I'm sorry for the noise. However, isn't > omitting the leading / a potential problem then? The leading / is stripped away several lines before this.. > While it's not > very likely for us to gain ./dev/null, it's also not entirely impossible. True and this change does mean that get_maintainer.pl would fail to recognise such a patch as a patch..(just tried) > Furthermore, shouldn't you move the setting of $lastfile into > the conditional as well? Let me send a second version Alan ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] get_maintainers.pl: Avoid THE_REST when files are added or removed
Hi Jan, On Thu, Feb 22, 2018 at 02:16:23AM -0700, Jan Beulich wrote: > From: Jan Beulich > Subject: Re: [PATCH] get_maintainers.pl: Avoid THE_REST when files are > added or removed > > >>> On 22.02.18 at 10:09, wrote: > > When files are added or removed /dev/null is used as a place > > holder name in the patch for the absent file. Don't try and > > find a MAINTAINER for this place holder, it only ever flags > > and then spams THE REST. > > When a file is added, it falls under THE REST maintainership unless > there's a pattern already in place covering the file, or a new entry > is being added at the same time. When a file is removed, whoever > was its maintainer should be Cc-ed. So perhaps it's rather the > /dev/null placeholder use that's wrong? Exactly - that what this patch tries to do... get_maintainers.pl collects filename from the '+++' and '---' lines. A normal (not add/remove) patch looks like this: diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 0ce2d367fa..277ba17a67 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl An add/delete patch looks like this: diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c deleted file mode 100644 index 999839444e..00 --- a/xen/common/cpupool.c +++ /dev/null Here get_maintainers.pl finds two files, change _just_ ignores the dev/null. > > Also, please send patches _to_ the list, _cc_-ing individuals as > needed. Ahh..sorry about that Alan -- Alan Robinson Enterprise Platform Services, Germany Fujitsu Mies-van-der-Rohe-Str. 8, 80807 Muenchen, Deutschland Tel.: +49 (89) 62060 3927 Mob.: +49 (172) 8512843 E-Mail: alan.robin...@ts.fujitsu.com Web: http://www.fujitsu.com/de/ ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
[Xen-devel] [PATCH] get_maintainers.pl: Avoid THE_REST when files are added or removed
When files are added or removed /dev/null is used as a place holder name in the patch for the absent file. Don't try and find a MAINTAINER for this place holder, it only ever flags and then spams THE REST. Signed-off-by: Alan Robinson --- Tested by pretending to remove xen/common/cpupool.c for which get_maintainers.pl currently flags 11 addresses, after this patch only xen-devel and its two maintainers (Juergen and Dario) get listed... scripts/get_maintainer.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 0ce2d367fa..277ba17a67 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -447,7 +447,9 @@ foreach my $file (@ARGV) { $filename =~ s@^[^/]*/@@; $filename =~ s@\n@@; $lastfile = $filename; - push(@files, $filename); + if ($filename ne "dev/null") { #Ignore the no-file placeholder +push(@files, $filename); + } $patch_prefix = "^[+-].*"; #Now parsing the actual patch } elsif (m/^\@\@ -(\d+),(\d+)/) { if ($email_git_blame) { -- 2.14.1 ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions
Hi Philippe, On Thu, Feb 15, 2018 at 09:23:52AM -0300, Philippe Mathieu-Daudé wrote: > > Can I add your R-b tag once fixed? Respin will be: > > +xenstore_write_int(dom, "memory/target", ram_size / K_BYTE); > +xenstore_write_int(vm, "memory", ram_size / M_BYTE); > +xenstore_write_int(vm, "maxmem", ram_size / M_BYTE); > Yes - Alan smime.p7s Description: S/MIME cryptographic signature ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions
Hi Philippe, On Thu, Feb 15, 2018 at 01:29:00AM -0300, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daudé > Subject: [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions > List-Id: Xen developer discussion > > It ease code review, unit is explicit. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/xen_disk.c| 4 ++-- > hw/xenpv/xen_domainbuild.c | 10 +- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c > index f74fcd42d1..557005b5e5 100644 > --- a/hw/block/xen_disk.c > +++ b/hw/block/xen_disk.c > @@ -1153,9 +1153,9 @@ static int blk_connect(struct XenDevice *xendev) > } > > xen_pv_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename > \"%s\"," > - " size %" PRId64 " (%" PRId64 " MB)\n", > + " size %" PRId64 " (%llu MB)\n", >blkdev->type, blkdev->fileproto, blkdev->filename, > - blkdev->file_size, blkdev->file_size >> 20); > + blkdev->file_size, blkdev->file_size / M_BYTE); > > /* Fill in number of sector size and number of sectors */ > xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk); > diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c > index 027f76fad1..083fb80ee5 100644 > --- a/hw/xenpv/xen_domainbuild.c > +++ b/hw/xenpv/xen_domainbuild.c > @@ -75,9 +75,9 @@ int xenstore_domain_init1(const char *kernel, const char > *ramdisk, > xenstore_write_str(dom, "vm", vm); > > /* memory */ > -xenstore_write_int(dom, "memory/target", ram_size >> 10); // kB > -xenstore_write_int(vm, "memory", ram_size >> 20); // MB > -xenstore_write_int(vm, "maxmem", ram_size >> 20); // MB > +xenstore_write_int(dom, "memory/target", ram_size * K_BYTE); > +xenstore_write_int(vm, "memory", ram_size * M_BYTE); > +xenstore_write_int(vm, "maxmem", ram_size * M_BYTE); These changes looks wrong, surely it must be 'ram_size / K_BYTE'... Alan smime.p7s Description: S/MIME cryptographic signature ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel