On 1/21/2021 2:32 PM, David Laight wrote:
From: Randy Dunlap
Sent: 21 January 2021 22:19
On 1/21/21 2:16 PM, David Laight wrote:
From: Yu, Yu-cheng
On 1/21/2021 10:44 AM, Borislav Petkov wrote:
On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
[...]
@@ -343,6 +349,16 @@ static
From: Randy Dunlap
> Sent: 21 January 2021 22:19
>
> On 1/21/21 2:16 PM, David Laight wrote:
> > From: Yu, Yu-cheng
> >>
> >> On 1/21/2021 10:44 AM, Borislav Petkov wrote:
> >>> On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
> >> [...]
> @@ -343,6 +349,16 @@ static inline pte_t
On 1/21/21 2:16 PM, David Laight wrote:
> From: Yu, Yu-cheng
>>
>> On 1/21/2021 10:44 AM, Borislav Petkov wrote:
>>> On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
>> [...]
@@ -343,6 +349,16 @@ static inline pte_t pte_mkold(pte_t pte)
static inline pte_t pte_wrprotec
From: Yu, Yu-cheng
>
> On 1/21/2021 10:44 AM, Borislav Petkov wrote:
> > On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
> [...]
> >> @@ -343,6 +349,16 @@ static inline pte_t pte_mkold(pte_t pte)
> >>
> >> static inline pte_t pte_wrprotect(pte_t pte)
> >> {
> >> + /*
> >> + *
On 1/21/2021 12:41 PM, Borislav Petkov wrote:
On Thu, Jan 21, 2021 at 12:16:23PM -0800, Yu, Yu-cheng wrote:
It clears _PAGE_DIRTY and sets _PAGE_COW. That is,
if (pte.pte & _PAGE_DIRTY) {
pte.pte &= ~_PAGE_DIRTY;
pte.pte |= _PAGE_COW;
}
So, shifting makes resulting code more e
On 1/21/2021 12:26 PM, Dave Hansen wrote:
Usually, the compiler is better at making code efficient than humans. I
find that coding it in the most human-readable way is best unless I
*know* the compiler is unable to generate god code.
"good code", even.
I really want a "god code" compiler, tho
On Thu, Jan 21, 2021 at 12:16:23PM -0800, Yu, Yu-cheng wrote:
> It clears _PAGE_DIRTY and sets _PAGE_COW. That is,
>
> if (pte.pte & _PAGE_DIRTY) {
> pte.pte &= ~_PAGE_DIRTY;
> pte.pte |= _PAGE_COW;
> }
>
> So, shifting makes resulting code more efficient.
Efficient for what? Is thi
> Usually, the compiler is better at making code efficient than humans. I
> find that coding it in the most human-readable way is best unless I
> *know* the compiler is unable to generate god code.
"good code", even.
I really want a "god code" compiler, though. :)
On 1/21/21 12:16 PM, Yu, Yu-cheng wrote:
>
>>> @@ -343,6 +349,16 @@ static inline pte_t pte_mkold(pte_t pte)
>>> static inline pte_t pte_wrprotect(pte_t pte)
>>> {
>>> + /*
>>> + * Blindly clearing _PAGE_RW might accidentally create
>>> + * a shadow stack PTE (RW=0, Dirty=1). Mov
On 1/21/2021 10:44 AM, Borislav Petkov wrote:
On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
[...]
@@ -343,6 +349,16 @@ static inline pte_t pte_mkold(pte_t pte)
static inline pte_t pte_wrprotect(pte_t pte)
{
+ /*
+* Blindly clearing _PAGE_RW might accidentall
On Tue, Dec 29, 2020 at 01:30:35PM -0800, Yu-cheng Yu wrote:
> @@ -182,6 +182,12 @@ static inline int pud_young(pud_t pud)
>
> static inline int pte_write(pte_t pte)
> {
> + /*
> + * If _PAGE_DIRTY is set, the PTE must either have _PAGE_RW or be
> + * a shadow stack PTE, which is
There is essentially no room left in the x86 hardware PTEs on some OSes
(not Linux). That left the hardware architects looking for a way to
represent a new memory type (shadow stack) within the existing bits.
They chose to repurpose a lightly-used state: Write=0, Dirty=1.
The reason it's lightly
12 matches
Mail list logo