Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread James Bottomley
On Thu, 2024-11-07 at 11:51 +0200, Jarkko Sakkinen wrote: [...] > +void tpm_buf_append_auth(struct tpm_chip *chip, struct tpm_buf *buf, > +    u8 attributes, u8 *passphrase, int > passphrase_len) > +{ > +   /* offset tells us where the sessions area begins */ > +   int o

Re: [PATCH v6 01/10] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-11-07 Thread Nicolin Chen
On Thu, Nov 07, 2024 at 09:11:27PM +1100, Alexey Kardashevskiy wrote: > On 31/10/24 08:35, Nicolin Chen wrote: > > Introduce a new IOMMUFD_OBJ_VDEVICE to represent a physical device (struct > > device) against a vIOMMU (struct iommufd_viommu) object in a VM. > > > > This vDEVICE object (and its st

Re: [PATCH v2 0/3] Make Helped-by tag supported

2024-11-07 Thread Dragan Simic
Hello Jonathan, On 2024-11-06 15:28, Jonathan Corbet wrote: Dragan Simic writes: This is a short series that adds Helped-by tag to the list of accepted tags in scripts/checkpatch.pl, and describes the intended use of this new tag in Documentation/process/submitting-patches.rst. The propose

Re: [PATCH v7 0/7] Add AutoFDO and Propeller support for Clang build

2024-11-07 Thread Rong Xu
Thanks for the explanation. On Thu, Nov 7, 2024 at 6:58 AM Masahiro Yamada wrote: > > On Thu, Nov 7, 2024 at 4:00 AM Rong Xu wrote: > > > > On Wed, Nov 6, 2024 at 8:09 AM Masahiro Yamada wrote: > > > > > > On Sun, Nov 3, 2024 at 2:51 AM Rong Xu wrote: > > > > > > > > Hi, > > > > > > > > This p

Re: [PATCH v6 05/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-11-07 Thread Jason Gunthorpe
On Thu, Nov 07, 2024 at 12:37:59PM +1100, Alexey Kardashevskiy wrote: > > + hwpt_paging = iommufd_get_hwpt_paging(ucmd, cmd->hwpt_id); > > + if (IS_ERR(hwpt_paging)) { > > + rc = PTR_ERR(hwpt_paging); > > + goto out_put_idev; > > + } > > + > > + if (!hwpt_paging->nest_pa

Re: [PATCH v6 01/10] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-11-07 Thread Jason Gunthorpe
On Thu, Nov 07, 2024 at 08:31:39AM -0800, Nicolin Chen wrote: > > Is there any plan to add guest device BDFn as well, or I can add one > > here for my TEE-IO exercise, if it is the right place? It is the same as > > vDeviceID for AMD but I am not sure about the others, hence the > > question. Thank

[PATCH v7 03/27] dax: Document struct dev_dax_range

2024-11-07 Thread Ira Weiny
The device DAX structure is being enhanced to track additional DCD information. Specifically the range tuple needs additional parameters. The current range tuple is not fully documented and is large enough to warrant its own definition. Separate the struct dax_dev_range definition and document it

[PATCH v7 08/27] cxl/mem: Read dynamic capacity configuration from the device

2024-11-07 Thread ira . weiny
From: Navneet Singh Devices which optionally support Dynamic Capacity (DC) are configured via mailbox commands. CXL 3.1 requires the host to issue the Get DC Configuration command in order to properly configure DCDs. Without the Get DC Configuration command DCD can't be supported. Implement th

[PATCH v7 07/27] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD)

2024-11-07 Thread ira . weiny
From: Navneet Singh Per the CXL 3.1 specification software must check the Command Effects Log (CEL) for dynamic capacity command support. Detect support for the DCD commands while reading the CEL, including: Get DC Config Get DC Extent List Add DC Response Releas

[PATCH v7 06/27] cxl/region: Refactor common create region code

2024-11-07 Thread Ira Weiny
create_pmem_region_store() and create_ram_region_store() are identical with the exception of the region mode. With the addition of DC region mode this would end up being 3 copies of the same code. Refactor create_pmem_region_store() and create_ram_region_store() to use a single common function to

[PATCH v7 12/27] cxl/cdat: Gather DSMAS data for DCD regions

2024-11-07 Thread Ira Weiny
Additional DCD region (partition) information is contained in the DSMAS CDAT tables, including performance, read only, and shareable attributes. Match DCD partitions with DSMAS tables and store the meta data. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny --- d

[PATCH v7 15/27] cxl/region: Add sparse DAX region support

2024-11-07 Thread ira . weiny
From: Navneet Singh Dynamic Capacity CXL regions must allow memory to be added or removed dynamically. In addition to the quantity of memory available the location of the memory within a DC partition is dynamic based on the extents offered by a device. CXL DAX regions must accommodate the spars

[PATCH v7 14/27] cxl/port: Add endpoint decoder DC mode support to sysfs

2024-11-07 Thread ira . weiny
From: Navneet Singh Endpoint decoder mode is used to represent the partition the decoder points to such as ram or pmem. Expand the mode to allow a decoder to point to a specific DC partition (Region). Signed-off-by: Navneet Singh Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Co-devel

[PATCH v7 13/27] cxl/mem: Expose DCD partition capabilities in sysfs

2024-11-07 Thread ira . weiny
From: Navneet Singh To properly configure CXL regions on Dynamic Capacity Devices (DCD), user space will need to know the details of the DC partitions available. Expose dynamic capacity capabilities through sysfs. Signed-off-by: Navneet Singh Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni

[PATCH v7 05/27] cxl/hdm: Use guard() in cxl_dpa_set_mode()

2024-11-07 Thread Ira Weiny
Additional DCD functionality is being added to this call which will be simplified by the use of guard() with the cxl_dpa_rwsem. Convert the function to use guard() prior to adding DCD functionality. Suggested-by: Jonathan Cameron Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Signe

[PATCH v7 02/27] ACPI/CDAT: Add CDAT/DSMAS shared and read only flag values

2024-11-07 Thread Ira Weiny
The Coherent Device Attribute Table (CDAT) Device Scoped Memory Affinity Structure (DSMAS) version 1.04 [1] defines flags to indicate if a DPA range is read only and/or shared. Add read only and shareable flag definitions. This change was merged in ACPICA via PR 976.[2] Link: https://uefi.org/s

[PATCH v7 04/27] cxl/pci: Delay event buffer allocation

2024-11-07 Thread Ira Weiny
The event buffer does not need to be allocated if something has failed in setting up event irq's. In prep for adjusting event configuration for DCD events move the buffer allocation to the end of the event configuration. Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Reviewed-by: Jonathan

[PATCH v7 09/27] cxl/core: Separate region mode from decoder mode

2024-11-07 Thread ira . weiny
From: Navneet Singh Until now region modes and decoder modes were equivalent in that both modes were either PMEM or RAM. The addition of Dynamic Capacity partitions defines up to 8 DC partitions per device. The region mode is thus no longer equivalent to the endpoint decoder mode. IOW the endp

[PATCH v7 10/27] cxl/region: Add dynamic capacity decoder and region modes

2024-11-07 Thread ira . weiny
From: Navneet Singh One or more decoders each pointing to a Dynamic Capacity (DC) partition form a CXL software region. The region mode reflects composition of that entire software region. Decoder mode reflects a specific DC partition. DC partitions are also known as DC regions per CXL specifi

[PATCH v7 11/27] cxl/hdm: Add dynamic capacity size support to endpoint decoders

2024-11-07 Thread ira . weiny
From: Navneet Singh To support Dynamic Capacity Devices (DCD) endpoint decoders will need to map DC partitions (regions). In addition to assigning the size of the DC partition, the decoder must assign any skip value from the previous decoder. This must be done within a contiguous DPA space. Tw

[PATCH v7 19/27] cxl/core: Return endpoint decoder information from region search

2024-11-07 Thread Ira Weiny
cxl_dpa_to_region() finds the region from a tuple. The search involves finding the device endpoint decoder as well. Dynamic capacity extent processing uses the endpoint decoder HPA information to calculate the HPA offset. In addition, well behaved extents should be contained within an endpoint d

[PATCH v7 18/27] cxl/mem: Configure dynamic capacity interrupts

2024-11-07 Thread ira . weiny
From: Navneet Singh Dynamic Capacity Devices (DCD) support extent change notifications through the event log mechanism. The interrupt mailbox commands were extended in CXL 3.1 to support these notifications. Firmware can't configure DCD events to be FW controlled but can retain control of memor

[PATCH v7 16/27] cxl/events: Split event msgnum configuration from irq setup

2024-11-07 Thread Ira Weiny
Dynamic Capacity Devices (DCD) require event interrupts to process memory addition or removal. BIOS may have control over non-DCD event processing. DCD interrupt configuration needs to be separate from memory event interrupt configuration. Split cxl_event_config_msgnums() from irq setup in prepa

[PATCH v7 17/27] cxl/pci: Factor out interrupt policy check

2024-11-07 Thread Ira Weiny
Dynamic Capacity Devices (DCD) require event interrupts to process memory addition or removal. BIOS may have control over non-DCD event processing. DCD interrupt configuration needs to be separate from memory event interrupt configuration. Factor out event interrupt setting validation. Reviewed

[PATCH v7 20/27] cxl/extent: Process DCD events and realize region extents

2024-11-07 Thread ira . weiny
From: Navneet Singh A dynamic capacity device (DCD) sends events to signal the host for changes in the availability of Dynamic Capacity (DC) memory. These events contain extents describing a DPA range and meta data for memory to be added or removed. Events may be sent from the device at any tim

[PATCH v7 22/27] dax/bus: Factor out dev dax resize logic

2024-11-07 Thread Ira Weiny
Dynamic Capacity regions must limit dev dax resources to those areas which have extents backing real memory. Such DAX regions are dubbed 'sparse' regions. In order to manage where memory is available four alternatives were considered: 1) Create a single region resource child on region creation w

[PATCH v7 21/27] cxl/region/extent: Expose region extent information in sysfs

2024-11-07 Thread ira . weiny
From: Navneet Singh Extent information can be helpful to the user to coordinate memory usage with the external orchestrator and FM. Expose the details of region extents by creating the following sysfs entries. /sys/bus/cxl/devices/dax_regionX/extentX.Y /sys/bus/cxl/devices/dax_r

[PATCH v7 23/27] dax/region: Create resources on sparse DAX regions

2024-11-07 Thread ira . weiny
From: Navneet Singh DAX regions which map dynamic capacity partitions require that memory be allowed to come and go. Recall sparse regions were created for this purpose. Now that extents can be realized within DAX regions the DAX region driver can start tracking sub-resource information. The t

[PATCH v7 27/27] tools/testing/cxl: Add DC Regions to mock mem data

2024-11-07 Thread Ira Weiny
cxl_test provides a good way to ensure quick smoke and regression testing. The complexity of Dynamic Capacity (DC) extent processing as well as the complexity of the new sparse DAX regions can mostly be tested through cxl_test. This includes management of sparse regions and DAX devices on those r

[PATCH v7 25/27] cxl/mem: Trace Dynamic capacity Event Record

2024-11-07 Thread ira . weiny
From: Navneet Singh CXL rev 3.1 section 8.2.9.2.1 adds the Dynamic Capacity Event Records. User space can use trace events for debugging of DC capacity changes. Add DC trace points to the trace log. Signed-off-by: Navneet Singh Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Reviewed-b

[PATCH v7 26/27] tools/testing/cxl: Make event logs dynamic

2024-11-07 Thread Ira Weiny
The event logs test was created as static arrays as an easy way to mock events. Dynamic Capacity Device (DCD) test support requires events be generated dynamically when extents are created or destroyed. The current event log test has specific checks for the number of events seen including log ove

[PATCH v7 24/27] cxl/region: Read existing extents on region creation

2024-11-07 Thread ira . weiny
From: Navneet Singh Dynamic capacity device extents may be left in an accepted state on a device due to an unexpected host crash. In this case it is expected that the creation of a new region on top of a DC partition can read those extents and surface them for continued use. Once all endpoint d

Re: [PATCH v7 7/7] Add Propeller configuration for kernel build

2024-11-07 Thread Rong Xu
Thanks Nathan for finding this out! We changed the propeller option with this patch: https://github.com/llvm/llvm-project/pull/110039 Currently, this patch is only in the ToT clang (v20) and not yet released in v19. I'll add a compiler version check to the patch: if the clang version >= 20, use t

Re: [PATCH 2/3] KVM: x86: Add support for VMware guest specific hypercalls

2024-11-07 Thread Sean Christopherson
On Mon, Nov 04, 2024, Zack Rusin wrote: > On Mon, Nov 4, 2024 at 5:13 PM Paolo Bonzini wrote: > > > > On Wed, Oct 30, 2024 at 4:35 AM Zack Rusin wrote: > > > > > > VMware products handle hypercalls in userspace. Give KVM the ability > > > to run VMware guests unmodified by fowarding all hypercall

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Mimi Zohar
On Thu, 2024-11-07 at 11:51 +0200, Jarkko Sakkinen wrote: > The initial HMAC session feature added TPM bus encryption and/or integrity > protection to various in-kernel TPM operations. This can cause performance > bottlenecks with IMA, as it heavily utilizes PCR extend operations. > > In order to

Re: [PATCH v6 05/27] cxl/hdm: Use guard() in cxl_dpa_set_mode()

2024-11-07 Thread Ira Weiny
Jonathan Cameron wrote: > On Tue, 05 Nov 2024 12:38:27 -0600 > Ira Weiny wrote: > > > Additional DCD functionality is being added to this call which will be > > simplified by the use of guard() with the cxl_dpa_rwsem. > > > > Convert the function to use guard() prior to adding DCD functionality.

Re: [PATCH v7 7/7] Add Propeller configuration for kernel build

2024-11-07 Thread Nathan Chancellor
Hi Rong, On Sat, Nov 02, 2024 at 10:51:14AM -0700, Rong Xu wrote: > diff --git a/scripts/Makefile.propeller b/scripts/Makefile.propeller > new file mode 100644 > index 0..344190717e471 > --- /dev/null > +++ b/scripts/Makefile.propeller > @@ -0,0 +1,28 @@ > +# SPDX-License-Identifier: G

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread kernel test robot
Hi Jarkko, kernel test robot noticed the following build errors: [auto build test ERROR on char-misc/char-misc-testing] [also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus linus/master v6.12-rc6 next-20241107] [If your patch is applied to the wrong git tree, kindly drop

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Mimi Zohar
On Thu, 2024-11-07 at 15:47 +0200, Jarkko Sakkinen wrote: > On Thu Nov 7, 2024 at 3:44 PM EET, Mimi Zohar wrote: > > > > > > @@ -232,18 +236,26 @@ int tpm2_pcr_extend(struct tpm_chip *chip, u32 > > > pcr_idx, > > > int rc; > > > int i; > > > > > > - rc = tpm2_start_auth_session(chip); > > >

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Jarkko Sakkinen
On Thu Nov 7, 2024 at 4:00 PM EET, Mimi Zohar wrote: > On Thu, 2024-11-07 at 15:47 +0200, Jarkko Sakkinen wrote: > > On Thu Nov 7, 2024 at 3:44 PM EET, Mimi Zohar wrote: > > > > > > > > @@ -232,18 +236,26 @@ int tpm2_pcr_extend(struct tpm_chip *chip, u32 > > > > pcr_idx, > > > > int rc; >

Re: [PATCH v6 05/27] cxl/hdm: Use guard() in cxl_dpa_set_mode()

2024-11-07 Thread Jonathan Cameron
On Tue, 05 Nov 2024 12:38:27 -0600 Ira Weiny wrote: > Additional DCD functionality is being added to this call which will be > simplified by the use of guard() with the cxl_dpa_rwsem. > > Convert the function to use guard() prior to adding DCD functionality. > > Suggested-by: Jonathan Cameron

[PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Jarkko Sakkinen
The initial HMAC session feature added TPM bus encryption and/or integrity protection to various in-kernel TPM operations. This can cause performance bottlenecks with IMA, as it heavily utilizes PCR extend operations. In order to mitigate this performance issue, introduce a kernel command-line par

Re: [PATCH v6 23/27] dax/region: Create resources on sparse DAX regions

2024-11-07 Thread Jonathan Cameron
On Tue, 05 Nov 2024 12:38:45 -0600 ira.we...@intel.com wrote: > From: Navneet Singh > > DAX regions which map dynamic capacity partitions require that memory be > allowed to come and go. Recall sparse regions were created for this > purpose. Now that extents can be realized within DAX regions

Re: [PATCH v6 01/10] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-11-07 Thread Alexey Kardashevskiy
On 31/10/24 08:35, Nicolin Chen wrote: Introduce a new IOMMUFD_OBJ_VDEVICE to represent a physical device (struct device) against a vIOMMU (struct iommufd_viommu) object in a VM. This vDEVICE object (and its structure) holds all the infos and attributes in the VM, regarding the device related to

Re: [PATCH v7 0/7] Add AutoFDO and Propeller support for Clang build

2024-11-07 Thread Masahiro Yamada
On Thu, Nov 7, 2024 at 4:00 AM Rong Xu wrote: > > On Wed, Nov 6, 2024 at 8:09 AM Masahiro Yamada wrote: > > > > On Sun, Nov 3, 2024 at 2:51 AM Rong Xu wrote: > > > > > > Hi, > > > > > > This patch series is to integrate AutoFDO and Propeller support into > > > the Linux kernel. AutoFDO is a prof

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Jarkko Sakkinen
On Thu Nov 7, 2024 at 3:20 PM EET, James Bottomley wrote: > On Thu, 2024-11-07 at 11:51 +0200, Jarkko Sakkinen wrote: > [...] > > +void tpm_buf_append_auth(struct tpm_chip *chip, struct tpm_buf *buf, > > +    u8 attributes, u8 *passphrase, int > > passphrase_len) > > +{ > > +   

Re: [PATCH v6 20/27] cxl/extent: Process DCD events and realize region extents

2024-11-07 Thread Jonathan Cameron
On Tue, 05 Nov 2024 12:38:42 -0600 ira.we...@intel.com wrote: > From: Navneet Singh > > A dynamic capacity device (DCD) sends events to signal the host for > changes in the availability of Dynamic Capacity (DC) memory. These > events contain extents describing a DPA range and meta data for memo

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread kernel test robot
us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jarkko-Sakkinen/tpm-Opt-in-in-disable-PCR-integrity-protection/20241107-175515 ba

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread Jarkko Sakkinen
On Thu Nov 7, 2024 at 3:44 PM EET, Mimi Zohar wrote: > > + tpm.disable_pcr_integrity_protection= [HW,TPM] > > + Do not protect PCR registers from unintended physical > > + access, or interposers in the bus by the means of > > + having an encry

Re: [PATCH v2] tpm: Opt-in in disable PCR integrity protection

2024-11-07 Thread James Bottomley
On Thu, 2024-11-07 at 15:49 +0200, Jarkko Sakkinen wrote: > On Thu Nov 7, 2024 at 3:20 PM EET, James Bottomley wrote: > > On Thu, 2024-11-07 at 11:51 +0200, Jarkko Sakkinen wrote: > > [...] > > > +void tpm_buf_append_auth(struct tpm_chip *chip, struct tpm_buf > > > *buf, > > > +

[PATCH net-next v7 0/6] Suspend IRQs during application busy periods

2024-11-07 Thread Joe Damato
Greetings: Welcome to v7, see changelog below. This revision drops patch 2 from the previous version, which was unnecessary as Jakub pointed out. The tests were fully re-run after dropping the patch to confirm the performance numbers hold; they do - see below. FAQ #2 has been updated to be more v

[PATCH net-next v8 0/6] Suspend IRQs during application busy periods

2024-11-07 Thread Joe Damato
Greetings: Welcome to v8, see changelog below. This revision is a quick follow-up to v7 and only drops the unneeded exports in patch 2. No other changes. This series introduces a new mechanism, IRQ suspension, which allows network applications using epoll to mask IRQs during periods of high traf

Re: [PATCH 2/3] KVM: x86: Add support for VMware guest specific hypercalls

2024-11-07 Thread Zack Rusin
On Thu, Nov 7, 2024 at 5:32 PM Sean Christopherson wrote: > > On Mon, Nov 04, 2024, Zack Rusin wrote: > > On Mon, Nov 4, 2024 at 5:13 PM Paolo Bonzini wrote: > > > > > > On Wed, Oct 30, 2024 at 4:35 AM Zack Rusin > > > wrote: > > > > > > > > VMware products handle hypercalls in userspace. Give