[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v2 3/4] VT-d: replace flush_all_cache()
- To: "Beulich, Jan" <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
- Date: Fri, 18 Feb 2022 05:35:26 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- 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=KjN3JFxacm4iP65kvUanE9pOzvfIR6bD9mkByBqe6Hg=; b=f9u1xTln6zEo1xBXr1UqJiKnKK2EwvMzHhNX9PvkVN3cYtgmn29yF+TJ2wwNtn/SyKqCx+cc6z2QI3i0X8iHCy5a9xCoHFxp5+PBQ6xtQNwzC/r9LvvyErUqV3XImjZg/8CXxpqz4de5q0sgHjk+G7eyOv4OE34MV7mQ6kIlvwxcwOJMsQpGhqyzURiu3JJv1TiXqHCfmt0Uhlb6DwPOEbNyD/WF//b9INQWEDLOj5aFt8u+hsvXmuvNu/PxzXnUhDMvuFxwWKklu2fmXPqssOK2j0BcO9sDf5uC//vn5hZE64xjHER+d1agN6p6JoHwodOA7Gk8Fv1Wke/1P5zRyg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bNTY3VcvPLdGdYpIH2fDKLLrIt1QpnxGZIM+QKxNxU9FgqbwpuAQ8/90olJgq6KvwBciCHmLFyWA2/a5ibPNLZ7sERxa37R5UjrgNZsTVVkjCISc3ZrHMvMoSSMHjMDsScF01Ye/AbLL1181Kxns+1RqDmfSFA4M1XTHPzYOiELM/v2BD1HXl/GNgwCG36TMXa5r0L2H03maDkDoxJtO0RP2BWfy4i0tRvgx9uUx1rD/kaL7zWD5/+XiQBFKs9V8gEGuDzB16nMMdKGqFrPFFQDwfaG6DLFxMjg4ZbhnQWo6HeWWHUHqU4NIu8BG8SQnG8ns1gBMBWq81oINORnyeg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
- Cc: Paul Durrant <paul@xxxxxxx>, "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Fri, 18 Feb 2022 05:35:35 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYE40cwzioqi7zCkCsPderd+h65ayY62ww
- Thread-topic: [PATCH v2 3/4] VT-d: replace flush_all_cache()
> From: Jan Beulich
> Sent: Thursday, January 27, 2022 10:49 PM
>
> Let's use infrastructure we have available instead of an open-coded
> wbinvd() invocation.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
>
> --- a/xen/drivers/passthrough/vtd/extern.h
> +++ b/xen/drivers/passthrough/vtd/extern.h
> @@ -78,8 +78,6 @@ int __must_check qinval_device_iotlb_syn
> struct pci_dev *pdev,
> u16 did, u16 size, u64 addr);
>
> -void flush_all_cache(void);
> -
> uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node);
> void free_pgtable_maddr(u64 maddr);
> void *map_vtd_domain_page(u64 maddr);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -623,7 +623,8 @@ static int __must_check iommu_flush_all(
> bool_t flush_dev_iotlb;
> int rc = 0;
>
> - flush_all_cache();
> + flush_local(FLUSH_CACHE);
> +
> for_each_drhd_unit ( drhd )
> {
> int context_rc, iotlb_rc;
> --- a/xen/drivers/passthrough/vtd/x86/vtd.c
> +++ b/xen/drivers/passthrough/vtd/x86/vtd.c
> @@ -46,8 +46,3 @@ void unmap_vtd_domain_page(const void *v
> {
> unmap_domain_page(va);
> }
> -
> -void flush_all_cache()
> -{
> - wbinvd();
> -}
>
|