Re: [PATCH V4] PCI: Extend ACS configurability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 25, 2024 at 09:01:50PM +0530, Vidya Sagar wrote:
> Add a kernel command-line option 'config_acs' to directly control all the
> ACS bits for specific devices, which allows the operator to setup the
> right level of isolation to achieve the desired P2P configuration.

An example wouldn't hurt, here and in kernel-parameters.txt.


> ACS offers a range of security choices controlling how traffic is
> allowed to go directly between two devices. Some popular choices:
>   - Full prevention
>   - Translated requests can be direct, with various options
>   - Asymmetric direct traffic, A can reach B but not the reverse
>   - All traffic can be direct
> Along with some other less common ones for special topologies.

I'm wondering whether it would make more sense to let users choose
between those "higher-level" options, instead of giving direct access
to bits (and thus risking users to choose an incorrect setting).

Also, would it be possible to automatically change ACS settings
when enabling or disabling P2PDMA?

The representation chosen here (as a command line option) seems
questionable:

We're going to add more user-controllable options going forward.
E.g., when introducing IDE, we'll have to let user space choose
whether encryption should be enabled for certain PCIe devices.
That's because encryption isn't for free, so can't be enabled
opportunistically.  (The number of crypto engines on a CPU is
limited and enabling encryption consumes energy.)

What about exposing such user configurable settings with sysctl?
The networking subsystem has per-interface sysctl settings,
we could have per-PCI-device settings.

So just like this...

net.ipv4.conf.default.arp_accept = 0
net.ipv4.conf.eth0.arp_accept = 0
net.ipv4.conf.eth1.arp_accept = 0

... we could have...

pci.0000:03:00.0.acs = full_prevention
pci.0000:03:00.0.ide = 1
pci.0000:03:01.0.acs = all_traffic
pci.0000:03:01.0.ide = 0

This isn't hard to do, just call register_sysctl() for each device
on enumeration and unregister_sysctl_table() on pci_destroy_dev().

Thanks,

Lukas




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux