[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/2] xen/pci: replace call to is_memory_hole to pci_check_bar
- To: Julien Grall <julien@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Fri, 9 Sep 2022 07:46:54 +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=X9t0EgJPcUHOqOm+x5NpCj8PWNZFagWdWrTdQF3n7BM=; b=Zk8z0MWPKzAIb7tFI0KIWWqihWd5Q+OluxfqBmyRE1McE6lUTLaGkZMPNai0UsMrLaUFIttcHe+Pdq8+fpofHeLCJTki5NUSRG0AiQEze67wlrL9384OQSDe2W4/jAAUz0KfCUSSH2tOrLuUpnJQlteKNB0E42r0PTW8Mk/6gjX2b7RfBDTjsz+ILC2SWYIMDy6panEk1q8ZCUHr5I59NfumNLAZ4diZk0uY1fELzqN0bdrNi0p4rzbEKsFiQhhahtLNjkZggtqfgkHBqgATb2MQNSo3oXW9A+gnhP68awtL46X1cbRb3FUqnvOxxgFW0o4ezZedLly94oIPepk98w==
- 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=X9t0EgJPcUHOqOm+x5NpCj8PWNZFagWdWrTdQF3n7BM=; b=YWfsXTwPfPm5fUTg21tnidC/A1kWjyzsHuUAfiDzkNitJrJk443QRwXrOAHNr+ys8COAHRF2CmdVjajUv69TevrIhCXGEUb2otOfY3Nyl3VubWnoaJsL43z6WyLvyNbFLYAVP4a3J7vwU+cME48KobCQFar4YwGiFOwKJfc+bSNm/jv+Ixup7SpFPxVTXH0TD0MaAbkvhwFaKYvfiBm4Ej41DjObyhRiKHQpDV2ZueH6kTA+2ouOq3Hjb/fNdk3e0PNfOVGlGVgqg4Q5+HqtzYSXrsbiFxms4uPrTXasl42Ebt/2DS6MpJ2b6CwYjeCq1SqrEtRw531pH0nvos4VVg==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=iLG5HEQ80JmgE+TpYjCgNMMnDSYaQ4wNLGAIBzMI4Yq09WmD+sdStExeikl9oT5pn3FcprKWLYPYBkDIeoY5Pqg5ukrXJixeC8C9YQ5mC8/wBnvaMXJX175UJ7DMQkGvjnOB6LjQlwMOD1cNdszmLl8vvBAIA7w0WPkbzYmEwsiDLz/KVmP/HTzbUicBydAq4UotUZMxvaxXGbHD/B2YXsmF2S7XlhM2F4KaYf+4cRmJmrM3q5gFww2/bKsOd2E2sZAztxGEky7e0QXmVHBqBp4xAZTIyRexW2w9W3cfC98HnqJ30yT9qMizoxAh2EAXizoHZWekRM9EhGjJkShJ2g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mwZg7jfojU5O352pQDdihVP/Rw14DIUEqtdF9AP1F/zyaLulgK+Osut6tU/ONGcFAJvO4PMmGyK7/WmE5n5F63KsHVtvZi1gC1FZj+U5NK6y7m+e/bhljMne4R5bBAKU3+HB2Annl7nGlsZJdvB3yM5v/LXIDgp3Zp1Rdqpp3Jn8IO6cCMGn5uZfQpkjdiROg0AUIkTezgCqrOAbcO/pTreF2mljfOlkL/mT9hAGicAsdFSRtpadyYQI7ssYV2f9H24fIzlHU6SMt7raPvmfAEfrt0P7Gd6z1F4nOjpDC762RtZC0IfGLrCBZq/EnOQtGzyH/cKa/g7KLlvCBHCwWA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>
- Delivery-date: Fri, 09 Sep 2022 07:47:27 +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: AQHYw3lB6B8WhlC/sEygMdr51CFDi63WBOiAgAALjYCAAKlBAA==
- Thread-topic: [PATCH v5 2/2] xen/pci: replace call to is_memory_hole to pci_check_bar
Hi,
> On 8 Sep 2022, at 22:41, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Stefano,
>
> On 08/09/2022 21:59, Stefano Stabellini wrote:
>>> +/*
>>> + * TODO: BAR addresses and Root Complex window addresses are not guaranteed
>>> + * to be page aligned. We should check for alignment but this is not the
>>> + * right place for alignment check.
>>> + */
>>> +static int is_bar_valid(const struct dt_device_node *dev,
>>> + uint64_t addr, uint64_t len, void *data)
>>> +{
>>> + struct pdev_bar_check *bar_data = data;
>>> + unsigned long s = bar_data->start;
>>> + unsigned long e = bar_data->end;
>>> +
>>> + if ( (s >= addr) && (e <= (addr + len - 1)) )
>>> + bar_data->is_valid = true;
>> "s" and "e" are "unsigned long" while "addr" and "len" are uint64_t. Is
>> that OK?
>
> Good catch. No, physical address on Arm32 can be up to 40 bits.
>
>> Specifically, considering a potential arm32 case, shouldn't "s" and "e"
>> be uint64_t as well? Which means pdev_bar_check.start and end should be
>> uint64_t?
>
> They should be paddr_t which will be 64-bit on both arm32 and arm64.
paddr_t sounds a lot better here.
@Rahul: Can you send a v6 fixing this ?
Thanks
Bertrand
>
> Cheers,
>
> --
> Julien Grall
|