[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Thu, 18 Apr 2024 07:44:08 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AcbTUjYhGq5guoyqnpt3YMaIlsYavqoRdiDfc88Dwg4=; b=HWuWArVV0/SooNGjX/0ngilCPq50mdEGdeeQoMoY+ayLU3T/gOjgplin0HtM3VMqJ+LtEceLSp0jVYvksidekKB5xDQMFgBbXbxH01zCQrqA/jWxzXmRMG3An72KpBGHOY24aXv//FNYvjByldfVWY8L++C/cr4mkYgAGKfQMvR1S/SozBcNMkVDFhKD6HeHFOQtffy1ZEDqcICI0Im+MowkuOmCIlfMwuNK9p9Anykm0/OIWHWP4gCQWTAY8C4TjZgj+eMsPj4TDholr5qB4smFojtbLBuytTTjVwur79l10Nl/zxE5Ty6825+iwUlnV3vrXqfPl5OsrS+fEj8D8A==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AcbTUjYhGq5guoyqnpt3YMaIlsYavqoRdiDfc88Dwg4=; b=CNdtFawD99s4AoWk+MIN15XA58Aq+DUxweVJpo0sYJcefSWZOhiYgeG/LIapIJfpRYBLK0qriTCvni8+bgLoX3EPczWqF9ypbLS6xtJY+O052FDl3ahkf53itZIoiuLoUyCoTlyA+MVIBB44LLKQOwe3Xrw4i70rR+Qh0UJp0zJ0OQx9xLvsvEUCVMsKfohmpGSawIUUUisIFisbXnodd7Rn54zoj+cVytwEPb8WWZ7Wz8yTLASLGB1Fz3jkGqAqy7dKlbqyWEFNz8Epm803rmGffXDk51r5vPOvediwn0v77YcKfIH1L0ZkkEC4XHG04V1TdLzEJT3I83h9LybJAA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Zxtoxp8Ob6YEB7n68OmwUoE3lsHmJfoPt+Ok2+EnkeIspNbPRHczQqVMTHsjsAIqO/ku169ot3BPfBoPR67Z3GQDteBqm+XkBUDNNZH+WvFhtnzgCx6rDPMvEtTpb2m/LTuMv18gdnwhh2ApUihPWAYYvNpXbiD6EHTYM4UK1Nt0ew1daYvjQbWGsFRlfsjtybC/ptJ9Pycz4+YIeLr44sPH+C2/FB7EPqcXM87R/buOkLGIdvgL8RF8wxfIrZTZOG2b8k3eksExbyC3l19qBrP+pbJWeweGO+NLz0jDDpdgHm3tEh4Paj2GsqZx6KweArNe4PCXmnuaTAwFr56Pqg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MTWKDLxUYbr8fY5i4vLkfXBjfVCbC6FLi/eNcqGs4TmfMN7ak6EFpOJQ/p/8Wa9pJBOShQHqvWm9PC0PnxJwKShB5Y9/jJwCA2FflKoeRtYwjeeLMa2MAG6pYc5k9gxizpw49BpCQoeXdiSsb08wVLwy6mjULG2A5Tn/bQycDfF8r8gzezxNx1dOhWg4B/WGXM7Y/LJc2An9mz5T+K7tWwZRdtXbJdU/kXLp/phFVt3jBY/G/rbxq145Uj5newSyEYmXVg6y48pHmBSfnMjOGkyJvv5yVUTmAc0ogRRRUX/jW7BJuM7r2v2p3ZGnJgBaQi6mU0dPiPN3ncDeJ4AKRQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 18 Apr 2024 07:44:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHainObwzEJT+Mf6kG9My8yFKsem7Ftnm0AgAAVAwA=
- Thread-topic: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals
> On 18 Apr 2024, at 07:28, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 09.04.2024 13:45, Luca Fancellu wrote:
>> --- a/xen/arch/x86/extable.c
>> +++ b/xen/arch/x86/extable.c
>> @@ -23,7 +23,8 @@ static inline unsigned long ex_cont(const struct
>> exception_table_entry *x)
>> return EX_FIELD(x, cont);
>> }
>>
>> -static int init_or_livepatch cf_check cmp_ex(const void *a, const void *b)
>> +static int init_or_livepatch cf_check cmp_ex(const void *a, const void *b,
>> + const void *data)
>> {
>> const struct exception_table_entry *l = a, *r = b;
>> unsigned long lip = ex_addr(l);
>> @@ -53,7 +54,7 @@ void init_or_livepatch sort_exception_table(struct
>> exception_table_entry *start,
>> const struct exception_table_entry *stop)
>> {
>> sort(start, stop - start,
>> - sizeof(struct exception_table_entry), cmp_ex, swap_ex);
>> + sizeof(struct exception_table_entry), cmp_ex, swap_ex, NULL);
>> }
>
> Not the least because of this addition of an entirely useless parameter /
> argument
Well it’s not useless in this patch, given that without it I couldn’t know the
size of the address
element, however ...
> I'm not in favor of ...
>
>> --- a/xen/include/xen/sort.h
>> +++ b/xen/include/xen/sort.h
>> @@ -23,8 +23,8 @@
>> extern gnu_inline
>> #endif
>> void sort(void *base, size_t num, size_t size,
>> - int (*cmp)(const void *a, const void *b),
>> - void (*swap)(void *a, void *b, size_t size))
>> + int (*cmp)(const void *a, const void *b, const void *data),
>> + void (*swap)(void *a, void *b, size_t size), const void *cmp_data)
>> {
>
> ... this change. Consider you were doing this on a C library you cannot
> change.
> You'd have to find a different solution anyway.
I get your point here, we should not change standard functions.
> And the way we have sort()
> right now is matching the C spec. The change to do renders things unexpected
> to
> anyone wanting to use this function in a spec-compliant way. One approach may
> be to make an adjustment to data representation, such that the extra reference
> data is accessible through the pointers already being passed.
>
> Jan
>
Anyway in the end this patch was dropped for other reasons.
Cheers,
Luca
|