Received: by 10.213.65.68 with SMTP id h4csp1577384imn; Mon, 19 Mar 2018 07:54:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELtohDfHPcAbt7j+ccToZHmJKIAVTqM6ZUcDRV2S87UcZh9gldKyzgbazitBr8VOfpD1ZwRn X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr13051021plb.144.1521471268381; Mon, 19 Mar 2018 07:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521471268; cv=none; d=google.com; s=arc-20160816; b=Y8NM4Igl9ksAk3NBTvXzQ6+EceiB2gzt+vNotg4zMnOGm8JOl6pJSZ3mbkAs6f4C7x RLI+vkqIAAc0a3KoUrMezHxW2CAy0Tn6hqQFeImC2Fv0OB8dkAsvM6L2umM+AZ/ZjnCh tKxecZ6TLF7J5oe/i8fnXM0bHh9MLk806E4n8+llokRBzgLS03uOV/4C9UKE/w/+oGlY FiiZleMPlU8ZzDRHVRkus9KtmJ/0u+qOmLv/WGa/yl+RqfG5TKSkDnikCphVmv2TWQt+ hVM1gKpT3B64rkxBYCXIPMtnFXViUDP6KWxt0m8ePO61117SWAWQFQqRta6sBgt1gQFR 2dWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=TCguEkDi4q09i7ZLjTK6OKQgTMJhjkhT8/QGwAx1yuw=; b=SGs/CTZRuI1w1vTfENQ3YrU1/QQTkhUwpiK3koABJfWffaXSxOXvfgLssDjHPKLVQD aWFDep6+f446riwVccsSbt6ypkptHvOX18EURiV2tnXGTk230nIbtiA9O/52dULTg70m HCME11O3ZIfp9k5iL6//cgXbT5MPPsrWtEYr7nL3Ddw0x5w6Nt+R387YmWLzS5Zo2/To A5tMy4mcnvExwVNY12i0kdb2aMoWtlpziD0Knl9JbXuMg12NHgl4B66/NnjgAQXLu3o/ F+rMxk4HsNd2hhA5pmSh0Eymo9oJMd4XUydkYdxOl1tcDxCk+Zwv/n7lFuwgJEFhHiro N1Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=z2h3f6bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12-v6si136824pls.74.2018.03.19.07.54.14; Mon, 19 Mar 2018 07:54:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=z2h3f6bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933671AbeCSOlQ (ORCPT + 99 others); Mon, 19 Mar 2018 10:41:16 -0400 Received: from mail-by2nam03on0072.outbound.protection.outlook.com ([104.47.42.72]:58656 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933327AbeCSOlL (ORCPT ); Mon, 19 Mar 2018 10:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TCguEkDi4q09i7ZLjTK6OKQgTMJhjkhT8/QGwAx1yuw=; b=z2h3f6bUlh7OUsMumtbFZWsN9wzNl/TojS5uopCsjuZBVFUQWV63DWIKHk/6HSvEusdm9J3hXWnFeF/IZ12kFbLhQbMnAAwArPCUAmf4m5LE4wFffSyIuEofg/tw4joEpcJJU7JYrC9JgHDCbXAca8MvjNed95CSRRcvijZYjOE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.65.116] (165.204.78.1) by MWHPR12MB1149.namprd12.prod.outlook.com (2603:10b6:300:e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Mon, 19 Mar 2018 14:41:08 +0000 Subject: Re: [PATCH 11/14] swiotlb: remove swiotlb_set_mem_attributes To: Christoph Hellwig , x86@kernel.org Cc: Konrad Rzeszutek Wilk , David Woodhouse , Muli Ben-Yehuda , Jon Mason , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20180319103826.12853-1-hch@lst.de> <20180319103826.12853-12-hch@lst.de> From: Tom Lendacky Message-ID: <7fe2c163-c659-c27f-b54b-23b38e4b0149@amd.com> Date: Mon, 19 Mar 2018 09:41:03 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180319103826.12853-12-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR06CA0071.namprd06.prod.outlook.com (2603:10b6:3:37::33) To MWHPR12MB1149.namprd12.prod.outlook.com (2603:10b6:300:e::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6ea070d1-f4d2-42c3-3240-08d58da774cd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:MWHPR12MB1149; X-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z1ibiRCsiLUkjMfMEnrLU/gfOP+6D0zrwReLL1qidsiz72RiDMR4MGmObFCm9Ol5gOyurs5ikMub/rhrssnqaHscxpUl7Iqq+Z9zRIeM7WMSZAqm97KF59lS2kIBNRSWfMZKacqeAiVJT3d1h4wrIvk4aBIzJtARCj0qaxGFU9AtHTSADK8TS+H6mALuaNrGDOrABJepK0T/Hd/NkBKnqAymwUAn9Wz+LRRdWU92h4zSuKU3aKG5gWoPIOJ9bBYzD5vfXVgs9BmjzyILfVPGc3RkeQ7Ncc3bB4/gXPQ68VtZoj4rnZeMnGDH4li2mJ7hso7tXauzoh3Slp0i4gyhPdRhtMJ68H3gCZRTE7cINc6BEXYsrUdK9IGTpS2;4:CcKhGIxjoh3oeodWdKedgLaFwtNcg482SWqt12TXrYkj/vegSVKrEd3KmiY/TuNyr1E42pf8dlk0TTgESJsxmbn2HPl6bnh4YKNPASxV8cfojTuJtoVh6GYTEvhuYeXvwtNKhJJStuC0G8109Phhz0k3ISewDUMlMyIYz+1rvMEHI11pVmi+F3oWHZrbQsc2OZuTOdW9/BZcfepRptnWcZ3sfv04QmNhFLF5enzbo5nR/NFtrGB4Zx4rMNvBPQAgDkyoHVi8KiQXBRH4cfBeaw8+j1PXnGYyjAjI7wMFvTYH393YCCTQb+9k45odzlOgjWNDTa1TCE2B+ifGVYSCdr35Zd/2mGFT0jE2NcBENEk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231221)(944501300)(52105095)(10201501046)(6055026)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:MWHPR12MB1149;BCL:0;PCL:0;RULEID:;SRVR:MWHPR12MB1149; X-Forefront-PRVS: 06167FAD59 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39380400002)(39860400002)(346002)(376002)(366004)(396003)(199004)(189003)(77096007)(2906002)(31696002)(3846002)(6116002)(23676004)(52146003)(2486003)(76176011)(68736007)(50466002)(65806001)(53546011)(64126003)(65956001)(106356001)(66066001)(47776003)(386003)(16526019)(54906003)(52116002)(26005)(186003)(31686004)(105586002)(59450400001)(16576012)(2950100002)(58126008)(316002)(36756003)(6246003)(81166006)(81156014)(5660300001)(25786009)(8936002)(65826007)(230700001)(4326008)(8676002)(3260700006)(86362001)(575784001)(229853002)(7736002)(53936002)(478600001)(305945005)(6666003)(6486002)(72206003)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1149;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTQ5OzIzOlRES0RGaG02SU9CV0RWY1NndDljbXVaWW53?= =?utf-8?B?TTNadnlYMm1ZM1lDMGxTcm8rWTI4WU13UnpGbUR5YnJ0akNRYUtGMDdMOE9z?= =?utf-8?B?UUUxTzBuZzVObHBKRjFGVUNDckppcXpEYkk0SzdTdjRTY0w3Ty8weVBZM1pT?= =?utf-8?B?dWIyaXRLcTMydFRubUpTbExHQUVRU2VMRzFaMGI5SVIybWNsaVB3dXRDOVl0?= =?utf-8?B?VVlNZlAwNXVTbk9RY2dZNEJoV043WFdmNXJERVQ4ZjZDTmNLMlU4YmliR21x?= =?utf-8?B?cVNTNGp0cEFoZU5nSjdYUFVwNnZWSXpWcFpuQ3JlM2NIVnVoWVJPb1dORTJh?= =?utf-8?B?Wm9BcVBLb3JLajVEdXM3MWxKTWh1ZkdQMW9UQ21vMGlqRkxqZkt3ay81UHRz?= =?utf-8?B?cndvbXZHS2RMajJLWnNaWGoxemhJUndBeTZvWUpWcG1ueTI0V0YzeV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EvuxkGlCiOJPIr1Oh8z0fG5juYjM+05CdmAIvUMDMPSBu7gwZFP9teHeabhAvYAaGYZO4tpS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2018 14:41:08.0984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea070d1-f4d2-42c3-3240-08d58da774cd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1149 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/19/2018 5:38 AM, Christoph Hellwig wrote: > Now that set_memory_decrypted is always available we can just call it > directly. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Tom Lendacky > --- > arch/x86/include/asm/mem_encrypt.h | 2 -- > arch/x86/mm/mem_encrypt.c | 9 --------- > lib/swiotlb.c | 12 ++++++------ > 3 files changed, 6 insertions(+), 17 deletions(-) > > diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h > index 22c5f3e6f820..9da0b63c8fc7 100644 > --- a/arch/x86/include/asm/mem_encrypt.h > +++ b/arch/x86/include/asm/mem_encrypt.h > @@ -48,8 +48,6 @@ int __init early_set_memory_encrypted(unsigned long vaddr, unsigned long size); > /* Architecture __weak replacement functions */ > void __init mem_encrypt_init(void); > > -void swiotlb_set_mem_attributes(void *vaddr, unsigned long size); > - > bool sme_active(void); > bool sev_active(void); > > diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c > index 66beedc8fe3d..d3b80d5f9828 100644 > --- a/arch/x86/mm/mem_encrypt.c > +++ b/arch/x86/mm/mem_encrypt.c > @@ -446,15 +446,6 @@ void __init mem_encrypt_init(void) > : "Secure Memory Encryption (SME)"); > } > > -void swiotlb_set_mem_attributes(void *vaddr, unsigned long size) > -{ > - WARN(PAGE_ALIGN(size) != size, > - "size is not page-aligned (%#lx)\n", size); > - > - /* Make the SWIOTLB buffer area decrypted */ > - set_memory_decrypted((unsigned long)vaddr, size >> PAGE_SHIFT); > -} > - > struct sme_populate_pgd_data { > void *pgtable_area; > pgd_t *pgd; > diff --git a/lib/swiotlb.c b/lib/swiotlb.c > index c43ec2271469..005d1d87bb2e 100644 > --- a/lib/swiotlb.c > +++ b/lib/swiotlb.c > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -156,8 +157,6 @@ unsigned long swiotlb_size_or_default(void) > return size ? size : (IO_TLB_DEFAULT_SIZE); > } > > -void __weak swiotlb_set_mem_attributes(void *vaddr, unsigned long size) { } > - > /* For swiotlb, clear memory encryption mask from dma addresses */ > static dma_addr_t swiotlb_phys_to_dma(struct device *hwdev, > phys_addr_t address) > @@ -209,12 +208,12 @@ void __init swiotlb_update_mem_attributes(void) > > vaddr = phys_to_virt(io_tlb_start); > bytes = PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT); > - swiotlb_set_mem_attributes(vaddr, bytes); > + set_memory_decrypted((unsigned long)vaddr, bytes >> PAGE_SHIFT); > memset(vaddr, 0, bytes); > > vaddr = phys_to_virt(io_tlb_overflow_buffer); > bytes = PAGE_ALIGN(io_tlb_overflow); > - swiotlb_set_mem_attributes(vaddr, bytes); > + set_memory_decrypted((unsigned long)vaddr, bytes >> PAGE_SHIFT); > memset(vaddr, 0, bytes); > } > > @@ -355,7 +354,7 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) > io_tlb_start = virt_to_phys(tlb); > io_tlb_end = io_tlb_start + bytes; > > - swiotlb_set_mem_attributes(tlb, bytes); > + set_memory_decrypted((unsigned long)tlb, bytes >> PAGE_SHIFT); > memset(tlb, 0, bytes); > > /* > @@ -366,7 +365,8 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) > if (!v_overflow_buffer) > goto cleanup2; > > - swiotlb_set_mem_attributes(v_overflow_buffer, io_tlb_overflow); > + set_memory_decrypted((unsigned long)v_overflow_buffer, > + io_tlb_overflow >> PAGE_SHIFT); > memset(v_overflow_buffer, 0, io_tlb_overflow); > io_tlb_overflow_buffer = virt_to_phys(v_overflow_buffer); > >