Re: [RFC PATCH v4 14/28] Add support to access boot related data in the clear

2017-02-24 Thread Borislav Petkov
On Thu, Feb 23, 2017 at 03:34:30PM -0600, Tom Lendacky wrote: > Hmm... maybe I'm missing something here. This doesn't have anything to > do with kexec or efi_reuse_config. This has to do with the fact that I said kexec because kexec uses the setup_data mechanism to pass config tables to the

Re: [RFC PATCH v4 13/28] efi: Update efi_mem_type() to return defined EFI mem types

2017-02-24 Thread Matt Fleming
On Thu, 23 Feb, at 11:27:55AM, Tom Lendacky wrote: > > I can do that, I'll change the return type to an int. For the > !efi_enabled I can return -ENOTSUPP and for when an entry isn't > found I can return -EINVAL. Sound good? Sounds good to me! ___

[PATCH v11 00/10] perf/amd/iommu: Enable multi-IOMMU support

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit This patch series modifies the existing IOMMU and Perf drivers to support systems with multiple IOMMUs by allocating an amd_iommu PMU per IOMMU instance. This allows users to specify performance events and filters separately for each

[PATCH v11 01/10] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2017-02-24 Thread Suravee Suthikulpanit
Declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Also check return value when _init_events_attrs fails. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit ---

[PATCH v11 05/10] iommu/amd: Introduce amd_iommu_get_num_iommus()

2017-02-24 Thread Suravee Suthikulpanit
Introduce amd_iommu_get_num_iommus(), which returns the value of amd_iommus_present. The function is used to replace direct access to the variable, which is now declared as static. This function will also be used by Perf AMD IOMMU driver. Cc: Borislav Petkov Cc: Joerg Roedel

[PATCH v11 06/10] perf/amd/iommu: Modify functions to query max banks and counters

2017-02-24 Thread Suravee Suthikulpanit
Currently, amd_iommu_pc_get_max_[banks|counters]() use end-point device ID to locate an IOMMU and check the reported max banks/counters. The logic assumes that the IOMMU_BASE_DEVID belongs to the first IOMMU, and uses it to acquire a reference to the first IOMMU, which does not work on certain

[PATCH v11 02/10] perf/amd/iommu: Clean up bitwise operations

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit Clean up register initializaton and make use of BIT_ULL(x) where appropriate. This should not affect logic and functionality. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee

[PATCH v11 09/10] perf/amd/iommu: Introduce amd_iommu-specific struct in struct hw_perf_event

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit Current AMD IOMMU Perf PMU inappropriately uses hardware struct inside the union inside the struct hw_perf_event, mainly the use of extra_reg. Instead, introduce amd_iommu-specific struct with required parameters to be programmed onto

[PATCH v11 08/10] perf/amd/iommu: Fix sysfs perf attribute groups

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit Introduce static amd_iommu_attr_groups to simplify the sysfs attributes initialization code. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit

[PATCH v11 10/10] perf/amd/iommu: Enable support for multiple IOMMUs

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit Add multi-IOMMU support for perf by exposing an AMD IOMMU PMU for each IOMMU found in the system via: /bus/event_source/devices/amd_iommu_x where x is the IOMMU index. This allows users to specify different events to be programmed

[PATCH v11 07/10] perf/amd/iommu: Modify amd_iommu_pc_get_set_reg_val() to allow specifying IOMMU

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit The current amd_iommu_pc_get_set_reg_val() cannot support multiple IOMMUs. So, modify it to allow callers to specify IOMMU. This prepares the driver for supporting multi-IOMMU in subsequent patch. Cc: Peter Zijlstra

[PATCH v11 03/10] perf/amd/iommu: Clean up perf_iommu_read()

2017-02-24 Thread Suravee Suthikulpanit
Fix coding style and make use of GENMASK_ULL macro. Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Joerg Roedel Signed-off-by: Suravee Suthikulpanit --- arch/x86/events/amd/iommu.c | 16 ++-- 1 file

Re: [PATCH v2] iommu: iova: Consolidate code for adding new node to iovad domain rbtree

2017-02-24 Thread Robin Murphy
On 24/02/17 11:13, Marek Szyprowski wrote: > This patch consolidates almost the same code used in iova_insert_rbtree() > and __alloc_and_insert_iova_range() functions. While touching this code, > replace BUG() with WARN_ON(1) to avoid taking down the whole system in > case of corrupted iova tree

[PATCH v2] iommu: iova: Consolidate code for adding new node to iovad domain rbtree

2017-02-24 Thread Marek Szyprowski
This patch consolidates almost the same code used in iova_insert_rbtree() and __alloc_and_insert_iova_range() functions. While touching this code, replace BUG() with WARN_ON(1) to avoid taking down the whole system in case of corrupted iova tree or incorrect calls. Signed-off-by: Marek Szyprowski

Re: [RFC PATCH v4 14/28] Add support to access boot related data in the clear

2017-02-24 Thread Borislav Petkov
On Fri, Feb 24, 2017 at 09:04:21AM -0600, Tom Lendacky wrote: > I looked at doing that but you get into this cyclical situation unless > you specifically map each setup data elemement as decrypted. This is ok > for early_memremap since we have early_memremap_decrypted() but a new >

Re: [RFC PATCH v1] iommu/io-pgtable-arm-v7s: Check for leaf entry right after finding it

2017-02-24 Thread Will Deacon
On Tue, Feb 21, 2017 at 03:31:26PM +0200, Oleksandr Tyshchenko wrote: > On Tue, Feb 21, 2017 at 2:00 PM, Robin Murphy wrote: > > Would it not be more logical (and simpler) to just check that the thing > > we dereference is valid to dereference when we dereference it? i.e.: >

Re: intel-iommu sysfs oops.

2017-02-24 Thread Dave Jones
On Fri, Feb 24, 2017 at 12:30:38AM +0100, Joerg Roedel wrote: > Hi Dave, > > On Thu, Feb 23, 2017 at 02:44:06PM -0500, Dave Jones wrote: > > cat /sys/devices/virtual/iommu/dmar0/intel-iommu/version > > > > Oops: [#1] PREEMPT SMP DEBUG_PAGEALLOC > > Thanks for the report, the

Re: [RFC PATCH v4 14/28] Add support to access boot related data in the clear

2017-02-24 Thread Tom Lendacky
On 2/24/2017 4:21 AM, Borislav Petkov wrote: On Thu, Feb 23, 2017 at 03:34:30PM -0600, Tom Lendacky wrote: Hmm... maybe I'm missing something here. This doesn't have anything to do with kexec or efi_reuse_config. This has to do with the fact that I said kexec because kexec uses the