Re: [PATCH 1/1] s390/protvirt: restore force_dma_unencrypted()

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

 



On Mon, 15 Jul 2019 06:20:27 -0700
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> This looks good to me - if you and Tom are fine with it I'd like to
> fold it into his commit so that what I'll send to Linus is bisection
> clean.

No objections here.

> 
> > Note: we still need sev_active() defined because of the reference
> > in fs/core/vmcore, but this one is likely to go away soon along
> > with the need for an s390 sev_active().
> 
> Any chance we could not change the return value from the function
> at least in this patch/fold as that change seems unrelated to the
> dma functionality.  If that is what you really wanted and only
> the dma code was in the way we can happily merge it as a separate
> patch, of couse.
> 

AFAIU the story form fs/core/vmcore.c boils down to the same on s390. I
explained this in an email I've sent a moment ago (to Thiago). I expect
sev_active() on s390 to go away soon as it really does not make sense
for us (any more).

Thus yes, we can restore the pre- e67a5ed1f86f ("dma-direct: Force
unencrypted DMA under SME for certain DMA masks") sev_active() behavior
as well, even if we don't care about it. What I did conveys the semantic
better. Not changing the behavior of however sev_active() makes more
sense if the two are going to be squashed.

The corresponding diff looks like follows. Would you like me to send it
out as v2?

Regards,
Halil

----------------------------8<---------------------------------------

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 5d8570ed6cab..a4ad2733eedf 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -189,6 +189,7 @@ config S390
        select VIRT_CPU_ACCOUNTING
        select ARCH_HAS_SCALED_CPUTIME
        select HAVE_NMI
+       select ARCH_HAS_FORCE_DMA_UNENCRYPTED
        select SWIOTLB
        select GENERIC_ALLOCATOR
 
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index f0bee6af3960..dfe47a22480a 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -155,12 +155,17 @@ int set_memory_decrypted(unsigned long addr, int numpages)
        return 0;
 }
 
-/* are we a protected virtualization guest? */
 bool sev_active(void)
 {
        return is_prot_virt_guest();
 }
 
+/* are we a protected virtualization guest? */
+bool force_dma_unencrypted(struct device *dev)
+{
+       return is_prot_virt_guest();
+}
+
 /* protected virtualization */
 static void pv_init(void)
 {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux