Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1553014

Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI)

From Khalid Aziz <khalid.aziz@oracle.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI)
Date 2017-01-06 19:20 +0100
Message-ID <sWHho-5GO-31@gated-at.bofh.it> (permalink)
References (1 earlier) <sWFyV-4sv-35@gated-at.bofh.it> <sWG23-4DR-27@gated-at.bofh.it> <sWGbE-4WL-25@gated-at.bofh.it> <sWGlk-52t-23@gated-at.bofh.it> <sWGY2-5hC-21@gated-at.bofh.it>
Organization Oracle Corp

Show all headers | View raw


On 01/06/2017 10:54 AM, Rob Gardner wrote:
> On 01/06/2017 09:10 AM, Khalid Aziz wrote:
>> On 01/06/2017 10:02 AM, David Miller wrote:
>>> From: Dave Hansen <dave.hansen@linux.intel.com>
>>> Date: Fri, 6 Jan 2017 08:55:03 -0800
>>>
>>>> Actually, that reminds me...  How does your code interface with
>>>> ksm?  Or
>>>> is there no interaction needed since you're always working on virtual
>>>> addresses?
>>>
>>> This reminds me, I consider this feature potentially extremely useful
>>> for
>>> kernel debugging.  So I would like to make sure we don't implement
>>> anything
>>> in a way which would preclude that in the long term.
>>
>> I agree and please do point out if I have made any implementation
>> decisions that could preclude that.
>>
>> Thanks,
>> Khalid
>
>
> Khalid, I have already pointed out an implementation decision that
> interferes with the potential for kernel debugging with ADI: lazy
> clearing of version tags.

This does not preclude kernel debugging. If kernel debugging ends up 
requiring tags be cleared whenever a page is freed, we can add that code 
as part of kernel debugging support code and enable it conditionally 
only when kernel is being debugged. Forcing every task to incur the 
large cost of clearing tags on every "free" all the time is just not an 
acceptable cost only to support kernel debugging. It should be a dynamic 
switch to be toggled on only when debugging kernel. PSTATE.mcde being 
set is not enough to trigger a trap. It is easy enough to clear TTE.mcd 
before block initialization of a page and avoid a trap due to tag 
mismatch, or just use physical address with block initialization.

We can evaluate all of these options when we get to implementing kernel 
debugging using ADI.

Thanks,
Khalid


>
> Details: when memory is "freed" the version tags are left alone, as it
> is an expensive operation to go through the memory and clear the tag for
> each cache line. So this is done lazily whenever memory is "allocated".
> More specifically, the first time a user process touches freshly
> allocated memory, a fault occurs and the kernel then clears the page. In
> the NG4 and M7 variants of clear_user_page, the block init store ASI is
> used to optimize, and it has the side effect of clearing the ADI tag for
> the cache line. BUT only if pstate.mcde is clear. If pstate.mcde is set,
> then instead of the ADI tag being cleared, the tag is *checked*, and if
> there is a mismatch between the version in the virtual address and the
> version in memory, then you'll get a trap and panic. Therefore, with
> this design, you cannot have pstate.mcde enabled while in the kernel (in
> general). To solve this you have to check the state of pstate.mcde (or
> just turn it off) before doing any block init store in clear_user_page,
> memset, memcpy, etc.
>
> Rob
>
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:30 +0100
  Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 00:40 +0100
    Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 00:50 +0100
      Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:50 +0100
        Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 01:00 +0100
          Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 01:10 +0100
            Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 01:10 +0100
              Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 01:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 01:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 20:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 21:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Michal Hocko <mhocko@kernel.org> - 2017-01-06 10:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-06 16:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 17:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) David Miller <davem@redhat.com> - 2017-01-06 17:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-06 18:00 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) David Miller <davem@davemloft.net> - 2017-01-06 18:10 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 18:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-06 19:00 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 19:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-06 19:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 18:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 16:40 +0100
        Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 01:00 +0100
    Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:50 +0100
  Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 00:50 +0100

csiph-web